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

refactor(web): asset grid stores #3464

Merged
merged 3 commits into from
Aug 1, 2023
Merged

Conversation

brighteyed
Copy link
Contributor

Description

This PR is a preparation for the #2464

Currently we have a bunch of global stores shared between all the components. This PR focuses on refactoring the stores required for the AssetGrid component:

  • createAssetStore function creates new assets store (buckets, get next/prev asset)
  • createAssetInteractionStore function creates new asset interaction store for selecting. The created store now doesn't depend on the assets store and therefore can be created independently.
  • assetViewingStore: stores the current asset being viewed and show/hide state for the AssetViewer

Each component that creates an AssetGrid will create its own stores now. As a result multiple AssetGrid components can be mounted at once (see this comment as a reference)

How Has This Been Tested?

  • View the main timeline and scroll it up and down to load/unload buckets
  • Select/deselect assets in the timeline including range selection
  • Select All button in the main timeline
  • Archive/unarchive assets and view archived assets in the GalleryViewer component
  • Mark/unmark asset as favorite and view favorite assets in the GalleryViewer component
  • Map page: view assets in the AssetViewer and navigate between them
  • Album page: select/deselect assets. View assets in the AssetViewer and navigate between them. Add new assets to the album
  • View the partner's assets timeline and scroll it up and down to load/unload buckets
  • Select/deselect assets in the partner's assets timeline including range selection

@vercel
Copy link

vercel bot commented Jul 29, 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 30, 2023 4:48pm

@etnoy
Copy link
Contributor

etnoy commented Jul 29, 2023

Love that we're making progress on #2464

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.

Thanks for working on this!

@alextran1502
Copy link
Contributor

Hello, thank you for the PR. I just finished the first round of testing and an issue I found is that when you select asset on the timeline and click "Add to album", the modal isn't rendered correctly

@alextran1502 alextran1502 merged commit 5f9dfa9 into main Aug 1, 2023
20 checks passed
@alextran1502 alextran1502 deleted the refactor/asset-grid-stores branch August 1, 2023 01:27
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.

None yet

5 participants