File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 12421242 <!-- Task list display -->
12431243 {#if chatTasks .length > 0 }
12441244 <div class =" mx-1" >
1245- <TaskList tasks ={chatTasks } />
1245+ <TaskList tasks ={chatTasks } done ={ ! generating } />
12461246 </div >
12471247 {/if }
12481248
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 ;
1112
1213 let collapsed = false ;
1314
1415 $ : completedCount = tasks .filter ((t ) => t .status === ' completed' ).length ;
1516 $ : totalCount = tasks .length ;
16- $ : hasActive = tasks .some ((t ) => t .status === ' pending' || t .status === ' in_progress' );
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 );
1726 </script >
1827
1928{#if tasks .length > 0 && hasActive }
You can’t perform that action at this time.
0 commit comments