Skip to content

Generalized collections UI#1077

Draft
fhennig wants to merge 34 commits intogeneralized-collections-frontend-apifrom
generalized-collections-ui
Draft

Generalized collections UI#1077
fhennig wants to merge 34 commits intogeneralized-collections-frontend-apifrom
generalized-collections-ui

Conversation

@fhennig
Copy link
Contributor

@fhennig fhennig commented Mar 16, 2026

resolves #

Summary

  • src/backendApi/ — moved from src/components/subscriptions/backendApi/ to sit alongside
    src/lapis/ and src/covspectrum/; shared backend proxy logic extracted so collections and
    subscriptions routes share a single implementation
  • New Zod schemas in src/types/Collection.ts for response, request, and update types, following
    the same pattern as subscriptions
  • 5 new backend service methods: getCollections, getCollection, postCollection, putCollection,
    deleteCollection
  • New pages under /collections/[organism]/:
    • Hub page listing all organisms
    • Overview table (ID, name, description, variant count) with row links
    • Detail view (collection metadata + per-variant cards with type badge and field display)
    • Create form
    • Edit form (pre-populated from fetched collection, preserves variant IDs for update)
  • Shared CollectionForm component used by both create and edit, with a VariantEditor supporting
    both query-type (LAPIS filter expressions) and mutation-list-type variants

Screenshot

PR Checklist

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

@vercel
Copy link

vercel bot commented Mar 16, 2026

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

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

Request Review

@fhennig fhennig changed the base branch from main to generalized-collections-pt1 March 16, 2026 12:50
@fhennig fhennig force-pushed the generalized-collections-ui branch from 9bf63dc to 760f283 Compare March 17, 2026 09:30
@fhennig fhennig force-pushed the generalized-collections-ui branch from 760f283 to db49022 Compare March 17, 2026 10:11
@fhennig fhennig self-assigned this Mar 17, 2026
@fhennig fhennig changed the base branch from generalized-collections-pt1 to generalized-collections-frontend-api March 17, 2026 10:16
@fhennig fhennig force-pushed the generalized-collections-frontend-api branch from 6ff08e9 to 8ca09af Compare March 17, 2026 15:04
@fhennig fhennig force-pushed the generalized-collections-ui branch from db49022 to ce8db16 Compare March 17, 2026 15:06
@fhennig fhennig force-pushed the generalized-collections-frontend-api branch 2 times, most recently from 9e5ed16 to db7b941 Compare March 18, 2026 14:11
@fhennig fhennig force-pushed the generalized-collections-ui branch from ce8db16 to 74a1a44 Compare March 18, 2026 14:13
fhennig and others added 7 commits March 19, 2026 16:28
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
userId is injected by the backend proxy from the session, so there
is no need to pass it from the client.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The userId is added by the backend proxy, so callers don't need to supply it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fhennig fhennig force-pushed the generalized-collections-frontend-api branch from db7b941 to 9870dc4 Compare March 19, 2026 15:28
fhennig and others added 23 commits March 23, 2026 10:15
* Rename MutationListDefinition to FilterObject

- MutationListDefinition → FilterObject
- MutationListVariantType → FilterObjectVariantType
- MUTATION_LIST → FILTER_OBJECT (enum values and VariantType)
- JSON discriminator "mutationList" → "filterObject"
- Field mutationList → filterObject throughout
- DB column "mutation_list" → "filter_object", stored value updated

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

* Spell out abbreviated field names in FilterObject

aa -> aminoAcid, nuc -> nucleotide:
- aaMutations -> aminoAcidMutations
- nucMutations -> nucleotideMutations
- aaInsertions -> aminoAcidInsertions
- nucInsertions -> nucleotideInsertions

Also fix missed .mutationList. -> .filterObject. accesses in tests.

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

* Convert FilterObject to regular class with JsonAnySetter for filters

- Remove data class; no-arg constructor, var properties
- Arbitrary extra JSON properties captured via @JsonAnySetter into a
  private map, exposed via @JsonAnyGetter (no longer a "filters" sub-object)
- Spell out field names: aa -> aminoAcid, nuc -> nucleotide
- Update all call sites to use .apply { } instead of constructor params
- Restructure FilterObjectTest: explicit JSON string comparisons,
  full and partial serialization/deserialization, and a type-error test

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

* Update V1.1 migration: mutation_list -> filter_object, mutationList -> filterObject

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

* Fix remaining mutationList -> filterObject in test JSON strings

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

* Add equals/hashCode to FilterObject

Lost when converting from data class.

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

* Rename FilterObjectTest methods to WHEN/THEN convention

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

* Use GIVEN/WHEN/THEN naming convention in FilterObjectTest

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

* docs

* Rename MutationList* variant classes to FilterObject*

- MutationListVariant -> FilterObjectVariant
- MutationListVariantRequest -> FilterObjectVariantRequest
- MutationListVariantUpdate -> FilterObjectVariantUpdate
- Related local variables and test helpers updated

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

* Add another test

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
- MutationListDefinition -> FilterObject
- mutationList discriminator -> filterObject
- mutationList field -> filterObject on variant objects
- aaMutations/nucMutations/aaInsertions/nucInsertions -> spelled-out names
- filters sub-object removed; arbitrary filter props now top-level via catchall

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces [...path].ts with index.ts (GET+POST) and [id].ts (GET+PUT+DELETE),
making auth requirements per endpoint explicit. Also adds proxyToBackendOptionalAuth
to backendProxy.ts to support endpoints where auth is optional.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Collections mega menu dropdown listing all organisms
- Use details[name] exclusive accordion to close sibling menus on open

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GitHub returns profile.id as a number, but the backend stores ownedBy
as a string. Strict equality between the two always returned false.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use contents <a> for clickable rows with proper cursor
- Row hover uses bg-base-300 (distinct from zebra bg-base-200)
- Left-align ID and variant count column headers
- Show organism label in page headline
- Replace text-base-content opacity modifiers with explicit gray colors
- Show #<id> prefix in detail view headline
- Replace Details card with inline organism/owner sentence

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

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

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fhennig and others added 2 commits March 23, 2026 11:09
…thenticated users

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant