Skip to content

fix(toast): keep folder errors above standard modal backdrops - #22423

Merged
nwparker merged 3 commits into
mainfrom
nwparker/external-22107-modal-toast
Sep 26, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/external-22107-modal-toast

Conversation

@nwparker

@nwparker nwparker commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​180 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​180
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5

ELI5

An invalid-folder error stays readable while the Add Project dialog is open.

What Changed

Raise the existing toast layer from 40 to the existing popover tier 60 only while a standard dialog or modal sheet overlay is present. Match the modal markers instead of scroll-lock state, which menus and selects also use. Add a paired-client Add Project regression test in both themes.

Why

The modal backdrop currently blurs the error behind it. Reusing the established overlay markers and layer tier avoids a second modal-state tracker and avoids lifting every scroll-locked toast. Adapted from @midego1 #22117 with the trigger narrowed to real modal overlays; contributor credit is preserved.

Linked Issue

Fixes #22107 for the standard Add Project path dialogs. Related to #22117.

Visual Proof

Real hidden macOS paired Electron client/runtime over loopback; an invalid host path is submitted through Add Project. Baseline ba742a86bb4 versus this same CSS rule in the prior validation pass. Temporary fixture paths are explicitly redacted in both images; the dialog and toast rendering is otherwise unchanged.

22107-before.png
22107-after.png

Testing

CI exposed that the E2E spec inherited its required background flag from the caller. The host fixture and paired client now explicitly receive ORCA_BACKGROUND_LAUNCH=1. After rebuilding this branch, both real hidden dark/light paired-client scenarios pass locally (2 tests); rendered screenshots were inspected, and the hidden/unfocused isolated-HOME assertions pass for both apps before and after each flow. Changed-code quality also passes.

  • I manually tested these changes locally
  • Automated tests added/updated

Current-base renderer types, changed-code quality and three native-chat layer regression tests pass. Prior hidden paired-client journeys: two baseline failures become two passes (dark/light); pointer/focus containment, higher SSH prompt layering, the nonmodal drawer and scroll-lock-only controls were checked. Thirteen prior focused unit tests passed.

Review

Reviewed the standard dialog/sheet markers, default toast tier, native-chat stacking and higher credential-dialog tiers. Toast actions remain blocked while the modal owns pointer/focus containment; they work after closing it.

Agent skill upstream boundary

  • Not applicable; no agent skill source changes.

Notes

Higher-priority dialogs at tiers 110–150 remain above tier-60 toasts. Modal sheets and live select/menu journeys were source-reviewed rather than separately rendered. The paired fixture is loopback, not real SSH. Native Windows/Linux/WSL, mobile and native focus were not run. The local full E2E typecheck retains existing unrelated failures. Required PR Checks, changed-spec E2E and packaging have passed in CI.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Required PR Checks verification, static analysis, types, tests and packaging pass; focused local checks are listed above

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 61264172-e5c6-4bfe-b1c6-66060946d9e9

📥 Commits

Reviewing files that changed from the base of the PR and between 0b16a31 and 5404484.

📒 Files selected for processing (2)
  • src/renderer/src/assets/main.css
  • tests/e2e/add-project-error-toast-stacking.spec.ts

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.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Toast layer lift while a modal is open — src/renderer/src/assets/main.css adds a body:has([data-slot='dialog-overlay'], [data-slot='sheet-overlay']) [data-sonner-toaster] rule that raises the toaster from z-index: 40 to 60 (the existing popover tier) only while a standard dialog/sheet overlay is mounted. The base 40 rule is untouched, so toasts fall back once the overlay unmounts. The new selector's specificity (0,2,1) and its position after the base rule both make it win, so the lift actually takes effect.
  • Paired-client regression test — tests/e2e/add-project-error-toast-stacking.spec.ts drives an invalid host path through the SSH Add Project flow in dark and light, asserting toast.zIndex > overlay.zIndex, that pointer/focus stay owned by the modal (pointer-events: none, path field still focused), that the tier returns to 40 after close and for the scroll-lock-only and non-modal-drawer states, and that the higher credential-dialog tier (140) is untouched.

I traced the layering tiers the change interacts with: base toaster 40, dialog/sheet overlay+content 50, popover 60, select/dropdown/context-menu 70, tooltip 90, onboarding 100–130, credential dialogs 140/150. The toast at 60 lands above dialog/sheet content and overlays and below menus, tooltips, and credential dialogs, which is the intended band. The test is non-theatrical — with the bug present, toast = 40 < overlay = 50 fails the toBeGreaterThan assertion — and it is not racing Sonner's auto-dismiss, since the folder error uses ERROR_TOAST_DURATION = 60_000 and the injected action toast uses duration: Infinity. The existing native-chat-stop-layering.test.ts regex still matches the unchanged base rule.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Explicit background launch for both E2E apps — tests/e2e/add-project-error-toast-stacking.spec.ts now sets ORCA_BACKGROUND_LAUNCH: '1' on the host fixture (orcaAppExtraEnv) and passes the same to launchPairedElectronClient via extraEnv. The spec's assertHiddenIsolation reads process.env.ORCA_BACKGROUND_LAUNCH inside each app, so without this it failed whenever the caller did not export the flag — which is what CI hit. Both helpers merge the value (orca-app.ts spreads orcaAppExtraEnv into the launch env; paired-electron-client.ts forwards options.extraEnv into createElectronHomeIsolation), and ORCA_BACKGROUND_LAUNCH is not in the home-boundary restricted key set, so the isolated-HOME assertions are unaffected. Test-infra only; no production code changed.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit 094fbef into main Sep 26, 2026
36 checks passed
@midego1

midego1 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Why no contribution? #22117 (comment)

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]: Error toast for invalid path is hidden behind the folder selection screen when adding a project on a remote machine

2 participants