Skip to content

feat(website): predefined COVID variant signatures from collections (W-ASAP)#1229

Merged
fhennig merged 31 commits into
mainfrom
feat/predefined-wasap-covid-variants
Jun 8, 2026
Merged

feat(website): predefined COVID variant signatures from collections (W-ASAP)#1229
fhennig merged 31 commits into
mainfrom
feat/predefined-wasap-covid-variants

Conversation

@fhennig

@fhennig fhennig commented May 27, 2026

Copy link
Copy Markdown
Contributor

resolves #1199

Adds support for predefined variant signatures in the W-ASAP Variant Explorer mode, as an alternative to computing signatures from clinical sequences. For COVID, these come from a configured collections source (filtered by user ID, organism, and a tag in the description).

Summary

  • Adds a predefinedVariantsSource config to WasapPageConfig specifying where to fetch predefined variant collections from (userId, tag, label); the organism is taken from the new internalName field on the base config
  • Pre-fetches matching collections via getCollectionSummaries and exposes them in a downshift autocomplete combobox in the filter panel
  • Extends WasapVariantFilter with a signatureType field ('computed' | 'predefined') and predefined-specific fields (collectionId, newMutationsOnly); serialised to/from URL
  • signatureType defaults to 'computed' and is omitted from the URL for backwards compatibility with existing bookmarks
  • Refactors the variant filter type from a discriminated union to a flat type (consistent with WasapUntrackedFilter), removing the need to pass computedDefaults through the component tree
  • Extracts SignatureType to wasapPageConfig.ts alongside all other WASAP types
  • Adds internalName to WasapPageConfigBase so the organism key is accessible from the config directly
  • Updates the Variant Explorer info box to describe both predefined and computed signature modes

Screenshot

image

Testing

  • WasapPageStateHandler.spec.ts — URL round-trip tests for the predefined signatureType: serialising a WasapVariantFilter with signatureType: 'predefined', collectionId, and newMutationsOnly into URL params and parsing them back produces the original state.
  • CollectionCombobox.browser.spec.tsx (new file) — Browser tests for the autocomplete combobox used to pick a predefined collection: selecting a collection from the dropdown, clearing the selection via the clear button, and blur behaviour (committing a valid value on blur, rejecting an invalid one with an error state).
  • VariantExplorerFilter.browser.spec.tsx — Browser tests for the predefined path in the filter panel: switching the "Variant definition source" dropdown from computed → predefined, selecting a collection, and toggling the "Mutation not in parent" checkbox.

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

@vercel

vercel Bot commented May 27, 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 8, 2026 8:36am

Request Review

@fhennig fhennig self-assigned this May 27, 2026
@fhennig fhennig changed the title Mock the UI Mock the UI (WIP) May 27, 2026
@fhennig

This comment was marked as outdated.

@fhennig fhennig force-pushed the feat/predefined-wasap-covid-variants branch from ef0f352 to 8246e5f Compare May 29, 2026 07:42
@fhennig fhennig changed the title Mock the UI (WIP) feat(website): predefined COVID variant signatures from collections (W-ASAP) May 29, 2026
@fhennig fhennig force-pushed the feat/predefined-wasap-covid-variants branch from 08a33ce to 160cebe Compare May 29, 2026 09:28
@fhennig fhennig force-pushed the feat/predefined-wasap-covid-variants branch from 3428cc9 to 5727296 Compare June 1, 2026 11:28
@fhennig fhennig marked this pull request as ready for review June 1, 2026 12:01

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

Adds support in the W-ASAP “Variant Explorer” for selecting curated, predefined COVID variant mutation signatures from Collections (in addition to the existing computed-from-clinical-signatures flow), including URL serialization and UI updates.

Changes:

  • Extends WASAP config/types and URL state handling to support signatureType: 'computed' | 'predefined' plus predefined-only params (collectionId, newMutationsOnly).
  • Adds a Downshift-based CollectionCombobox and updates the Variant Explorer filter panel to switch between computed vs predefined signature sources.
  • Fetches predefined collections from the backend (by user + organism) and adds tests for URL round-tripping and the new filter UI.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
website/src/views/pageStateHandlers/WasapPageStateHandler.ts Parse/serialize new predefined variant params into/from the URL.
website/src/views/pageStateHandlers/WasapPageStateHandler.spec.ts Adds URL round-trip tests for predefined signature params.
website/src/types/wastewaterConfig.ts Adds internalName and configures predefined variants source for COVID.
website/src/components/views/wasap/wasapPageConfig.ts Adds internalName, SignatureType, and extends WasapVariantFilter.
website/src/components/views/wasap/WasapPage.tsx Logs query errors; hides clinical fetch info for predefined signatures.
website/src/components/views/wasap/useWasapPageData.ts Adds predefined-signature fetching via backend collections.
website/src/components/views/wasap/initialMeanProportionInterval.spec.ts Updates test fixtures to include signatureType.
website/src/components/pageStateSelectors/wasap/WasapPageStateSelector.tsx Prefetches matching collections and passes results/label into the variant filter.
website/src/components/pageStateSelectors/wasap/utils/CollectionCombobox.tsx New Downshift combobox for selecting a predefined collection.
website/src/components/pageStateSelectors/wasap/utils/CollectionCombobox.browser.spec.tsx Browser tests for combobox selection/clearing/blur behavior.
website/src/components/pageStateSelectors/wasap/InfoBlocks.tsx Updates info text to describe both signature modes.
website/src/components/pageStateSelectors/wasap/filters/VariantExplorerFilter.tsx UI to toggle computed vs predefined and pick a collection / new-mutations-only.
website/src/components/pageStateSelectors/wasap/filters/VariantExplorerFilter.browser.spec.tsx Browser tests covering the predefined path in the filter panel.
website/src/backendApi/backendService.ts Extends getCollectionSummaries to accept an optional userId filter.
website/package.json Adds downshift dependency.
website/package-lock.json Locks downshift and updates dependency metadata.
Files not reviewed (1)
  • website/package-lock.json: Language not supported

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

Comment thread website/src/views/pageStateHandlers/WasapPageStateHandler.ts
Comment thread website/src/components/views/wasap/useWasapPageData.ts
fhennig and others added 25 commits June 8, 2026 10:35
…t mode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes the redundant collectionsOrganism field from predefinedVariantsSource
and exposes it as internalName on the base config, where it was already
implicitly known as the map key.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Falls back to the configured default when no collectionId is present in the URL,
mirroring the existing default variant behaviour for computed mode.

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

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

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

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…f hardcoded value

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

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on every keystroke

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

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

Co-authored-by: Fabian Engelniederhammer <92720311+fengelniederhammer@users.noreply.github.com>

@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.

LGTM (not sure why the diff shows 31 commits now, looks like something went wrong during the rebase)

@fhennig fhennig merged commit 0a40fa8 into main Jun 8, 2026
12 checks passed
@fhennig fhennig deleted the feat/predefined-wasap-covid-variants branch June 8, 2026 13:04
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.

wastewater: allow using Cornelius' definitions of variants

3 participants