-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR updates the search page functionality to store the previewed sequence ID and half-screen preference in the URL, enabling state persistence on reload or when sharing the URL.
- Initializes state from URL parameters for sequence and view mode
- Introduces callbacks to update both local state and URL query parameters
- Adds tests to verify the URL parameter integration for sequence selection and half-screen view
Reviewed Changes
File | Description |
---|---|
website/src/components/SearchPage/SearchFullUI.tsx | Refactored state initialization and updated functions to synchronize URL parameters |
website/tests/pages/search/index.spec.ts | Added integration tests for updating and restoring URL parameters |
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
website/src/components/SearchPage/SearchFullUI.tsx:121
- [nitpick] The callback function 'setPreviewedSeqId' shares a similar naming to the inner state setter 'setPreviewedSeqIdInner', which could be confusing. Consider renaming the callback to 'updatePreviewedSeqId' for improved clarity.
const setPreviewedSeqId = useCallback(
9c0e31a
to
e15ae83
Compare
…icated code for now to verify it fixes that
6b9af64
to
fd75c6d
Compare
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
to initialize from URL parameters
URL state
URL parameters when they change
- 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:
in the URL
and view mode will be preserved
Tests aren't working atm though the function does