Skip to content

refactor(website): use per-mutation annotations for wastewater resistance mutations#1274

Merged
fhennig merged 4 commits into
mainfrom
feat/wasap-per-mutation-annotations
Jun 23, 2026
Merged

refactor(website): use per-mutation annotations for wastewater resistance mutations#1274
fhennig merged 4 commits into
mainfrom
feat/wasap-per-mutation-annotations

Conversation

@fhennig

@fhennig fhennig commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

resolves #1223

Summary

  • Replaces the two-mode annotation system (perVariant / perCollection) with a single unified approach, taking advantage of per-mutation name support added in dashboard-components 1.18
  • All resistance mutation collections now produce one MutationAnnotation per collection, with each individual mutation carrying its variant name via the new { mutation, name } object form
  • Removes the annotationMode field from ResistanceMutationCollectionConfig and the annotationMode constant entirely
  • Simplifies the test suite from four tests across two describe blocks down to two focused tests

Test plan

  • npm run check-types passes
  • resistanceData.spec.ts passes (2 tests)
  • WasapPageStateHandler.spec.ts passes (26 tests)
  • Verified locally against COVID, RSV-A wastewater dashboards

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Jun 23, 2026 9:00am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the wastewater resistance mutation annotation pipeline to use a single unified annotation approach that leverages per-mutation naming support (dashboard-components ^1.18.0), removing the previous two-mode system (perVariant / perCollection).

Changes:

  • Remove annotationMode from ResistanceMutationCollectionConfig and delete the annotationMode constant.
  • Update resistance annotation generation to always emit one MutationAnnotation per collection, with { mutation, name } entries per mutation (variant name stored per mutation).
  • Simplify the buildResistanceData test suite to match the unified behavior and updated annotation shape.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/src/views/pageStateHandlers/WasapPageStateHandler.spec.ts Updates test config objects to remove the deleted annotationMode field.
website/src/types/wastewaterConfig.ts Removes usage/import of annotationMode in wastewater organism configs.
website/src/components/views/wasap/wasapPageConfig.ts Deletes annotationMode constant and removes annotationMode from resistance collection config type.
website/src/components/views/wasap/resistanceData.ts Unifies annotation construction: one annotation per collection with per-mutation names derived from collection variants.
website/src/components/views/wasap/resistanceData.spec.ts Updates expectations to the new unified annotation structure and reduces redundant mode-based tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fengelniederhammer fengelniederhammer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but filtering for any of the mutation sets doesn't return data:

Image

Comment on lines +59 to +60
aminoAcidMutations: filterVariants.flatMap((variant) =>
(variant.filterObject.aminoAcidMutations ?? []).map((mutation) => ({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we also use allMutations here?

Suggested change
aminoAcidMutations: filterVariants.flatMap((variant) =>
(variant.filterObject.aminoAcidMutations ?? []).map((mutation) => ({
aminoAcidMutations:
allMutations.map((mutation) => ({

or something?

fhennig and others added 4 commits June 23, 2026 11:00
…ance mutations

Takes advantage of the new per-mutation name support in dashboard-components
1.18 to replace the two-mode annotation system (perVariant / perCollection)
with a single unified approach: one MutationAnnotation per collection, with
each mutation carrying its variant name via the new object form.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…owser test flakiness

Vite was re-optimizing react/jsx-dev-runtime mid browser test run, causing
React to load as null and breaking tests that use hooks (e.g. useRef in
LabeledField). Pinning it in optimizeDeps.include prevents the reload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t failures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fhennig fhennig force-pushed the feat/wasap-per-mutation-annotations branch from 2a02680 to b198675 Compare June 23, 2026 09:00
@fhennig fhennig merged commit 54ed1b9 into main Jun 23, 2026
11 checks passed
@fhennig fhennig deleted the feat/wasap-per-mutation-annotations branch June 23, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotations - allow descriptions for individual mutations

3 participants