Adopt IChatWidgetService.openSession in more places#278973
Merged
roblourens merged 4 commits intomainfrom Nov 24, 2025
Merged
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
Contributor
There was a problem hiding this comment.
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
findExistingChatEditorByUrifrom a shared utility to a private method withinChatWidgetService - Simplified
getSessionItemContextOverlayto usechatService.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 |
dmitrivMS
approved these changes
Nov 22, 2025
21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopt
ChatWidgetService.openSessionin various components to streamline session handling and simplify code. Remove unnecessary dependencies onIChatWidgetServicewhere applicable.