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

feat(website): store previewed sequence ID in URL #3762

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

theosanderson
Copy link
Member

@theosanderson theosanderson commented Feb 26, 2025

resolves #2025

preview URL: http://previewurl.loculus.org

Summary

Stores the ID of the sequence currently previewed in a modal on the search page in the URL

  1. Modified both the previewedSeqId and previewHalfScreen state
    to initialize from URL parameters
  2. Created callback functions to update both local state and
    URL state
  3. Added a useEffect hook to keep the local state in sync with
    URL parameters when they change
  4. Used the same pattern as the page parameter:
    - For selected sequence: selectedSeq=ABC123 in URL
    - For half screen mode: halfScreen=true in URL
    - Parameters are completely removed from URL when not active

Now when users:

  1. Select a sequence for preview, it will be stored in the URL
  2. Change to half-screen view, that preference will be stored
    in the URL
  3. Reload the page or share the URL, both the selected sequence
    and view mode will be preserved

Tests aren't working atm though the function does

@theosanderson theosanderson added the preview Triggers a deployment to argocd label Feb 26, 2025
@theosanderson theosanderson marked this pull request as draft February 26, 2025 22:02
@theosanderson theosanderson removed the preview Triggers a deployment to argocd label Feb 26, 2025
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.

Persist sequence opened in modal in URL
1 participant