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
16 changes: 14 additions & 2 deletions codex-rs/tui/src/history_cell/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,27 @@ impl HistoryCell for StreamingAgentTailCell {
fn display_hyperlink_lines(&self, _width: u16) -> Vec<HyperlinkLine> {
// Tail lines are already rendered at the controller's current stream width.
// Re-wrapping them here can split table borders and produce malformed in-flight rows.
prefix_hyperlink_lines(
let mut lines = prefix_hyperlink_lines(
self.lines.clone(),
if self.is_first_line {
"• ".dim()
} else {
" ".into()
},
" ".into(),
)
);
for line in &mut lines {
if line
.line
.spans
.iter()
.all(|span| span.content.chars().all(char::is_whitespace))
{
line.line = Line::default().style(line.line.style);
line.hyperlinks.clear();
}
}
lines
}

fn transcript_hyperlink_lines(&self, width: u16) -> Vec<HyperlinkLine> {
Expand Down
18 changes: 18 additions & 0 deletions codex-rs/tui/src/history_cell/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@ fn test_cwd() -> PathBuf {
std::env::temp_dir()
}

#[test]
fn streaming_agent_tail_blank_line_uses_one_viewport_row() {
let cell = StreamingAgentTailCell::new(
vec![
HyperlinkLine::from("first"),
HyperlinkLine::from(""),
HyperlinkLine::from("second"),
],
/*is_first_line*/ false,
);

let lines = cell.display_lines(/*width*/ 80);
insta::assert_snapshot!(render_lines(&lines).join("\n"), @" first

second");
assert_eq!(cell.desired_height(/*width*/ 80), 3);
}

fn stdio_server_config(
command: &str,
args: Vec<&str>,
Expand Down
Loading