@@ -20,9 +20,9 @@ import { IContextKeyService, ContextKeyExpr } from '../../../../platform/context
2020import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js' ;
2121import { IOpenerService } from '../../../../platform/opener/common/opener.js' ;
2222import { IHoverService } from '../../../../platform/hover/browser/hover.js' ;
23- import { IMenuService } from '../../../../platform/actions/common/actions.js' ;
23+ import { IMenuService , MenuId , MenuRegistry } from '../../../../platform/actions/common/actions.js' ;
2424import { getActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js' ;
25- import { DisposableStore } from '../../../../base/common/lifecycle.js' ;
25+ import { Disposable , DisposableStore } from '../../../../base/common/lifecycle.js' ;
2626import { ViewPaneContainer } from '../../../browser/parts/views/viewPaneContainer.js' ;
2727import { ViewPane , IViewPaneOptions } from '../../../browser/parts/views/viewPane.js' ;
2828import { Extensions , IViewContainersRegistry , IViewDescriptorService , ViewContainerLocation , IViewsRegistry , IViewDescriptor } from '../../../common/views.js' ;
@@ -37,7 +37,6 @@ import { CancellationToken } from '../../../../base/common/cancellation.js';
3737import { FuzzyScore } from '../../../../base/common/filters.js' ;
3838import { ResourceLabels , IResourceLabel } from '../../../browser/labels.js' ;
3939import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js' ;
40- import { Disposable } from '../../../../base/common/lifecycle.js' ;
4140import { append , $ , getActiveWindow , clearNode } from '../../../../base/browser/dom.js' ;
4241import { URI } from '../../../../base/common/uri.js' ;
4342import { IEditorGroupsService , IEditorGroup } from '../../../services/editor/common/editorGroupsService.js' ;
@@ -49,7 +48,6 @@ import { EditorInput } from '../../../common/editor/editorInput.js';
4948import { ChatEditorInput } from './chatEditorInput.js' ;
5049import { IChatWidgetService , IChatWidget } from './chat.js' ;
5150import { ChatAgentLocation , ChatConfiguration } from '../common/constants.js' ;
52- import { MenuId , MenuRegistry } from '../../../../platform/actions/common/actions.js' ;
5351import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js' ;
5452import { IWorkbenchContribution } from '../../../common/contributions.js' ;
5553import { IViewsService } from '../../../services/views/common/viewsService.js' ;
@@ -62,15 +60,11 @@ export const VIEWLET_ID = 'workbench.view.chat.sessions';
6260
6361// Helper function to create context overlay for session items
6462function getSessionItemContextOverlay ( session : IChatSessionItem , provider ?: IChatSessionItemProvider ) : [ string , any ] [ ] {
65- const overlay : [ string , any ] [ ] = [
66- [ ChatContextKeys . sessionId . key , session . id ] ,
67- [ ChatContextKeys . sessionLabel . key , session . label ] ,
68- ] ;
69-
63+ const overlay : [ string , any ] [ ] = [ ] ;
7064 if ( provider ) {
7165 overlay . push ( [ ChatContextKeys . sessionType . key , provider . chatSessionType ] ) ;
7266 }
73-
67+
7468 return overlay ;
7569}
7670
@@ -636,7 +630,8 @@ class SessionsRenderer extends Disposable implements ITreeRenderer<IChatSessionI
636630 renderTemplate ( container : HTMLElement ) : ISessionTemplateData {
637631 const element = append ( container , $ ( '.chat-session-item' ) ) ;
638632 const resourceLabel = this . labels . create ( element , { supportHighlights : true } ) ;
639- const actionBar = new ActionBar ( container ) ;
633+ const actionsContainer = append ( resourceLabel . element , $ ( '.actions' ) ) ;
634+ const actionBar = new ActionBar ( actionsContainer ) ;
640635 const elementDisposable = new DisposableStore ( ) ;
641636
642637 return {
@@ -650,7 +645,7 @@ class SessionsRenderer extends Disposable implements ITreeRenderer<IChatSessionI
650645 renderElement ( element : ITreeNode < IChatSessionItem , FuzzyScore > , index : number , templateData : ISessionTemplateData ) : void {
651646 const session = element . element ;
652647 const sessionWithProvider = session as IChatSessionItem & { provider : IChatSessionItemProvider } ;
653-
648+
654649 // Clear previous element disposables
655650 templateData . elementDisposable . clear ( ) ;
656651
@@ -691,7 +686,7 @@ class SessionsRenderer extends Disposable implements ITreeRenderer<IChatSessionI
691686
692687 // Create context overlay for this specific session item
693688 const contextOverlay = getSessionItemContextOverlay ( session , sessionWithProvider . provider ) ;
694-
689+
695690 const contextKeyService = this . contextKeyService . createOverlay ( contextOverlay ) ;
696691
697692 // Create menu for this session item
@@ -703,12 +698,15 @@ class SessionsRenderer extends Disposable implements ITreeRenderer<IChatSessionI
703698 const setupActionBar = ( ) => {
704699 templateData . actionBar . clear ( ) ;
705700
701+ const actions = menu . getActions ( { arg : session , shouldForwardArgs : true } ) ;
702+
706703 const { primary } = getActionBarActions (
707- menu . getActions ( { arg : session , shouldForwardArgs : true } ) ,
708- 'inline'
704+ actions ,
705+ 'inline' ,
709706 ) ;
707+
710708 templateData . actionBar . push ( primary , { icon : true , label : false } ) ;
711-
709+
712710 // Set context for the action bar
713711 templateData . actionBar . context = session ;
714712 } ;
0 commit comments