diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index ec3284866d9..5a39b53aa94 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -3410,6 +3410,7 @@ impl ChatComposer { esc_backtrack_hint: self.footer.esc_backtrack_hint, use_shift_enter_hint: self.footer.use_shift_enter_hint, is_task_running: self.is_task_running, + queue_submissions: self.queue_submissions, quit_shortcut_key: self.footer.quit_shortcut_key, collaboration_modes_enabled: self.collaboration_modes_enabled, is_wsl, @@ -4691,6 +4692,16 @@ mod tests { }, ); + snapshot_composer_state( + "footer_mode_shortcut_overlay_queue_submissions", + /*enhanced_keys_supported*/ true, + |composer| { + composer.set_queue_submissions(/*queue_submissions*/ true); + let _ = composer + .handle_key_event(KeyEvent::new(KeyCode::Char('?'), KeyModifiers::NONE)); + }, + ); + snapshot_composer_state( "footer_mode_ctrl_c_quit", /*enhanced_keys_supported*/ true, diff --git a/codex-rs/tui/src/bottom_pane/footer.rs b/codex-rs/tui/src/bottom_pane/footer.rs index 8035881e8ea..e11534ac823 100644 --- a/codex-rs/tui/src/bottom_pane/footer.rs +++ b/codex-rs/tui/src/bottom_pane/footer.rs @@ -68,6 +68,7 @@ pub(crate) struct FooterProps { pub(crate) esc_backtrack_hint: bool, pub(crate) use_shift_enter_hint: bool, pub(crate) is_task_running: bool, + pub(crate) queue_submissions: bool, pub(crate) collaboration_modes_enabled: bool, pub(crate) is_wsl: bool, /// Which key the user must press again to quit. @@ -742,6 +743,8 @@ fn footer_from_props_lines( let state = ShortcutsState { use_shift_enter_hint: props.use_shift_enter_hint, esc_backtrack_hint: props.esc_backtrack_hint, + is_task_running: props.is_task_running, + queue_submissions: props.queue_submissions, is_wsl: props.is_wsl, collaboration_modes_enabled: props.collaboration_modes_enabled, key_hints, @@ -864,6 +867,8 @@ fn footer_hint_items_line(items: &[(String, String)]) -> Line<'static> { struct ShortcutsState { use_shift_enter_hint: bool, esc_backtrack_hint: bool, + is_task_running: bool, + queue_submissions: bool, is_wsl: bool, collaboration_modes_enabled: bool, key_hints: FooterKeyHints, @@ -1096,6 +1101,13 @@ impl ShortcutDescriptor { }?; let mut line = Line::from(vec![self.prefix.into(), key.into()]); match self.id { + ShortcutId::QueueMessageTab => { + if state.is_task_running || state.queue_submissions { + line.push_span(" to queue message"); + } else { + line.push_span(" to submit message"); + } + } ShortcutId::EditPrevious => { if state.esc_backtrack_hint { line.push_span(" again to edit previous message"); @@ -1107,6 +1119,13 @@ impl ShortcutDescriptor { ]); } } + ShortcutId::Quit => { + if state.is_task_running { + line.push_span(" to interrupt"); + } else { + line.push_span(" to exit"); + } + } _ => line.push_span(self.label), }; Some(line) @@ -1542,6 +1561,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1559,6 +1579,7 @@ mod tests { esc_backtrack_hint: true, use_shift_enter_hint: true, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1579,6 +1600,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: true, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1589,6 +1611,24 @@ mod tests { }, ); + snapshot_footer( + "footer_shortcuts_running", + FooterProps { + mode: FooterMode::ShortcutOverlay, + esc_backtrack_hint: false, + use_shift_enter_hint: false, + is_task_running: true, + queue_submissions: false, + collaboration_modes_enabled: false, + is_wsl: false, + quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), + status_line_value: None, + status_line_enabled: false, + key_hints: FooterKeyHints::default_bindings(), + active_agent_label: None, + }, + ); + snapshot_footer( "footer_ctrl_c_quit_idle", FooterProps { @@ -1596,6 +1636,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1613,6 +1654,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: true, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1630,6 +1672,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1647,6 +1690,7 @@ mod tests { esc_backtrack_hint: true, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1664,6 +1708,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: true, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1683,6 +1728,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1702,6 +1748,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: true, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1717,6 +1764,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: true, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1745,6 +1793,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: true, + queue_submissions: false, collaboration_modes_enabled: true, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1766,6 +1815,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1782,6 +1832,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: true, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1798,6 +1849,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1814,6 +1866,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: true, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1844,6 +1897,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: true, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1866,6 +1920,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1889,6 +1944,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: true, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1913,6 +1969,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1929,6 +1986,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: false, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -1948,6 +2006,7 @@ mod tests { esc_backtrack_hint: false, use_shift_enter_hint: false, is_task_running: false, + queue_submissions: false, collaboration_modes_enabled: true, is_wsl: false, quit_shortcut_key: key_hint::ctrl(KeyCode::Char('c')), @@ -2009,6 +2068,8 @@ mod tests { .binding_for(ShortcutsState { use_shift_enter_hint: false, esc_backtrack_hint: false, + is_task_running: false, + queue_submissions: false, is_wsl, collaboration_modes_enabled: false, key_hints: FooterKeyHints::default_bindings(), diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay.snap index b5508114fed..5239a34bd24 100644 --- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay.snap +++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay.snap @@ -11,7 +11,7 @@ expression: terminal.backend() " " " " " / for commands ! for shell commands " -" shift + enter for newline tab to queue message " +" shift + enter for newline tab to submit message " " @ for file paths ctrl + v to paste images " " ctrl + g to edit in external editor esc again to edit previous message " " ctrl + r search history ctrl + c to exit " diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay_queue_submissions.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay_queue_submissions.snap new file mode 100644 index 00000000000..582724eea7d --- /dev/null +++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay_queue_submissions.snap @@ -0,0 +1,21 @@ +--- +source: tui/src/bottom_pane/chat_composer.rs +expression: terminal.backend() +--- +" " +"› Ask Codex to do anything " +" " +" " +" " +" " +" " +" " +" / for commands ! for shell commands " +" shift + enter for newline tab to queue message " +" @ for file paths ctrl + v to paste images " +" ctrl + g to edit in external editor esc esc to edit previous message " +" ctrl + r search history ctrl + c to exit " +" ⌥ + , reasoning down ⌥ + . reasoning up " +" ctrl + t to view transcript " +" " +" customize shortcuts with /keymap " diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_collaboration_modes_enabled.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_collaboration_modes_enabled.snap index dc2f8960961..3b67a90683e 100644 --- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_collaboration_modes_enabled.snap +++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_collaboration_modes_enabled.snap @@ -3,7 +3,7 @@ source: tui/src/bottom_pane/footer.rs expression: terminal.backend() --- " / for commands ! for shell commands " -" ctrl + j for newline tab to queue message " +" ctrl + j for newline tab to submit message " " @ for file paths ctrl + v to paste images " " ctrl + g to edit in external editor esc esc to edit previous message " " ctrl + r search history ctrl + c to exit " diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_running.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_running.snap new file mode 100644 index 00000000000..7c733bd13b0 --- /dev/null +++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_running.snap @@ -0,0 +1,13 @@ +--- +source: tui/src/bottom_pane/footer.rs +expression: terminal.backend() +--- +" / for commands ! for shell commands " +" ctrl + j for newline tab to queue message " +" @ for file paths ctrl + v to paste images " +" ctrl + g to edit in external editor esc esc to edit previous message " +" ctrl + r search history ctrl + c to interrupt " +" ⌥ + , reasoning down ⌥ + . reasoning up " +" ctrl + t to view transcript " +" " +" customize shortcuts with /keymap " diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_shift_and_esc.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_shift_and_esc.snap index 52c26826e93..07e97062835 100644 --- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_shift_and_esc.snap +++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_shift_and_esc.snap @@ -3,7 +3,7 @@ source: tui/src/bottom_pane/footer.rs expression: terminal.backend() --- " / for commands ! for shell commands " -" shift + enter for newline tab to queue message " +" shift + enter for newline tab to submit message " " @ for file paths ctrl + v to paste images " " ctrl + g to edit in external editor esc again to edit previous message " " ctrl + r search history ctrl + c to exit "