From bc60690d753438ce1ff621f3fc3d0aeb793f7231 Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Sun, 22 Feb 2026 16:52:21 -0300 Subject: [PATCH] fix(tui): prevent link columns from collapsing in markdown tables Adjust table column classification in `markdown_render.rs` so token-heavy, low-word-density columns are treated as Structured instead of Narrative. This keeps URL-heavy link columns from being first in the shrink order, reducing rare but severe narrow-column wrapping in rendered tables. --- codex-rs/tui/src/markdown_render.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codex-rs/tui/src/markdown_render.rs b/codex-rs/tui/src/markdown_render.rs index 316d9ba6f1..ba8c047306 100644 --- a/codex-rs/tui/src/markdown_render.rs +++ b/codex-rs/tui/src/markdown_render.rs @@ -1161,7 +1161,11 @@ where } else { total_cell_width as f64 / total_cells as f64 }; - let kind = if avg_words_per_cell >= 4.0 || avg_cell_width >= 28.0 { + let kind = if body_token_width >= 20 && avg_words_per_cell <= 2.0 { + // URL-like/token-heavy columns should resist collapse even if their + // average cell width is high. + TableColumnKind::Structured + } else if avg_words_per_cell >= 4.0 || avg_cell_width >= 28.0 { TableColumnKind::Narrative } else { TableColumnKind::Structured