@@ -77,22 +77,14 @@ fn handle_key_event(state: &mut AppState, key: event::KeyEvent) -> io::Result<bo
7777
7878 match ( key. code , key. modifiers ) {
7979 ( KeyCode :: Char ( 'q' ) , _) => return Ok ( true ) ,
80- ( KeyCode :: Esc , _) if state. ui . has_execution_output ( ) => {
81- state. ui . clear_execution_output ( )
82- }
80+ ( KeyCode :: Esc , _) if state. ui . has_execution_output ( ) => state. ui . clear_execution_output ( ) ,
8381 ( KeyCode :: Char ( 'p' ) , KeyModifiers :: CONTROL ) => state. ui . palette . open ( ) ,
8482 ( KeyCode :: Char ( 'r' ) , KeyModifiers :: CONTROL ) => {
8583 refresh_project ( state) ?;
8684 }
87- ( KeyCode :: Char ( 'b' ) , KeyModifiers :: CONTROL ) => {
88- route_action ( state, "docker.build" )
89- }
90- ( KeyCode :: Char ( 'd' ) , KeyModifiers :: CONTROL ) => {
91- route_action ( state, "kubernetes.deploy" )
92- }
93- ( KeyCode :: Char ( 'l' ) , KeyModifiers :: CONTROL ) => {
94- router:: route_to ( state, Screen :: Monitoring )
95- }
85+ ( KeyCode :: Char ( 'b' ) , KeyModifiers :: CONTROL ) => route_action ( state, "docker.build" ) ,
86+ ( KeyCode :: Char ( 'd' ) , KeyModifiers :: CONTROL ) => route_action ( state, "kubernetes.deploy" ) ,
87+ ( KeyCode :: Char ( 'l' ) , KeyModifiers :: CONTROL ) => router:: route_to ( state, Screen :: Monitoring ) ,
9688 ( KeyCode :: Char ( 't' ) , _) => cycle_theme ( state) ,
9789 ( KeyCode :: Tab , _) | ( KeyCode :: BackTab , _) => {
9890 state. ui . toggle_focus ( ) ;
@@ -155,7 +147,15 @@ fn handle_enter_key(state: &mut AppState) {
155147 . ui
156148 . screen_actions ( & state. actions , state. current_screen )
157149 . iter ( )
158- . map ( |a| ( a. id . clone ( ) , a. screen , a. label . clone ( ) , a. enabled , a. reason . clone ( ) ) )
150+ . map ( |a| {
151+ (
152+ a. id . clone ( ) ,
153+ a. screen ,
154+ a. label . clone ( ) ,
155+ a. enabled ,
156+ a. reason . clone ( ) ,
157+ )
158+ } )
159159 . collect ( ) ;
160160 if let Some ( ( id, screen, label, enabled, reason) ) =
161161 screen_actions. get ( state. ui . selected_action ) . cloned ( )
@@ -529,7 +529,11 @@ fn render_deployments(frame: &mut Frame, area: Rect, state: &AppState, palette:
529529 let plan = deploy:: pipeline:: plan ( & state. capabilities , & state. runtime ) ;
530530 let layout = Layout :: default ( )
531531 . direction ( Direction :: Vertical )
532- . constraints ( [ Constraint :: Length ( 5 ) , Constraint :: Min ( 5 ) , Constraint :: Length ( 8 ) ] )
532+ . constraints ( [
533+ Constraint :: Length ( 5 ) ,
534+ Constraint :: Min ( 5 ) ,
535+ Constraint :: Length ( 8 ) ,
536+ ] )
533537 . split ( area) ;
534538 let ready = plan. ready ( ) ;
535539
@@ -640,7 +644,12 @@ fn render_action_list(
640644 if screen_actions. is_empty ( ) {
641645 render_empty_actions ( frame, area, is_focused, palette) ;
642646 } else {
643- let items = build_action_list_items ( & screen_actions, is_focused, state. ui . selected_action , palette) ;
647+ let items = build_action_list_items (
648+ & screen_actions,
649+ is_focused,
650+ state. ui . selected_action ,
651+ palette,
652+ ) ;
644653 render_active_actions ( frame, area, items, is_focused, palette) ;
645654 }
646655}
@@ -652,15 +661,17 @@ fn render_empty_actions(frame: &mut Frame, area: Rect, is_focused: bool, palette
652661 Style :: default ( ) . fg ( palette. muted )
653662 } ;
654663 frame. render_widget (
655- Paragraph :: new ( "No actions available for this screen.\n \n Use Ctrl+P to open the command palette." )
656- . wrap ( Wrap { trim : false } )
657- . block (
658- Block :: default ( )
659- . title ( " Actions " )
660- . borders ( Borders :: ALL )
661- . border_style ( border_style) ,
662- )
663- . style ( Style :: default ( ) . fg ( palette. muted ) ) ,
664+ Paragraph :: new (
665+ "No actions available for this screen.\n \n Use Ctrl+P to open the command palette." ,
666+ )
667+ . wrap ( Wrap { trim : false } )
668+ . block (
669+ Block :: default ( )
670+ . title ( " Actions " )
671+ . borders ( Borders :: ALL )
672+ . border_style ( border_style) ,
673+ )
674+ . style ( Style :: default ( ) . fg ( palette. muted ) ) ,
664675 area,
665676 ) ;
666677}
@@ -688,7 +699,11 @@ fn build_action_list_items(
688699 Style :: default ( ) . fg ( palette. text )
689700 } ;
690701
691- let suffix = if !action. enabled { " (unavailable)" } else { "" } ;
702+ let suffix = if !action. enabled {
703+ " (unavailable)"
704+ } else {
705+ ""
706+ } ;
692707
693708 ListItem :: new ( Line :: from ( format ! ( "{marker}{}{suffix}" , action. label) ) ) . style ( style)
694709 } )
@@ -724,8 +739,6 @@ fn render_active_actions(
724739 ) ;
725740}
726741
727-
728-
729742fn render_command_palette (
730743 frame : & mut Frame ,
731744 area : Rect ,
@@ -927,7 +940,6 @@ fn refresh_project(state: &mut AppState) -> io::Result<()> {
927940 Ok ( ( ) )
928941}
929942
930-
931943fn cycle_theme ( state : & mut AppState ) {
932944 state. ui . active_theme = state. ui . active_theme . next ( ) ;
933945 let theme_str = state
@@ -980,7 +992,6 @@ fn availability(value: bool) -> &'static str {
980992 }
981993}
982994
983-
984995fn render_short_list ( values : & [ String ] ) -> String {
985996 if values. is_empty ( ) {
986997 "- No immediate next steps" . to_string ( )
0 commit comments