Skip to content

Commit db8d483

Browse files
authored
fix(tui): off-by-one in table constraints for stats table (#2163)
1 parent eef6402 commit db8d483

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vortex-tui/src/browse/ui/layouts.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ fn render_array(app: &AppState, area: Rect, buf: &mut Buffer, is_stats_table: bo
128128
if is_stats_table {
129129
// Render the stats table horizontally
130130
let struct_array = array.as_struct_array().vortex_expect("stats table");
131-
let field_count = struct_array.nfields();
131+
// add 1 for the chunk column
132+
let field_count = struct_array.nfields() + 1;
132133
let header = std::iter::once("chunk")
133134
.chain(struct_array.names().iter().map(|x| x.as_ref()))
134135
.map(Cell::from)
@@ -158,7 +159,7 @@ fn render_array(app: &AppState, area: Rect, buf: &mut Buffer, is_stats_table: bo
158159
});
159160

160161
Widget::render(
161-
Table::new(rows, (0..field_count).map(|_| Constraint::Length(6))).header(header),
162+
Table::new(rows, (0..field_count).map(|_| Constraint::Min(6))).header(header),
162163
widget_area,
163164
buf,
164165
);

0 commit comments

Comments
 (0)