Skip to content

Commit 2b84ee1

Browse files
jb55claude
andcommitted
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>
1 parent af52bf0 commit 2b84ee1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/notedeck_dave/src/ui/markdown_ui.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,12 @@ fn render_table(headers: &[Span], rows: &[Vec<Span>], theme: &MdTheme, buffer: &
500500

501501
// Use first header's byte offset as id_salt so multiple tables don't clash
502502
let salt = headers.first().map_or(0, |h| h.start);
503-
let available_width = ui.available_width();
504-
let min_col_width = (available_width / num_cols as f32).max(40.0);
505-
506-
let mut builder = TableBuilder::new(ui).id_salt(salt).vscroll(false);
503+
let mut builder = TableBuilder::new(ui)
504+
.id_salt(salt)
505+
.vscroll(false)
506+
.auto_shrink([false, false]);
507507
for _ in 0..num_cols {
508-
builder = builder.column(Column::auto().at_least(min_col_width).resizable(true));
508+
builder = builder.column(Column::auto().resizable(true));
509509
}
510510

511511
let header_bg = theme.code_bg;

0 commit comments

Comments
 (0)