@@ -33,24 +33,23 @@ import { FuzzyScore } from '../../../../../base/common/filters.js';
3333import { IMenuService , MenuId , registerAction2 } from '../../../../../platform/actions/common/actions.js' ;
3434import { IChatSessionsService } from '../../common/chatSessionsService.js' ;
3535import { ICommandService } from '../../../../../platform/commands/common/commands.js' ;
36- import { findExistingChatEditorByUri , getSessionItemContextOverlay , NEW_CHAT_SESSION_ACTION_ID } from '../chatSessions/common.js' ;
36+ import { getSessionItemContextOverlay , NEW_CHAT_SESSION_ACTION_ID } from '../chatSessions/common.js' ;
3737import { ACTION_ID_OPEN_CHAT } from '../actions/chatActions.js' ;
3838import { IProgressService } from '../../../../../platform/progress/common/progress.js' ;
3939import { IChatEditorOptions } from '../chatEditor.js' ;
40- import { IEditorService } from '../../../../services/editor/common/editorService.js' ;
41- import { assertReturnsDefined , upcast } from '../../../../../base/common/types.js' ;
40+ import { assertReturnsDefined } from '../../../../../base/common/types.js' ;
4241import { IEditorGroupsService } from '../../../../services/editor/common/editorGroupsService.js' ;
4342import { DeferredPromise } from '../../../../../base/common/async.js' ;
4443import { Event } from '../../../../../base/common/event.js' ;
4544import { MutableDisposable } from '../../../../../base/common/lifecycle.js' ;
46- import { IEditorOptions } from '../../../../../platform/editor/common/editor.js' ;
4745import { ITreeContextMenuEvent } from '../../../../../base/browser/ui/tree/tree.js' ;
4846import { MarshalledId } from '../../../../../base/common/marshallingIds.js' ;
4947import { getActionBarActions } from '../../../../../platform/actions/browser/menuEntryActionViewItem.js' ;
5048import { IChatService } from '../../common/chatService.js' ;
5149import { IChatWidgetService } from '../chat.js' ;
5250import { AGENT_SESSIONS_VIEW_ID , AGENT_SESSIONS_VIEW_CONTAINER_ID , AgentSessionProviders } from './agentSessions.js' ;
5351import { TreeFindMode } from '../../../../../base/browser/ui/tree/abstractTree.js' ;
52+ import { SIDE_GROUP } from '../../../../services/editor/common/editorService.js' ;
5453
5554export class AgentSessionsView extends ViewPane {
5655
@@ -70,7 +69,6 @@ export class AgentSessionsView extends ViewPane {
7069 @IChatSessionsService private readonly chatSessionsService : IChatSessionsService ,
7170 @ICommandService private readonly commandService : ICommandService ,
7271 @IProgressService private readonly progressService : IProgressService ,
73- @IEditorService private readonly editorService : IEditorService ,
7472 @IEditorGroupsService private readonly editorGroupsService : IEditorGroupsService ,
7573 @IChatService private readonly chatService : IChatService ,
7674 @IMenuService private readonly menuService : IMenuService ,
@@ -132,12 +130,6 @@ export class AgentSessionsView extends ViewPane {
132130 return ;
133131 }
134132
135- const existingSessionEditor = findExistingChatEditorByUri ( session . resource , this . editorGroupsService ) ;
136- if ( existingSessionEditor ) {
137- await existingSessionEditor . group . openEditor ( existingSessionEditor . editor , e . editorOptions ) ;
138- return ;
139- }
140-
141133 let sessionOptions : IChatEditorOptions ;
142134 if ( isLocalAgentSessionItem ( session ) ) {
143135 sessionOptions = { } ;
@@ -147,14 +139,14 @@ export class AgentSessionsView extends ViewPane {
147139
148140 sessionOptions . ignoreInView = true ;
149141
150- await this . editorService . openEditor ( {
151- resource : session . resource ,
152- options : upcast < IEditorOptions , IChatEditorOptions > ( {
153- ...sessionOptions ,
154- title : { preferred : session . label } ,
155- ... e . editorOptions
156- } )
157- } ) ;
142+ const options : IChatEditorOptions = {
143+ preserveFocus : false ,
144+ ... sessionOptions ,
145+ ...e . editorOptions ,
146+ } ;
147+
148+ const group = e . sideBySide ? SIDE_GROUP : undefined ;
149+ await this . chatWidgetService . openSession ( session . resource , group , options ) ;
158150 }
159151
160152 private showContextMenu ( { element : session , anchor } : ITreeContextMenuEvent < IAgentSessionViewModel > ) : void {
0 commit comments