Repository navigation
feat(tui): tui table --column-sizes sets column widths - #19560
Conversation
There was a problem hiding this comment.
Review overview
🟡 Changes recommended
--column-sizes does what #19503 asked for. [10 1fr] gives the issue's layout, --multi keeps its checkbox column, and tables without the flag render as before. One real problem remains. On a wide table, a missing entry hangs the render.
Findings: 1
Open (3)
Notes from my clanker, checked on e9b62b0. Built the branch (debug) and ran cargo fmt --all --check and cargo test -p nu-tui (83 unit + 80 integration passed). Clippy and typos come from CI, which is green. Ran each case on the branch binary and on 0.117.1. For the hang, I also timed ratatui 0.30.2's Layout::split on its own in a release build, and built and reverted a trial of the fix in the first thread.
e9b62b0 to
43ca5f7
Compare
|
Thanks for the review! As you noticed (#19566) the first identified issue affected I investigated the original freeze through Nushell → Ratatui → Kasuari. I tested the proposed solver fix in Kasuari #24 (ratatui/kasuari#24). It resolved the 40-column/child reproductions, but some larger cases still timed out or returned an unbounded-objective error. Given the workaround now adopted in #19566, this PR reuses that mechanism:
|
|
Thanks |



Description
tui tablegives every shown column an equal share of its width, so short columns waste space and long ones get truncated (#19503).This PR adds
--column-sizes, which takes one width per shown column, in the same forms astui split --sizes. Without the flag, columns keep their equal shares, so existing tables render as before.User-facing changes (Release notes)
Set column widths in
tui tablewith--column-sizestui tablenow accepts--column-sizes, with one width per shown column, using the same sizes astui split --sizes. Columns without an entry share the remaining space. Without the flag, columns still share the width equally.[{time: '12:34:56', entry: 'A very long entry that does not fit the screen.'}] | tui table --column-sizes [10 1fr] | tui run ls | tui table --columns [name type size] --column-sizes ["40%" 8 1fr] | tui runAdditional notes
closes #19503