File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 122122 export let history;
123123 export let taskIds = null ;
124124
125+ $ : isActive = (taskIds && taskIds .length > 0 ) || (history .currentId && history .messages [history .currentId ]?.done != true ) || generating ;
126+
125127 export let prompt = ' ' ;
126128 export let files = [];
127129
12401242 />
12411243
12421244 <!-- Task list display -->
1243- {#if chatTasks .length > 0 }
1245+ {#if isActive && chatTasks .length > 0 }
12441246 <div class =" mx-1" >
1245- <TaskList tasks ={chatTasks } done ={ ! generating } />
1247+ <TaskList tasks ={chatTasks } />
12461248 </div >
12471249 {/if }
12481250
18571859 </div >
18581860
18591861 <div class =" self-end flex space-x-1 mr-1 shrink-0 gap-[0.5px]" >
1860- {#if ( taskIds && taskIds . length > 0 ) || ( history . currentId && history . messages [ history . currentId ]?. done != true ) || generating }
1862+ {#if isActive }
18611863 <div class =" flex items-center" >
18621864 <Tooltip content ={$i18n .t (' Stop' )}>
18631865 <button
Original file line number Diff line number Diff line change 88 const i18n = getContext (' i18n' );
99
1010 export let tasks: Array <{ id: string ; content: string ; status: string }> = [];
11- export let done = false ;
1211
1312 let collapsed = false ;
1413
1514 $ : completedCount = tasks .filter ((t ) => t .status === ' completed' ).length ;
1615 $ : totalCount = tasks .length ;
17- $ : inProgressCount = tasks .filter ((t ) => t .status === ' in_progress' ).length ;
18- $ : pendingCount = tasks .filter ((t ) => t .status === ' pending' ).length ;
19-
20- // Hide once all work is effectively done:
21- // - no active tasks at all, OR
22- // - message is done and the only remaining active tasks are in_progress (no pending)
23- $ : hasActive =
24- tasks .some ((t ) => t .status === ' pending' || t .status === ' in_progress' ) &&
25- ! (done && pendingCount === 0 && inProgressCount > 0 );
16+ $ : hasActive = tasks .some ((t ) => t .status === ' pending' || t .status === ' in_progress' );
2617 </script >
2718
2819{#if tasks .length > 0 && hasActive }
You can’t perform that action at this time.
0 commit comments