Skip to content

fix(agent-manager): apply reasoning-variant and mode picks in worktree dialog - #11924

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-worktree-reasoning-selector
Jul 3, 2026
Merged

fix(agent-manager): apply reasoning-variant and mode picks in worktree dialog#11924
marius-kilocode merged 1 commit into
mainfrom
fix-worktree-reasoning-selector

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Problem

Selecting a reasoning variant (or mode) in the New Worktree dialog did nothing — the trigger label reverted to the previous value and the chosen variant never reached the created sessions.

Root cause

The New Worktree dialog renders a full-screen modal overlay (data-component="dialog-overlay", z-index 50, pointer-events: auto) behind its content. The reasoning-variant (ThinkingSelector) and mode (ModeSwitcher) pickers portaled their popover content to <body>, placing it outside the dialog content and therefore under the overlay. A real pointer click on an option hit the overlay first, which:

  1. Dismissed the popover via outside-pointerdown handling
  2. Never fired the option's onClick

so the selection did not apply. JS .click() (which bypasses hit-testing) worked, which is why the bug was easy to miss on inspection.

The model picker was unaffected because it already rendered inline via portal={false} (added in 09f0156 for the same class of click interception). The sidebar prompt was unaffected because it has no modal overlay.

Fix

Forward a portal prop through ThinkingSelectorBase and ModeSwitcherBase (mirroring ModelSelectorBase) and pass portal={false} from NewWorktreeDialog so all three pickers render their popovers inline within the dialog content, above the overlay.

Validation

Reproduced live in the isolated VS Code self-test harness before and after the fix:

  • Before: opening the dialog and clicking a variant option via a real pointer timed out with dialog-overlay ... intercepts pointer events; the trigger label stayed unchanged.
  • After: the popover nests inside [dialog] and clicking a variant applies in both directions (Instant <-> Thinking) with no console errors.

Automated checks: extension bun run lint, bun run typecheck, bun run knip clean; worktree dialog unit tests pass (11/11).

…e dialog

The reasoning-variant and mode pickers in the New Worktree dialog portaled
their popover content to <body>, where the dialog's full-screen modal overlay
(z-index 50, pointer-events auto) intercepted pointer events before the
option onClick fired. Selecting a variant dismissed the popover via the
overlay without applying the choice, so the trigger label reverted to the
previous value.

The model picker already avoided this with portal={false} (09f0156).
Forward the same portal prop through ThinkingSelectorBase and
ModeSwitcherBase and pass portal={false} from NewWorktreeDialog so all
three pickers render inline within the dialog content, above the overlay.

Reproduced live in the isolated VS Code self-test: before the fix a real
pointer click on a variant option timed out with 'dialog-overlay ...
intercepts pointer events' and the label stayed unchanged; after the fix
the popover nests inside [dialog] and clicking a variant applies in both
directions with no console errors.
@marius-kilocode
marius-kilocode enabled auto-merge July 3, 2026 15:46
@marius-kilocode
marius-kilocode merged commit 2799ba6 into main Jul 3, 2026
21 checks passed
@marius-kilocode
marius-kilocode deleted the fix-worktree-reasoning-selector branch July 3, 2026 15:51
@kilo-code-bot

kilo-code-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The fix forwards a portal?: boolean prop through ModeSwitcherBase and ThinkingSelectorBase to their underlying PopupSelectorDeferredPopoverPopover chain, mirroring the existing ModelSelectorBase pattern exactly. Confirmed:

  • portal={props.portal} preserves prior default behavior for all other callers (base Popover uses local.portal ?? true, so omitting the prop still defaults to portal mode).
  • Every other popover in NewWorktreeDialog.tsx (model selector, branch selectors, compare-models selector) already renders non-portaled, either via an explicit portal={false} or because BranchSelectPopover hardcodes it — the mode/reasoning-variant selectors were the last two with no opt-out, so this closes the gap without missing any other instance of the bug.
  • Types are structurally identical end-to-end (boolean | undefined), no widening/narrowing or any introduced.
  • Changeset is present and written from a user-facing perspective.
Files Reviewed (4 files)
  • .changeset/fix-worktree-reasoning-selector.md
  • packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx
  • packages/kilo-vscode/webview-ui/src/components/shared/ModeSwitcher.tsx
  • packages/kilo-vscode/webview-ui/src/components/shared/ThinkingSelector.tsx

Reviewed by claude-sonnet-5-20260630 · Input: 12 · Output: 4.7K · Cached: 218.4K

Review guidance: REVIEW.md from base branch main

NJ-2020 pushed a commit to NJ-2020/kilocode that referenced this pull request Jul 4, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…g-selector

fix(agent-manager): apply reasoning-variant and mode picks in worktree dialog
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.

2 participants