feat(components): add per-mutation name/description overrides to MutationAnnotation#1121
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
002c25d to
90aefbf
Compare
…tionAnnotation
Entries in nucleotideMutations, aminoAcidMutations, nucleotidePositions, and
aminoAcidPositions can now be either a plain string or an object with an optional
name and description that override the group-level values in the annotation popup.
BREAKING CHANGE: The four mutation/position list fields on MutationAnnotation now
accept (string | { mutation: string; name?: string; description?: string })[] and
(string | { position: string; name?: string; description?: string })[] respectively,
instead of string[]. Existing plain-string arrays remain valid.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
90aefbf to
42f869f
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for per-mutation (and per-position) name/description overrides in mutation annotations, resolving those overrides eagerly when building the annotation lookup index so UI rendering remains simple and backward compatible with existing string-only configs.
Changes:
- Extend the mutation annotation schema/types to allow list entries to be either strings or
{ mutation/position, name?, description? }objects. - Build a resolved annotation index (
ResolvedMutationAnnotation) at provider setup time and update consumers to render resolved names/descriptions. - Add story + unit tests covering the override behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| components/src/web-components/mutationAnnotations.mdx | Documents the new per-entry override shape and provides an example. |
| components/src/web-components/mutation-annotations-context.ts | Updates Zod schema/types to accept per-entry override objects. |
| components/src/web-components/gs-app.ts | Updates public prop typings and JSDoc to reflect new entry shapes. |
| components/src/preact/MutationAnnotationsContext.tsx | Builds an indexed lookup with resolved per-entry name/description overrides. |
| components/src/preact/MutationAnnotationsContext.spec.tsx | Updates expectations for resolved outputs and adds override-focused tests. |
| components/src/preact/components/annotated-mutation.tsx | Renders resolved title/description in the annotation modal. |
| components/src/preact/components/annotated-mutation.stories.tsx | Adds a story to demonstrate per-mutation override display. |
| components/src/preact/mutationsOverTime/getFilteredMutationCodes.ts | Adapts filtering to the new resolved annotation shape. |
| components/src/preact/mutationsOverTime/getFilteredMutationCodes.spec.ts | Updates tests to build the new annotation index before filtering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This isn't really breaking, is it? |
fengelniederhammer
left a comment
There was a problem hiding this comment.
- what Copilot said
…-mutation overrides Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| <gs-app | ||
| lapis="https://your.lapis.url" | ||
| mutationAnnotations="[ | ||
| { | ||
| name: '3CLpro inhibitor resistance', | ||
| description: 'Mutations affecting 3CLpro drug binding.', | ||
| symbol: 'c', | ||
| nucleotideMutations: [ | ||
| { mutation: 'ORF1a:T2343C', name: '3CLpro:T31C', description: 'Disrupts nirmatrelvir binding.' }, | ||
| { mutation: 'ORF1a:G2558A', name: '3CLpro:E166K' }, | ||
| 'ORF1a:C2566T' | ||
| ] | ||
| }, | ||
| ]" | ||
| > | ||
| {/* children... */} | ||
| </gs-app> |
🤖 I have created a release *beep* *boop* --- ## [1.18.0](dashboard-components-v1.17.0...dashboard-components-v1.18.0) (2026-06-09) ### Features * **components:** add per-mutation name/description overrides to MutationAnnotation ([#1121](#1121)) ([bccd701](bccd701)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Felix Hennig <mail@felixhennig.com>
Closes #1120
Summary
nucleotideMutations,aminoAcidMutations,nucleotidePositions, andaminoAcidPositionscan now be a plain string or an object with optionalname/descriptionfields that override the group-level annotation values in the popupbuildAnnotationIndex, so no extra work happens at render timeExample
{ "name": "3CLpro inhibitor resistance", "description": "Mutations affecting 3CLpro drug binding", "symbol": "c", "nucleotideMutations": [ { "mutation": "ORF1a:T2343C", "name": "3CLpro:T31C", "description": "Disrupts nirmatrelvir binding" }, "ORF1a:G2558A" ] }Annotation type change
The TypeScript types for the four list fields change from
string[]to(string | { mutation/position: string; name?: string; description?: string })[]. Consumers passing plain string arrays are unaffected at runtime; only strict TypeScript type checks would surface a difference.Test plan
MutationWithPerMutationInfoOverridestory covers the override path🤖 Generated with Claude Code