@@ -13,7 +13,7 @@ import { ICompressedTreeNode } from '../../../../../base/browser/ui/tree/compres
1313import { ICompressibleKeyboardNavigationLabelProvider , ICompressibleTreeRenderer } from '../../../../../base/browser/ui/tree/objectTree.js' ;
1414import { ITreeNode , ITreeElementRenderDetails , IAsyncDataSource , ITreeSorter , ITreeDragAndDrop , ITreeDragOverReaction } from '../../../../../base/browser/ui/tree/tree.js' ;
1515import { Disposable , DisposableStore , IDisposable } from '../../../../../base/common/lifecycle.js' ;
16- import { IAgentSession , IAgentSessionsModel , isAgentSession , isAgentSessionsModel } from './agentSessionsModel.js' ;
16+ import { IAgentSession , IAgentSessionsModel , isAgentSession , isAgentSessionsModel , hasValidDiff } from './agentSessionsModel.js' ;
1717import { IconLabel } from '../../../../../base/browser/ui/iconLabel/iconLabel.js' ;
1818import { ThemeIcon } from '../../../../../base/common/themables.js' ;
1919import { Codicon } from '../../../../../base/common/codicons.js' ;
@@ -162,11 +162,9 @@ export class AgentSessionRenderer implements ICompressibleTreeRenderer<IAgentSes
162162
163163 // Details Actions
164164 const { changes : diff } = session . element ;
165- if ( session . element . status !== ChatSessionStatus . InProgress && diff && this . hasValidDiff ( diff ) ) {
166- if ( diff instanceof Array ? diff . length > 0 : ( diff . files > 0 || diff . insertions > 0 || diff . deletions > 0 ) ) {
167- const diffAction = template . elementDisposable . add ( new AgentSessionShowDiffAction ( session . element ) ) ;
168- template . detailsToolbar . push ( [ diffAction ] , { icon : false , label : true } ) ;
169- }
165+ if ( session . element . status !== ChatSessionStatus . InProgress && diff && hasValidDiff ( diff ) ) {
166+ const diffAction = template . elementDisposable . add ( new AgentSessionShowDiffAction ( session . element ) ) ;
167+ template . detailsToolbar . push ( [ diffAction ] , { icon : false , label : true } ) ;
170168 }
171169
172170 // Description otherwise
@@ -181,17 +179,7 @@ export class AgentSessionRenderer implements ICompressibleTreeRenderer<IAgentSes
181179 this . renderHover ( session , template ) ;
182180 }
183181
184- private hasValidDiff ( diff : IAgentSession [ 'changes' ] ) : boolean {
185- if ( ! diff ) {
186- return false ;
187- }
188182
189- if ( diff instanceof Array ) {
190- return diff . length > 0 ;
191- }
192-
193- return diff . files > 0 || diff . insertions > 0 || diff . deletions > 0 ;
194- }
195183
196184 private getIcon ( session : IAgentSession ) : ThemeIcon {
197185 if ( session . status === ChatSessionStatus . InProgress ) {
0 commit comments