Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds Feature 020 (Raw Upload Support): introduces a RAW size variant (value 0) and shifts existing variants +1; detects and preserves RAW/HEIC/PSD originals, converts to JPEG for display, adds RAW storage/DB pipeline, gated RAW download config, migrations, docs, tests, and frontend/state updates. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ❌ 1❌ Failed checks (1 warning)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/specs/4-architecture/open-questions.md (1)
1770-1770:⚠️ Potential issue | 🟡 MinorUpdate the last modified date.
The last updated date is
2026-01-02, but this PR was created on2026-02-28and adds new Feature 020 content. The date should reflect the most recent changes.📅 Proposed fix
-*Last updated: 2026-01-02* +*Last updated: 2026-02-28*docs/specs/4-architecture/roadmap.md (1)
101-101:⚠️ Potential issue | 🟡 MinorUpdate the last modified date.
The last updated date is
2026-02-26, but this PR adds Feature 020 content on2026-02-28. The date should reflect the most recent changes.📅 Proposed fix
-*Last updated: 2026-02-26* +*Last updated: 2026-02-28*
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
docs/specs/4-architecture/features/020-raw-upload-support/plan.mddocs/specs/4-architecture/features/020-raw-upload-support/spec.mddocs/specs/4-architecture/features/020-raw-upload-support/tasks.mddocs/specs/4-architecture/open-questions.mddocs/specs/4-architecture/roadmap.md
Add first-class RAW file support: camera RAW/HEIC/PSD files are preserved as a dedicated RAW size variant (type=0) while being converted to JPEG for display. All existing variant types shifted by +1. Backend: - SizeVariantType: RAW=0, ORIGINAL=1, ..., PLACEHOLDER=8 (4 migrations) - RawToJpeg: Imagick converter (quality 92, preserves source) - DetectAndStoreRaw: Init pipe replacing ConvertUnsupportedMedia - CreateRawSizeVariant: Standalone pipe after CreateOriginalSizeVariant - CONVERTIBLE_RAW_EXTENSIONS: .nef .cr2 .cr3 .arw .dng .orf .rw2 .raf .pef .srw .nrw .psd .heic .heif (14 formats) - Removed: HeifToJpeg, ConvertUnsupportedMedia, PhotoConverterFactory, ConvertableImageType, PhotoConverter interface - PhotoResource: has_raw flag (bool) - ZipRequest: raw_download_enabled config gate for RAW downloads - DownloadVariantType::RAW = 'RAW' - InitConfig: is_raw_download_enabled exposed to frontend - AlbumSizeStatistics + Spaces.php: size_raw column throughout - RecomputeAlbumSizeJob: size_raw in computeSizes() Migrations: - 000001: two-phase type column shift (safe for SQLite/MySQL/PostgreSQL) - 000002: add raw_download_enabled config (default false) - 000003: reclassify existing raw-format ORIGINAL rows to RAW (excl. PDF) - 000004: add size_raw to album_size_statistics Frontend: - DownloadPhoto.vue: conditional RAW download button, updated svtoVariant and isDownloadable for new enum values - LycheeState.ts: is_raw_download_enabled state - StatsSizeVariantToColours.ts + MaintenanceGenSizevariants.vue: updated for shifted enum values - Maintenance.vue: updated :sv prop values - TypeScript types regenerated (has_raw, RAW variant, SizeVariantType 0-8) Translations: - lang/en/gallery.php: 'raw', 'download_raw' - lang/en/all_settings.php: raw_download_enabled description + details - Placeholders in 21 other languages Tests: - RawUploadImagickTest: 4 integration tests (HEIC creates RAW, JPEG/PNG unaffected, TIFF in raw_formats stays ORIGINAL) - DetectAndStoreRawTest: 4 unit tests - All 38 RAW-related tests passing; PHPStan 0 errors; php-cs-fixer clean Spec impact: All 47 tasks (T-020-01 to T-020-47) complete. Roadmap status updated to Complete. knowledge-map.md and image-processing.md updated.
There was a problem hiding this comment.
Actionable comments posted: 13
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/Image/SizeVariantDimensionHelpers.php (1)
63-77:⚠️ Potential issue | 🟠 Major
isEnabledByConfiguration()still throws for RAW/ORIGINAL (unreachablefalsebranch).Because
getMaxDimensions()is called first, RAW/ORIGINAL hit exceptions fromgetMaxWidth()/getMaxHeight()before the newmatcharm can returnfalse.💡 Proposed fix
public function isEnabledByConfiguration(SizeVariantType $size_variant): bool { + if ($size_variant === SizeVariantType::RAW || $size_variant === SizeVariantType::ORIGINAL) { + return false; + } + $max_dim = $this->getMaxDimensions($size_variant); if ($max_dim->width === 0 && $max_dim->height === 0) { return false; } return match ($size_variant) { SizeVariantType::MEDIUM2X => $this->config_manager->getValueAsBool('medium_2x'), SizeVariantType::SMALL2X => $this->config_manager->getValueAsBool('small_2x'), SizeVariantType::THUMB2X => $this->config_manager->getValueAsBool('thumb_2x'), SizeVariantType::PLACEHOLDER => $this->config_manager->getValueAsBool('low_quality_image_placeholder'), SizeVariantType::SMALL, SizeVariantType::MEDIUM, SizeVariantType::THUMB => true, - SizeVariantType::RAW, SizeVariantType::ORIGINAL => false, }; }Also applies to: 112-113, 129-130
🧹 Nitpick comments (3)
lang/el/gallery.php (1)
29-29: Empty translation value for 'download_raw'.The translation key follows the correct snake_case convention, but the value is an empty string. This will result in no visible text for Greek users when the RAW download option is displayed. Consider providing a Greek translation (e.g.,
'Λήψη RAW'or similar) or using a fallback English value like'Download RAW'.Based on learnings: ildyria does not prioritize strict localization consistency for new menu items, so this may be intentional.
lang/bg/gallery.php (1)
29-29: Use a non-empty fallback value fordownload_raw.Line 29 currently sets
download_rawto an empty string; this can produce a blank menu/button label in UI. Prefer a non-empty fallback string.Proposed change
- 'download_raw' => '', + 'download_raw' => 'Download RAW',docs/specs/4-architecture/knowledge-map.md (1)
294-294: Update the "Last updated" date.As per coding guidelines, the last updated date should reflect when the document was modified. This should be updated to "February 28, 2026" to match the current changes.
-*Last updated: January 14, 2026* +*Last updated: February 28, 2026*
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (89)
app/Actions/Photo/BaseArchive.phpapp/Actions/Photo/Convert/PhotoConverterFactory.phpapp/Actions/Photo/Convert/RawToJpeg.phpapp/Actions/Photo/Create.phpapp/Actions/Photo/Pipes/Init/ConvertUnsupportedMedia.phpapp/Actions/Photo/Pipes/Init/DetectAndStoreRaw.phpapp/Actions/Photo/Pipes/Standalone/CreateRawSizeVariant.phpapp/Actions/Statistics/Spaces.phpapp/Assets/BaseSizeVariantNamingStrategy.phpapp/Contracts/Models/AbstractSizeVariantNamingStrategy.phpapp/Contracts/PhotoCreate/PhotoConverter.phpapp/DTO/PhotoCreate/InitDTO.phpapp/DTO/PhotoCreate/StandaloneDTO.phpapp/Enum/ConvertableImageType.phpapp/Enum/DownloadVariantType.phpapp/Enum/SizeVariantType.phpapp/Http/Requests/Album/ZipRequest.phpapp/Http/Resources/GalleryConfigs/InitConfig.phpapp/Http/Resources/Models/PhotoResource.phpapp/Image/SizeVariantDefaultFactory.phpapp/Image/SizeVariantDimensionHelpers.phpapp/Image/Watermarker.phpapp/Jobs/RecomputeAlbumSizeJob.phpapp/Models/AlbumSizeStatistics.phpapp/Models/Extensions/SizeVariants.phpdatabase/factories/SizeVariantFactory.phpdatabase/migrations/2026_02_28_000001_shift_size_variant_type_for_raw.phpdatabase/migrations/2026_02_28_000002_add_raw_download_enabled_config.phpdatabase/migrations/2026_02_28_000003_reclassify_existing_raw_format_files.phpdatabase/migrations/2026_02_28_000004_add_size_raw_to_album_size_statistics.phpdocs/specs/3-reference/image-processing.mddocs/specs/4-architecture/features/020-raw-upload-support/tasks.mddocs/specs/4-architecture/knowledge-map.mddocs/specs/4-architecture/roadmap.mdlang/ar/all_settings.phplang/ar/gallery.phplang/bg/all_settings.phplang/bg/gallery.phplang/cz/all_settings.phplang/cz/gallery.phplang/de/all_settings.phplang/de/gallery.phplang/el/all_settings.phplang/el/gallery.phplang/en/all_settings.phplang/en/gallery.phplang/es/all_settings.phplang/es/gallery.phplang/fa/all_settings.phplang/fa/gallery.phplang/fr/all_settings.phplang/fr/gallery.phplang/hu/all_settings.phplang/hu/gallery.phplang/it/all_settings.phplang/it/gallery.phplang/ja/all_settings.phplang/ja/gallery.phplang/nl/all_settings.phplang/nl/gallery.phplang/no/all_settings.phplang/no/gallery.phplang/pl/all_settings.phplang/pl/gallery.phplang/pt/all_settings.phplang/pt/gallery.phplang/ru/all_settings.phplang/ru/gallery.phplang/sk/all_settings.phplang/sk/gallery.phplang/sv/all_settings.phplang/sv/gallery.phplang/vi/all_settings.phplang/vi/gallery.phplang/zh_CN/all_settings.phplang/zh_CN/gallery.phplang/zh_TW/all_settings.phplang/zh_TW/gallery.phpresources/js/components/maintenance/MaintenanceGenSizevariants.vueresources/js/components/modals/DownloadPhoto.vueresources/js/lychee.d.tsresources/js/stores/LycheeState.tsresources/js/utils/StatsSizeVariantToColours.tsresources/js/views/Maintenance.vuetests/Constants/TestConstants.phptests/Feature_v2/Maintenance/GenSizeVariantsTest.phptests/ImageProcessing/Image/Handlers/RawUploadImagickTest.phptests/Unit/Actions/Photo/Pipes/Init/ConvertUnsupportedMediaTest.phptests/Unit/Actions/Photo/Pipes/Init/DetectAndStoreRawTest.php
💤 Files with no reviewable changes (5)
- tests/Unit/Actions/Photo/Pipes/Init/ConvertUnsupportedMediaTest.php
- app/Actions/Photo/Pipes/Init/ConvertUnsupportedMedia.php
- app/Actions/Photo/Convert/PhotoConverterFactory.php
- app/Contracts/PhotoCreate/PhotoConverter.php
- app/Enum/ConvertableImageType.php
✅ Files skipped from review due to trivial changes (3)
- lang/fr/gallery.php
- lang/sk/gallery.php
- lang/nl/all_settings.php
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/specs/4-architecture/roadmap.md
database/migrations/2026_02_28_000003_reclassify_existing_raw_format_files.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
lang/ja/gallery.php (1)
19-30:⚠️ Potential issue | 🟡 MinorAvoid empty translations for visible UI labels.
Line 19 (
raw) and Line 30 (download_raw) are set to empty strings, which can render blank labels in the Japanese UI. Please provide non-empty values (or temporarily omit the keys so fallback text can be used).Suggested fix
- 'raw' => '', + 'raw' => 'RAW', @@ - 'download_raw' => '', + 'download_raw' => 'RAWをダウンロード',lang/no/gallery.php (1)
19-30:⚠️ Potential issue | 🟡 MinorFill RAW labels with non-empty translations.
Line 19 and Line 30 currently use empty strings, which will render blank labels in Norwegian UI for RAW-related actions. Please set fallback text (Norwegian preferred, English acceptable until translated).
💡 Suggested patch
- 'raw' => '', + 'raw' => 'RAW', ... - 'download_raw' => '', + 'download_raw' => 'Last ned RAW',
🧹 Nitpick comments (1)
lang/ru/gallery.php (1)
18-18: Empty translation values for new RAW-related keys.The
'raw'and'download_raw'keys have empty string values. Russian users will see blank labels in the UI for these elements. Consider adding placeholder text (e.g., English fallback or Russian translation like'RAW'/'Скачать RAW') to avoid empty UI elements.Based on learnings: maintainer does not prioritize strict localization consistency, so this may be intentional.
💬 Suggested Russian translations
- 'raw' => '', + 'raw' => 'RAW',- 'download_raw' => '', + 'download_raw' => 'Скачать RAW',Also applies to: 29-29
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (25)
lang/ar/gallery.phplang/bg/gallery.phplang/cz/gallery.phplang/de/gallery.phplang/el/gallery.phplang/es/gallery.phplang/fa/gallery.phplang/fr/gallery.phplang/hu/gallery.phplang/it/gallery.phplang/ja/gallery.phplang/nl/gallery.phplang/no/gallery.phplang/pl/gallery.phplang/pt/gallery.phplang/ru/gallery.phplang/sk/gallery.phplang/sv/gallery.phplang/vi/gallery.phplang/zh_CN/gallery.phplang/zh_TW/gallery.phpresources/js/components/forms/sharing/CreateSharing.vueresources/js/composables/contextMenus/contextMenu.tsresources/js/lychee.d.tsresources/js/services/album-service.ts
💤 Files with no reviewable changes (1)
- resources/js/services/album-service.ts
🚧 Files skipped from review as they are similar to previous changes (13)
- lang/it/gallery.php
- lang/zh_TW/gallery.php
- lang/el/gallery.php
- lang/hu/gallery.php
- lang/bg/gallery.php
- lang/pl/gallery.php
- lang/vi/gallery.php
- lang/cz/gallery.php
- lang/de/gallery.php
- lang/fa/gallery.php
- lang/ar/gallery.php
- lang/es/gallery.php
- lang/nl/gallery.php
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (7)
lang/es/all_settings.php (1)
58-58: New settings entries are in English within the Spanish locale file.The new
raw_download_enabledentries are in English, which is consistent with the rest of this file (all entries are currently in English). If this file is intended as a Spanish translation rather than a fallback, these strings should eventually be translated:
- Line 58:
'Allow users to download the original RAW file'→ Spanish translation needed- Line 393:
'When enabled, users with download permissions can download the untouched RAW/HEIC/PSD file that was preserved during upload.'→ Spanish translation neededIf the entire file is intentionally using English as a fallback, this is fine as-is.
Also applies to: 393-393
lang/vi/gallery.php (1)
30-30: Consider translating to Vietnamese for consistency.The value
'Download RAW'is in English. For consistency with other Vietnamese translations in this file (e.g.,'Ghim','Album được ghim','công khai nhưng ẩn'), consider using a Vietnamese translation like'Tải xuống RAW'.That said, this follows the existing pattern where some strings remain untranslated, so it's acceptable as-is.
lang/ar/all_settings.php (1)
58-58: Consider aligning wording for supported source formats.
documentation.raw_download_enabledmentions only “RAW”, whiledetails.raw_download_enabledmentions “RAW/HEIC/PSD”. Using consistent text (e.g., “original source file (RAW/HEIC/PSD)”) in both places would reduce ambiguity in settings UI.Also applies to: 393-393
lang/fr/all_settings.php (1)
56-56: French translations are in English.Both
raw_download_enabledentries contain English text instead of French translations. Other entries in this file use empty strings''as placeholders for untranslated content (see lines 9-16), or provide actual French text.Consider either:
- Providing French translations, or
- Using empty strings as placeholders for consistency with other untranslated entries
Suggested French translations
- 'raw_download_enabled' => 'Allow users to download the original RAW file', + 'raw_download_enabled' => 'Autoriser les utilisateurs à télécharger le fichier RAW original',- 'raw_download_enabled' => 'When enabled, users with download permissions can download the untouched RAW/HEIC/PSD file that was preserved during upload.', + 'raw_download_enabled' => 'Lorsqu\'activé, les utilisateurs avec les permissions de téléchargement peuvent télécharger le fichier RAW/HEIC/PSD original qui a été conservé lors du téléversement.',Also applies to: 391-391
app/Services/Image/FileExtensionService.php (2)
187-187: Fix typo in comment.Minor typo: "We imagick is enabeld" should be "If Imagick is enabled" or "When Imagick is enabled".
Proposed fix
- // We imagick is enabeld, then we can allow PDF files. + // If Imagick is enabled, we can allow PDF files.
93-114: Document ImageMagick/LibRaw delegate requirements for RAW format conversion.The
CONVERTIBLE_RAW_EXTENSIONSconstant assumes Imagick can convert all listed formats, but this depends entirely on how the deployed ImageMagick was built. CR3 specifically requires ImageMagick to be compiled with LibRaw ≥ 0.20; without it, CR3 conversion will fail at runtime. Other formats (.nef,.cr2, etc.) may fall back to older delegates likedcraworufraw-batch, but CR3 is not reliably handled by these tools. Add a comment documenting the ImageMagick build requirement (LibRaw delegate support) to clarify the deployment dependency, or consider adding a runtime verification method that checks ImageMagick's delegate capabilities before attempting conversion.tests/Unit/Actions/Photo/Pipes/Init/DetectAndStoreRawTest.php (1)
119-129: Consider adding tests for conversion success/failure paths.The current tests cover pass-through behavior for non-convertible formats. For complete coverage of
DetectAndStoreRaw, consider adding:
- Successful conversion test: Mock
RawToJpegto return a converted file, verifyraw_source_fileis set andsource_fileis replaced- Conversion failure test: Mock
RawToJpegto throwCannotConvertMediaFileException, verify graceful fallback behaviorWould you like me to generate the additional test cases?
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (57)
app/Actions/Photo/Pipes/Init/DetectAndStoreRaw.phpapp/Actions/Photo/Pipes/Init/LoadFileMetadata.phpapp/Actions/Photo/Pipes/Standalone/CreateRawSizeVariant.phpapp/Http/Resources/Models/SizeVariantsResouce.phpapp/Image/SizeVariantDimensionHelpers.phpapp/Services/Image/FileExtensionService.phpdatabase/migrations/2026_02_28_000003_reclassify_existing_raw_format_files.phpdocs/specs/3-reference/image-processing.mddocs/specs/4-architecture/knowledge-map.mddocs/specs/4-architecture/roadmap.mdlang/ar/all_settings.phplang/ar/gallery.phplang/bg/all_settings.phplang/bg/gallery.phplang/cz/all_settings.phplang/cz/gallery.phplang/de/all_settings.phplang/de/gallery.phplang/el/all_settings.phplang/el/gallery.phplang/es/all_settings.phplang/es/gallery.phplang/fa/all_settings.phplang/fa/gallery.phplang/fr/all_settings.phplang/fr/gallery.phplang/hu/all_settings.phplang/hu/gallery.phplang/it/all_settings.phplang/it/gallery.phplang/ja/all_settings.phplang/ja/gallery.phplang/nl/all_settings.phplang/nl/gallery.phplang/no/all_settings.phplang/no/gallery.phplang/pl/all_settings.phplang/pl/gallery.phplang/pt/all_settings.phplang/pt/gallery.phplang/ru/all_settings.phplang/ru/gallery.phplang/sk/all_settings.phplang/sk/gallery.phplang/sv/all_settings.phplang/sv/gallery.phplang/vi/all_settings.phplang/vi/gallery.phplang/zh_CN/all_settings.phplang/zh_CN/gallery.phplang/zh_TW/all_settings.phplang/zh_TW/gallery.phpresources/js/components/modals/DownloadPhoto.vueresources/js/lychee.d.tstests/Constants/TestConstants.phptests/ImageProcessing/Image/Handlers/RawUploadImagickTest.phptests/Unit/Actions/Photo/Pipes/Init/DetectAndStoreRawTest.php
🚧 Files skipped from review as they are similar to previous changes (32)
- lang/bg/gallery.php
- lang/ru/gallery.php
- lang/sv/all_settings.php
- lang/zh_TW/all_settings.php
- resources/js/components/modals/DownloadPhoto.vue
- app/Image/SizeVariantDimensionHelpers.php
- tests/ImageProcessing/Image/Handlers/RawUploadImagickTest.php
- app/Actions/Photo/Pipes/Standalone/CreateRawSizeVariant.php
- lang/ja/all_settings.php
- lang/fa/all_settings.php
- lang/zh_TW/gallery.php
- lang/bg/all_settings.php
- lang/el/all_settings.php
- lang/nl/gallery.php
- lang/el/gallery.php
- lang/de/all_settings.php
- lang/zh_CN/gallery.php
- lang/hu/gallery.php
- lang/vi/all_settings.php
- lang/sk/all_settings.php
- lang/pl/all_settings.php
- docs/specs/4-architecture/knowledge-map.md
- lang/cz/all_settings.php
- lang/fr/gallery.php
- lang/cz/gallery.php
- lang/pt/gallery.php
- lang/it/all_settings.php
- lang/ru/all_settings.php
- lang/zh_CN/all_settings.php
- lang/nl/all_settings.php
- lang/sv/gallery.php
- docs/specs/4-architecture/roadmap.md
Fixes #1554
Summary by CodeRabbit
New Features
Documentation
Tests
Chores