Skip to content

[PB-6480] feature/Filmstrip scrub and scroll restoration in photo viewer#488

Open
CandelR wants to merge 1 commit into
feature/PB-6100-handle-offline-and-wifi-optionfrom
feature/modify-carousel
Open

[PB-6480] feature/Filmstrip scrub and scroll restoration in photo viewer#488
CandelR wants to merge 1 commit into
feature/PB-6100-handle-offline-and-wifi-optionfrom
feature/modify-carousel

Conversation

@CandelR

@CandelR CandelR commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Add filmstrip scrub and scroll restoration to the photo preview screen

Summary

  • PreviewCarousel: drag on the thumbnail strip now changes the main preview photo in real time. Uses isUserScrollingRef to stay active through the momentum phase so the final settled index is captured correctly. filmstripPadding corrected to center the active thumb (screenWidth/2 - (THUMB_W_ACTIVE/2 + THUMB_ACTIVE_MARGIN)) instead of the inactive slot midpoint.
  • PreviewPager: receives isScrubbing prop and reads it via ref (isScrubbingRef) excluded from useEffect deps. Prevents an oscillation loop where scrub-end would trigger an animated scroll, fire onMomentumScrollEnd, and restart the cycle.
  • usePreviewSource: full resolution fetch is deferred while scrubbing. Replaced uri: string | null | undefined with uri: string | null + isLoading: boolean so loading state is explicit rather than encoded as undefined.
  • PreviewPage: drills isScrubbing to usePreviewSource. Passes isLoading to PageContent replacing the uri === undefined spinner check.
  • PhotoPreviewScreen/index: owns isScrubbing stat. Reports the current item id to PhotosScreen via onCurrentItemChange route param on every index change.
  • PhotosTimeline: converted to forwardRef exposing scrollToAssetId(id).
  • PhotosScreen/index: stores the last viewed photo id in lastViewedIdRef. On useFocusEffect scrolls the grid back to that photo and clears the ref.

…sset preview state management and scroll restoration
@CandelR CandelR self-assigned this Jun 9, 2026
@CandelR CandelR added the enhancement New feature or request label Jun 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant