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
247 changes: 218 additions & 29 deletions codex-rs/tui/src/bottom_pane/chat_composer.rs

Large diffs are not rendered by default.

471 changes: 265 additions & 206 deletions codex-rs/tui/src/bottom_pane/footer.rs

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions codex-rs/tui/src/bottom_pane/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::path::PathBuf;
use crate::app_event_sender::AppEventSender;
use crate::tui::FrameRequester;
use bottom_pane_view::BottomPaneView;
use codex_core::protocol::TokenUsageInfo;
use codex_file_search::FileMatch;
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
Expand Down Expand Up @@ -378,13 +377,6 @@ impl BottomPane {
!self.is_task_running && self.view_stack.is_empty() && !self.composer.popup_active()
}

/// Update the *context-window remaining* indicator in the composer. This
/// is forwarded directly to the underlying `ChatComposer`.
pub(crate) fn set_token_usage(&mut self, token_info: Option<TokenUsageInfo>) {
self.composer.set_token_usage(token_info);
self.request_redraw();
}

pub(crate) fn show_view(&mut self, view: Box<dyn BottomPaneView>) {
self.push_view(view);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ expression: terminal.backend()
" "
" "
" "
" ⏎ send ⌃J newline ⌃T transcript ⌃C quit "
" ? for shortcuts "
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ expression: terminal.backend()
" "
" "
" "
" ⏎ send ⌃J newline ⌃T transcript ⌃C quit "
" ? for shortcuts "
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: tui/src/bottom_pane/chat_composer.rs
expression: terminal.backend()
---
" "
"› Ask Codex to do anything "
" "
" "
" "
" "
" "
" "
" ctrl + c again to interrupt "
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: tui/src/bottom_pane/chat_composer.rs
expression: terminal.backend()
---
" "
"› Ask Codex to do anything "
" "
" "
" "
" "
" "
" "
" ctrl + c again to quit "
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: tui/src/bottom_pane/chat_composer.rs
expression: terminal.backend()
---
" "
"› Ask Codex to do anything "
" "
" "
" "
" "
" "
" "
" esc esc to edit previous message "
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: tui/src/bottom_pane/chat_composer.rs
expression: terminal.backend()
---
" "
"› Ask Codex to do anything "
" "
" "
" "
" "
" "
" "
" esc again to edit previous message "
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: tui/src/bottom_pane/chat_composer.rs
expression: terminal.backend()
---
" "
"› Ask Codex to do anything "
" "
" "
" "
" "
" "
" "
" esc esc to edit previous message "
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: tui/src/bottom_pane/chat_composer.rs
expression: terminal.backend()
---
" "
"› Ask Codex to do anything "
" "
" "
" "
" "
" "
" "
" esc again to edit previous message "
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
source: tui/src/bottom_pane/chat_composer.rs
expression: terminal.backend()
---
" "
"› Ask Codex to do anything "
" "
" "
" "
" "
" "
" "
" / for commands shift + enter for newline shift + tab to change mode "
" @ for file paths ctrl + v to paste images esc again to edit previous message "
" ctrl + c to exit ctrl + t to view transcript "
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ expression: terminal.backend()
" "
" "
" "
" ⏎ send ⌃J newline ⌃T transcript ⌃C quit "
" ? for shortcuts "
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ expression: terminal.backend()
" "
" "
" "
" ⏎ send ⌃J newline ⌃T transcript ⌃C quit "
" ? for shortcuts "
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ expression: terminal.backend()
" "
" "
" "
" ⏎ send ⌃J newline ⌃T transcript ⌃C quit "
" ? for shortcuts "
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
source: tui/src/bottom_pane/footer.rs
expression: terminal.backend()
---
" ⌃C again to quit "
" "
" "
" ctrl + c again to quit "
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
source: tui/src/bottom_pane/footer.rs
expression: terminal.backend()
---
" ⌃C again to interrupt "
" "
" "
" ctrl + c again to interrupt "
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
source: tui/src/bottom_pane/footer.rs
expression: terminal.backend()
---
" esc esc to edit previous message "
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
source: tui/src/bottom_pane/footer.rs
expression: terminal.backend()
---
" esc again to edit previous message "
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
source: tui/src/bottom_pane/footer.rs
expression: terminal.backend()
---
"⏎ send ⌃J newline ⌃T transcript ⌃C quit "
" "
" "
"? for shortcuts "
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
source: tui/src/bottom_pane/footer.rs
expression: terminal.backend()
---
"⏎ send ⇧⏎ newline ⌃T transcript ⌃C quit Esc edit prev 4.20K tokens use"
" "
" "
" / for commands shift + enter for newline shift + tab to change m"
" @ for file paths ctrl + v to paste images esc again to edit previ"
" ctrl + c to exit ctrl + t to view transcript "
2 changes: 0 additions & 2 deletions codex-rs/tui/src/chatwidget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ impl ChatWidget {

pub(crate) fn set_token_info(&mut self, info: Option<TokenUsageInfo>) {
if info.is_some() {
self.bottom_pane.set_token_usage(info.clone());
self.token_info = info;
}
}
Expand Down Expand Up @@ -1975,7 +1974,6 @@ impl ChatWidget {

pub(crate) fn clear_token_usage(&mut self) {
self.token_info = None;
self.bottom_pane.set_token_usage(None);
}

pub fn cursor_pos(&self, area: Rect) -> Option<(u16, u16)> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ expression: term.backend().vt100().screen().contents()

Summarize recent commits

sendJ newlineT transcriptC quit

? for shortcuts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ expression: terminal.backend()
" "
"› Ask Codex to do anything "
" "
" ⏎ send ⌃J newline ⌃T transcript ⌃C quit "
" "
" ? for shortcuts "
" "
26 changes: 0 additions & 26 deletions codex-rs/tui/src/key_hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@ const ALT_PREFIX: &str = "⌥";
#[cfg(all(not(test), not(target_os = "macos")))]
const ALT_PREFIX: &str = "Alt+";

#[cfg(test)]
const CTRL_PREFIX: &str = "⌃";
#[cfg(all(not(test), target_os = "macos"))]
const CTRL_PREFIX: &str = "⌃";
#[cfg(all(not(test), not(target_os = "macos")))]
const CTRL_PREFIX: &str = "Ctrl+";

#[cfg(test)]
const SHIFT_PREFIX: &str = "⇧";
#[cfg(all(not(test), target_os = "macos"))]
const SHIFT_PREFIX: &str = "⇧";
#[cfg(all(not(test), not(target_os = "macos")))]
const SHIFT_PREFIX: &str = "Shift+";

fn key_hint_style() -> Style {
Style::default().bold()
}
Expand All @@ -32,18 +18,6 @@ fn modifier_span(prefix: &str, key: impl Display) -> Span<'static> {
Span::styled(format!("{prefix}{key}"), key_hint_style())
}

pub(crate) fn ctrl(key: impl Display) -> Span<'static> {
modifier_span(CTRL_PREFIX, key)
}

pub(crate) fn alt(key: impl Display) -> Span<'static> {
modifier_span(ALT_PREFIX, key)
}

pub(crate) fn shift(key: impl Display) -> Span<'static> {
modifier_span(SHIFT_PREFIX, key)
}

pub(crate) fn plain(key: impl Display) -> Span<'static> {
Span::styled(format!("{key}"), key_hint_style())
}
Loading