Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds album slug support end-to-end: DB migration and model attribute, SlugRule validation, ResolveAlbumSlug middleware (registered and applied), request/resource changes to accept/persist/expose slugs, frontend UI/types, translations, tests, and documentation for Feature 019. 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 |
787c83e to
16b11bb
Compare
There was a problem hiding this comment.
Actionable comments posted: 10
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/roadmap.md (1)
100-100:⚠️ Potential issue | 🟡 MinorUpdate the "Last updated" date to reflect actual changes.
The file shows Feature 019 was updated on 2026-02-28, but the footer still reads "2026-02-26". As per coding guidelines, update this to match the most recent modification date.
-*Last updated: 2026-02-26* +*Last updated: 2026-02-28*resources/js/components/forms/album/AlbumProperties.vue (1)
490-521:⚠️ Potential issue | 🟡 MinorNormalize slug input before sending update payloads.
The current
slug.value === "" ? null : slug.valuecheck misses whitespace-only values (e.g." "), which are then sent to the API and fail validation unnecessarily.💡 Proposed fix
+function normalizedSlug(): string | null { + const value = slug.value?.trim() ?? ""; + return value === "" ? null : value; +} + function saveAlbum() { const data: UpdateAbumData = { album_id: albumId.value, title: title.value, - slug: slug.value === "" ? null : slug.value, + slug: normalizedSlug(), @@ function saveTagAlbum() { @@ const data: UpdateTagAlbumData = { album_id: albumId.value, title: title.value, - slug: slug.value === "" ? null : slug.value, + slug: normalizedSlug(),
🧹 Nitpick comments (5)
lang/no/gallery.php (1)
138-139: Localize newnostrings to avoid mixed-language UILine 138 and Line 139 are still English in the Norwegian locale file, so users will see inconsistent language.
Proposed localization patch
- 'generate_slug' => 'Generate slug from title', - 'copy_slug_url' => 'Copy URL to clipboard', + 'generate_slug' => 'Generer slug fra tittel', + 'copy_slug_url' => 'Kopier URL til utklippstavlen',lang/ru/gallery.php (1)
136-138: New slug translation keys added; two strings remain in English.Lines 137-138 contain English text (
'Generate slug from title','Copy URL to clipboard') in this Russian translation file. Line 136 uses a hybrid approach with the technical term "Slug" followed by a Russian explanation, which is reasonable.Given the existing pattern in this file (many other strings also remain untranslated), this is consistent with the current approach but may warrant localization in a future pass.
💬 Suggested Russian translations
'slug' => 'Slug (дружественный URL)', - 'generate_slug' => 'Generate slug from title', - 'copy_slug_url' => 'Copy URL to clipboard', + 'generate_slug' => 'Сгенерировать slug из названия', + 'copy_slug_url' => 'Скопировать URL в буфер обмена',Based on learnings: "The user ildyria does not prioritize strict localization consistency for new menu items in language files."
lang/it/gallery.php (1)
137-139: Translations are in English rather than Italian.These new slug-related strings are in English. Consider translating them to Italian for consistency with the rest of the file:
'Slug (friendly URL)'→'Slug (URL amichevole)''Generate slug from title'→'Genera slug dal titolo''Copy URL to clipboard'→'Copia URL negli appunti'tests/Unit/Rules/SlugRuleTest.php (1)
31-43: Minor: Handle null values in assertion messages.In
assertPasses(line 35), concatenating a potentiallynullvalue will produce "Expected slug "" to pass..." which works but could be clearer. Consider usingvar_export($value, true)or a null-coalescing string for better debugging output.💡 Optional improvement for clearer assertion messages
private function assertPasses(SlugRule $rule, mixed $value): void { $failed = false; $rule->validate('slug', $value, function () use (&$failed): void { $failed = true; }); - self::assertFalse($failed, 'Expected slug "' . $value . '" to pass but it failed.'); + self::assertFalse($failed, 'Expected slug "' . var_export($value, true) . '" to pass but it failed.'); } private function assertFails(SlugRule $rule, mixed $value): void { $failed = false; $rule->validate('slug', $value, function () use (&$failed): void { $failed = true; }); - self::assertTrue($failed, 'Expected slug "' . $value . '" to fail but it passed.'); + self::assertTrue($failed, 'Expected slug "' . var_export($value, true) . '" to fail but it passed.'); }tests/Unit/Http/AlbumSlugCrudTest.php (1)
98-378: Extract a reusable payload builder for album/tag-album patch requests.The repeated full payload arrays across many tests increase maintenance drift risk when request fields change. A small helper (base payload + overrides) would keep these tests easier to update and less error-prone.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (49)
.github/copilot-instructions.mdapp/Contracts/Http/Requests/RequestAttribute.phpapp/Http/Kernel.phpapp/Http/Middleware/ResolveAlbumSlug.phpapp/Http/Requests/Album/UpdateAlbumRequest.phpapp/Http/Requests/Album/UpdateTagAlbumRequest.phpapp/Http/Resources/Editable/EditableBaseAlbumResource.phpapp/Http/Resources/Models/HeadAlbumResource.phpapp/Http/Resources/Models/HeadTagAlbumResource.phpapp/Models/BaseAlbumImpl.phpapp/Models/Extensions/BaseAlbum.phpapp/Rules/SlugRule.phpdatabase/migrations/2026_02_27_000001_add_slug_to_base_albums.phpdocs/specs/4-architecture/features/019-friendly-urls/plan.mddocs/specs/4-architecture/features/019-friendly-urls/spec.mddocs/specs/4-architecture/features/019-friendly-urls/tasks.mddocs/specs/4-architecture/open-questions.mddocs/specs/4-architecture/roadmap.mdlang/ar/gallery.phplang/bg/gallery.phplang/cz/gallery.phplang/de/gallery.phplang/el/gallery.phplang/en/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/album/AlbumProperties.vueresources/js/lychee.d.tsresources/js/services/album-service.tsroutes/web_v2.phptests/Unit/Http/AlbumSlugCrudTest.phptests/Unit/Http/Requests/Album/UpdateAlbumRequestTest.phptests/Unit/Http/Requests/Album/UpdateTagAlbumRequestTest.phptests/Unit/Middleware/ResolveAlbumSlugTest.phptests/Unit/Rules/SlugRuleTest.php
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
Fixes #330
Fixes #1423
Summary by CodeRabbit
New Features
Validation
Middleware
Database
Tests
Documentation
Translations