@@ -520,15 +520,15 @@ class LocalChatSessionsProvider extends Disposable implements IChatSessionItemPr
520520 } ) ;
521521
522522 // Add "Show history..." node at the end
523- const historyNode : IChatSessionItem = {
524- id : 'show-history' ,
525- label : nls . localize ( 'chat.sessions.showHistory' , "History" ) ,
526- } ;
527-
528523 return [ ...sessions , historyNode ] ;
529524 }
530525}
531526
527+ const historyNode : IChatSessionItem = {
528+ id : 'show-history' ,
529+ label : nls . localize ( 'chat.sessions.showHistory' , "History" ) ,
530+ } ;
531+
532532// Chat sessions container
533533class ChatSessionsViewPaneContainer extends ViewPaneContainer {
534534 private registeredViewDescriptors : Map < string , IViewDescriptor > = new Map ( ) ;
@@ -762,7 +762,7 @@ class SessionsDataSource implements IAsyncDataSource<IChatSessionItemProvider, C
762762 }
763763
764764 // Check if this is the "Show history..." node
765- if ( 'id' in element && element . id === 'show-history' ) {
765+ if ( 'id' in element && element . id === historyNode . id ) {
766766 return true ;
767767 }
768768
@@ -800,7 +800,7 @@ class SessionsDataSource implements IAsyncDataSource<IChatSessionItemProvider, C
800800 }
801801
802802 // Check if this is the "Show history..." node
803- if ( 'id' in element && element . id === 'show-history' ) {
803+ if ( 'id' in element && element . id === historyNode . id ) {
804804 return this . getHistoryItems ( ) ;
805805 }
806806
@@ -1026,7 +1026,7 @@ class SessionsRenderer extends Disposable implements ITreeRenderer<IChatSessionI
10261026 // Handle different icon types
10271027 let iconResource : URI | undefined ;
10281028 let iconTheme : ThemeIcon | undefined ;
1029- if ( ! session . iconPath && session . id !== 'show-history' ) {
1029+ if ( ! session . iconPath && session . id !== historyNode . id ) {
10301030 iconTheme = this . statusToIcon ( session . status ) ;
10311031 } else {
10321032 iconTheme = session . iconPath ;
@@ -1485,6 +1485,9 @@ class SessionsViewPane extends ViewPane {
14851485 }
14861486 } ,
14871487 getDragURI : ( element : ChatSessionItemWithProvider ) => {
1488+ if ( element . id === historyNode . id ) {
1489+ return null ;
1490+ }
14881491 return getResourceForElement ( element ) . toString ( ) ;
14891492 } ,
14901493 getDragLabel : ( elements : ChatSessionItemWithProvider [ ] ) => {
@@ -1520,7 +1523,7 @@ class SessionsViewPane extends ViewPane {
15201523
15211524 // Register context menu event for right-click actions
15221525 this . _register ( this . tree . onContextMenu ( ( e ) => {
1523- if ( e . element && e . element . id !== 'show-history' ) {
1526+ if ( e . element && e . element . id !== historyNode . id ) {
15241527 this . showContextMenu ( e ) ;
15251528 }
15261529 } ) ) ;
@@ -1600,7 +1603,7 @@ class SessionsViewPane extends ViewPane {
16001603 }
16011604
16021605 try {
1603- if ( element . id === 'show-history' ) {
1606+ if ( element . id === historyNode . id ) {
16041607 // Don't try to open the "Show history..." node itself
16051608 return ;
16061609 }
0 commit comments