Skip to content

inlineChat: shared history service with persistence#303471

Merged
jrieken merged 2 commits intomainfrom
joh/inline-chat-history-service
Mar 20, 2026
Merged

inlineChat: shared history service with persistence#303471
jrieken merged 2 commits intomainfrom
joh/inline-chat-history-service

Conversation

@jrieken
Copy link
Member

@jrieken jrieken commented Mar 20, 2026

Summary

Introduces IInlineChatHistoryService so that all InlineChatInputWidget instances share one history and that history survives reloads.

What changed

  • New InlineChatHistoryService (inlineChatHistoryService.ts)

    • Wraps a single HistoryNavigator2<string> instance
    • Persists to IStorageService under StorageScope.PROFILE (survives reloads, shared across windows of the same profile)
    • Restores history on construction; saves on onWillSaveState
  • Updated InlineChatInputWidget - removed the per-instance _historyNavigator field and injects IInlineChatHistoryService instead, delegating all history operations to it

  • Registered the service as a delayed singleton in inlineChat.contribution.ts

Why

Previously each InlineChatInputWidget instance had its own HistoryNavigator2, so history was not shared across editors and was lost on reload. Now a single service owns the history, making it consistent everywhere and persistent.

Copilot AI review requested due to automatic review settings March 20, 2026 11:18
@jrieken jrieken enabled auto-merge (squash) March 20, 2026 11:18
@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 20, 2026
Copy link
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

Introduces a shared, persistent inline chat input history so all InlineChatInputWidget instances reuse the same history and it survives reloads.

Changes:

  • Added InlineChatHistoryService with HistoryNavigator2<string> and profile-scoped persistence via IStorageService.
  • Updated InlineChatInputWidget to delegate history navigation/state to IInlineChatHistoryService instead of a per-widget navigator.
  • Registered the new history service as a delayed singleton in inlineChat.contribution.ts.

Reviewed changes

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

File Description
src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.ts Switches history handling from per-widget HistoryNavigator2 to injected shared history service.
src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.ts New service that restores/saves inline chat input history to profile storage.
src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.ts Registers IInlineChatHistoryService as a delayed singleton.

@jrieken jrieken merged commit d05f2f2 into main Mar 20, 2026
19 checks passed
@jrieken jrieken deleted the joh/inline-chat-history-service branch March 20, 2026 14:51
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.

3 participants