Repository navigation
Conversation
Toasts are pinned to z-index 40 so they stay below the native chat interrupt controls, but dialogs and their backdrop sit at z-50. Errors raised from inside a dialog (e.g. an invalid path in "Set project location") were blurred behind its overlay. Radix modals set data-scroll-locked on <body> while open; lift the toaster to z-index 60 only then, so the no-modal stacking is unchanged. Fixes stablyai#22107 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe stylesheet raises Sonner toasts to z-index 60 when Priority: ⬇️ Low 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
ℹ️ No critical issues — one scope caveat and one inline note.
Reviewed changes
- Toast lift while the body is scroll-locked — adds
body[data-scroll-locked] [data-sonner-toaster] { z-index: 60 !important }so toasts clear thez-50dialog overlay only while Radix's scroll-lock attribute is on<body>(src/renderer/src/assets/main.css:404). - Style unit test — reads
main.cssandui/dialog.tsxto pin the base toaster layer below 50 and the locked layer above 50 (src/renderer/src/assets/toaster-stacking-style.test.ts:16). - E2E regression spec — opens the Add project dialog, drives the non-git-path failure through
setupProjectExistingFolder, and hit-tests the toast at its own center to prove it is the topmost element (tests/e2e/add-project-error-toast-stacking.spec.ts:17).
I confirmed the toaster is rendered inline in App.tsx:106 inside .app-layout, which does not create a stacking context, so the lift does beat the body-level z-50 dialog portal — the fix works for the reported flow, and the E2E assertion (temporarily re-enabling pointer events before elementFromPoint) can genuinely fail on main.
ℹ️ Dialogs that override the shared z-50 remain covered
A handful of Radix dialogs raise their overlay/content above the shared Dialog's z-50. They still lock the body, so the toaster stays at 60 and a toast raised from inside them is still painted behind the overlay — the same symptom as #22107. The PR rationale says tying the lift to "a modal is open" fixes "every dialog at once"; that holds for the default z-50 dialog but not for these. If the coverage matters, the lift needs to clear the highest modal tier (or a shared z token) rather than a flat 60.
Technical details
# Higher-z modal dialogs left uncovered
## Affected sites
- `src/renderer/src/components/link-routing-preference-dialog.tsx:131` — overlay `!z-[140]`, content `!z-[150]`
- `src/renderer/src/components/settings/SshPassphraseDialog.tsx:119` — overlay `!z-[140]`, content `!z-[150]`
- `src/renderer/src/components/settings/jira-integration-card.tsx:252` — `z-[110]`/`z-[120]`
- `src/renderer/src/components/settings/task-tracker-integration-cards.tsx:224` — `z-[110]`/`z-[120]`
- `src/renderer/src/components/onboarding/OnboardingSkipConfirmationDialog.tsx:42` — `z-[120]`/`z-[130]`
- `src/renderer/src/components/onboarding/IntegrationsStep.tsx:212` — `z-[110]`/`z-[120]`
## Required outcome
- Decide whether toasts should surface above these dialogs too; if so, the lift must exceed the
highest modal tier rather than a flat `60`. If not, the "every dialog at once" claim is worth
narrowing.
## Open questions for the human
- Are errors ever toasted from inside the onboarding / integration / credential dialogs, or is
the default `z-50` dialog the only realistic source?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| /* Why: modals (z-50) lock body scroll; lift toasts above them so errors raised | ||
| from inside a dialog stay readable instead of blurred behind its overlay. */ | ||
| body[data-scroll-locked] [data-sonner-toaster] { | ||
| z-index: 60 !important; | ||
| } |
There was a problem hiding this comment.
data-scroll-locked is not modal-only: Radix sets it on <body> for any RemoveScroll mount, which in this app includes every Select and any DropdownMenu (Radix defaults modal), not just dialogs. The comment here scopes the trigger to modals, but the lift also applies while a Select or modal dropdown is open, moving toasts above z-50 chrome that has nothing to do with a modal. Worth either describing the real trigger in the comment or confirming the broader lift is intended.
Technical details
# `data-scroll-locked` trigger is broader than "modals"
## Affected sites
- `src/renderer/src/assets/main.css:404` — the Why comment says "modals (z-50) lock body scroll"
- `src/renderer/src/assets/main.css:406` — the rule fires on any `body[data-scroll-locked]`
## Evidence
- `react-remove-scroll-bar` `useLockAttribute` sets `document.body[data-scroll-locked]` (node_modules/react-remove-scroll-bar/dist/es2019/component.js:59-72).
- `SelectContent` mounts `RemoveScroll` unconditionally: `src/renderer/src/components/ui/select.tsx:76` (content `z-[70]`).
- `DropdownMenu` defaults to `modal` and Orca forwards props unchanged: `src/renderer/src/components/ui/dropdown-menu.tsx:7`.
- `ContextMenu` pins `modal={false}` so it does not lock: `src/renderer/src/components/ui/context-menu.tsx:8`. `Popover` defaults non-modal, so it does not lock either.
## Required outcome
- Either update the comment to describe the actual trigger (any body scroll lock: dialogs, selects, modal menus), or key the lift to a modal-specific signal if the narrower behavior was the intent.|
Closing as superseded by merged #22423, which carries the reviewed fix and regression coverage. Thank you for the original contribution. |

ELI5
When adding a project failed while a dialog was open, the error message popped up behind the dialog's dimmed, blurred background, so you couldn't read it. Now the error shows on top of the dialog.
What Changed
Before: in "Set project location" (or any other modal dialog), choosing an invalid path showed a "Failed to add project" toast in the bottom-right corner, but it was blurred and dimmed behind the dialog's backdrop.
After: while a modal dialog is open, toasts render above it and are fully readable. When no dialog is open, toasts keep their current stacking order.
Mechanism: Orca pins the toast layer to
z-index: 40, and dialogs and their backdrop usez-50, so any toast raised from inside a dialog landed underneath it. Radix modals set adata-scroll-lockedattribute on<body>while open (viareact-remove-scroll-bar). A new CSS rule,body[data-scroll-locked] [data-sonner-toaster], lifts the toast layer toz-index: 60only while that attribute is present.Why
The
z-index: 40was chosen on purpose (#16729) so toasts sit below the native-chat pane's interrupt controls (z-50) while an agent is working. Raising toasts globally would cover those controls again. Closing the dialog before showing the error would lose what the user typed, and would only fix this one flow. Tying the lift to "a modal is open" fixes every dialog at once and leaves the native-chat case unchanged. While a modal is open, the chat pane is behind the dialog anyway.While a modal is open, toasts stay visible but not clickable, because Radix disables pointer events outside the dialog. That matches the behavior before this change.
Linked Issue
Fixes #22107
Visual Proof
Both captured from the real app by the new E2E spec, using an isolated profile on a headless window. The screenshots are identical except for the fix.
Testing
New E2E spec
tests/e2e/add-project-error-toast-stacking.spec.ts. It opens the Add project dialog and fires the same "Set location" action with a non-git folder. It then asserts that the "Failed to add project" toast is the topmost element at its own center. It fails onmain("dialog overlay covers the error toast") and passes with this change.New unit test
src/renderer/src/assets/toaster-stacking-style.test.ts. It locks both rules: belowz-50with no modal open, abovez-50while one is open.pnpm tc,oxlint, andpnpm run check:code-quality:changedpass.Platforms: tested on Linux only, with headless Electron under Xvfb. The change is CSS-only and has no platform branches. The remote/SSH flow from the issue uses the same dialog and toast components, but I did not reproduce it against a real remote host.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Investigation, fix, tests, and screenshots were produced with Claude Code (Claude Opus 5). I reviewed the change.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
<body>with no:has(). It only re-matches when a modal opens or closes.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code