Skip to content

fix(tui): restore ask focus after settings#3204

Open
roboomp wants to merge 2 commits into
mainfrom
farm/0f517b06/restore-ask-focus-after-settings
Open

fix(tui): restore ask focus after settings#3204
roboomp wants to merge 2 commits into
mainfrom
farm/0f517b06/restore-ask-focus-after-settings

Conversation

@roboomp

@roboomp roboomp commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Repro

Opening /settings while a model turn is still running can leave an ask selector pending underneath the fullscreen settings overlay. The minimal focus repro is: focus the prompt editor, open a fullscreen settings overlay, attempt to focus a pending ask selector while the overlay is visible, close the overlay, and assert the ask selector has focus; before the fix it prints duringOverlay=settings and afterClose=editor and exits 1.

Cause

SelectorController.showSettingsSelector in packages/coding-agent/src/modes/controllers/selector-controller.ts always called ui.setFocus(this.ctx.editor) when the settings overlay closed. If ExtensionUiController.showHookSelector had already mounted an ask selector in editorContainer, the fullscreen overlay prevented that selector from taking focus until close, and the settings close handler then forced focus back to the main prompt editor.

Fix

  • Added getEditorSurfaceFocusTarget to choose the active hook selector/input/editor before falling back to the main prompt editor.
  • Updated the /settings close path to restore focus to that active editor-surface component after hiding the overlay.
  • Added a regression test covering the fullscreen overlay close sequence with a pending ask selector.
  • Added a coding-agent changelog entry for Can't answer ask tool after exiting /settings #3203.

Verification

Ran bun test test/settings-focus.test.ts and bun run check:types in packages/coding-agent; both passed. gh_push_branch completed the pre-publish gate and pushed the branch. Fixes #3203

roboomp added 2 commits June 21, 2026 16:35
Restored the editor-surface focus target after closing the fullscreen settings overlay so pending ask selectors keep keyboard input instead of returning to the main prompt editor.

Added a regression test for the overlay close sequence.

Fixes #3203
@github-actions github-actions Bot added the vouched Passed the vouch gate label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't answer ask tool after exiting /settings

1 participant