File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
src/vs/workbench/contrib/chat/browser Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -136,14 +136,14 @@ export class ChatTodoListWidget extends Disposable {
136136 this . updateTodoDisplay ( ) ;
137137 }
138138
139- public clear ( sessionId : string | undefined ) : void {
139+ public clear ( sessionId : string | undefined , force : boolean = false ) : void {
140140 if ( ! sessionId || this . domNode . style . display === 'none' ) {
141141 return ;
142142 }
143143
144144 const currentTodos = this . chatTodoListService . getTodos ( sessionId ) ;
145- const todoListCompleted = ! currentTodos . some ( todo => todo . status !== 'completed' ) ;
146- if ( todoListCompleted ) {
145+ const shouldClear = force || ! currentTodos . some ( todo => todo . status !== 'completed' ) ;
146+ if ( shouldClear ) {
147147 this . clearAllTodos ( ) ;
148148 }
149149 }
Original file line number Diff line number Diff line change @@ -852,6 +852,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
852852 // Unlock coding agent when clearing
853853 this . unlockFromCodingAgent ( ) ;
854854 this . _onDidClear . fire ( ) ;
855+ this . chatTodoListWidget . clear ( this . viewModel ?. sessionId , true ) ;
855856 }
856857
857858 private onDidChangeItems ( skipDynamicLayout ?: boolean ) {
@@ -2059,8 +2060,8 @@ export class ChatWidget extends Disposable implements IChatWidget {
20592060 if ( e . kind === 'setAgent' ) {
20602061 this . _onDidChangeAgent . fire ( { agent : e . agent , slashCommand : e . command } ) ;
20612062 }
2062- if ( e . kind === 'addRequest' ) {
2063- this . chatTodoListWidget . clear ( model . sessionId ) ;
2063+ if ( e . kind === 'addRequest' || e . kind === 'removeRequest' ) {
2064+ this . chatTodoListWidget . clear ( model . sessionId , e . kind === 'removeRequest' /*force*/ ) ;
20642065 }
20652066 } ) ) ;
20662067
You can’t perform that action at this time.
0 commit comments