feat(dashboards): collections create/edit UI#1100
Draft
fhennig wants to merge 14 commits intogeneralized-collections-ui-detail-viewfrom
Draft
feat(dashboards): collections create/edit UI#1100fhennig wants to merge 14 commits intogeneralized-collections-ui-detail-viewfrom
fhennig wants to merge 14 commits intogeneralized-collections-ui-detail-viewfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c560f43 to
4adeee1
Compare
ebd3666 to
4daffe2
Compare
only on staging for now, remove when enabling on prod: #1108 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reads lineageFields from the per-organism LAPIS config and renders a
GsLineageFilter for each field above the mutation filter. Values are
stored as plain strings in filterObject. Also fixes the type toggle
discriminator ('mutationList' → 'filterObject') and adds the showLabel
prop to GsMutationFilter.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move mutation filter to top with label re-enabled, lineage filters below. Replace radio type toggle with a checkbox at the bottom. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e/description changes The variant editor contains GsMutationFilter and GsLineageFilter — web components from @genspectrum/dashboard-components that are expensive to render. Previously, typing in the variant name or description field caused these components to re-render on every keystroke, resulting in noticeable input lag. Root cause: React re-renders the entire component subtree whenever a parent re-renders. Typing a name called setVariants in CollectionForm, which re-rendered all VariantEditors, which re-rendered MutationListVariantFields, which re-rendered the Gs* web components — even though none of their data had changed. Fix applied in layers: 1. CollectionForm: wrapped addVariant, updateVariant, removeVariant in useCallback so their references are stable across re-renders. 2. VariantEditor: wrapped in memo so it only re-renders when its own props change, not when unrelated CollectionForm state (e.g. collection name) changes. The onChange/onRemove props are now stable thanks to (1), so memo's shallow comparison holds. 3. MutationListVariantFields: wrapped in memo and refactored to receive filterObject directly instead of the full variant object. This means its props only change when filter data changes — not when name or description changes. 4. handleFilterObjectChange: the onChange handler passed to MutationListVariantFields needs to build a full VariantUpdate including name and description. If we put variant in useCallback's deps, the callback is recreated on every name/description change, breaking memo. Instead, we store variant in a ref (variantRef.current = variant on every render) and read from it inside the callback. The ref is always current without being a dependency, so the callback is stable for the lifetime of the component. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
70805e1 to
a43ad11
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds create and edit UI for collections. It's the same form in both cases.
TODO - more description.
When hitting on 'save' you get to the 'view collection' page, which doesn't exist yet in this PR - it's implemented here: #1099 (I used to have this PR based on the other one, but eventually though it's simpler to keep them independent)
Screenshot
New collection button on the overview page:
PR Checklist