@@ -861,6 +861,7 @@ export class AgentTitleBarStatusWidget extends BaseActionViewItem {
861861 // Build status sections but don't append yet - we need to control order
862862 let unreadSection : HTMLElement | undefined ;
863863 let activeSection : HTMLElement | undefined ;
864+ let needsInputSection : HTMLElement | undefined ;
864865
865866 // Unread section (blue dot + count)
866867 if ( viewSessionsEnabled && hasUnreadSessions && this . workspaceContextService . getWorkbenchState ( ) !== WorkbenchState . EMPTY ) {
@@ -899,29 +900,54 @@ export class AgentTitleBarStatusWidget extends BaseActionViewItem {
899900 disposables . add ( this . hoverService . setupManagedHover ( hoverDelegate , unreadSection , unreadTooltip ) ) ;
900901 }
901902
902- // In-progress/Needs-input section - shows "needs input" state when any session needs attention,
903- // otherwise shows "in progress" state. This is a single section that transforms based on state.
904- if ( viewSessionsEnabled && hasActiveSessions ) {
903+ // Needs-input section - shows sessions requiring user attention (approval/confirmation/input)
904+ if ( viewSessionsEnabled && hasAttentionNeeded ) {
905+ needsInputSection = $ ( 'span.agent-status-badge-section.active.needs-input' ) ;
906+ needsInputSection . setAttribute ( 'role' , 'button' ) ;
907+ needsInputSection . tabIndex = 0 ;
908+ const needsInputIcon = $ ( 'span.agent-status-icon' ) ;
909+ reset ( needsInputIcon , renderIcon ( Codicon . report ) ) ;
910+ needsInputSection . appendChild ( needsInputIcon ) ;
911+ const needsInputCount = $ ( 'span.agent-status-text' ) ;
912+ needsInputCount . textContent = String ( attentionNeededSessions . length ) ;
913+ needsInputSection . appendChild ( needsInputCount ) ;
914+
915+ disposables . add ( addDisposableListener ( needsInputSection , EventType . CLICK , ( e ) => {
916+ e . preventDefault ( ) ;
917+ e . stopPropagation ( ) ;
918+ this . _openSessionsWithFilter ( 'inProgress' ) ;
919+ } ) ) ;
920+ disposables . add ( addDisposableListener ( needsInputSection , EventType . KEY_DOWN , ( e ) => {
921+ if ( e . key === 'Enter' || e . key === ' ' ) {
922+ e . preventDefault ( ) ;
923+ e . stopPropagation ( ) ;
924+ this . _openSessionsWithFilter ( 'inProgress' ) ;
925+ }
926+ } ) ) ;
927+
928+ const needsInputTooltip = attentionNeededSessions . length === 1
929+ ? localize ( 'needsInputSessionsTooltip1' , "{0} session needs input" , attentionNeededSessions . length )
930+ : localize ( 'needsInputSessionsTooltip' , "{0} sessions need input" , attentionNeededSessions . length ) ;
931+ disposables . add ( this . hoverService . setupManagedHover ( hoverDelegate , needsInputSection , needsInputTooltip ) ) ;
932+ }
933+
934+ // In-progress section - shows sessions that are actively running (excludes needs-input)
935+ const inProgressOnly = activeSessions . filter ( s => s . status !== AgentSessionStatus . NeedsInput ) ;
936+ if ( viewSessionsEnabled && inProgressOnly . length > 0 ) {
905937 const { isFilteredToInProgress } = this . _getCurrentFilterState ( ) ;
906938 activeSection = $ ( 'span.agent-status-badge-section.active' ) ;
907- if ( hasAttentionNeeded ) {
908- activeSection . classList . add ( 'needs-input' ) ;
909- }
910939 if ( isFilteredToInProgress ) {
911940 activeSection . classList . add ( 'filtered' ) ;
912941 }
913942 activeSection . setAttribute ( 'role' , 'button' ) ;
914943 activeSection . tabIndex = 0 ;
915944 const statusIcon = $ ( 'span.agent-status-icon' ) ;
916- // Show report icon when needs input, otherwise session-in-progress icon
917- reset ( statusIcon , renderIcon ( hasAttentionNeeded ? Codicon . report : Codicon . sessionInProgress ) ) ;
945+ reset ( statusIcon , renderIcon ( Codicon . sessionInProgress ) ) ;
918946 activeSection . appendChild ( statusIcon ) ;
919947 const statusCount = $ ( 'span.agent-status-text' ) ;
920- // Show needs-input count when attention needed, otherwise total active count
921- statusCount . textContent = String ( hasAttentionNeeded ? attentionNeededSessions . length : activeSessions . length ) ;
948+ statusCount . textContent = String ( inProgressOnly . length ) ;
922949 activeSection . appendChild ( statusCount ) ;
923950
924- // Click handler - filter to in-progress sessions
925951 disposables . add ( addDisposableListener ( activeSection , EventType . CLICK , ( e ) => {
926952 e . preventDefault ( ) ;
927953 e . stopPropagation ( ) ;
@@ -935,32 +961,24 @@ export class AgentTitleBarStatusWidget extends BaseActionViewItem {
935961 }
936962 } ) ) ;
937963
938- // Hover tooltip - different message based on state
939- const activeTooltip = hasAttentionNeeded
940- ? ( attentionNeededSessions . length === 1
941- ? localize ( 'needsInputSessionsTooltip1' , "{0} session needs input" , attentionNeededSessions . length )
942- : localize ( 'needsInputSessionsTooltip' , "{0} sessions need input" , attentionNeededSessions . length ) )
943- : ( activeSessions . length === 1
944- ? localize ( 'activeSessionsTooltip1' , "{0} session in progress" , activeSessions . length )
945- : localize ( 'activeSessionsTooltip' , "{0} sessions in progress" , activeSessions . length ) ) ;
964+ const activeTooltip = inProgressOnly . length === 1
965+ ? localize ( 'activeSessionsTooltip1' , "{0} session in progress" , inProgressOnly . length )
966+ : localize ( 'activeSessionsTooltip' , "{0} sessions in progress" , inProgressOnly . length ) ;
946967 disposables . add ( this . hoverService . setupManagedHover ( hoverDelegate , activeSection , activeTooltip ) ) ;
947968 }
948969
949970 // Append status sections in the correct order
950971 if ( reverseOrder ) {
951- // Add line separator before badge sections when inline in compact mode
952- if ( inlineContainer ) {
953- const badgeSeparator = $ ( 'span.agent-status-badge-separator' ) ;
954- badge . appendChild ( badgeSeparator ) ;
955- }
956- // [active, unread, sparkle] — populates inward
972+ // [needs-input, active, unread, sparkle] — populates inward
973+ if ( needsInputSection ) { badge . appendChild ( needsInputSection ) ; }
957974 if ( activeSection ) { badge . appendChild ( activeSection ) ; }
958975 if ( unreadSection ) { badge . appendChild ( unreadSection ) ; }
959976 badge . appendChild ( sparkleContainer ) ;
960977 } else {
961- // Original: [sparkle (already appended), unread, active]
978+ // Original: [sparkle (already appended), unread, active, needs-input ]
962979 if ( unreadSection ) { badge . appendChild ( unreadSection ) ; }
963980 if ( activeSection ) { badge . appendChild ( activeSection ) ; }
981+ if ( needsInputSection ) { badge . appendChild ( needsInputSection ) ; }
964982 }
965983
966984 }
0 commit comments