-
-
Notifications
You must be signed in to change notification settings - Fork 362
Add more display option for subtitle on albums #3662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds three new album subtitle enum cases, updates a migration to append/remove these options in configs.type_range, adjusts AlbumThumbOverlay.vue to render new subtitle types via switch, introduces a select control for album_subtitle_type in settings, and expands TypeScript definitions to include the new literals. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)resources/**/*.{vue,ts}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
resources/**/*.vue📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🔇 Additional comments (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
database/migrations/2025_08_31_122020_add_display_num_photos_option_album_view.php (1)
9-11: Import DB facade for clarity and toolingExplicitly import the DB facade to satisfy static analysis and keep consistency with other migrations.
use Illuminate\Database\Migrations\Migration; +use Illuminate\Support\Facades\DB;resources/js/components/gallery/albumModule/thumbs/AlbumThumbOverlay.vue (1)
40-67: Subtitle composition works; consider pluralization and zero handling
- Current output may read “0 images” or “0 subalbums”; combined case hides zeros. Align behavior across cases and consider pluralization for i18n.
Example (if transChoice is available):
// pseudo-code const photos = props.album.num_photos > 0 ? transChoice('gallery.album.hero.images', props.album.num_photos) : ''; const albums = props.album.num_subalbums > 0 ? transChoice('gallery.album.hero.subalbums', props.album.num_subalbums) : '';Additionally, there’s a small icon-class typo tied to these date-based cases. Apply outside-this-hunk fix:
- <i v-if="props.config.album_subtitle_type === 'takedate' || props.config.album_subtitle_type === 'creation'" class="pi pi-pi-camera"></i> + <i v-if="props.config.album_subtitle_type === 'takedate' || props.config.album_subtitle_type === 'creation'" class="pi pi-camera"></i>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
app/Enum/ThumbAlbumSubtitleType.php(1 hunks)database/migrations/2025_08_31_122020_add_display_num_photos_option_album_view.php(1 hunks)resources/js/components/gallery/albumModule/thumbs/AlbumThumbOverlay.vue(1 hunks)resources/js/components/settings/ConfigGroup.vue(1 hunks)resources/js/lychee.d.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
resources/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
resources/**/*.{vue,ts}: Use the Vue 3 Composition API with TypeScript; prefer PrimeVue for UI components
In Vue3 code, do not use await; prefer promise chaining with .then()
Do not use const fn = () => {}; define functions with function functionName() {}
Files:
resources/js/lychee.d.tsresources/js/components/gallery/albumModule/thumbs/AlbumThumbOverlay.vueresources/js/components/settings/ConfigGroup.vue
resources/**/*.vue
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Order sections in .vue files as: template first, then script lang="ts", then style
Files:
resources/js/components/gallery/albumModule/thumbs/AlbumThumbOverlay.vueresources/js/components/settings/ConfigGroup.vue
**/*.php
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.php: New PHP files must include the project license header and have a single blank line after the opening <?php tag
Use snake_case for PHP variable names
Apply PSR-4 coding standard to PHP code
Always call in_array with true as the third parameter for strict checking (in_array($needle, $haystack, true))
Only use boolean expressions in if statements; avoid integers or strings as conditions
Use strict comparison (===, !==) instead of loose comparison (==, !=)
Avoid duplicating code in both if and else branches
Do not use empty(); prefer explicit checks (e.g., === null, === '', count(...) === 0)
Files:
database/migrations/2025_08_31_122020_add_display_num_photos_option_album_view.phpapp/Enum/ThumbAlbumSubtitleType.php
🧠 Learnings (1)
📚 Learning: 2025-08-18T10:19:04.946Z
Learnt from: ildyria
PR: LycheeOrg/Lychee#3626
File: database/migrations/2025_06_07_144157_photo_tags_to_table.php:87-105
Timestamp: 2025-08-18T10:19:04.946Z
Learning: In the Lychee photo management system, the migration `2025_06_07_144157_photo_tags_to_table.php` runs on data that only contains comma-separated tag names in tag_albums.show_tags - OR/AND expressions do not exist at this migration time, so handling them is unnecessary.
Applied to files:
database/migrations/2025_08_31_122020_add_display_num_photos_option_album_view.php
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: 3️⃣ PHP dist / 8.4 - sqlite
- GitHub Check: 3️⃣ PHP dist / 8.3 - mariadb
- GitHub Check: 3️⃣ PHP dist / 8.4 - postgresql
- GitHub Check: 3️⃣ PHP dist / 8.4 - mariadb
- GitHub Check: 3️⃣ PHP dist / 8.3 - sqlite
- GitHub Check: 3️⃣ PHP dist / 8.3 - postgresql
- GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Unit,Feature_v2
- GitHub Check: 2️⃣ PHP tests / 8.4 - mariadb -- Unit,Feature_v2
- GitHub Check: 2️⃣ PHP tests / 8.4 - sqlite -- Unit,Feature_v2
- GitHub Check: 2️⃣ PHP tests / 8.4 - postgresql -- Unit,Feature_v2
- GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Unit,Feature_v2
- GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Unit,Feature_v2
🔇 Additional comments (4)
app/Enum/ThumbAlbumSubtitleType.php (1)
22-24: Enum additions are consistent with frontend types — LGTMNew cases look correct and align with the TS union. No further changes needed.
database/migrations/2025_08_31_122020_add_display_num_photos_option_album_view.php (1)
15-20: Keep the up()→down() pattern for idempotent migrations
Migrations in Lychee intentionally call down() inside up() to reset state before applying changes; removing that call or adding null‐guards here conflicts with established conventions.Likely an incorrect or invalid review comment.
resources/js/lychee.d.ts (1)
107-107: TS union updated — LGTMFrontend type matches backend enum and UI. Ship it.
resources/js/components/gallery/albumModule/thumbs/AlbumThumbOverlay.vue (1)
35-35: Importing trans is correctImport aligns with the new subtitle cases.
database/migrations/2025_08_31_122020_add_display_num_photos_option_album_view.php
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Optionally display the number of photos and/or albums under the album thumbnail.
Summary by CodeRabbit
New Features
Chores