From 6343a292e8c6c261bbcdefeb40eed73c172ffc16 Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Sun, 22 Feb 2026 17:10:49 -0300 Subject: [PATCH] fix(tui): post-rebase fixups for upstream API changes - Use codex_protocol::protocol instead of codex_core::protocol (made private upstream) - Add missing word_wrap_lines import in history_cell tests - Update column classification test for URL-like token heuristic --- codex-rs/tui/src/history_cell.rs | 1 + codex-rs/tui/src/markdown_render.rs | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rs index eaebf9e044..132ad48354 100644 --- a/codex-rs/tui/src/history_cell.rs +++ b/codex-rs/tui/src/history_cell.rs @@ -2861,6 +2861,7 @@ fn format_mcp_invocation<'a>(invocation: McpInvocation) -> Line<'a> { #[cfg(test)] mod tests { use super::*; + use crate::wrapping::word_wrap_lines; use crate::exec_cell::CommandOutput; use crate::exec_cell::ExecCall; use crate::exec_cell::ExecCell; diff --git a/codex-rs/tui/src/markdown_render.rs b/codex-rs/tui/src/markdown_render.rs index ba8c047306..8a83f3a1c3 100644 --- a/codex-rs/tui/src/markdown_render.rs +++ b/codex-rs/tui/src/markdown_render.rs @@ -2160,8 +2160,9 @@ mod tests { } #[test] - fn column_classification_narrative_by_char_width() { - // Col with short word count but ≥28 avg char width → Narrative + fn column_classification_structured_by_url_like_token() { + // Col with short word count but ≥28 avg char width and long tokens → Structured + // (URL-like/token-heavy columns resist collapse) let header = vec![make_cell("URL")]; let rows = vec![ vec![make_cell("https://example.com/very/long/path")], @@ -2169,7 +2170,7 @@ mod tests { ]; let metrics = W::collect_table_column_metrics(&header, &rows, 1); assert!(metrics[0].avg_cell_width >= 28.0); - assert_eq!(metrics[0].kind, TableColumnKind::Narrative); + assert_eq!(metrics[0].kind, TableColumnKind::Structured); } #[test]