@@ -1582,26 +1582,49 @@ export class ActionExecutor {
15821582 return 'Task list cleared (0 tasks)' ;
15831583 }
15841584
1585- const completed = allTodos . filter ( ( t : any ) => t . status === 'completed' ) . length ;
1585+ const completedTasks = allTodos . filter ( ( t : any ) => t . status === 'completed' ) ;
15861586 const inProgress = allTodos . filter ( ( t : any ) => t . status === 'in_progress' ) ;
1587- const pending = allTodos . filter ( ( t : any ) => t . status === 'pending' ) . length ;
1587+ const pendingTasks = allTodos . filter ( ( t : any ) => t . status === 'pending' ) ;
1588+ const completed = completedTasks . length ;
1589+ const pending = pendingTasks . length ;
15881590
15891591 const percent = Math . round ( ( completed / total ) * 100 ) ;
15901592 const barWidth = 20 ;
15911593 const filled = Math . round ( ( barWidth * percent ) / 100 ) ;
15921594 const bar = '█' . repeat ( filled ) + '░' . repeat ( barWidth - filled ) ;
15931595
1594- console . log ( chalk . cyan ( '\n📋 Task Progress:' ) ) ;
1595- console . log ( ` ${ chalk . green ( bar ) } ${ percent } %` ) ;
1596- console . log ( chalk . gray ( ` ${ completed } done · ${ inProgress . length } in progress · ${ pending } pending` ) ) ;
1596+ const titleOf = ( task : Record < string , unknown > ) : string => {
1597+ const title = task . title ?? task . content ;
1598+ return typeof title === 'string' && title . trim ( ) . length > 0 ? title : 'Untitled task' ;
1599+ } ;
1600+ const outputLines = [
1601+ chalk . cyan ( '\n📋 Task Progress:' ) ,
1602+ ` ${ chalk . green ( bar ) } ${ percent } %` ,
1603+ chalk . gray ( ` ${ completed } done · ${ inProgress . length } in progress · ${ pending } pending` )
1604+ ] ;
1605+
1606+ if ( completedTasks . length > 0 ) {
1607+ outputLines . push ( '' , chalk . green ( ' ✅ Completed Tasks:' ) ) ;
1608+ for ( const task of completedTasks ) {
1609+ outputLines . push ( chalk . green ( ` ✓ ${ titleOf ( task ) } ` ) ) ;
1610+ }
1611+ }
15971612
15981613 if ( inProgress . length > 0 ) {
1599- console . log ( chalk . yellow ( '\n 🔄 Active Tasks:' ) ) ;
1614+ outputLines . push ( '' , chalk . yellow ( ' 🔄 Active Tasks:' ) ) ;
16001615 for ( const task of inProgress ) {
1601- console . log ( ` • ${ ( task as any ) . title || ( task as any ) . content } ` ) ;
1616+ outputLines . push ( chalk . yellow ( ` • ${ titleOf ( task ) } ` ) ) ;
16021617 }
16031618 }
1604- console . log ( ) ;
1619+
1620+ if ( pendingTasks . length > 0 ) {
1621+ outputLines . push ( '' , chalk . cyan ( ' ⏳ Pending Tasks:' ) ) ;
1622+ for ( const task of pendingTasks ) {
1623+ outputLines . push ( chalk . dim ( ` ○ ${ titleOf ( task ) } ` ) ) ;
1624+ }
1625+ }
1626+
1627+ console . log ( `${ outputLines . join ( '\n' ) } \n` ) ;
16051628
16061629 return `Updated task list: ${ percent } % complete (${ completed } /${ total } )` ;
16071630 }
0 commit comments