@@ -28,8 +28,10 @@ pub fn draw(frame: &mut Frame, app: &mut App) {
2828 let complete = summary. done > 0 && !app. in_flight ( ) ;
2929
3030 let advisory = ttl_advisory ( app, & summary, complete) ;
31+ // The header grows one row for the ECS line, only when --ecs/config set
32+ // subnets up — an ECS-less run renders exactly as before.
3133 let [ header, body, footer] = Layout :: vertical ( [
32- Constraint :: Length ( 4 ) ,
34+ Constraint :: Length ( if app . ecs_list . is_empty ( ) { 4 } else { 5 } ) ,
3335 Constraint :: Min ( 6 ) ,
3436 Constraint :: Length ( if advisory. is_some ( ) { 3 } else { 2 } ) ,
3537 ] )
@@ -132,36 +134,36 @@ fn draw_header(frame: &mut Frame, app: &App, area: Rect) {
132134 } ) ;
133135 types. push ( Span :: raw ( " " ) ) ;
134136 }
135- // Active client subnet, only when --ecs/config set one up — an ECS-less
136- // run renders exactly as before.
137+ let mut lines = vec ! [ input, Line :: from( types) ] ;
138+ // Active client subnet on its own line, only when --ecs/config set one
139+ // up — an ECS-less run renders exactly as before (the header layout in
140+ // `draw` reserves the extra row on the same condition).
137141 if !app. ecs_list . is_empty ( ) {
138- types . push ( Span :: styled ( "· ECS: " , th. muted . style ( ) ) ) ;
142+ let mut ecs = vec ! [ Span :: styled( " ECS: " , th. muted. style( ) ) ] ;
139143 match app. ecs_sel {
140144 Some ( i) => {
141- types . push ( Span :: styled (
145+ ecs . push ( Span :: styled (
142146 format ! ( " {} " , crate :: dns:: fmt_ecs( & app. ecs_list[ i] ) ) ,
143147 Style :: new ( ) . fg ( Color :: Black ) . bg ( th. accent ) . bold ( ) ,
144148 ) ) ;
145149 if app. ecs_list . len ( ) > 1 {
146- types . push ( Span :: styled (
150+ ecs . push ( Span :: styled (
147151 format ! ( " {}/{}" , i + 1 , app. ecs_list. len( ) ) ,
148152 th. muted . style ( ) ,
149153 ) ) ;
150154 }
151155 }
152- None => types . push ( Span :: styled ( " off " , th. muted . style ( ) ) ) ,
156+ None => ecs . push ( Span :: styled ( " off " , th. muted . style ( ) ) ) ,
153157 }
158+ lines. push ( Line :: from ( ecs) ) ;
154159 }
155160
156161 let block = Block :: default ( )
157162 . borders ( Borders :: ALL )
158163 . border_style ( Style :: new ( ) . fg ( th. accent ) )
159164 . title ( " 🌍 DNS Propagation Checker " )
160165 . title_style ( Style :: new ( ) . bold ( ) ) ;
161- frame. render_widget (
162- Paragraph :: new ( vec ! [ input, Line :: from( types) ] ) . block ( block) ,
163- area,
164- ) ;
166+ frame. render_widget ( Paragraph :: new ( lines) . block ( block) , area) ;
165167}
166168
167169fn draw_gauge ( frame : & mut Frame , app : & App , summary : & Summary , area : Rect ) {
0 commit comments