Merge 3d676c3032 into sapling-pr-archive-bolinfest

This commit is contained in:
Michael Bolin
2025-05-08 15:09:40 -07:00
committed by GitHub
23 changed files with 101 additions and 11 deletions
+3
View File
@@ -11,6 +11,9 @@ path = "src/main.rs"
name = "codex_tui"
path = "src/lib.rs"
[lints]
workspace = true
[dependencies]
anyhow = "1"
clap = { version = "4", features = ["derive"] }
+2 -2
View File
@@ -107,7 +107,7 @@ impl App<'_> {
pub(crate) fn run(&mut self, terminal: &mut tui::Tui) -> Result<()> {
// Insert an event to trigger the first render.
let app_event_tx = self.app_event_tx.clone();
app_event_tx.send(AppEvent::Redraw).unwrap();
app_event_tx.send(AppEvent::Redraw)?;
while let Ok(event) = self.app_event_rx.recv() {
match event {
@@ -128,7 +128,7 @@ impl App<'_> {
modifiers: crossterm::event::KeyModifiers::CONTROL,
..
} => {
self.app_event_tx.send(AppEvent::ExitRequest).unwrap();
self.app_event_tx.send(AppEvent::ExitRequest)?;
}
_ => {
self.dispatch_key_event(key_event);
@@ -385,9 +385,12 @@ impl WidgetRef for ConversationHistoryWidget {
// second time by the widget – which manifested as the entire block
// drifting off‑screen when the user attempted to scroll.
let paragraph = Paragraph::new(visible_lines)
.block(block)
.wrap(Wrap { trim: false });
// Currently, we do not use the `wrap` method on the `Paragraph` widget
// because it messes up our scrolling math above that assumes each Line
// contributes one line of height to the widget. Admittedly, this is
// bad because users cannot see content that is clipped without
// resizing the terminal.
let paragraph = Paragraph::new(visible_lines).block(block);
paragraph.render(area, buf);
let needs_scrollbar = num_lines > viewport_height;
-1
View File
@@ -2,7 +2,6 @@
// The standalone `codex-tui` binary prints a short help message before the
// alternate‑screen mode starts; that file opts‑out locally via `allow`.
#![deny(clippy::print_stdout, clippy::print_stderr)]
use app::App;
use codex_core::config::Config;
use codex_core::config::ConfigOverrides;