╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │365 const tabs_child = self.tabsChild(); │ │366 const tabs_box = &tabs_child.widget.box; │ │367 │ │368 - const viewport_width = constraint.max_size.width orelse constraint.min_size.width; │ │369 - // the outer box's hidden border occupies two columns │ │370 - const content_width = if (viewport_width) |width| width -| 2 else null; │ │371 - const wrap = if (content_width) |width| self.first_group_width >= width / 2 else false; │ │372 - box.options.direction = if (wrap) .vert else .horiz; │ │373 - tabs_child.min_size = if (wrap) .{ .width = content_width, .height = null } else null; │ │374 - │ │368 // only the selected tab shows its border │ │369 const selected_tab = if (box.getFocus().child_id == self.tabs_id) tabs_box.getFocus().child_id else null;│ │370 + var tabs_width: usize = 0; │ │371 for (tabs_box.children.keys(), tabs_box.children.values()) |id, *child| { │ │372 const tb: ?*wgt.TextBox(ui.Widget) = switch (child.widget) { │ │373 .text_box => |*x| x, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │381 if (tb) |t| { │ │382 t.options.border_style = if (selected_tab == id) .single else .hidden; │ │383 } │ │384 + tabs_width += if (child.min_size) |min_size| min_size.width orelse 0 else 0; │ │385 } │ │386 + │ │387 + const viewport_width = constraint.max_size.width orelse constraint.min_size.width; │ │388 + // the outer box's hidden border occupies two columns. keep the title │ │389 + // and tabs together if they fit; otherwise tab strip on its own row. │ │390 + const content_width = if (viewport_width) |width| width -| 2 else null; │ │391 + const wrap = if (content_width) |width| self.first_group_width + tabs_width > width else false;│ │392 + box.options.direction = if (wrap) .vert else .horiz; │ │393 + tabs_child.min_size = if (wrap) .{ .width = content_width, .height = null } else null; │ │394 + │ │395 var scroll_constraint = constraint; │ │396 scroll_constraint.min_size.width = viewport_width; │ │397 try self.scroll.build(allocator, scroll_constraint, root_focus); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯