commit 2b84ee1f93f385ce07927e208557a5384af64dd6
parent af52bf0b68e49e4ab6a8e4d9549aa6d31d7bcc74
Author: William Casarin <jb55@jb55.com>
Date: Thu, 19 Feb 2026 11:47:13 -0800
dave: use auto_shrink for markdown table column sizing
Use auto_shrink(false) so the table fills its container while
columns auto-size to fit their content, replacing the even
distribution approach.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/crates/notedeck_dave/src/ui/markdown_ui.rs b/crates/notedeck_dave/src/ui/markdown_ui.rs
@@ -500,12 +500,12 @@ fn render_table(headers: &[Span], rows: &[Vec<Span>], theme: &MdTheme, buffer: &
// Use first header's byte offset as id_salt so multiple tables don't clash
let salt = headers.first().map_or(0, |h| h.start);
- let available_width = ui.available_width();
- let min_col_width = (available_width / num_cols as f32).max(40.0);
-
- let mut builder = TableBuilder::new(ui).id_salt(salt).vscroll(false);
+ let mut builder = TableBuilder::new(ui)
+ .id_salt(salt)
+ .vscroll(false)
+ .auto_shrink([false, false]);
for _ in 0..num_cols {
- builder = builder.column(Column::auto().at_least(min_col_width).resizable(true));
+ builder = builder.column(Column::auto().resizable(true));
}
let header_bg = theme.code_bg;