Skip to content

Adopt IChatWidgetService.openSession in more places#278973

Merged
roblourens merged 4 commits intomainfrom
roblou/individual-tarantula
Nov 24, 2025
Merged

Adopt IChatWidgetService.openSession in more places#278973
roblourens merged 4 commits intomainfrom
roblou/individual-tarantula

Conversation

@roblourens
Copy link
Member

Adopt ChatWidgetService.openSession in various components to streamline session handling and simplify code. Remove unnecessary dependencies on IChatWidgetService where applicable.

Copilot AI review requested due to automatic review settings November 22, 2025 19:56
@roblourens roblourens enabled auto-merge (squash) November 22, 2025 19:56
@roblourens roblourens self-assigned this Nov 22, 2025
@vs-code-engineering
Copy link

vs-code-engineering bot commented Nov 22, 2025

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.ts
  • src/vs/workbench/contrib/chat/browser/chatSessions/common.ts
  • src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.ts
  • src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.ts

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

This PR refactors chat session handling by centralizing session opening logic in ChatWidgetService.openSession(), replacing direct editorService.openEditor() calls across multiple components. The refactoring improves code maintainability, eliminates code duplication, and provides consistent behavior for handling already-open sessions.

Key changes:

  • Moved findExistingChatEditorByUri from a shared utility to a private method within ChatWidgetService
  • Simplified getSessionItemContextOverlay to use chatService.getSession() for determining active sessions
  • Updated multiple action classes to use chatWidgetService.openSession() for consistent session handling

Reviewed changes

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

Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/chatWidgetService.ts Added private findExistingChatEditorByUri method, imported IEditorGroup for type support
src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.ts Removed chatWidgetService parameter from getSessionItemContextOverlay call
src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.ts Removed IChatWidgetService dependency from constructor and getSessionItemContextOverlay call
src/vs/workbench/contrib/chat/browser/chatSessions/common.ts Removed findExistingChatEditorByUri function and chatWidgetService parameter from getSessionItemContextOverlay, simplified active session detection logic
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.ts Removed chatWidgetService parameter from getSessionItemContextOverlay call
src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.ts Refactored three actions to use chatWidgetService.openSession(), removed unnecessary IEditorService and IEditorGroupsService dependencies
src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.ts Replaced editorService.openEditor() calls with chatWidgetService.openSession() in move actions
src/vs/workbench/contrib/chat/browser/actions/chatImportExport.ts Replaced editorService with chatWidgetService for opening imported chat sessions
src/vs/workbench/contrib/chat/browser/actions/chatActions.ts Updated multiple actions and picker methods to use chatWidgetService.openSession(), added ChatViewPaneTarget import

@roblourens roblourens changed the title Refactor chat widget service usage Adopt IChatWidgetService.openSession in more places Nov 22, 2025
@roblourens roblourens mentioned this pull request Nov 22, 2025
21 tasks
@roblourens roblourens merged commit 0b0efb8 into main Nov 24, 2025
28 checks passed
@roblourens roblourens deleted the roblou/individual-tarantula branch November 24, 2025 05:57
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants