Skip to content

feat(website): Add success toast notification when releasing sequences#6175

Merged
theosanderson merged 11 commits intomainfrom
claude/add-release-toast-5w5dV
Mar 25, 2026
Merged

feat(website): Add success toast notification when releasing sequences#6175
theosanderson merged 11 commits intomainfrom
claude/add-release-toast-5w5dV

Conversation

@theosanderson
Copy link
Copy Markdown
Member

@theosanderson theosanderson commented Mar 20, 2026

Description

Added a success toast notification that displays when sequences are successfully released through the approve processed data operation.

image image

🚀 Preview: https://claude-add-release-toast.loculus.org

Show a success toast notification when sequences are released
successfully via the approve/release button on the review page.

https://claude.ai/code/session_01BtFqdwWDF1ndHnFZv5i9K1
@theosanderson theosanderson added the preview Triggers a deployment to argocd label Mar 20, 2026
@claude claude Bot added the website Tasks related to the web application label Mar 20, 2026
claude and others added 8 commits March 20, 2026 16:42
Replace the simple success toast with a loading toast that appears
immediately when release is triggered, then transitions to a success
or error state when the mutation completes.

https://claude.ai/code/session_01BtFqdwWDF1ndHnFZv5i9K1
…tent

Change the release success toast to show a bigger celebratory message
with emoji and disable auto-close so users can dismiss it manually.

https://claude.ai/code/session_01BtFqdwWDF1ndHnFZv5i9K1
Only show the celebratory persistent toast when releasing all sequences.
Single sequence releases get a simpler message with auto-close.

https://claude.ai/code/session_01BtFqdwWDF1ndHnFZv5i9K1
Use type assertions instead of explicit parameter types to avoid
incompatibility with the hook's expected callback signatures.

https://claude.ai/code/session_01BtFqdwWDF1ndHnFZv5i9K1
… release

The previous check used `variables.accessionVersionsFilter != null` to
determine if a single sequence was released. However, when using the
"Release all" button with only one sequence, `accessionVersionsFilter`
is not passed (it's undefined), causing the batch emoji message to show
even for a single sequence. Now checks `data.length > 1` from the
response instead, which correctly reflects how many sequences were
actually released.

https://claude.ai/code/session_01BtFqdwWDF1ndHnFZv5i9K1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theosanderson theosanderson changed the title Add success toast notification when releasing sequences feat(website): Add success toast notification when releasing sequences Mar 20, 2026
@theosanderson theosanderson marked this pull request as ready for review March 20, 2026 21:53
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 20, 2026

Claude finished @theosanderson's task in 2m 11s —— View job


Code Review

  • Read changed files
  • Analyze code
  • Post review

The implementation is clean and the loading → success/error toast pattern is a nice UX improvement. A few issues below.

context not safely typed in onSuccess

On line 76, context as { toastId: string | number } assumes context is never undefined. The onError handler (line 88) correctly uses { toastId: string | number } | undefined, but onSuccess doesn't — if context were somehow absent this would throw. These should be consistent; the onSuccess handler should do the same defensive check. Fix this →

Unreachable else branch

Lines 96–98 (openErrorFeedback(...) in the else) can never execute — onMutate always runs before onError in react-query, so context will always contain toastId. The else branch is dead code. Fix this →

Batch detection edge case

data.length > 1 (line 77) means releasing exactly 1 sequence from a batch selection shows the single-item message. This is arguably fine, but data.length > 0 for single and >= 1 for "any" might be worth reconsidering. More importantly, the batch toast sets autoClose: false — this means it never dismisses unless the user clicks it. Worth confirming this is intended UX.

Test coverage

The PR checklist marks tests as covered, but no new test files are included. The existing review-page.spec.ts integration test exercises approveAll() but doesn't assert the toast appears. Consider adding a toast assertion there, or unchecking that checklist item.

…ranch

Both onSuccess and onError now defensively check for undefined context
with optional chaining, matching react-query's type signature. Removed
the unreachable else branch in onError since onMutate always provides
context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@maverbiest maverbiest left a comment

Choose a reason for hiding this comment

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

Very nice!

One thing I noticed on the preview is that the 🎉 All sequences have been released successfully! toast doesn't go away unless I do a hard reload of the page, and it blocks some buttons in the UI. Shouldn't toasts close when you click them? (at least, that's what I'm used to from a user perspective)

Copy link
Copy Markdown
Collaborator

@tombch tombch left a comment

Choose a reason for hiding this comment

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

I just realised I did not actually click send on my review - but I have the same comment as Max 😆

Comment thread website/src/hooks/useSubmissionOperations.ts
Since the batch release toast doesn't auto-close, add a close button
so users can dismiss it manually.

https://claude.ai/code/session_01BtFqdwWDF1ndHnFZv5i9K1
Copy link
Copy Markdown
Contributor

@maverbiest maverbiest left a comment

Choose a reason for hiding this comment

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

Looks great!

@theosanderson theosanderson merged commit f98390c into main Mar 25, 2026
42 checks passed
@theosanderson theosanderson deleted the claude/add-release-toast-5w5dV branch March 25, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Triggers a deployment to argocd website Tasks related to the web application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants