Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Add spacing before queued status indicator messages (#3474)

Ahmed Ibrahime9327222927a
diff --git a/codex-rs/tui/src/snapshots/codex_tui__status_indicator_widget__tests__renders_with_queued_messages.snap b/codex-rs/tui/src/snapshots/codex_tui__status_indicator_widget__tests__renders_with_queued_messages.snap
index 0290eb6976..7f2c267f21 100644
--- a/codex-rs/tui/src/snapshots/codex_tui__status_indicator_widget__tests__renders_with_queued_messages.snap
+++ b/codex-rs/tui/src/snapshots/codex_tui__status_indicator_widget__tests__renders_with_queued_messages.snap
@@ -3,10 +3,10 @@ source: tui/src/status_indicator_widget.rs
expression: terminal.backend()
---
" Working (0s • Esc to interrupt) "
+" "
" ↳ first "
" ↳ second "
" ⌥↑ edit "
" "
" "
" "
-" "
diff --git a/codex-rs/tui/src/status_indicator_widget.rs b/codex-rs/tui/src/status_indicator_widget.rs
index bf392b6997..e3a1b854db 100644
--- a/codex-rs/tui/src/status_indicator_widget.rs
+++ b/codex-rs/tui/src/status_indicator_widget.rs
@@ -63,10 +63,13 @@ impl StatusIndicatorWidget {
}
pub fn desired_height(&self, width: u16) -> u16 {
- // Status line + wrapped queued messages (up to 3 lines per message)
+ // Status line + optional blank line + wrapped queued messages (up to 3 lines per message)
// + optional ellipsis line per truncated message + 1 spacer line
let inner_width = width.max(1) as usize;
let mut total: u16 = 1; // status line
+ if !self.queued_messages.is_empty() {
+ total = total.saturating_add(1); // blank line between status and queued messages
+ }
let text_width = inner_width.saturating_sub(3); // account for " ↳ " prefix
if text_width > 0 {
for q in &self.queued_messages {
@@ -168,6 +171,9 @@ impl WidgetRef for StatusIndicatorWidget {
// Build lines: status, then queued messages, then spacer.
let mut lines: Vec<Line<'static>> = Vec::new();
lines.push(Line::from(spans));
+ if !self.queued_messages.is_empty() {
+ lines.push(Line::from(""));
+ }
// Wrap queued messages using textwrap and show up to the first 3 lines per message.
let text_width = area.width.saturating_sub(3); // " ↳ " prefix
for q in &self.queued_messages {