╭ changed ─────────────────╮ │src/ui/Home/Auth/Login.zig│ ╰──────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │42 │ │43 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session, users_tab_id: usize) !View {│ │44 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .vert }); │ │45 - errdefer box.deinit(); │ │45 + errdefer box.deinit(allocator); │ │46 │ │47 var nav_ids: [3]usize = undefined; │ │48 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │49 { │ │50 var username = wgt.TextInput(ui.Widget).init(allocator, .{ .label = " username ", .name = "username" });│ │51 - errdefer username.deinit(); │ │51 + errdefer username.deinit(allocator); │ │52 username.getFocus().focusable = true; │ │53 nav_ids[username_index] = username.getFocus().id; │ │54 try box.children.put(allocator, username.getFocus().id, .{ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │60 │ │61 { │ │62 var password = wgt.TextInput(ui.Widget).init(allocator, .{ .label = " password ", .password = true, .name = "password" });│ │63 - errdefer password.deinit(); │ │63 + errdefer password.deinit(allocator); │ │64 password.getFocus().focusable = true; │ │65 nav_ids[password_index] = password.getFocus().id; │ │66 try box.children.put(allocator, password.getFocus().id, .{ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │72 │ │73 { │ │74 var button = try wgt.TextBox(ui.Widget).init(allocator, "login", .{ .border_style = .single, .wrap_kind = .none });│ │75 - errdefer button.deinit(); │ │75 + errdefer button.deinit(allocator); │ │76 button.getFocus().focusable = true; │ │77 // the renderer distinguishes plain clickables from buttons that │ │78 // should POST to a server route by this kind. │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 97 }; │ │ 98 } │ │ 99 │ │100 - pub fn deinit(self: *View) void { │ │101 - self.center.deinit(); │ │100 + pub fn deinit(self: *View, allocator: std.mem.Allocator) void { │ │101 + self.center.deinit(allocator); │ │102 } │ │103 │ │104 - pub fn build(self: *View, constraint: layout.Constraint, root_focus: *Focus) !void { │ │104 + pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │105 const box = &self.center.child.box; │ │106 │ │107 const button = &box.children.values()[button_index].widget.text_box; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │122 else │ │123 " password "; │ │124 │ │125 - try self.center.build(constraint, root_focus); │ │125 + try self.center.build(allocator, constraint, root_focus); │ │126 } │ │127 │ │128 - pub fn input(self: *View, key: inp.Key, root_focus: *Focus) !void { │ │128 + pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │129 const box = &self.center.child.box; │ │130 const child_id = box.focus.child_id orelse return; │ │131 const current = self.indexOf(child_id) orelse return; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │146 // submit on Enter from any nav field — typical "press Enter in│ │147 // a form to submit" UX │ │148 .enter => { │ │149 - try self.submit(root_focus); │ │149 + try self.submit(allocator, root_focus); │ │150 return; │ │151 }, │ │152 else => {}, │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │161 if (mouse.x >= r.x and mouse.y >= r.y and │ │162 mouse.x < r.x + r.size.width and mouse.y < r.y + r.size.height)│ │163 { │ │164 - try self.submit(root_focus); │ │164 + try self.submit(allocator, root_focus); │ │165 return; │ │166 } │ │167 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │177 const password_len_before = password_input.content.items.len; │ │178 │ │179 if (box.children.getIndex(child_id)) |idx| { │ │180 - try box.children.values()[idx].widget.input(key, root_focus); │ │180 + try box.children.values()[idx].widget.input(allocator, key, root_focus);│ │181 } │ │182 │ │183 if (username_input.content.items.len != username_len_before or │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │211 return null; │ │212 } │ │213 │ │214 - fn submit(self: *View, root_focus: *Focus) !void { │ │214 + fn submit(self: *View, allocator: std.mem.Allocator, root_focus: *Focus) !void {│ │215 if (comptime wasm) { │ │216 // no DB cursor available on the wasm render path │ │217 self.status = .unknown_user; │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯