feat(website): add Required Segments filter for multi-segmented viruses#6057
feat(website): add Required Segments filter for multi-segmented viruses#6057anna-parker merged 5 commits intomainfrom
Conversation
|
This PR may be related to: #5840 (Create a |
|
Claude finished @anna-parker's task in 2m 46s —— View job Code Review
The implementation is clean and well-structured. The component correctly guards against non-multi-segmented organisms, uses Two things worth addressing: No tests – the PR checklist acknowledges this. Even a single integration test that checks a segment presence checkbox and verifies the URL param / search result count changes would give good confidence. Hardcoded field name convention – The two inline comments cover a performance nit (memoising |
|
|
6c45e88 to
85f9edd
Compare
Add a new SegmentFilter component to the search form that lets users
easily filter for sequence entries that include specific segments of
multi-segmented viruses.
Previously, users had to manually set the length filter to > 0 for each
segment they wanted to require, which was unintuitive and created a
cluttered UI. The new "Required segments" section appears at the top of
the Sequence Filters panel (only for multi-segmented organisms) and
shows a checkbox per segment. Checking a segment automatically sets
length_{segment}From = 1, filtering to entries where that segment is
present. Unchecking it clears the constraint.
The filter is rendered only when the underlying length_{segment}From
fields exist in the metadata schema, making it a no-op for organisms
that haven't configured per-segment length fields.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
85f9edd to
c83cc1a
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
resolves #5840
Add a new SegmentFilter component to the search form that lets users easily filter for sequence entries that include specific segments of multi-segmented viruses.
Previously, users had to manually set the length filter to > 0 for each segment they wanted to require, which was unintuitive and created a cluttered UI. The new "Required segments" section appears at the top of the Sequence Filters panel (only for multi-segmented organisms) and shows a checkbox per segment. Checking a segment automatically sets length_{segment}From = 1, filtering to entries where that segment is present. Unchecking it clears the constraint.
The filter is rendered only when the underlying length_{segment}From fields exist in the metadata schema, making it a no-op for organisms that haven't configured per-segment length fields.
Screenshot
PR Checklist
🚀 Preview: https://feat-segment-presence-fil.loculus.org