╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────────╮ │src/ui/Home/Auth.zig│ ╰────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │34 │ │35 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session, users_tab_id: usize) !View {│ │36 var login_view = try Login.View.init(allocator, &data.login, session, users_tab_id); │ │37 - errdefer login_view.deinit(); │ │37 + errdefer login_view.deinit(allocator); │ │38 var logout_view = try Logout.View.init(allocator, &data.logout, session, users_tab_id); │ │39 - errdefer logout_view.deinit(); │ │39 + errdefer logout_view.deinit(allocator); │ │40 return .{ │ │41 .focus = Focus.init(allocator, .container), │ │42 .login = login_view, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │45 }; │ │46 } │ │47 │ │48 - pub fn deinit(self: *View) void { │ │48 + pub fn deinit(self: *View, allocator: std.mem.Allocator) void { │ │49 self.focus.deinit(); │ │50 - self.login.deinit(); │ │51 - self.logout.deinit(); │ │50 + self.login.deinit(allocator); │ │51 + self.logout.deinit(allocator); │ │52 } │ │53 │ │54 - pub fn build(self: *View, constraint: layout.Constraint, root_focus: *Focus) !void { │ │54 + pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │55 self.focus.clear(); │ │56 if (self.session.user_id != null) { │ │57 - try self.logout.build(constraint, root_focus); │ │57 + try self.logout.build(allocator, constraint, root_focus); │ │58 if (self.logout.getGrid()) |inner_grid| { │ │59 try self.focus.addChild(self.logout.getFocus(), inner_grid.size, 0, 0); │ │60 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │61 self.focus.child_id = self.logout.getFocus().id; │ │62 } else { │ │63 - try self.login.build(constraint, root_focus); │ │63 + try self.login.build(allocator, constraint, root_focus); │ │64 if (self.login.getGrid()) |inner_grid| { │ │65 try self.focus.addChild(self.login.getFocus(), inner_grid.size, 0, 0);│ │66 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │68 } │ │69 } │ │70 │ │71 - pub fn input(self: *View, key: inp.Key, root_focus: *Focus) !void { │ │71 + pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │72 if (self.session.user_id != null) { │ │73 - try self.logout.input(key, root_focus); │ │73 + try self.logout.input(allocator, key, root_focus); │ │74 } else { │ │75 - try self.login.input(key, root_focus); │ │75 + try self.login.input(allocator, key, root_focus); │ │76 } │ │77 } │ │78 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────────╮ │src/ui/Home/Auth/Login.zig│ ╰──────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯