feat(036): fix direct photo links in large paginated albums via ?page=N#4294
feat(036): fix direct photo links in large paginated albums via ?page=N#4294
Conversation
…aginated album photos Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
… prepend cap, page validation, error handler Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
📝 WalkthroughWalkthroughImplements Feature 036 – Photo Page URL with comprehensive documentation and code changes. Introduces page tracking via Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 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: 1
🧹 Nitpick comments (4)
resources/js/composables/album/scrollable.ts (1)
19-41: Consider adding a fallback when thumbnail never appears.When
scroll_photo_idis set but the thumbnail element is never found after 50 retries (5 seconds), the function silently exits without restoring any scroll position. Previously, it would fall back torecoverScrollPage()which restores the saved scroll offset.If the target photo was deleted, the page param was wrong, or the background prepend failed, users may be left at an unexpected scroll position with no visual feedback.
♻️ Suggested fallback after exhausting retries
async function setScroll(_v: void, iter = 0) { if (path.value === undefined) { return; } // Abort. We tried 10 times (waited 5s). if (iter == 50) { + // Fallback: restore saved scroll position if thumbnail never appeared + const e = document.getElementById("galleryView"); + if (e && path.value) { + toggleableStore.recoverScrollPage(e, path.value); + } + toggleableStore.scroll_photo_id = undefined; return; }docs/specs/4-architecture/features/036-photo-page-url/tasks.md (1)
71-74: Add required footer format per coding guidelines.Documentation files should end with an hr line followed by the last updated timestamp in the specified format.
📝 Add footer
- **Timeline prepend ordering:** The timeline `prependPhotos` uses `unshift` for new groups not matching an existing header. The correct visual order of prepended timeline groups depends on the album sort order; for typical date-descending albums (newest first, page 1), prepending an earlier page (older photos, higher page N) will insert the group at the front of the timeline array. This is correct for date-descending sort but may need revisiting for ascending sort. + +--- + +*Last updated: 2026-04-12*As per coding guidelines: "At the bottom of documentation files, add an hr line followed by 'Last updated: [date of the update]'"
docs/specs/4-architecture/features/036-photo-page-url/spec.md (1)
69-70: Add required footer format per coding guidelines.📝 Add footer
| S-036-06 | User navigates next/previous across a page boundary → URL `?page` updates to the adjacent page | + +--- + +*Last updated: 2026-04-12*As per coding guidelines: "At the bottom of documentation files, add an hr line followed by 'Last updated: [date of the update]'"
docs/specs/4-architecture/features/036-photo-page-url/plan.md (1)
113-114: Add required footer format per coding guidelines.📝 Add footer
- **Same-pattern application to Search, Tag, Timeline views:** Currently only album and flow-album routes include `?page`. The same `photoPageMap` approach can be extended to those views. + +--- + +*Last updated: 2026-04-12*As per coding guidelines: "At the bottom of documentation files, add an hr line followed by 'Last updated: [date of the update]'"
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 42279c88-d852-478f-a5c7-6abd33fe59ec
📒 Files selected for processing (9)
docs/specs/4-architecture/features/036-photo-page-url/plan.mddocs/specs/4-architecture/features/036-photo-page-url/spec.mddocs/specs/4-architecture/features/036-photo-page-url/tasks.mdresources/js/composables/album/scrollable.tsresources/js/composables/photo/photoRoute.tsresources/js/stores/AlbumState.tsresources/js/stores/ModalsState.tsresources/js/stores/PhotosState.tsresources/js/views/gallery-panels/Album.vue
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Fixes #4260
Fixes #4063
Summary by CodeRabbit
Release Notes
New Features
?page=N) for direct navigation to the correct photo.Improvements
Documentation