Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions codex-rs/tui/src/bottom_pane/chat_composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
61 changes: 61 additions & 0 deletions codex-rs/tui/src/bottom_pane/footer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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");
Comment thread
fcoury-oai marked this conversation as resolved.
}
}
ShortcutId::EditPrevious => {
if state.esc_backtrack_hint {
line.push_span(" again to edit previous message");
Expand All @@ -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)
Expand Down Expand Up @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -1589,13 +1611,32 @@ 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 {
mode: FooterMode::QuitShortcutReminder,
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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand Down Expand Up @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand Down Expand Up @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand All @@ -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')),
Expand Down Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
Original file line number Diff line number Diff line change
@@ -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 "
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
Original file line number Diff line number Diff line change
@@ -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 "
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
Loading