╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │890 │ │891 var text_box = try wgt.TextBox(ui.Widget).init(allocator, data.content, .{ .border_style = .hidden, .wrap_kind = .none }); │ │892 errdefer text_box.deinit(allocator); │ │893 - try box.children.put(allocator, text_box.getFocus().id, .{ .widget = .{ .text_box = text_box }, .rect = null, .min_size = null, .shrink = true }); │ │893 + try box.children.put(allocator, text_box.getFocus().id, .{ .widget = .{ .text_box = text_box }, .rect = null, .min_size = null, .flex = .shrink });│ │894 │ │895 return .{ .box = box, .data = data }; │ │896 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │43 } │ │44 │ │45 pub const View = struct { │ │46 - box: wgt.Box(ui.Widget), │ │46 + scroll: wgt.Scroll(ui.Widget), │ │47 data: *const Self, │ │48 tab_ids: std.AutoArrayHashMapUnmanaged(usize, void),│ │49 │ ╰────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │72 .widget = .{ .text_box = text_box },│ │73 .rect = null, │ │74 .min_size = null, │ │75 - .shrink = true, │ │75 + .flex = .shrink, │ │76 }); │ │77 } │ │78 │ ╰────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────╮ │93 .widget = .{ .title = title_view },│ │94 .rect = null, │ │95 .min_size = null, │ │96 - .shrink = true, │ │96 + .flex = .shrink, │ │97 }); │ │98 } │ │99 │ ╰───────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────╮ │246 .widget = .{ .spacer = spacer },│ │247 .rect = null, │ │248 .min_size = null, │ │249 + .flex = .grow, │ │250 }); │ │251 } │ │252 │ ╰─────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │297 }); │ │298 } │ │299 │ │299 - var self = View{ .box = box, .data = data, .tab_ids = tab_ids }; │ │300 + var self = View{ │ │301 + .scroll = try wgt.Scroll(ui.Widget).init(allocator, .{ .box = box }, .{ .direction = .horiz, .show_bar = false, .web_native = !session.is_terminal }),│ │302 + .data = data, │ │303 + .tab_ids = tab_ids, │ │304 + }; │ │305 self.getFocus().child_id = selected_tab orelse self.tab_ids.keys()[0]; │ │306 return self; │ │307 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │308 │ │309 pub fn deinit(self: *View, allocator: std.mem.Allocator) void {│ │305 - self.box.deinit(allocator); │ │310 + self.scroll.deinit(allocator); │ │311 self.tab_ids.deinit(allocator); │ │312 } │ │313 │ ╰────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │314 pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │315 self.clearGrid(); │ │316 // only the selected tab shows its border │ │312 - for (self.box.children.keys(), self.box.children.values()) |id, *child| { │ │317 + const box = &self.scroll.child.box; │ │318 + for (box.children.keys(), box.children.values()) |id, *child| { │ │319 const tb: ?*wgt.TextBox(ui.Widget) = switch (child.widget) { │ │320 .text_box => |*x| x, │ │321 .auth_tab => |*at| blk: { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │329 t.options.border_style = if (self.getFocus().child_id == id) .single else .hidden; │ │330 } │ │331 } │ │326 - try self.box.build(allocator, constraint, root_focus); │ │332 + var scroll_constraint = constraint; │ │333 + scroll_constraint.min_size.width = constraint.max_size.width orelse constraint.min_size.width;│ │334 + try self.scroll.build(allocator, scroll_constraint, root_focus); │ │335 } │ │336 │ │337 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │338 _ = allocator; │ │339 const current_tab = self.currentTabIndex() orelse return; │ │340 if (inp.moveTab(key, current_tab, self.tab_ids.count())) |new_tab| { │ │333 - root_focus.setFocus(self.tab_ids.keys()[new_tab]); │ │341 + const tab_id = self.tab_ids.keys()[new_tab]; │ │342 + root_focus.setFocus(tab_id); │ │343 + const tab = self.scroll.child.box.children.get(tab_id) orelse return;│ │344 + if (tab.rect) |rect| self.scroll.scrollToRect(rect); │ │345 } │ │346 } │ │347 │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯