Skip to content

fix(pa): show save/delete cohort toast after the modal closes - #3210

Open
khairul-syazwan wants to merge 2 commits into
developfrom
khairul-syazwan/fix-mri-cohort-toast-feedback
Open

fix(pa): show save/delete cohort toast after the modal closes#3210
khairul-syazwan wants to merge 2 commits into
developfrom
khairul-syazwan/fix-mri-cohort-toast-feedback

Conversation

@khairul-syazwan

@khairul-syazwan khairul-syazwan commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

DELETE

Screen.Recording.2026-08-26.at.3.30.20.PM.mov

CREATE

Screen.Recording.2026-08-26.at.3.30.36.PM.mov

UPDATE
Save button is disabled after clicking

Screen.Recording.2026-08-26.at.3.31.02.PM.mov

Summary

Show save/delete cohort success feedback after the confirm modal closes. The success toast fired while the modal was still open, its z-index was below the modal overlay, and its 2s auto-dismiss could expire before the modal closed — so on the slower v0.18 instance the user saw no confirmation. This raises the toast above overlays, closes the delete dialog immediately after delete succeeds, defers the save toast to after the dialog closes, and disables the Save button while a save is in flight.

Affected modules

  • plugins/ui/apps/vue-mri-ui-lib/src/components/Bookmarks.vue
  • plugins/ui/apps/vue-mri-ui-lib/src/components/FiltersFooter.vue
  • plugins/ui/apps/vue-mri-ui-lib/src/components/ShinyViewer/SaveCohortModal.vue
  • plugins/ui/apps/vue-mri-ui-lib/src/store/modules/bookmark.ts
  • plugins/ui/apps/vue-mri-ui-lib/src/styles/toast.scss

Validation performed

Agent-reported evidence — the no-mistakes gate was not run against this branch because the local working tree had unrelated uncommitted changes (blocking an unclean-tree gate). Evidence collected manually:

  • vite build for vue-mri passes (2635 modules transformed).
  • vitest run on bookmark.test.ts, MessageToast.test.ts, useDashboardFlow.test.ts — 44 tests pass.
  • Lint not run: plugins/ui hoists eslint 7, which cannot read the app's flat eslint.config.js.

Merge Checklist

  • Automated Tests (Jasmine integration tests, Unit tests, and/or Performance tests)
  • Updated Manual tests / Demo Config
  • Documentation (Application guide, Admin guide, Markdown, Readme and/or Wiki)
  • Verified that local development environment is working with latest changes (integrated with latest develop branch)
  • following best practices in code review doc

Refs: #3209

The success feedback for saving or deleting a cohort was fired while the
confirm modal was still open. It rendered below the modal overlay
(z-index 1000) and its 2s auto-dismiss could expire before the modal
closed, so the user saw no feedback (most visible on the slower v0.18
instance).

Changes:
- Raise the app toast above modal overlays (z-index 100000).
- Close the delete dialog right after the delete succeeds, before the
  post-delete list refresh, so the toast appears after the dialog closes.
- Defer the save toast to after the save/update succeeds by suppressing
  the store's inline toast (suppressToast) and firing it after the dialog
  closes; also disable the Save button while the save is in flight.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves cohort save/delete feedback visibility around confirmation dialogs.

Changes:

  • Raises toast stacking priority above modal overlays.
  • Defers save feedback and closes delete dialogs earlier.
  • Disables save controls while saving.

Reviewed changes

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

Show a summary per file
File Description
Bookmarks.vue Closes the delete dialog before refresh.
FiltersFooter.vue Adds save-in-progress state and deferred toast.
SaveCohortModal.vue Suppresses bookmark toast and emits final success feedback.
bookmark.ts Adds optional success-toast suppression.
toast.scss Raises toast z-index.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread plugins/ui/apps/vue-mri-ui-lib/src/components/FiltersFooter.vue
Comment thread plugins/ui/apps/vue-mri-ui-lib/src/components/Bookmarks.vue
- Guard FiltersFooter.saveBookmark against re-entry so a pending save
  cannot be started again via the name-input Enter key.
- Rethrow failed materialized/Atlas/D2E cohort deletes so the delete
  dialog stays open on failure instead of closing and losing the
  error context.
- Suppress the premature materialize success toast in SaveCohortModal
  (pass suppressToast to onAddCohortOkButtonPress) so only the
  post-modal-close success notification is shown.
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.

3 participants