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.
This commit is contained in:
Felipe Coury
2026-04-06 13:45:49 -03:00
committed by Felipe Coury
parent 70bc4fc226
commit bc60690d75
+5 -1
View File
@@ -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