╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │125 │ │126 // spacer pushes settings + auth to the right │ │127 { │ │128 - var spacer = ui.Spacer.init(); │ │128 + var spacer = try ui.Spacer.init(allocator); │ │129 errdefer spacer.deinit(allocator); │ │130 try box.children.put(allocator, spacer.getFocus().id, .{│ │131 .widget = .{ .spacer = spacer }, │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────╮ │src/ui/Settings.zig│ ╰───────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │28 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │29 const logged_in = session.data.user_id != null; │ │30 │ │31 - var box = wgt.Box(ui.Widget).init(.{ .border_style = null, .rounded_corners = true, .direction = .vert }); │ │31 + var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .rounded_corners = true, .direction = .vert });│ │32 errdefer box.deinit(allocator); │ │33 // when logged in, the toggle posts to a page-scoped /ansi path so the │ │34 // server sends us back to this page's settings tab; logged out, the │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │88 const stack_index: usize = 1; │ │89 │ │90 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │91 - var box = wgt.Box(ui.Widget).init(.{ .border_style = null, .rounded_corners = true, .direction = .vert }); │ │91 + var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .rounded_corners = true, .direction = .vert });│ │92 errdefer box.deinit(allocator); │ │93 │ │94 // build the header first so we can grab the repos-tab id for the auth │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────╮ │102 } │ │103 │ │104 { │ │105 - var stack = wgt.Stack(ui.Widget).init(); │ │105 + var stack = try wgt.Stack(ui.Widget).init(allocator);│ │106 errdefer stack.deinit(allocator); │ │107 │ │108 // repos list — the default tab │ ╰──────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │30 tab_ids: std.AutoArrayHashMapUnmanaged(usize, void), │ │31 │ │32 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │33 - var box = wgt.Box(ui.Widget).init(.{ .border_style = .hidden, .rounded_corners = true, .direction = .horiz }); │ │33 + var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = .hidden, .rounded_corners = true, .direction = .horiz });│ │34 errdefer box.deinit(allocator); │ │35 │ │36 var tab_ids: std.AutoArrayHashMapUnmanaged(usize, void) = .empty; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │53 │ │54 // spacer │ │55 { │ │56 - var text = wgt.Text(ui.Widget).init(" "); │ │56 + var text = try wgt.Text(ui.Widget).init(allocator, " ");│ │57 errdefer text.deinit(allocator); │ │58 try box.children.put(allocator, text.getFocus().id, .{ │ │59 .widget = .{ .text = text }, │ ╰────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │87 │ │88 // spacer pushes settings + auth to the right │ │89 { │ │90 - var spacer = ui.Spacer.init(); │ │90 + var spacer = try ui.Spacer.init(allocator); │ │91 errdefer spacer.deinit(allocator); │ │92 try box.children.put(allocator, spacer.getFocus().id, .{│ │93 .widget = .{ .spacer = spacer }, │ ╰────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │392 │ │393 const content = try generateHtml(allocator, &root); │ │394 defer allocator.free(content); │ │395 - const overlay = try generateOverlay(allocator, &root); │ │395 + const overlay = try generateOverlay(allocator, &root, &session); │ │396 defer allocator.free(overlay); │ │397 │ │398 // serialize the snapshot so the wasm side can parse it back without│ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │553 // emits the form overlay — one <form> per "form:<url>" focus subtree in the │ │554 // widget tree, each wrapping the text inputs and submit button inside it, │ │555 // positioned absolutely over the matching grid cells. │ │556 -pub fn generateOverlay(allocator: std.mem.Allocator, root: *ui.Widget) ![]const u8 { │ │556 +pub fn generateOverlay(allocator: std.mem.Allocator, root: *ui.Widget, session: *ui.Session) ![]const u8 {│ │557 const root_focus = root.getFocus(); │ │558 │ │559 var out: std.ArrayList(u8) = .empty; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │592 const r = root_child.rect; │ │593 switch (root_child.focus.kind) { │ │594 .text_input, .text_input_password => { │ │595 - const ti: *wgt.TextInput(ui.Widget) = @fieldParentPtr("focus", root_child.focus);│ │595 + const ti = session.text_inputs.get(inner_id) orelse continue; │ │596 const inner_left = r.x + 1; │ │597 const inner_top = r.y + 1; │ │598 const inner_width = if (r.size.width > 2) r.size.width - 2 else 0; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯