@@ -24,6 +24,7 @@ pub fn render_resource_list(
2424 selected_resource_type : & Option < String > ,
2525 resource_objects : & Arc < RwLock < HashMap < String , serde_json:: Value > > > ,
2626 theme : & Theme ,
27+ no_icons : bool ,
2728) {
2829 let visible_height = ( area. height as usize ) . saturating_sub ( 2 ) ;
2930
@@ -109,7 +110,7 @@ pub fn render_resource_list(
109110
110111 // Status indicator
111112 let ( status_indicator, status_color) =
112- get_status_indicator ( r. ready , r. suspended , theme) ;
113+ get_status_indicator ( r. ready , r. suspended , theme, no_icons ) ;
113114
114115 let message = r. message . as_deref ( ) . unwrap_or ( "-" ) ;
115116 let message_display = if message. len ( ) > 40 {
@@ -131,14 +132,15 @@ pub fn render_resource_list(
131132 } )
132133 . collect ( ) ;
133134
135+ let status_width = if no_icons { 6 } else { 3 } ; // "PAUSED" vs "●"
134136 let constraints: Vec < Constraint > = vec ! [
135- Constraint :: Length ( 3 ) , // STATUS
136- Constraint :: Min ( 15 ) , // NAMESPACE
137- Constraint :: Min ( 30 ) , // NAME
138- Constraint :: Min ( 20 ) , // TYPE
139- Constraint :: Length ( 10 ) , // SUSPENDED
140- Constraint :: Length ( 6 ) , // READY
141- Constraint :: Percentage ( 40 ) , // MESSAGE
137+ Constraint :: Length ( status_width ) , // STATUS
138+ Constraint :: Min ( 15 ) , // NAMESPACE
139+ Constraint :: Min ( 30 ) , // NAME
140+ Constraint :: Min ( 20 ) , // TYPE
141+ Constraint :: Length ( 10 ) , // SUSPENDED
142+ Constraint :: Length ( 6 ) , // READY
143+ Constraint :: Percentage ( 40 ) , // MESSAGE
142144 ] ;
143145
144146 ( rows, header, constraints)
@@ -168,7 +170,7 @@ pub fn render_resource_list(
168170 } ;
169171
170172 let ( status_indicator, status_color) =
171- get_status_indicator ( r. ready , r. suspended , theme) ;
173+ get_status_indicator ( r. ready , r. suspended , theme, no_icons ) ;
172174
173175 // Get resource-specific fields from stored object
174176 let key = crate :: watcher:: resource_key ( & r. namespace , & r. name , & r. resource_type ) ;
@@ -233,7 +235,7 @@ pub fn render_resource_list(
233235 let constraints: Vec < Constraint > = column_names
234236 . iter ( )
235237 . map ( |col| match * col {
236- "STATUS" => Constraint :: Length ( 3 ) ,
238+ "STATUS" => Constraint :: Length ( if no_icons { 6 } else { 3 } ) ,
237239 "NAMESPACE" => Constraint :: Min ( 15 ) ,
238240 "NAME" => Constraint :: Min ( 30 ) ,
239241 "TYPE" => Constraint :: Min ( 20 ) ,
@@ -268,12 +270,25 @@ fn get_status_indicator(
268270 ready : Option < bool > ,
269271 suspended : Option < bool > ,
270272 theme : & Theme ,
273+ no_icons : bool ,
271274) -> ( & ' static str , Color ) {
272- match ( ready, suspended) {
273- ( Some ( true ) , Some ( false ) ) => ( "●" , theme. status_ready ) ,
274- ( Some ( true ) , Some ( true ) ) => ( "⏸" , theme. status_suspended ) ,
275- ( Some ( false ) , _) => ( "✗" , theme. status_error ) ,
276- ( None , Some ( true ) ) => ( "⏸" , theme. status_suspended ) ,
277- _ => ( "○" , theme. status_unknown ) ,
275+ if no_icons {
276+ // Use text alternatives when icons are disabled
277+ match ( ready, suspended) {
278+ ( Some ( true ) , Some ( false ) ) => ( "OK" , theme. status_ready ) ,
279+ ( Some ( true ) , Some ( true ) ) => ( "PAUSED" , theme. status_suspended ) ,
280+ ( Some ( false ) , _) => ( "ERR" , theme. status_error ) ,
281+ ( None , Some ( true ) ) => ( "PAUSED" , theme. status_suspended ) ,
282+ _ => ( "?" , theme. status_unknown ) ,
283+ }
284+ } else {
285+ // Use Unicode icons when enabled
286+ match ( ready, suspended) {
287+ ( Some ( true ) , Some ( false ) ) => ( "●" , theme. status_ready ) ,
288+ ( Some ( true ) , Some ( true ) ) => ( "⏸" , theme. status_suspended ) ,
289+ ( Some ( false ) , _) => ( "✗" , theme. status_error ) ,
290+ ( None , Some ( true ) ) => ( "⏸" , theme. status_suspended ) ,
291+ _ => ( "○" , theme. status_unknown ) ,
292+ }
278293 }
279294}
0 commit comments