Skip to content

chore: update prod from main - #1187

Merged
fhennig merged 3 commits into
prodfrom
main
May 5, 2026
Merged

chore: update prod from main#1187
fhennig merged 3 commits into
prodfrom
main

Conversation

@github-actions

Copy link
Copy Markdown

This pull request updates the prod branch with the latest changes from the main branch.

Make sure to merge this creating a merge commit.

Do not squash-merge this PR. Do not rebase and merge.

… the page state (#1166)

* 1156 vibe code

* 1156 don't ignore lint

* 1156 extract mutation

* 1156 also commit the test

* 1156 loading spinner

* 1156 show when valid

* 1156 add doFullValidation param to query endpoint

* 1156 on error, also just show an icon

* 1156 fix test

* 1156 format

* 1156 fix types

* 1156 proper error tooltip

* 1156 "sticky" tooltip

* 1156 close sticky tooltip

* 1156 extract component

* 1156 do full validation

* 1156 do todo

* 1156 fix stuff

* 1156 better test

* 1156 type=button

* 1156 relax assertion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented Apr 30, 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 Apr 30, 2026 11:18am

Request Review

* Fix auth secret regenerating on every server restart

Remove hardcoded `crypto.randomUUID()` as the auth secret — auth-astro
and @auth/core both automatically read AUTH_SECRET from the environment,
so the explicit secret field was overriding that and causing all sessions
to be invalidated on every restart/deploy.

Add AUTH_SECRET to .env.example with generation instructions.

Fixes #1145

* Add e2e test for auth session cookie

Set a fixed AUTH_SECRET in docker-compose and .env.e2e so tests can
mint valid session cookies with a known secret. Add a Playwright test
that verifies the account icon appears (not the Login button) when an
authenticated cookie is present — this also acts as a regression test
for the secret-regenerating bug: if AUTH_SECRET were ignored, the
minted cookie would fail to decode and the test would fail.

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

* Add hover test for username in auth dropdown

Extract cookie setup into a helper, add name to the minted token, and
test that hovering the account icon shows the username from the session.

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

* Refactor e2e test helpers into tests/helpers/ directory

Move authHelper into tests/helpers/ alongside a new organisms.ts
(split out from the old helpers.ts) so helper files are grouped
together rather than living in feature directories. Add authenticatedPage
fixture to e2e.fixture.ts so tests declare auth as a dependency instead
of calling the helper imperatively.

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

* Add collection create/edit/delete UI

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

* Use default button style for New collection button

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

* foo

* hot-fix an issue

* Add lineage filter to variant editor

Reads lineageFields from the per-organism LAPIS config and renders a
GsLineageFilter for each field above the mutation filter. Values are
stored as plain strings in filterObject. Also fixes the type toggle
discriminator ('mutationList' → 'filterObject') and adds the showLabel
prop to GsMutationFilter.

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

* Redesign variant editor controls

Move mutation filter to top with label re-enabled, lineage filters
below. Replace radio type toggle with a checkbox at the bottom.

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

* Rename checkbox label and remove coverage query from variant form

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

* Add some memoization and callback wrapping

* Prevent expensive Gs* web components from re-rendering on variant name/description changes

The variant editor contains GsMutationFilter and GsLineageFilter — web components
from @genspectrum/dashboard-components that are expensive to render. Previously,
typing in the variant name or description field caused these components to re-render
on every keystroke, resulting in noticeable input lag.

Root cause: React re-renders the entire component subtree whenever a parent
re-renders. Typing a name called setVariants in CollectionForm, which re-rendered
all VariantEditors, which re-rendered MutationListVariantFields, which re-rendered
the Gs* web components — even though none of their data had changed.

Fix applied in layers:

1. CollectionForm: wrapped addVariant, updateVariant, removeVariant in useCallback
   so their references are stable across re-renders.

2. VariantEditor: wrapped in memo so it only re-renders when its own props change,
   not when unrelated CollectionForm state (e.g. collection name) changes. The
   onChange/onRemove props are now stable thanks to (1), so memo's shallow
   comparison holds.

3. MutationListVariantFields: wrapped in memo and refactored to receive filterObject
   directly instead of the full variant object. This means its props only change
   when filter data changes — not when name or description changes.

4. handleFilterObjectChange: the onChange handler passed to MutationListVariantFields
   needs to build a full VariantUpdate including name and description. If we put
   variant in useCallback's deps, the callback is recreated on every name/description
   change, breaking memo. Instead, we store variant in a ref (variantRef.current =
   variant on every render) and read from it inside the callback. The ref is always
   current without being a dependency, so the callback is stable for the lifetime
   of the component.

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

* some rebase fixes

* delete

* undo

* Polish collection edit/create UI

- Add 'New collection' / 'Edit collection' page title
- Use organism label in general info description
- Make 'Add variant' button full-width
- Default new variants to filterObject (unticked advanced query)
- Fix bottom padding for both create and edit pages
- Consistent label styles and textarea sizing throughout
- Remove button styled for variant removal

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

* Add component and E2E tests for collection create/edit pages [WIP]

Component tests (vitest-browser-react) for CollectionForm and VariantEditor
are working. E2E tests for the create/edit pages are not yet fully working —
the pages require authentication, which cannot be set up in tests until the
AUTH_SECRET bug (random UUID on each server start) is fixed.

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

* docs

* Add edit button to collection detail page for owners

Shows an Edit button on the collection detail view only when the logged-in
user is the owner. Fixes type mismatch between GitHub OAuth numeric user ID
and the string ownedBy field by coercing with String() before comparing.

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

* Add auth fixtures and unauthenticated access test for collection form

Extract auth cookie setup into a shared authHelper, add authenticatedPage
and authenticatedCollectionFormPage fixtures so tests declare auth as a
dependency rather than calling a helper imperatively. Add a test verifying
that the create collection page shows "Please login" when not authenticated.

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

* Fix ownership check, error message, and clean up test files

- Check server-side that the logged-in user owns the collection before
  rendering the edit page; redirect to /404 otherwise, matching the
  pattern used in the detail page
- Fix inconsistent delete error message in CollectionEdit ("Failed to
  delete" → "Failed to delete collection")
- Remove leftover auth/authHelper.ts and its duplicate import in
  e2e.fixture.ts
- Remove E2E_test_notes.md

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

* Fix TypeScript errors in Inset and CollectionForm

Restore PropsWithChildren<WithClassName> in Inset (matching the pattern
used elsewhere) after the formatter incorrectly removed the type argument.
Add `as const` to filterObject type literals in CollectionForm so
TypeScript narrows them to the required literal type.

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

* Revert accidental XFG* change in wastewaterConfig

Restore A.D.1* as the default variant for the second wastewater config
entry — XFG* was already set on the first entry and should not have
been duplicated here.

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

* Revert unused showLabel prop from GsMutationFilter

The prop was added but never passed by any call site.

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

* Use stable clientKey instead of index for variant list keys

key={index} causes React to reuse component state from the wrong row
when a variant is removed. Use variant.id when available (existing
variants) or crypto.randomUUID() for new ones, preserved through
updates.

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

* Use named checkbox selector in CollectionFormPage

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

* Use named checkbox selector in VariantEditor browser spec

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

* Use named checkbox selector in CollectionForm browser spec

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

* Pass collection from edit.astro to CollectionEdit, avoiding duplicate fetch

The page already fetches the collection for ownership validation, so
passing it as a prop removes the redundant useQuery in CollectionEdit.

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

* refactor(website): move String cast for GitHub user ID to assignment site

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

* refactor(website): extract DeleteCollectionSection from CollectionEdit

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

* fix

* fix

* feat(website): redirect to new collection after creation

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

* test(website): add E2E tests for create redirect and description deletion

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(example-data): add staging example data seeder

Adds a new example-data/ folder with a Node.js script and Dockerfile
that seed the backend with resistance mutation collections (3CLpro, RdRp,
Spike mAb) on staging. The seeder runs as a Docker Compose service
activated via --profile staging and is idempotent.

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

* feat(example-data): add CLI interface to seed.js

Adds util.parseArgs-based CLI (no dependencies) with --url, --user-id,
--session-token, --wait, and --help flags. Session token mode hits the
website proxy at /api/collections with the correct cookie, mirroring the
shell script. The wait retry loop auto-enables when no TTY is detected so
Docker Compose behaviour is unchanged. Also adds a README with usage examples.

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

* fix(example-data): rename seed.js to .mjs, bump node to 25-alpine, always run seeder

- Rename seed.js → seed.mjs to reflect ES module usage
- Update Dockerfile to node:25-alpine
- Remove `profiles: staging` from docker-compose so the seeder always runs
- Update README accordingly

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

* fix(example-data): remove session token support from seed.mjs

Always call the backend directly; the session token path via the website
proxy is no longer needed.

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

* feat(example-data): add CI workflow and publish seeder as Docker image

- Add GitHub Actions workflow to build and push the seeder image to ghcr.io
- Switch docker-compose to use the published image via SEEDER_TAG
- Update README accordingly

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

* update readme

* seeder tag

* node 24

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@fhennig
fhennig merged commit f92f770 into prod May 5, 2026
16 checks passed
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.

2 participants