Repository navigation
fix(ui): dismiss notifications without closing modal editors - #32065
Conversation
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
d582b59 to
58f949a
Compare
Radix menus and selects also set body pointer-events:none; gating on that blocked toast clicks from closing an open dropdown.
There was a problem hiding this comment.
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
Files selected for processing: 2-
src/renderer/src/assets/main.csssrc/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.
-
| 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 | ||
| ) | ||
| } | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness |
🔎 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'])
…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.
… per-pointer Dismiss as on main
…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
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:
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
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.