Skip to content

fix(bots): show the agent switch confirm above the open agent picker - #48673

Merged
nwparker merged 1 commit into
stablyai:mainfrom
eltria:fix/bot-agent-switch-confirm-over-picker
Nov 25, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
eltria:fix/bot-agent-switch-confirm-over-picker

Conversation

@eltria

@eltria eltria commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When you pick a different AI agent for a bot, Orca asks "Switch this bot to the new agent?" before doing it. That question was showing up behind the agent list, which stays open after you click the new agent's tab. You couldn't read it, and clicking what looked like a row in the list could actually press the hidden "Switch" or "Cancel" button. Now the question shows on top of the list, so you can see it and answer it.

What Changed

Before: In Settings › Bots › a bot › Agent and model, clicking another agent's tab in the picker opened the "Switch to ?" confirm at the default dialog layer (z-50), under the still-open dropdown (z-[70]). The menu covered the dialog. Because Radix makes the menu click-through while a modal dialog is open, a click on a visible model row went to the hidden confirm button under it.

After: That confirm renders at z-[80], above the picker. The picker is dimmed under the dialog's overlay, and Cancel and "Switch to " are visible and clickable. After confirming, the picker stays open on the new agent's pane so you can pick its model and effort next.

How:

  • ConfirmationDialogOptions gets an opt-in aboveMenus flag. When it is set, the shared ConfirmationDialogProvider gives the dialog content and overlay z-[80]. This is the tier the resource-manager confirms (useDaemonActions, resource-usage-kill-dialog) already use over the popovers that open them.
  • useConfirmBotAgentSwitch sets aboveMenus: true.
  • All other confirms stay at z-50, so their layering with toasts doesn't change.

Why

The bot agent picker uses selectAgentOnTab: a tab click commits the agent while the dropdown stays open, and then the switch is confirmed. Closing the picker before asking would also fix the layering. But it would mean making the picker's open state controlled, which is more code, and it would break the intended flow of staying on the new agent's pane. Raising only this confirm is the smallest fix and follows the existing above-menu convention.

Linked Issue

Fixes #48672

Visual Proof

The real AgentLaunchPicker with selectAgentOnTab, inside ConfirmationDialogProvider, with onPick calling the real useConfirmBotAgentSwitch. Headless component fixture after clicking the Codex tab:

Before (main) After (this PR)
Before: the switch confirm is hidden behind the open agent picker After: the switch confirm shows above the dimmed agent picker

Testing

  • Reproduced with a temporary headless component fixture (pnpm fixtures:shot, headless Chromium, dark theme; not committed). It renders the real picker and confirm, wired like BotAgentSettings.setAgentSetup.
    • main: dialog and overlay at z-index 50, menu at 70. The menu covers the confirm's buttons, and elementFromPoint over a menu row returns the hidden "Switch" button, so clicking there switched the agent with no visible prompt.
    • This PR: dialog and overlay at 80. Title, Cancel and Confirm are on top. Confirming settles true, the picker stays open, and the Codex tab stays selected.
    • Same on main and this PR: the first Escape closes only the confirm (it settles false) and the picker stays open. A plain confirm() without aboveMenus stays at 50.
  • No committed test. This is CSS stacking, which jsdom can't hit-test, and asserting a class name would be a test anti-pattern.
  • Unit tests that render the confirmation dialog pass (google-account-picker, TabGroupStripActions, worktree-card-agent-row-menu: 24 tests).
  • oxlint, oxfmt --check, anti-slop, code-quality, ast-grep and the changed-code quality gate are clean on the 3 changed files.
  • Platform: macOS (headless Chromium). The change is CSS only and doesn't depend on the platform.
  • Perf: renderer only. It adds two ternaries to the ConfirmationDialogProvider render, which runs only when the confirm queue changes. No hot path, I/O, polling or subprocess work.

Trade-off: while this confirm is open, toasts (z-60) sit behind its z-80 overlay, the same as the existing resource-manager confirms. The prompt is short-lived.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The confirmation options now include an optional aboveMenus flag. When enabled, the confirmation dialog applies z-[80] to its content and overlay. The bot agent-switch confirmation enables this option.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 668fd

The bot agent-switch confirmation now appears above the still-open agent picker, so its buttons can be clicked. Other confirmations are unchanged. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Issue #48672 requires the bot agent switch confirm to open above the agent picker so its text is readable and its buttons are clickable. The diff at head 668fde4 meets this. In src/renderer/src/compon…
Out of Scope Changes check Passed All four changed hunks serve the issue #48672 fix. The bot switch confirm option is set in bot-home-chat-confirm.tsx. The new ConfirmationDialogOptions.aboveMenus field in confirmation-dialog-context.…
Title check Passed The title names the bot agent switch confirmation and the agent picker layering fix, which matches the code change: an aboveMenus option that raises the confirm to z-80. It is specific and conventiona…
Description check Passed The description follows the template and covers ELI5, What Changed (before and after), Why (alternatives considered), Linked Issue (Fixes #48672), Visual Proof (before/after images), Testing, Performa…
Full details: Linked Issues check

Explanation

Issue #48672 requires the bot agent switch confirm to open above the agent picker so its text is readable and its buttons are clickable. The diff at head 668fde4 meets this. In src/renderer/src/components/bots/bot-home-chat-confirm.tsx, useConfirmBotAgentSwitch sets aboveMenus: true. In confirmation-dialog.tsx, that flag adds className and overlayClassName 'z-[80]' to DialogContent and its DialogOverlay. In src/renderer/src/components/ui/dialog.tsx, DialogContent passes className through cn() after its base z-50 class, and DialogOverlay merges overlayClassName the same way. Tailwind class merging should let z-[80] replace z-50. The picker menu is z-[70], so the dialog now sits above it. The issue does not request automated tests. The PR adds no committed test and cites the repo's UI-layering test exclusion. The author reports a local hit-test and click check. That check is not committed and was not re-run in this review.

Full details: Out of Scope Changes check

Explanation

All four changed hunks serve the issue #48672 fix. The bot switch confirm option is set in bot-home-chat-confirm.tsx. The new ConfirmationDialogOptions.aboveMenus field in confirmation-dialog-context.ts is the option type for that flag. The rendering change in confirmation-dialog.tsx applies the z-[80] class only when aboveMenus is set. Other confirmations do not set the flag and keep the default z-50. No unrelated files or behavior changes appear in the diff between the merge base 315dacd and head 668fde4.

Full details: Title check

Explanation

The title names the bot agent switch confirmation and the agent picker layering fix, which matches the code change: an aboveMenus option that raises the confirm to z-80. It is specific and conventional, with a fix() prefix and a scope. It is slightly long at 68 characters, but it stays on the main change.

Full details: Description check

Explanation

The description follows the template and covers ELI5, What Changed (before and after), Why (alternatives considered), Linked Issue (Fixes #48672), Visual Proof (before/after images), Testing, Performance, and Risk. Its content is specific and substantive. The Risk section has no Level value, and the template's Risk section asks for a level and a rollback path. The Review, Agent skill upstream boundary, Notes, Checklist, and AI Disclosure sections are not filled in. The Risk section also lacks a rollback note. These gaps are non-critical, so the check passes.

  • 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

Recent 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: ca260777-51fd-4df9-8b8b-a7a380b49560
Commits

Reviewing files that changed from the base of the PR and between a3854ce and 668fde4.

Files selected for processing: 3

  • src/renderer/src/components/bots/bot-home-chat-confirm.tsx
  • src/renderer/src/components/dismiss/confirmation/confirmation-dialog-context.ts
  • src/renderer/src/components/dismiss/confirmation/confirmation-dialog.tsx

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

The bot agent picker commits a tab click while its dropdown stays open,
then asks to confirm the switch. The confirm used the default z-50
dialog layer while the dropdown sits at z-[70], so the dialog was hidden
behind the picker and clicks on visible menu rows pressed its hidden
buttons. Add an opt-in aboveMenus option to the shared confirmation
dialog that lifts it to z-[80], matching the existing confirms shown
over popovers, and set it for the bot agent switch confirm.

Fixes stablyai#48672
@nwparker
nwparker force-pushed the fix/bot-agent-switch-confirm-over-picker branch from 668fde4 to ea01b0f Compare November 25, 2026 03:42
@nwparker nwparker changed the title fix(bots): show the agent switch confirm above the agent picker fix(bots): show the agent switch confirm above the open agent picker Nov 25, 2026
@nwparker
nwparker merged commit 33c535b into stablyai:main Nov 25, 2026
55 of 56 checks passed
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]: Bot agent switch confirm opens behind the agent picker in Settings › Agent and model

2 participants