Skip to content

feat(website,backend): notification bell for sequences awaiting review [WIP]#6841

Draft
corneliusroemer wants to merge 3 commits into
mainfrom
review-notification
Draft

feat(website,backend): notification bell for sequences awaiting review [WIP]#6841
corneliusroemer wants to merge 3 commits into
mainfrom
review-notification

Conversation

@corneliusroemer

@corneliusroemer corneliusroemer commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Claude generated prototype

No integration test yet.

Resolves #6670

2026-07-05 16 24 14
Claude generated description

What & why

New users don't discover the submission approval step. After uploading, sequences sit unapproved (not released) and users are surprised they don't appear (see #6669). Reaching the review page today takes several clicks and requires first selecting the right organism, then Submit, then Review — 2–3 extra clicks if you start on the wrong organism, and new users don't know the path exists.

This PR adds a notification bell to the top-right nav (a familiar web pattern) that collapses this to one click: click the bell → drawer lists organism/group pairs with unapproved submissions → click a row → deep-link straight to that group's review page.

WIP / draft — opened for preview testing.

Behaviour

  • Bell only rendered when logged in (avoids layout shift for logged-out visitors).
  • Muted grey bell with no badge when nothing is pending; primary-coloured bell + red count badge when there are sequences to review.
  • Drawer lists one row per (organism, group) with a count, deep-linking via routes.userSequenceReviewPage.
  • Polls every 30s via a single aggregated backend call.

Backend

  • New GET /my/review-counts endpoint (NotificationController, root-scoped like AdminDashboardControllerSubmissionController is locked to /{organism}), scoped to the authenticated user's groups (super users see all).
  • SubmissionDatabaseService.getReviewCounts() counts unreleased entries (released_at IS NULL) grouped by organism + group, querying the base sequence_entries table to avoid the preprocessed-data join and stay cheap.
    • Trade-off: the count includes still-processing (RECEIVED / IN_PROCESSING) entries, not strictly "awaiting approval". Documented on ReviewCount / getReviewCounts; narrowable to Status.PROCESSED later if exactness is wanted.
  • Partial index migration V1.34 (ON sequence_entries (organism, group_id) WHERE released_at IS NULL) backs the query.
  • GetReviewCountsEndpointTest covers unauthorized / empty / per-group counts / non-member isolation.

Website

  • NotificationBell.tsx island (wrapped in withQueryProvider): headless-ui Menu drawer reusing the OrganismNavigation pattern; button disabled until hydration to avoid Playwright races.
  • Endpoint + zod schemas wired into backendApi.ts / types/backend.ts; added groupManagementClientHooks for group-name labels.
  • Mounted in Navigation.astro, gated on isLoggedIn.

Not in this PR (documented as follow-ups)

  • Bell in the mobile SandwichMenu.
  • Optional numeric badge on the Submit nav item.
  • Dismissal — a deferred localStorage-based design (keyed on a future latestSubmittedAt) is written up in architecture_docs/notification-bell-review-counts.md.

Tests

  • Backend: GetReviewCountsEndpointTest (4 tests) pass.
  • Website: check-types, format, and full unit suite (694 tests) pass.

Not yet visually verified in a running browser — hence preview label for manual testing.

🤖 Generated with Claude Code

🚀 Preview: https://review-notification.loculus.org

Add a notification bell to the top-right navigation that surfaces
sequences awaiting review and deep-links straight to each group's
review page, collapsing the "select organism -> submit -> review"
path down to a single click (see #6669).

Backend:
- New GET /my/review-counts endpoint (NotificationController), scoped
  to the authenticated user's groups (super users see all).
- SubmissionDatabaseService.getReviewCounts() counts unreleased
  entries (released_at IS NULL) grouped by organism and group, querying
  the base sequence_entries table to avoid the preprocessed-data join.
  The count therefore includes still-processing entries; documented on
  ReviewCount / getReviewCounts, and narrowable to PROCESSED later.
- Partial index (V1.34) backing the query.
- GetReviewCountsEndpointTest covering auth, empty, per-group counts
  and non-member isolation.

Website:
- NotificationBell island: single aggregated 30s-polled call, headless
  Menu drawer with per-organism/group rows deep-linking via
  routes.userSequenceReviewPage, button disabled until hydration.
- Muted grey bell when nothing is pending, primary bell + red badge
  when there is; only rendered when logged in to avoid layout shift.
- Wired endpoint + zod schemas; added groupManagementClientHooks.

Docs: architecture_docs/notification-bell-review-counts.md, including a
deferred localStorage-based dismissal design and follow-ups.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@corneliusroemer corneliusroemer added the preview Triggers a deployment to argocd label Jul 5, 2026
@claude claude Bot added website Tasks related to the web application backend related to the loculus backend component labels Jul 5, 2026
@corneliusroemer corneliusroemer changed the title feat(website): notification bell for sequences awaiting review [WIP] feat(website,backend): notification bell for sequences awaiting review [WIP] Jul 5, 2026
@claude

claude Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This PR may be related to: #6670 ("Add notification drawer about unreleased submissions with deeplink to review page") — the feature request this PR appears to implement. It isn't currently referenced in the PR description (only #6669 is linked).

@corneliusroemer corneliusroemer added preview Triggers a deployment to argocd and removed preview Triggers a deployment to argocd labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend related to the loculus backend component preview Triggers a deployment to argocd update_db_schema website Tasks related to the web application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add notification drawer about unreleased submissions with deeplink to review page

2 participants