Skip to content

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Nov 15, 2025

Summary by CodeRabbit

  • New Features

    • Independent dock transparency settings for desktop and mobile; docks can be fully transparent or use standard opacity with adaptive hover/touch behavior.
    • App exposes and respects these settings so the UI reflects user choices.
  • Refactor

    • Embedded album payload simplified to a concise, typed album info for cleaner external embeds.

@ildyria ildyria requested a review from a team as a code owner November 15, 2025 08:54
@coderabbitai
Copy link

coderabbitai bot commented Nov 15, 2025

📝 Walkthrough

Walkthrough

Adds two gallery config flags for desktop/mobile dock full transparency, a migration to register them, exposes flags in InitConfig and frontend state/types, updates Dock.vue opacity logic to use those flags, and introduces a typed EmbedAlbumInfo used by EmbedAlbumResource.

Changes

Cohort / File(s) Summary
Backend — Gallery config & migration
app/Http/Resources/GalleryConfigs/InitConfig.php, database/migrations/2025_11_15_092400_optional_dock_transparency.php
InitConfig: added booleans is_desktop_dock_full_transparency_enabled and is_mobile_dock_full_transparency_enabled, initialized from config. Migration: anonymous BaseConfigMigration adding two gallery config entries for desktop/mobile dock full transparency (default '0', BOOL, expert-level, metadata).
Backend — Embed resources
app/Http/Resources/Embed/EmbedAlbumInfo.php, app/Http/Resources/Embed/EmbedAlbumResource.php
Added EmbedAlbumInfo Data class (id,title,description,photo_count,copyright,license) with fromModel(). EmbedAlbumResource::$album now typed as EmbedAlbumInfo and constructed via EmbedAlbumInfo::fromModel.
Frontend — Types
resources/js/lychee.d.ts
Added EmbedAlbumInfo and EmbedStreamResource types; updated GalleryConfigs.InitConfig to include the two transparency booleans; EmbedAlbumResource.album now EmbedAlbumInfo.
Frontend — State
resources/js/stores/LycheeState.ts
Added boolean state properties is_desktop_dock_full_transparency_enabled and is_mobile_dock_full_transparency_enabled (default false) and populate them in load() from fetched data.
Frontend — Component
resources/js/components/gallery/photoModule/Dock.vue
Reworked opacity classes to apply conditional Tailwind classes based on touch detection and the two transparency flags; added hover/transition classes and explicit opacity variants (0/50/75/20) per device/config combinators.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Cross-layer checks needed (PHP resource ↔ TS types ↔ frontend state).
  • Pay extra attention to:
    • Migration: config keys, default values, and metadata fields (is_expert, not_on_docker).
    • EmbedAlbumInfo.fromModel: photo_count fallback and license localization call.
    • lychee.d.ts: keep shape and nullability aligned with PHP Data class.
    • Dock.vue: combined Tailwind class order and conditional expressions for touch vs non-touch and flags.
    • LycheeState.load(): ensure safe mapping when fields are absent.

Poem

🐇
I hop on keys and nibble strings,
Two clear flags give the dock its wings.
Desktop fades and mobiles might too,
I twitch my nose — the pixels grew.
A tiny hop, a joyful commit ✨

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38bc994 and e0812dc.

📒 Files selected for processing (1)
  • database/migrations/2025_11_15_092400_optional_dock_transparency.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • database/migrations/2025_11_15_092400_optional_dock_transparency.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). (11)
  • GitHub Check: 2️⃣ PHP tests / 8.4 - sqlite -- Install
  • GitHub Check: 2️⃣ PHP tests / 8.4 - postgresql -- Install
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Install
  • GitHub Check: 2️⃣ PHP tests / 8.4 - mariadb -- Install
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Webshop
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Feature_v2
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Unit
  • GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Feature_v2
  • GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Unit
  • GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Feature_v2
  • GitHub Check: 2️⃣ PHP 8.3 - PHPStan

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a46e39 and 17c6777.

📒 Files selected for processing (3)
  • app/Http/Resources/Embed/EmbedAlbumInfo.php (1 hunks)
  • app/Http/Resources/Embed/EmbedAlbumResource.php (1 hunks)
  • resources/js/lychee.d.ts (3 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-08-14T10:17:35.082Z
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3616
File: app/Actions/Album/PositionData.php:38-39
Timestamp: 2025-08-14T10:17:35.082Z
Learning: PositionDataResource uses toPhotoResources() method to convert photos to PhotoResource instances, and PhotoResource accesses the tags relationship ($photo->tags->pluck('name')->all()), making the 'tags' eager-loading in PositionData necessary to avoid N+1 queries.

Applied to files:

  • app/Http/Resources/Embed/EmbedAlbumResource.php
📚 Learning: 2025-09-28T12:04:53.277Z
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3721
File: resources/js/stores/TagState.ts:34-36
Timestamp: 2025-09-28T12:04:53.277Z
Learning: In the Lychee codebase, different API services have different response structures. TagsService.get() returns TagWithPhotosResource directly with fields id, name, and photos (no "resource" wrapper field), while AlbumService.get() returns a response with data.resource that can be null. Always check the actual TypeScript definitions before assuming response structure.

Applied to files:

  • app/Http/Resources/Embed/EmbedAlbumResource.php
  • resources/js/lychee.d.ts
📚 Learning: 2025-09-28T08:46:37.299Z
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3721
File: resources/js/stores/UserState.ts:7-11
Timestamp: 2025-09-28T08:46:37.299Z
Learning: In Lychee codebase, the type `App.Enum.OauthProvidersType` is properly defined within the `App.Enum` namespace in `resources/js/lychee.d.ts` file. References to `App.Enum.OauthProvidersType` in TypeScript files are valid and resolve correctly.

Applied to files:

  • resources/js/lychee.d.ts
📚 Learning: 2025-08-16T14:00:53.808Z
Learnt from: ildyria
Repo: LycheeOrg/Lychee PR: 3504
File: resources/js/composables/selections/selections.ts:145-147
Timestamp: 2025-08-16T14:00:53.808Z
Learning: In the Lychee codebase, the maintainer ildyria has indicated that bounds checking for array access in selectables.albums.value[idx] within the albumClick function in resources/js/composables/selections/selections.ts is not necessary, suggesting there are adequate safeguards elsewhere in the code or the access pattern is guaranteed to be safe.

Applied to files:

  • resources/js/lychee.d.ts
🧬 Code graph analysis (2)
app/Http/Resources/Embed/EmbedAlbumResource.php (2)
resources/js/lychee.d.ts (2)
  • EmbedAlbumInfo (258-265)
  • Album (969-978)
app/Http/Resources/Embed/EmbedAlbumInfo.php (2)
  • __construct (24-32)
  • fromModel (41-51)
app/Http/Resources/Embed/EmbedAlbumInfo.php (2)
resources/js/lychee.d.ts (2)
  • Album (969-978)
  • EmbedAlbumInfo (258-265)
app/Http/Resources/Embed/EmbedAlbumResource.php (3)
  • TypeScript (23-48)
  • __construct (31-35)
  • fromModel (44-47)
⏰ 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). (8)
  • GitHub Check: 3️⃣ PHP dist / 8.3 - sqlite
  • GitHub Check: 2️⃣ PHP tests / 8.3 - sqlite -- Feature_v2
  • GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Webshop
  • GitHub Check: 2️⃣ PHP tests / 8.4 - mariadb -- Install
  • GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Install
  • GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Unit
  • GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Feature_v2
  • GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Feature_v2
🔇 Additional comments (5)
resources/js/lychee.d.ts (3)

267-267: Good refactoring to use named type.

Extracting the inline object to the named EmbedAlbumInfo type improves maintainability and follows the DRY principle.


277-280: LGTM!

The new EmbedStreamResource type is well-structured and follows existing patterns in the codebase.


368-369: LGTM!

The new dock transparency configuration fields directly support the PR objective and follow the existing naming conventions. The separation of desktop and mobile settings is appropriate for responsive design.

app/Http/Resources/Embed/EmbedAlbumResource.php (1)

26-26: LGTM! Clean refactoring to strongly-typed resource.

The refactoring from an inline array to a dedicated EmbedAlbumInfo typed object improves type safety and maintainability. The TypeScript types are properly aligned.

Also applies to: 33-33

app/Http/Resources/Embed/EmbedAlbumInfo.php (1)

24-32: LGTM! Clean use of promoted properties.

The constructor effectively uses PHP 8+ promoted properties with explicit typing, providing a clean and concise implementation.

@codecov
Copy link

codecov bot commented Nov 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.37%. Comparing base (fad833e) to head (38bc994).
⚠️ Report is 1 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria enabled auto-merge (squash) November 15, 2025 11:39
Copy link
Contributor

@d7415 d7415 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd approve, but automerge...

My interpretation - feel free to ignore.

@ildyria ildyria disabled auto-merge November 15, 2025 16:48
Co-authored-by: Martin Stone <1611702+d7415@users.noreply.github.com>
@ildyria ildyria enabled auto-merge (squash) November 15, 2025 16:49
@ildyria
Copy link
Member Author

ildyria commented Nov 15, 2025

@d7415 fixed. :)

@ildyria ildyria merged commit 249ba4f into master Nov 15, 2025
41 of 42 checks passed
@ildyria ildyria deleted the option-hide-photo-actions branch November 15, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants