Skip to content

Fix inline chat follow-up actions being non-functional when editor loses focus#308183

Merged
jrieken merged 3 commits intomainfrom
copilot/fix-inline-chat-focus-action
Apr 7, 2026
Merged

Fix inline chat follow-up actions being non-functional when editor loses focus#308183
jrieken merged 3 commits intomainfrom
copilot/fix-inline-chat-focus-action

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Inline chat overlay toolbar actions (Rephrase, Ask in Chat, Keep, Undo) silently fail if the user focuses a different editor before clicking them. The actions extend EditorAction2, which resolves the target editor via codeEditorService.getFocusedCodeEditor() — returning the wrong editor after a focus change, so InlineChatController.get() finds nothing.

Adds a custom ActionRunner to the MenuWorkbenchToolBar in InlineChatSessionOverlayWidget that focuses the owning editor before delegating to the action:

const actionRunner = this._showStore.add(new class extends ActionRunner {
    override async runAction(action: IAction, context?: unknown): Promise<void> {
        that._editorObs.editor.focus();
        return super.runAction(action, context);
    }
});

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --crashpad-handler-pid=10296 --enable-crash-reporter=22e96589-1fbf-499b-8b9a-9396b772936a,no_channel --user-data-dir=/tmp/vscode-tests-1775558631599 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,5330674278902452832,13785858715475631409,262144 --enable-features=PdfUseShowSaveFilePicker --disable-features=LocalNetworkAccessChecks,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TraceSiteInstanceGetProcessCreation --variations-seed-version --trace-process-track-uuid=3190708989122997041 n/sh on --pretty falsbash --inlineSources anguage-features--noprofile sh (dns block)
    • Triggering command: .build/electron/code-oss .build/electron/code-oss test/unit/electron/index.js --crash-reporter-directory=/home/REDACTED/work/vscode/vscode/.build/crashes --run src/vs/workbench/contrib/inlineChat/test/browser/inlineChatAffordance.test.ts xtensions/typescript-language-features/web/tsconfig.json --pretty false --sourceMap --inlineSourbash .build/electron/--project n/sh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 7, 2026 that may be closed by this pull request
…nning toolbar actions

When the inline chat overlay widget shows follow-up actions (Rephrase, Ask in Chat, etc.),
clicking them after focusing into another editor resulted in no action because EditorAction2
resolves the target editor via the focused/active code editor service. Add a custom ActionRunner
that focuses the owning editor before running any toolbar action.

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/47203e8e-c359-4980-891c-3dee04e83d2f

Co-authored-by: jrieken <1794099+jrieken@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix focus issue in InlineChatSessionOverlayWidget actions Fix inline chat follow-up actions being non-functional when editor loses focus Apr 7, 2026
Copilot AI requested a review from jrieken April 7, 2026 10:45
@jrieken jrieken marked this pull request as ready for review April 7, 2026 10:54
Copilot AI review requested due to automatic review settings April 7, 2026 10:54
@jrieken jrieken enabled auto-merge April 7, 2026 10:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes inline chat overlay toolbar actions (e.g., Rephrase / Keep / Undo) failing after the editor loses focus by ensuring the owning editor is focused before running toolbar actions, so EditorAction2 resolves the correct target editor.

Changes:

  • Added a custom ActionRunner for the inline chat overlay MenuWorkbenchToolBar to focus the owning editor before executing actions.
Show a summary per file
File Description
src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.ts Adds a toolbar actionRunner that focuses the overlay’s editor before delegating to the action execution.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.ts Outdated
…idget.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Screenshot Changes

Base: 9f457435 Current: ce302b3f

Changed (5)

chat/aiStats/AiStatsHover/Dark
Before After
before after
chat/aiStats/AiStatsHover/Light
Before After
before after
chat/aiStats/AiStatsHoverNoData/Dark
Before After
before after
chat/aiStats/AiStatsHoverNoData/Light
Before After
before after
editor/inlineCompletions/SideBySideView/Light
Before After
before after

@jrieken jrieken merged commit 6f671c3 into main Apr 7, 2026
19 checks passed
@jrieken jrieken deleted the copilot/fix-inline-chat-focus-action branch April 7, 2026 12:10
@vs-code-engineering vs-code-engineering Bot added this to the 1.116.0 milestone Apr 7, 2026
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.

Inline chat follow-ups are non-actions

4 participants