@@ -16,6 +16,7 @@ import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.j
1616import { MarshalledId } from '../../../../base/common/marshallingIds.js' ;
1717import { ThemeIcon } from '../../../../base/common/themables.js' ;
1818import { URI } from '../../../../base/common/uri.js' ;
19+ import { isMarkdownString } from '../../../../base/common/htmlContent.js' ;
1920import * as nls from '../../../../nls.js' ;
2021import { getActionBarActions } from '../../../../platform/actions/browser/menuEntryActionViewItem.js' ;
2122import { IMenuService , MenuId , MenuRegistry } from '../../../../platform/actions/common/actions.js' ;
@@ -48,9 +49,9 @@ import { IEditorGroup, IEditorGroupsService } from '../../../services/editor/com
4849import { IEditorService } from '../../../services/editor/common/editorService.js' ;
4950import { IExtensionService } from '../../../services/extensions/common/extensions.js' ;
5051import { IWorkbenchLayoutService } from '../../../services/layout/browser/layoutService.js' ;
52+ import { IChatSessionItem , IChatSessionItemProvider , IChatSessionsExtensionPoint , IChatSessionsService , ChatSessionStatus } from '../common/chatSessionsService.js' ;
5153import { IViewsService } from '../../../services/views/common/viewsService.js' ;
5254import { ChatContextKeys } from '../common/chatContextKeys.js' ;
53- import { IChatSessionItem , IChatSessionItemProvider , IChatSessionsExtensionPoint , IChatSessionsService } from '../common/chatSessionsService.js' ;
5455import { ChatSessionUri } from '../common/chatUri.js' ;
5556import { ChatAgentLocation , ChatConfiguration } from '../common/constants.js' ;
5657import { IChatWidget , IChatWidgetService } from './chat.js' ;
@@ -81,6 +82,7 @@ interface ILocalChatSessionItem extends IChatSessionItem {
8182 widget ?: IChatWidget ;
8283 sessionType : 'editor' | 'widget' ;
8384 description ?: string ;
85+ status ?: ChatSessionStatus ;
8486}
8587
8688export class ChatSessionsView extends Disposable implements IWorkbenchContribution {
@@ -548,14 +550,23 @@ class SessionsDataSource implements IAsyncDataSource<IChatSessionItemProvider, C
548550}
549551
550552// Tree delegate for session items
551- class SessionsDelegate implements IListVirtualDelegate < IChatSessionItem > {
553+ class SessionsDelegate implements IListVirtualDelegate < ChatSessionItemWithProvider > {
552554 static readonly ITEM_HEIGHT = 22 ;
555+ static readonly ITEM_HEIGHT_WITH_DESCRIPTION = 38 ; // Slightly smaller for cleaner look
553556
554- getHeight ( element : IChatSessionItem ) : number {
555- return SessionsDelegate . ITEM_HEIGHT ;
557+ getHeight ( element : ChatSessionItemWithProvider ) : number {
558+ // Check if element has a non-empty description
559+ const hasDescription = 'description' in element &&
560+ typeof element . description === 'string' &&
561+ element . description . trim ( ) . length > 0 ;
562+
563+ // Only give taller height to non-local sessions with descriptions
564+ const isLocalSession = element . provider . chatSessionType === 'local' ;
565+
566+ return hasDescription && ! isLocalSession ? SessionsDelegate . ITEM_HEIGHT_WITH_DESCRIPTION : SessionsDelegate . ITEM_HEIGHT ;
556567 }
557568
558- getTemplateId ( element : IChatSessionItem ) : string {
569+ getTemplateId ( element : ChatSessionItemWithProvider ) : string {
559570 return SessionsRenderer . TEMPLATE_ID ;
560571 }
561572}
@@ -636,8 +647,11 @@ class SessionsRenderer extends Disposable implements ITreeRenderer<IChatSessionI
636647
637648 renderTemplate ( container : HTMLElement ) : ISessionTemplateData {
638649 const element = append ( container , $ ( '.chat-session-item' ) ) ;
639- const resourceLabel = this . labels . create ( element , { supportHighlights : true } ) ;
640- const actionsContainer = append ( resourceLabel . element , $ ( '.actions' ) ) ;
650+
651+ // Create a container that holds both the label and actions
652+ const contentContainer = append ( element , $ ( '.session-content' ) ) ;
653+ const resourceLabel = this . labels . create ( contentContainer , { supportHighlights : true } ) ;
654+ const actionsContainer = append ( contentContainer , $ ( '.actions' ) ) ;
641655 const actionBar = new ActionBar ( actionsContainer ) ;
642656 const elementDisposable = new DisposableStore ( ) ;
643657
@@ -656,6 +670,13 @@ class SessionsRenderer extends Disposable implements ITreeRenderer<IChatSessionI
656670 // Clear previous element disposables
657671 templateData . elementDisposable . clear ( ) ;
658672
673+ // Add CSS class for local sessions
674+ if ( sessionWithProvider . provider . chatSessionType === 'local' ) {
675+ templateData . container . classList . add ( 'local-session' ) ;
676+ } else {
677+ templateData . container . classList . remove ( 'local-session' ) ;
678+ }
679+
659680 // Handle different icon types
660681 let iconResource : URI | undefined ;
661682 let iconTheme : ThemeIcon | undefined ;
@@ -688,7 +709,14 @@ class SessionsRenderer extends Disposable implements ITreeRenderer<IChatSessionI
688709 resource : iconResource
689710 } , {
690711 fileKind : undefined ,
691- icon : iconTheme || iconUri
712+ icon : iconTheme || iconUri ,
713+ title : 'tooltip' in session && session . tooltip ?
714+ ( typeof session . tooltip === 'string' ? session . tooltip :
715+ isMarkdownString ( session . tooltip ) ? {
716+ markdown : session . tooltip ,
717+ markdownNotSupportedFallback : session . tooltip . value
718+ } : undefined ) :
719+ undefined
692720 } ) ;
693721
694722 // Create context overlay for this specific session item
0 commit comments