@@ -33,7 +33,19 @@ import {
3333 usagePercentFromRatio ,
3434} from '#/utils/usage/usage-format' ;
3535
36- const DEFAULT_STATUS_LINE_ITEMS = [ 'mode' , 'goal' , 'model' , 'tasks' , 'cwd' , 'git' ] as const ;
36+ const DEFAULT_STATUS_LINE_LAYOUT = [
37+ { slot : 'mode' , collapsePriority : null } ,
38+ { slot : 'goal' , collapsePriority : null } ,
39+ { slot : 'model' , collapsePriority : 2 } ,
40+ { slot : 'tasks' , collapsePriority : 1 } ,
41+ { slot : 'cwd' , collapsePriority : 3 } ,
42+ { slot : 'git' , collapsePriority : 0 } ,
43+ ] as const ;
44+ const DEFAULT_STATUS_LINE_ITEMS = DEFAULT_STATUS_LINE_LAYOUT . map ( ( { slot } ) => slot ) ;
45+ const DEFAULT_STATUS_LINE_COLLAPSE_ORDER = DEFAULT_STATUS_LINE_LAYOUT
46+ . filter ( ( { collapsePriority } ) => collapsePriority !== null )
47+ . toSorted ( ( left , right ) => left . collapsePriority ! - right . collapsePriority ! )
48+ . map ( ( { slot } ) => slot ) ;
3749
3850const MAX_CWD_SEGMENTS = 3 ;
3951const GOAL_TIMER_INTERVAL_MS = 1_000 ;
@@ -313,13 +325,23 @@ export class FooterComponent implements Component {
313325 const slots = this . buildSlots ( colors ) ;
314326 const configured = this . state . statusLine ?. items ?? null ;
315327 const order : readonly string [ ] = configured ?? DEFAULT_STATUS_LINE_ITEMS ;
316- const left : string [ ] = [ ] ;
328+ let left : Array < { slot : string ; piece : string } > = [ ] ;
317329 for ( const slot of order ) {
318330 const pieces = slots [ slot as keyof typeof slots ] ;
319- if ( pieces !== undefined ) left . push ( ...pieces ) ;
331+ if ( pieces !== undefined ) {
332+ left . push ( ...pieces . map ( ( piece ) => ( { slot, piece } ) ) ) ;
333+ }
334+ }
335+
336+ let leftLine = left . map ( ( { piece } ) => piece ) . join ( ' ' ) ;
337+ if ( configured === null ) {
338+ for ( const slot of DEFAULT_STATUS_LINE_COLLAPSE_ORDER ) {
339+ if ( visibleWidth ( leftLine ) <= width ) break ;
340+ left = left . filter ( ( entry ) => entry . slot !== slot ) ;
341+ leftLine = left . map ( ( { piece } ) => piece ) . join ( ' ' ) ;
342+ }
320343 }
321344
322- const leftLine = left . join ( ' ' ) ;
323345 const leftWidth = visibleWidth ( leftLine ) ;
324346
325347 // Rotating hint tips stay on the right unless they were given an
@@ -405,9 +427,13 @@ export class FooterComponent implements Component {
405427 }
406428
407429 const modes : string [ ] = [ ] ;
408- if ( state . permissionMode === 'auto' ) modes . push ( chalk . hex ( colors . warning ) . bold ( 'auto' ) ) ;
409- if ( state . permissionMode === 'yolo' ) modes . push ( chalk . hex ( colors . warning ) . bold ( 'yolo' ) ) ;
410- if ( state . planMode ) modes . push ( chalk . hex ( colors . primary ) . bold ( 'plan' ) ) ;
430+ if ( state . permissionMode === 'auto' ) {
431+ modes . push ( chalk . hex ( colors . modeAutoAccept ) . bold ( 'auto' ) ) ;
432+ }
433+ if ( state . permissionMode === 'yolo' ) {
434+ modes . push ( chalk . hex ( colors . modePermission ) . bold ( 'yolo' ) ) ;
435+ }
436+ if ( state . planMode ) modes . push ( chalk . hex ( colors . modePlan ) . bold ( 'plan' ) ) ;
411437 if ( state . dynamicWorkflowMode ) modes . push ( chalk . hex ( colors . accent ) . bold ( 'dynamic_workflow' ) ) ;
412438 if ( state . towerMode ) modes . push ( chalk . hex ( colors . accent ) . bold ( 'tower' ) ) ;
413439 if ( modes . length > 0 ) slots [ 'mode' ] = [ modes . join ( ' ' ) ] ;
@@ -430,12 +456,10 @@ export class FooterComponent implements Component {
430456 ? ` thinking: ${ effort } `
431457 : ' thinking'
432458 : '' ;
433- const modelLabel = `${ model } ${ thinkingLabel } ` ;
434- let renderedModelLabel = chalk . hex ( colors . text ) ( modelLabel ) ;
435- if ( isRainbowHatching ( ) ) {
436- renderedModelLabel = renderHatchFooterModel ( modelLabel ) ;
437- }
438- slots [ 'model' ] = [ renderedModelLabel ] ;
459+ const renderedModel = isRainbowHatching ( )
460+ ? renderHatchFooterModel ( model )
461+ : chalk . hex ( colors . primary ) ( model ) ;
462+ slots [ 'model' ] = [ renderedModel + chalk . hex ( colors . textDim ) ( thinkingLabel ) ] ;
439463 }
440464
441465 // Background-task badges. `bash-*` tasks (shell processes) and `agent-*`
0 commit comments