Skip to content

fix(ui): dismiss notifications without closing modal editors - #32065

Merged
nwparker merged 4 commits into
stablyai:mainfrom
degisftw:fix/modal-toast-dismissal
Oct 24, 2026
Merged

nwparker merged 4 commits into
stablyai:mainfrom
degisftw:fix/modal-toast-dismissal

Conversation

@degisftw

@degisftw degisftw commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

A visible notification’s close button now works while a modal editor is open. Dismissing it preserves the editor’s unsaved input and focus. Notification bodies and action buttons remain blocked by the modal.

The close-only pointer exception applies to visible, non-removed front or expanded notifications. The Toaster captures close-button pointer-down to preserve focus and prevent outside dismissal; Sonner handles the close click. Folded, invisible, and removed notifications do not gain active close targets under the modal lock. Credential overlays remain above notifications.

Fixes #32064.

Credit

Original report and implementation by @degisftw (Daniel Gedgaudas). His exact original commit remains in this branch’s ancestry. Follow-up work preserves the existing stacking regression coverage, checks credential hit testing, and verifies the fix against current main.

Visual proof

Original author’s hidden Electron fixture screenshots, showing the result after clicking close:

Before: toast remains After: toast dismissed, draft and focus retained
Close remains blocked over modal Toast closes while modal editor retains draft and focus

Follow-up verification reproduced the bug on current main using the production Sheet, Dialog, Toaster, Sonner, and stylesheet in a dedicated hidden Electron fixture. It used synthetic notification data and a theme-only store stub. Before/after screenshots were inspected locally. The full paired-runtime application regression also passed; its screenshots were inspected. No user accounts, credentials, or existing workspace data were used.

Validation

  • Fresh full Electron e2e build and web typecheck passed.
  • Paired-runtime project-error regression passed twice in dark and light themes (4 passing tests total); the repeat used a fresh build at the final commit. It verifies dismissal with draft/focus retained, blocked actions, credential overlay140, normal/nonmodal tier47, scroll-lock behavior, and hidden/unfocused app isolation.
  • Additional rendered checks passed for both Sheet and Dialog in both themes, touch dismissal, expanded-stack dismissal, and folded/invisible/removed close targets.
  • 17 focused tests passed across security-surface, menu-closing focus, and Sonner notice suites.
  • Targeted oxlint, formatting, and changed-code quality checks passed with zero new findings.

Renderer-only change; no dependency, RPC, persistence, host execution, shortcut, or path changes. Paired-runtime behavior is covered by the e2e test, and no git-worktree assumptions are introduced. Touch behavior was checked through Chromium CDP. Windows and Linux app runs, full repository lint/tests, and native packaging were not run locally; CI supplies remaining platform gates.

AI disclosure

The original author used GitHub Copilot. Codex assisted with the follow-up reproduction, review, test hardening, and verification.

Agent skill upstream boundary

No upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation were copied or translated.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The change enables pointer events for visible, non-removed front or expanded toasts. The Toaster wrapper handles pointer events so toast close buttons remain interactive while other toast interactions are blocked when the document body has pointer events disabled. End-to-end tests check that toast actions preserve the open dialog, entered path, and focus. They also check toast interactions under a higher-tier dialog and verify the toaster z-index remains 47 in the tested states.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Low · up to e330f

Toast dismissal can be briefly blocked while a dialog or sheet closes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main UI fix: dismissing notifications without closing modal editors.
Description check Passed The description is detailed and covers the user impact, implementation, linked issue, visual proof, testing, AI disclosure, scope, and platform limitations. It does not reproduce every template headin…
Linked Issues check Passed Issue #32064 requires a notification close control to dismiss only the notification while the modal remains open and preserves unsaved input and focus. The CSS enables pointer events only for visible,…
Out of Scope Changes check Passed The changes stay within issue #32064. They update notification pointer-event styling, Toaster event handling, the star notification close-button marker, style guidance, and related regression tests.…
Full details: Description check

Explanation

The description is detailed and covers the user impact, implementation, linked issue, visual proof, testing, AI disclosure, scope, and platform limitations. It does not reproduce every template heading or checklist item, but the required information is mostly present.

Full details: Linked Issues check

Explanation

Issue #32064 requires a notification close control to dismiss only the notification while the modal remains open and preserves unsaved input and focus. The CSS enables pointer events only for visible, non-removed front or expanded notifications. Toaster permits close-button pointer-down and blocks other notification interactions while a dialog or sheet overlay is active. The updated end-to-end coverage verifies dismissal, modal and focus retention, blocked actions, touch input, folded or invisible targets, and credential-overlay precedence.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #32064. They update notification pointer-event styling, Toaster event handling, the star notification close-button marker, style guidance, and related regression tests. These changes support the close-only modal exception. No unrelated dependency, RPC, persistence, host-execution, shortcut, or path behavior changes are reported.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang force-pushed the fix/modal-toast-dismissal branch from d582b59 to 58f949a Compare October 23, 2026 18:18
Radix menus and selects also set body pointer-events:none; gating on that
blocked toast clicks from closing an open dropdown.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 88c8bc70-911e-4016-8b9e-9375434c9ef8
Commits

Reviewing files that changed from the base of the PR and between 58f949a and e330fc5.

Files selected for processing: 2
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/ui/sonner.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment on lines 10 to +20
import { useAppStore } from '@/store'

// Why: scope to real modals; Radix menus/selects also set body pointer-events:none.
function isModalOverlayOpen(element: Element): boolean {
return (
element.ownerDocument.body.querySelector(
":scope > [data-slot='dialog-overlay'], :scope > [data-slot='sheet-overlay']"
) !== null
)
}

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.

🎯 Functional Correctness | Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

set -eu
printf '%s\n' '--- sonner diff ---'
git diff --unified=30 89e93cfa387188ac63b0ec711da4bf02873225bf e330fc5052a876aa1e006dd2cf86d653af70add4 -- src/renderer/src/components/ui/sonner.tsx
printf '%s\n' '--- current sonner ---'
nl -ba src/renderer/src/components/ui/sonner.tsx | sed -n '1,180p'
printf '%s\n' '--- modal overlay usages ---'
rg -n -F --glob '*.{tsx,ts}' -e '<Sheet' -e '<Dialog' -e 'SheetContent' -e 'DialogContent' src/renderer/src | head -80

Repository: stablyai/orca

Length of output: 16907


🏁 Script executed:

set -eu
printf '%s\n' '--- CSS modal/toast selectors ---'
rg -n -F --glob '*.{css,tsx,ts}' -e 'dialog-overlay' -e 'sheet-overlay' -e 'data-close-button' -e 'data-sonner-toast' src/renderer/src
printf '%s\n' '--- focused Sonner tests ---'
rg -n -F --glob '*.{test,spec}.{ts,tsx}' -e 'Toaster' -e 'close-button' -e 'data-state' -e 'modal' src/renderer/src | head -160
printf '%s\n' '--- UI dialog and sheet wrappers ---'
nl -ba src/renderer/src/components/ui/dialog.tsx | sed -n '1,180p'
nl -ba src/renderer/src/components/ui/sheet.tsx | sed -n '1,150p'

Repository: stablyai/orca

Length of output: 42822


🏁 Script executed:

set -eu
printf '%s\n' '--- exact CSS block ---'
nl -ba src/renderer/src/assets/main.css | sed -n '498,575p'
printf '%s\n' '--- changed files ---'
git diff --name-only 89e93cfa387188ac63b0ec711da4bf02873225bf e330fc5052a876aa1e006dd2cf86d653af70add4
printf '%s\n' '--- all PR diff snippets mentioning modal/toast behavior ---'
git diff --unified=12 89e93cfa387188ac63b0ec711da4bf02873225bf e330fc5052a876aa1e006dd2cf86d653af70add4 -- 'src/renderer/src/assets/main.css' 'src/renderer/src/components/ui/sonner.tsx' | sed -n '1,240p'

Repository: stablyai/orca

Length of output: 10379


Ignore closing overlays when gating toast interactions.

Radix keeps a closing overlay mounted with data-state="closed" during its exit animation. The current isModalOverlayOpen query still matches it. The pointer-down capture handler then prevents the toast close button's pointer-down event, which can suppress Sonner's dismissal until the overlay unmounts.

Add [data-state='open'] to isModalOverlayOpen and the interaction CSS selector. Keep the separate z-index rule unchanged.

Suggested fix
diff --git a/src/renderer/src/components/ui/sonner.tsx b/src/renderer/src/components/ui/sonner.tsx
@@
-      ":scope > [data-slot='dialog-overlay'], :scope > [data-slot='sheet-overlay']"
+      ":scope > [data-slot='dialog-overlay'][data-state='open'], :scope > [data-slot='sheet-overlay'][data-state='open']"
diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css
@@
-body:has(> [data-slot='dialog-overlay'], > [data-slot='sheet-overlay'])
+body:has(> [data-slot='dialog-overlay'][data-state='open'], > [data-slot='sheet-overlay'][data-state='open'])

@nwparker
nwparker merged commit c8db507 into stablyai:main Oct 24, 2026
39 checks passed
nwparker added a commit that referenced this pull request Nov 1, 2026
…with a modal-safe opt-in

Restores #32065's lock (close always works; actions that navigate or change settings
don't bypass the modal) and fixes the clickable-but-dead look: blocked controls get
aria-disabled, a 'Close the dialog to use this' title, and disabled styling, updated
live as modals open and close. Background/toast-local actions opt in via
modalSafeToastActionLabel or data-toast-modal-safe.
nwparker added a commit that referenced this pull request Nov 1, 2026
nwparker added a commit that referenced this pull request Nov 1, 2026
…of looking live but dead (#36888)

* fix(ui): let toast actions work above a modal instead of looking clickable but dead

Radix modals dismiss/refocus on outside pointerdown, so the Toaster already swallowed
pointerdown inside toasts; it additionally swallowed click for every control except the
close button, making actions like 'Update skill' look live while doing nothing. Keep the
pointerdown shield (modal stays open, focus/input intact) and let the click run.

* test(e2e): keep a toast mounted and close Settings after the over-modal action

* fix(ui): default-deny toast actions above a modal, visibly disabled, with a modal-safe opt-in

Restores #32065's lock (close always works; actions that navigate or change settings
don't bypass the modal) and fixes the clickable-but-dead look: blocked controls get
aria-disabled, a 'Close the dialog to use this' title, and disabled styling, updated
live as modals open and close. Background/toast-local actions opt in via
modalSafeToastActionLabel or data-toast-modal-safe.

* fix(ui): return focus to the modal draft after a toast-opened dialog closes

A modal-safe action that opens a trigger-less dialog (Update skill) left focus on body
after close, minimize or Escape. captureDialogReturnFocus records the focused element
before opening and restores it via onCloseAutoFocus.

Also harden Dialog Escape: Radix arms a just-opened sibling dialog's Escape a render
late, so an early Escape closed the dialog beneath and dropped its draft. A dialog now
ignores Escape while a later-opened modal is open.

* fix(ui): hide toast actions above a modal instead of leaving them clickable-looking but dead

Replaces the modal-safe opt-in design. Main's close-only capture gate stays as is; a
single CSS rule hides every toast control except close while a modal overlay is open,
so the message and dismissal remain and actions return once the modal closes.

* fix(ui): type the sheet fixture's effect cleanup

* test(e2e): dismiss an older star-nag toast over the dialog instead of re-raising one id

* fix(ui): toasts sit behind a modal's backdrop until pressed or newly raised

Older toasts drop behind an open Dialog/Sheet backdrop, dimmed and inert, so nothing looks
clickable that isn't. A press on one, or a toast raised while the modal is open, brings the
stack forward; close and actions then work above the modal with its focus and draft intact.
Actions run that way are an escape hatch and emit toast_action_over_modal.

* test(e2e): read recorded telemetry without a type assertion

* test(e2e): read recorded telemetry through a typed global

* test(e2e): check the raised Later action once by mouse; keep #32065's per-pointer Dismiss as on main
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.

[Bug]: Notification close button is blocked while a modal is open

3 participants