Skip to content

Inline chat v3: add history navigation on arrow up/down#303427

Merged
jrieken merged 2 commits intomainfrom
copilot/fix-inline-chat-history-navigation
Mar 20, 2026
Merged

Inline chat v3: add history navigation on arrow up/down#303427
jrieken merged 2 commits intomainfrom
copilot/fix-inline-chat-history-navigation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 20, 2026

Inline chat v3 input widget lacks history navigation — pressing arrow up/down does not recall previously sent prompts.

Adds HistoryNavigator2-based history to InlineChatInputWidget, following the same pattern as SCM input (SCMInput.showPreviousHistoryValue):

  • History state: HistoryNavigator2<string> tracks submitted prompts; last entry is always the uncommitted current text
  • Arrow Up (cursor on line 1): saves current input via replaceLast, navigates to previous entry
  • Arrow Down (cursor on last line): navigates to next entry if not at tail; otherwise falls through to existing action bar focus
  • Submit: addToHistory(value) called from SubmitInlineChatInputAction and QueueInChatAction before hiding
  • Show: resets history cursor so each open starts at the uncommitted tail

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI linked an issue Mar 20, 2026 that may be closed by this pull request
@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 20, 2026
Copilot AI changed the title [WIP] Fix inline chat v3 to have history on arrow up/down Inline chat v3: add history navigation on arrow up/down Mar 20, 2026
Copilot AI requested a review from jrieken March 20, 2026 09:13
@jrieken jrieken marked this pull request as ready for review March 20, 2026 10:14
Copilot AI review requested due to automatic review settings March 20, 2026 10:14
@jrieken jrieken enabled auto-merge March 20, 2026 10:14
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

Adds prompt history navigation to the Inline Chat v3 input widget so users can recall previously submitted prompts with Up/Down arrows, mirroring established patterns (e.g., SCM input history).

Changes:

  • Introduces a HistoryNavigator2<string> to InlineChatInputWidget and wires Up/Down arrow handling for history traversal (with action bar focus fallback).
  • Adds addToHistory(value) on the input widget and calls it from submit/queue actions prior to hiding the widget.
  • Resets the history cursor on widget show() so each open starts at the uncommitted tail.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.ts Adds HistoryNavigator2 state and arrow-key handling for history navigation within the inline chat input editor.
src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts Records submitted/queued prompts into the new input history before hiding the widget.

@jrieken jrieken merged commit 4c9386b into main Mar 20, 2026
23 checks passed
@jrieken jrieken deleted the copilot/fix-inline-chat-history-navigation branch March 20, 2026 10:37
@jrieken
Copy link
Copy Markdown
Member

jrieken commented Mar 20, 2026

@copilot How we make it that #sym:_historyNavigator is shared across all instances of the #sym:InlineChatInputWidget ? Now, each instance has a different history and IMO that's not so good. Can we have a service for this? Ideally the service also handles persistence so that history survives reloads

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 v3 should have history on arrow up/down

4 participants