Repository navigation
fix(ui): toasts sit behind a modal's backdrop until pressed, instead of looking live but dead - #36888
Conversation
…kable 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.
|
Warning Outdated. This proof is for the first design (all toast actions clickable above a modal), which was rejected because it broke #32064 and could unmount a dialog's draft. See the newer proof comment below for the current default-deny design. Original (outdated) proofVisual proof: toast actions above a modal DialogCaptured from a hidden ( Case 1: non-navigating toast action ("Later") over the modal
Case 2: an action that opens a page lands behind the still-open modal
This is the trade-off flagged in the PR. The page change is visible only through the dimmed backdrop until the user closes the dialog. VideosBefore (main): before video After (this PR): after video |
…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.
|
Warning Outdated. This proof is for the modal-safe opt-in design, which was dropped in favour of hiding toast actions while a modal is open. See the newest proof comment below. Original (outdated) proofVisual proof (current design: default-deny + modal-safe opt-in)Captured from hidden ( 1. Clickable-but-dead is gone: blocked actions now look disabled
2. A modal-safe action ("Later") runs above the modal
On main the same click on "Later" is silently swallowed: 3. Close still dismisses only the toast (#32064)4. Reviewer repro: a navigating action must not unmount a dialog's draftSettings → Browser → Add Profile, type a name, then click "Open Mobile Settings" on the toast.
(The captures from section 4 are cropped to the dialog area so the Mobile pane's machine address stays out of frame.) VideosBefore (main): before video After: after video After, browser-profile draft scenario: after draft video |
…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.
…ckable-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.
… re-raising one id
|
Warning Outdated. This proof is for the "hide actions above a modal" design, which was replaced: toasts now sit behind the modal backdrop until pressed. See the newest proof comment below. Original (outdated) proofVisual proof (current design: toast actions hidden while a modal is open)Captured from hidden ( With a modal open
After the modal closes, the action is backClose still dismisses only the toast; the modal stays open (#32064)VideosBefore (main): before video After: after video |
…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.
… per-pointer Dismiss as on main
Visual proof (current design: toasts behind the modal backdrop until pressed)Captured from hidden ( 1. An older toast with a modal open
2. Pressing the dimmed toast brings it forward, and the modal stays open3. Close dismisses only the toast (#32064)4. A toast raised while the modal is open comes forward immediately (errors stay readable, #32065)VideosBefore (main): before video After: after video |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
No actionable comments were generated in the recent review.
|























Problem
With a modal open (e.g. the "Chat UI is here" dialog), a toast like "An installed Orca skill is out of date — [Update skill]" was drawn above the backdrop and looked interactive, but its action did nothing. #32065 had deliberately locked everything but the close button above modals, while toasts still looked live.
Fix: toasts sit behind the modal's backdrop until you reach for them
toast_action_over_modalso we can see when people need it and redesign that flow.Telemetry:
toast_action_over_modaltoast_idunpaired-device-auth-failure); dynamic or unnamed ids reportunnamedmodal_kinddialog|sheetraised_byclick(user pressed a dimmed toast) |new_toast(toast arrived while the modal was open)Suggested dashboard: count of
toast_action_over_modalbytoast_idandraised_byover time.Performance
:has().body, so opening a modal restyles only the toaster instead of the whole tree.data-modal-overlay-openbody attribute.pointerdowncapture listener exists only while a modal is open and toasts are lowered. Before reading any rects it checkstarget.matches(overlay).History
This design keeps everything visible and honest, and makes going around the modal a deliberate, measured choice.
Validation
pnpm tc✅, oxlint ✅, telemetry schema tests (telemetry-events,telemetry-payload-contracts) ✅tests/e2e/add-project-error-toast-stacking.spec.ts4/4 ✅, every case in dark and light.toast_action_over_modal{toast_id: 'unpaired-device-auth-failure', modal_kind: 'dialog', raised_by: 'new_toast'}, validated against the schema.Sheet coverage: the fixture
ui/sonner:olderToastBehindModalSheet(pnpm fixtures:shot; e2e can't open a modal Sheet without integration data). It mounts the production Sheet, Toaster and stylesheet, and asserts:It uses synthetic events and isn't run in CI.
Visual proof: see the newest proof comment; older ones are marked outdated.