Skip to content

Commit bcf2bc0

Browse files
authored
fix(tui): make ? work again (#4362)
Revert #4330 #4316
1 parent 6876521 commit bcf2bc0

File tree

25 files changed

+290
-601
lines changed

25 files changed

+290
-601
lines changed

codex-rs/tui/src/bottom_pane/chat_composer.rs

Lines changed: 29 additions & 218 deletions
Large diffs are not rendered by default.

codex-rs/tui/src/bottom_pane/footer.rs

Lines changed: 206 additions & 265 deletions
Large diffs are not rendered by default.

codex-rs/tui/src/bottom_pane/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::path::PathBuf;
44
use crate::app_event_sender::AppEventSender;
55
use crate::tui::FrameRequester;
66
use bottom_pane_view::BottomPaneView;
7+
use codex_core::protocol::TokenUsageInfo;
78
use codex_file_search::FileMatch;
89
use crossterm::event::KeyCode;
910
use crossterm::event::KeyEvent;
@@ -376,6 +377,13 @@ impl BottomPane {
376377
!self.is_task_running && self.view_stack.is_empty() && !self.composer.popup_active()
377378
}
378379

380+
/// Update the *context-window remaining* indicator in the composer. This
381+
/// is forwarded directly to the underlying `ChatComposer`.
382+
pub(crate) fn set_token_usage(&mut self, token_info: Option<TokenUsageInfo>) {
383+
self.composer.set_token_usage(token_info);
384+
self.request_redraw();
385+
}
386+
379387
pub(crate) fn show_view(&mut self, view: Box<dyn BottomPaneView>) {
380388
self.push_view(view);
381389
}

codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__backspace_after_pastes.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ expression: terminal.backend()
1111
" "
1212
" "
1313
" "
14-
" ? for shortcuts "
14+
" ⏎ send ⌃J newline ⌃T transcript ⌃C quit "

codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__empty.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ expression: terminal.backend()
1111
" "
1212
" "
1313
" "
14-
" ? for shortcuts "
14+
" ⏎ send ⌃J newline ⌃T transcript ⌃C quit "

codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_interrupt.snap

Lines changed: 0 additions & 13 deletions
This file was deleted.

codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_quit.snap

Lines changed: 0 additions & 13 deletions
This file was deleted.

codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_then_esc_hint.snap

Lines changed: 0 additions & 13 deletions
This file was deleted.

codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_esc_hint_backtrack.snap

Lines changed: 0 additions & 13 deletions
This file was deleted.

codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_esc_hint_from_overlay.snap

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)