feat(website): replace plain textarea in VariantEditor with validated AdvancedQueryFilter#1197
Open
fhennig wants to merge 7 commits into
Open
feat(website): replace plain textarea in VariantEditor with validated AdvancedQueryFilter#1197fhennig wants to merge 7 commits into
fhennig wants to merge 7 commits into
Conversation
Required by verbatimModuleSyntax. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yFilter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… AdvancedQueryFilter The advanced query mode in the collection variant editor now uses the same validated query input as the baseline filter, restricting users to lineage fields only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…spec Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the collection variant editor’s “advanced query” mode to use the existing validated AdvancedQueryFilter UI instead of a plain <textarea>, and wires it to restrict referenced metadata fields to the configured lineageFields.
Changes:
- Replaced the query variant
<textarea>withAdvancedQueryFilter(validated, with field allowlisting). - Plumbed
lapisUrlintoVariantEditorsoAdvancedQueryFiltercan validate against LAPIS. - Updated
VariantEditorbrowser specs to wrap with a React Query provider and passlapisUrl.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| website/src/components/collections/form/VariantEditor.tsx | Replaces query textarea with AdvancedQueryFilter, adds lapisUrl prop, and maps lineageFields → allowedFields. |
| website/src/components/collections/form/VariantEditor.browser.spec.tsx | Wraps VariantEditor with a QueryClientProvider for tests and provides a dummy LAPIS URL. |
| website/src/components/collections/form/CollectionForm.tsx | Passes lapisUrl down into VariantEditor. |
Comments suppressed due to low confidence (1)
website/src/components/collections/form/VariantEditor.tsx:87
onInputupdates the parent variant using thevariantvalue from the render closure. SinceAdvancedQueryFilterinvokesonInputasynchronously (debounced + network validation), this can overwrite newer edits to other fields (e.g., name/description) made before validation completes. UsevariantRef.current(or another up-to-date source) when constructing the next variant object to avoid clobbering concurrent changes.
lapisUrl={lapisUrl}
value={variant.countQuery}
allowedFields={lineageFields.length > 0 ? lineageFields : undefined}
onInput={(newValue) => onChange(index, { ...variant, countQuery: newValue ?? '' })}
/>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+81
to
+87
| <AdvancedQueryFilter | ||
| enabled | ||
| lapisUrl={lapisUrl} | ||
| value={variant.countQuery} | ||
| allowedFields={lineageFields.length > 0 ? lineageFields : undefined} | ||
| onInput={(newValue) => onChange(index, { ...variant, countQuery: newValue ?? '' })} | ||
| /> |
1bf81f3 to
142a533
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.
depends on #1195
Summary
<textarea>in the collection variant editor's advanced query mode with the validatedAdvancedQueryFiltercomponentlineageFieldsconfig, already passed toVariantEditor)lineageFieldsdoubles as the allowed fields list; when empty, no restriction is appliedTest plan
BA.1*) — should show checkmarkhost:Human) — should show error with field name and allowed listA123T) — should pass (no metadata columns referenced)VariantEditorbrowser spec tests pass🤖 Generated with Claude Code