╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │188 t.options.border_style = if (self.getFocus().child_id == id) .single else .hidden; │ │189 } │ │190 } │ │185 - try self.box.build(allocator, constraint, root_focus); │ │191 + var scroll_constraint = constraint; │ │192 + scroll_constraint.min_size.width = constraint.max_size.width orelse constraint.min_size.width;│ │193 + try self.scroll.build(allocator, scroll_constraint, root_focus); │ │194 } │ │195 │ │196 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │197 _ = allocator; │ │198 const current_tab = self.currentTabIndex() orelse return; │ │199 if (inp.moveTab(key, current_tab, self.tab_ids.count())) |new_tab| { │ │192 - root_focus.setFocus(self.tab_ids.keys()[new_tab]); │ │200 + const tab_id = self.tab_ids.keys()[new_tab]; │ │201 + root_focus.setFocus(tab_id); │ │202 + const tab = self.scroll.child.box.children.get(tab_id) orelse return;│ │203 + if (tab.rect) |rect| self.scroll.scrollToRect(rect); │ │204 } │ │205 } │ │206 │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────╮ │207 pub fn clearGrid(self: *View) void {│ │197 - self.box.clearGrid(); │ │208 + self.scroll.clearGrid(); │ │209 } │ │210 │ │211 pub fn getGrid(self: View) ?Grid { │ ╰─────────────────────────────────────────────╯ ╭──────────────────────────────────────────────╮ │201 - return self.box.getGrid(); │ │212 + return self.scroll.getGrid(); │ │213 } │ │214 │ │215 pub fn getFocus(self: *View) *Focus {│ ╰──────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────╮ │205 - return self.box.getFocus(); │ │216 + return self.scroll.getFocus(); │ │217 } │ │218 │ │219 pub fn getSelectedIndex(self: View) ?usize {│ ╰─────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │221 } │ │222 │ │223 fn currentTabIndex(self: View) ?usize { │ │213 - const child_id = self.box.focus.child_id orelse return null; │ │224 + const child_id = self.scroll.child.box.focus.child_id orelse return null;│ │225 return self.tab_ids.getIndex(child_id); │ │226 } │ │227 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1666 // scroll offset (in cells) rides along so JS can apply it when it has no │ │1667 // preserved position, letting a wasm-side scrollToRect (the files list │ │1668 // scrolling to its selected row on page load) reach the browser. │ │1669 - var buf: [224]u8 = undefined; │ │1670 - try output.appendSlice(allocator, try std.fmt.bufPrint(&buf, "<div class=\"scroll\" data-scroll-id=\"{d}-{d}\" data-scroll-x=\"{d}\" data-scroll-y=\"{d}\" style=\"left:{d}ch;top:{d}em;width:{d}ch;height:{d}em;{s}\">", .{ id, child.focus.version, info.offset_x, info.offset_y, r.x, r.y, r.size.width, r.size.height, overflow })); │ │1669 + var buf: [256]u8 = undefined; │ │1670 + try output.appendSlice(allocator, try std.fmt.bufPrint(&buf, "<div class=\"scroll\" data-scroll-id=\"{d}-{d}\" data-scroll-direction=\"{s}\" data-scroll-x=\"{d}\" data-scroll-y=\"{d}\" style=\"left:{d}ch;top:{d}em;width:{d}ch;height:{d}em;{s}\">", .{ id, child.focus.version, @tagName(info.direction), info.offset_x, info.offset_y, r.x, r.y, r.size.width, r.size.height, overflow }));│ │1671 try renderPanel(allocator, output, child.focus, info.content); │ │1672 try output.appendSlice(allocator, "</div>"); │ │1673 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯