Skip to content

Add Struct As Array to smart albums. - #4733

Merged
ildyria merged 5 commits into
masterfrom
v3-smart-albums
Sep 12, 2026
Merged

ildyria merged 5 commits into
masterfrom
v3-smart-albums

Conversation

@ildyria

@ildyria ildyria commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Photo buckets, details, and ratios now support tag, person, and smart albums.
    • Photo listings provide live bucket information across supported album types.
    • Photo assets automatically fall back to the next available smaller size when needed.
  • Bug Fixes

    • Improved album resolution, validation, deduplication, and cache handling.
    • Listing caches now update when photo tags, people, ratings, or highlighted status change.
  • Tests

    • Added coverage for album types, asset fallback, deduplication, and cache invalidation.

@ildyria
ildyria requested a review from a team as a code owner September 11, 2026 16:57
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5b61d0dd-033a-4f51-a9e0-b0a53ca49be2

📥 Commits

Reviewing files that changed from the base of the PR and between 44a8a75 and 04e9555.

📒 Files selected for processing (2)
  • app/Listeners/ManagedCachePhotoListingInvalidator.php
  • tests/Unit/Listeners/ManagedCachePhotoListingInvalidatorTest.php
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/Unit/Listeners/ManagedCachePhotoListingInvalidatorTest.php
  • app/Listeners/ManagedCachePhotoListingInvalidator.php

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Photo listing requests and queries now support regular, tag, person, and smart albums. Non-regular albums compute bucket IDs from live photo data. Photo asset fallback and listing cache invalidation paths were also updated.

Changes

Abstract photo listing support

Layer / File(s) Summary
Abstract album request resolution
app/Http/Requests/Photo/*, app/Http/Controllers/Gallery/AlbumListing/PhotoChildrenController.php, resources/js/stores/AlbumState.ts
Requests resolve abstract albums through AlbumFactory. Controllers use get_id(). The frontend enables the v3 listing tier for supported album types.
Source resolution and live buckets
app/Actions/Photo/StructOfArrays/*
Shared source resolution handles regular, tag, person, and smart albums. Non-regular sources compute bucket IDs and counts from live photo fields.
Listing cache invalidation
app/Events/PhotoTagsChanged.php, app/Http/Controllers/Gallery/PhotoController.php, app/Listeners/ManagedCachePhotoListingInvalidator.php, app/Providers/EventServiceProvider.php
Tag, person, rating, and highlight changes invalidate affected photo-listing caches.
Feature coverage
tests/Feature_v3/Photo/*, tests/Unit/Listeners/*
Tests cover abstract album buckets, details, ratios, deduplication, and cache invalidation.

Photo asset fallback handling

Layer / File(s) Summary
Size variant fallback chain
app/Enum/SizeVariantType.php, app/Http/Requests/Photo/GetPhotoAssetRequest.php, app/Http/Controllers/Gallery/PhotoAssetController.php, tests/Feature_v3/Photo/PhotoAssetV3Test.php
Asset requests walk smaller size variants when database rows are missing. The controller uses the shared fallback mapping. Tests cover successful fallback and exhausted chains.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Severity of issue fixed: Medium

Merge Risk: 🟡 Moderate · up to 04e95

Smart album photos can appear under an incorrect date bucket, and hourly bucket identifiers can be inconsistent. These listing correctness issues should be resolved before merge.

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 74.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 67 functions across 21 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
  • Fix all pre-merge checks with AI

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

A rabbit hops through albums bright
Live buckets bloom in moonlit light
Tags and people clear the way
Smart photos count once today
Small images find a smaller door
Cache crumbs vanish from the floor

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b2be5b88-4b54-489b-9795-76988637a4f3

📥 Commits

Reviewing files that changed from the base of the PR and between 0bc0e5b and 02eb715.

📒 Files selected for processing (12)
  • app/Actions/Photo/StructOfArrays/QueryPhotoBuckets.php
  • app/Actions/Photo/StructOfArrays/QueryPhotoDetails.php
  • app/Actions/Photo/StructOfArrays/QueryPhotoRatios.php
  • app/Actions/Photo/StructOfArrays/ResolvesPhotoSource.php
  • app/Http/Controllers/Gallery/AlbumListing/PhotoChildrenController.php
  • app/Http/Requests/Photo/GetPhotoBucketsRequest.php
  • app/Http/Requests/Photo/GetPhotoDetailsRequest.php
  • app/Http/Requests/Photo/GetPhotoRatiosRequest.php
  • resources/js/stores/AlbumState.ts
  • tests/Feature_v3/Photo/PhotoBucketsV3Test.php
  • tests/Feature_v3/Photo/PhotoDetailsV3Test.php
  • tests/Feature_v3/Photo/PhotoRatiosV3Test.php

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment thread app/Actions/Photo/StructOfArrays/ResolvesPhotoSource.php Outdated
Comment thread app/Actions/Photo/StructOfArrays/ResolvesPhotoSource.php
Comment thread app/Actions/Photo/StructOfArrays/ResolvesPhotoSource.php
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.44860% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.86%. Comparing base (0bc0e5b) to head (04e9555).
⚠️ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 180ed763-26c2-40cd-9b0b-afc50be05cb8

📥 Commits

Reviewing files that changed from the base of the PR and between 02eb715 and 44a8a75.

📒 Files selected for processing (13)
  • app/Actions/Photo/StructOfArrays/QueryPhotoBuckets.php
  • app/Actions/Photo/StructOfArrays/ResolvesPhotoSource.php
  • app/Enum/SizeVariantType.php
  • app/Events/PhotoTagsChanged.php
  • app/Http/Controllers/Gallery/PhotoAssetController.php
  • app/Http/Controllers/Gallery/PhotoController.php
  • app/Http/Requests/Photo/GetPhotoAssetRequest.php
  • app/Listeners/ManagedCachePhotoListingInvalidator.php
  • app/Providers/EventServiceProvider.php
  • tests/Feature_v3/Photo/PhotoAssetV3Test.php
  • tests/Feature_v3/Photo/PhotoBucketsV3Test.php
  • tests/Feature_v3/Photo/PhotoRatiosV3Test.php
  • tests/Unit/Listeners/ManagedCachePhotoListingInvalidatorTest.php
🚧 Files skipped from review as they are similar to previous changes (4)
  • app/Actions/Photo/StructOfArrays/QueryPhotoBuckets.php
  • app/Actions/Photo/StructOfArrays/ResolvesPhotoSource.php
  • tests/Feature_v3/Photo/PhotoRatiosV3Test.php
  • tests/Feature_v3/Photo/PhotoBucketsV3Test.php

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment thread app/Listeners/ManagedCachePhotoListingInvalidator.php
@ildyria
ildyria merged commit 6eab5a3 into master Sep 12, 2026
54 checks passed
@ildyria
ildyria deleted the v3-smart-albums branch September 12, 2026 20:09
@ildyria ildyria added the v8 label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant