Skip to content

feat(website): improve UX for W-ASAP collection analysis mode#1055

Merged
fhennig merged 12 commits intomainfrom
collection-feature-part-2
Mar 9, 2026
Merged

feat(website): improve UX for W-ASAP collection analysis mode#1055
fhennig merged 12 commits intomainfrom
collection-feature-part-2

Conversation

@fhennig
Copy link
Contributor

@fhennig fhennig commented Feb 24, 2026

resolves #1026

Summary

  • Add coverage query generation (much simpler than anticipated).
  • Adds variant query validation to W-ASAP wastewater dashboard collection mode. Collections now validate variant queries through LAPIS parsing and display invalid variants to users with error messages and a link to the collection on CoV-Spectrum.

Changes

Validation & Error Handling

  • Parse and validate all variant queries in collections using LAPIS /query/parse endpoint
  • Check that queries only contain genome-level filters (mutations/insertions, not metadata)
  • Track and display invalid variants with specific error messages

UI Improvements

  • New CollectionInfo component shows collection link and invalid variant warnings
  • Invalid variants highlighted with warning styling and detailed error messages

Code Organization

  • Refactored W-ASAP page by extracting inline components into dedicated files

Screenshot

Screen.Recording.2026-02-24.at.19.08.15.mov

PR Checklist

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

🤖 Generated with https://claude.com/claude-code (and refined by Felix hehe)

@vercel
Copy link

vercel bot commented Feb 24, 2026

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

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Mar 9, 2026 11:09am

Request Review

Copy link

Copilot AI left a comment

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 implements variant query validation and coverage query generation for the W-ASAP wastewater dashboard collection mode, resolving issue #1026. It introduces LAPIS-based parsing and validation of variant queries, generates coverage queries using the formula (query) or (not maybe(query)), and improves the UI by extracting inline components into dedicated files and adding a new CollectionInfo component to display collection metadata and invalid variant warnings.

Changes:

  • Added LAPIS query parsing and validation to ensure collection variants contain only genome-level filters (mutations/insertions)
  • Implemented coverage query generation using the LAPIS formula from PR #1558
  • Refactored W-ASAP page by extracting inline components (WasapStats, VariantFetchInfo, NoDataHelperText) and adding CollectionInfo component

Reviewed changes

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

Show a summary per file
File Description
website/src/util/siloExpressionUtils.ts New utility to validate SILO filter expressions contain only genome checks
website/src/util/siloExpressionUtils.spec.ts Tests for SILO expression validation logic
website/src/covspectrum/variantConversionUtil.ts Converts detailedMutations queries to LAPIS query strings
website/src/covspectrum/variantConversionUtil.spec.ts Tests for variant conversion utility
website/src/covspectrum/types.ts Exports DetailedMutationsQuery type
website/src/components/views/wasap/useWasapPageData.ts Core implementation of variant validation and coverage query generation
website/src/components/views/wasap/components/WasapStats.tsx Extracted component showing amplicon sequences and sampling dates statistics
website/src/components/views/wasap/components/VariantFetchInfo.tsx Extracted component displaying clinical sequence counts with warnings
website/src/components/views/wasap/components/NoDataHelperText.tsx Extracted component for no data helper messages
website/src/components/views/wasap/components/CollectionInfo.tsx New component displaying collection metadata and invalid variants
website/src/components/views/wasap/WasapPage.tsx Refactored to use extracted components

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

Copy link
Contributor

@fengelniederhammer fengelniederhammer left a comment

Choose a reason for hiding this comment

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

and what Copilot says about the missing tests for the invalid cases ;)

@Taepper
Copy link
Contributor

Taepper commented Mar 5, 2026

I realised that the coverage_query=(query) or (not maybe(query)) does not hold for the GAP symbol -, because Maybe(GAP) does not match N:

Example data:

0
----------
A
C
G
T
-
N
... (100 times in total)
N

query=1-

The count will return just a single row
Count: 1

However, the coverage query will return 105 instead of the expected 5:

(query) or (not maybe(query))
= (0-) or (not maybe(0-))
= (0-) or (not(0-))
= true

fhennig and others added 11 commits March 9, 2026 09:45
Refactored WasapPage.tsx by extracting all inline components into separate files
in a new components subdirectory. This improves code organization and maintainability.

Components extracted:
- CollectionInfo: displays collection link and invalid variants
- NoDataHelperText: shows helpful messages when no data is available
- VariantFetchInfo: displays clinical sequence count with warnings
- WasapStats: shows amplicon sequences and sampling date stats

Additional changes:
- Moved WasapStats to bottom of page for both mutation and collection modes
- Removed completed TODO about collection link (now implemented in CollectionInfo)
- Cleaned up imports in WasapPage.tsx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Simplified the collection link display to be more concise:
- Title: "CoV-Spectrum collection" (instead of "Collection")
- Main text: Collection title as clickable link (reduced from 3 lines to 2)
- Description: Shows collection ID

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@fhennig
Copy link
Contributor Author

fhennig commented Mar 9, 2026

Regarding Alex' comment, we're probably actually going to make some changes regarding this in SILO. Plan is now to disregard this issue with gaps for now - i'll make an issue for it though.

Edit: Issue link: #1067

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.


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

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

@fengelniederhammer fengelniederhammer left a comment

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 I can't test it because the WISE LAPIS doesn't have the query parse endpoint yet.

Copy link
Contributor

@fengelniederhammer fengelniederhammer left a comment

Choose a reason for hiding this comment

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

Tested, works 👍

@fhennig fhennig merged commit bbdc9ce into main Mar 9, 2026
9 checks passed
@fhennig fhennig deleted the collection-feature-part-2 branch March 9, 2026 11:21
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 dashboard collections - use LAPIS endpoint to generate coverage queries

4 participants