Skip to content
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

fix(web): previous/next asset navigation #3107

Merged
merged 8 commits into from
Jul 5, 2023
Merged

Conversation

brighteyed
Copy link
Contributor

This PR fixes the next/previous navigation in the AssetViewer including navigation across not loaded buckets

Example of the bug:

  1. Open the main timeline (the first N bucket(s) are loaded now)
  2. Click on the scrollbar somewhere near the bottom (some bucket(s) near that location are loaded. Note: _assetGridState.assets now contains assets from nonadjacent buckets)
  3. Click on any asset to open AssetViewer
  4. Click the Previous button multiple times. When we reach the end of the bucket(s) loaded in (2), we begin to show assets from buckets loaded in (1) thus missing a lot of assets in intermediate buckets.

Details:

I couldn't find a way to write navigateAsset function better. But I think the current implementation is at least clear and readable. It just finds the adjacent bucket when needed

@vercel
Copy link

vercel bot commented Jul 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Jul 5, 2023 8:22am

web/src/lib/stores/asset-interaction.store.ts Outdated Show resolved Hide resolved
web/src/lib/stores/asset-interaction.store.ts Outdated Show resolved Hide resolved
web/src/lib/stores/asset-interaction.store.ts Outdated Show resolved Hide resolved
web/src/lib/stores/asset-interaction.store.ts Outdated Show resolved Hide resolved
Co-authored-by: Thomas <9749173+uhthomas@users.noreply.github.com>
Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

Looks a lot better IMO! A few more suggestions, but looks good to me.

web/src/lib/stores/asset-interaction.store.ts Outdated Show resolved Hide resolved
web/src/lib/stores/asset-interaction.store.ts Outdated Show resolved Hide resolved
@alextran1502 alextran1502 merged commit 37edef8 into main Jul 5, 2023
@alextran1502 alextran1502 deleted the fix/next-prev-navigation branch July 5, 2023 20:24
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.

4 participants