╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Home/AuthTab.zig│ ╰───────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │21 │ │22 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │23 var text_box = try wgt.TextBox(ui.Widget).init(allocator, "login", .{ .border_style = .single, .wrap_kind = .none });│ │24 - errdefer text_box.deinit(); │ │24 + errdefer text_box.deinit(allocator); │ │25 text_box.getFocus().focusable = true; │ │26 return .{ │ │27 .text_box = text_box, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │30 }; │ │31 } │ │32 │ │33 - pub fn deinit(self: *View) void { │ │34 - self.text_box.deinit(); │ │33 + pub fn deinit(self: *View, allocator: std.mem.Allocator) void { │ │34 + self.text_box.deinit(allocator); │ │35 } │ │36 │ │37 - pub fn build(self: *View, constraint: layout.Constraint, root_focus: *Focus) !void { │ │37 + pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │38 // update the displayed label based on session state. the inner Text │ │39 // widget's content is just a slice, so we can repoint it without │ │40 // re-allocating. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │42 const text_widget = &self.text_box.box.children.values()[0].widget.text; │ │43 text_widget.content = if (self.session.user_id != null) "logout" else "login"; │ │44 } │ │45 - try self.text_box.build(constraint, root_focus); │ │45 + try self.text_box.build(allocator, constraint, root_focus); │ │46 } │ │47 │ │48 - pub fn input(self: *View, key: inp.Key, root_focus: *Focus) !void { │ │49 - try self.text_box.input(key, root_focus); │ │48 + pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │49 + try self.text_box.input(allocator, key, root_focus); │ │50 } │ │51 │ │52 pub fn clearGrid(self: *View) void { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │29 │ │30 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │31 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .horiz });│ │32 - errdefer box.deinit(); │ │32 + errdefer box.deinit(allocator); │ │33 │ │34 var tab_ids: [3]usize = undefined; │ │35 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │37 const fixed_tab_names = [_][]const u8{ "users", "repos" }; │ │38 for (fixed_tab_names, 0..) |name, i| { │ │39 var text_box = try wgt.TextBox(ui.Widget).init(allocator, name, .{ .border_style = .single, .wrap_kind = .none });│ │40 - errdefer text_box.deinit(); │ │40 + errdefer text_box.deinit(allocator); │ │41 text_box.getFocus().focusable = true; │ │42 tab_ids[i] = text_box.getFocus().id; │ │43 - try box.children.put(box.allocator, text_box.getFocus().id, .{ │ │43 + try box.children.put(allocator, text_box.getFocus().id, .{ │ │44 .widget = .{ .text_box = text_box }, │ │45 .rect = null, │ │46 .min_size = .{ .width = name.len + 2, .height = null }, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │50 // spacer pushes the auth tab to the right │ │51 { │ │52 var spacer = ui.Spacer.init(allocator); │ │53 - errdefer spacer.deinit(); │ │54 - try box.children.put(box.allocator, spacer.getFocus().id, .{│ │53 + errdefer spacer.deinit(allocator); │ │54 + try box.children.put(allocator, spacer.getFocus().id, .{ │ │55 .widget = .{ .spacer = spacer }, │ │56 .rect = null, │ │57 .min_size = .{ .width = 1, .height = null }, │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │61 // auth tab — knows how to swap its own label based on session │ │62 { │ │63 var auth_tab = try AuthTab.View.init(allocator, &data.auth_tab, session);│ │64 - errdefer auth_tab.deinit(); │ │64 + errdefer auth_tab.deinit(allocator); │ │65 tab_ids[auth_tab_index] = auth_tab.getFocus().id; │ │66 - try box.children.put(box.allocator, auth_tab.getFocus().id, .{ │ │66 + try box.children.put(allocator, auth_tab.getFocus().id, .{ │ │67 .widget = .{ .home_auth_tab = auth_tab }, │ │68 .rect = null, │ │69 .min_size = .{ .width = auth_tab_min_width, .height = null }, │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │75 return self; │ │76 } │ │77 │ │78 - pub fn deinit(self: *View) void { │ │79 - self.box.deinit(); │ │78 + pub fn deinit(self: *View, allocator: std.mem.Allocator) void { │ │79 + self.box.deinit(allocator); │ │80 } │ │81 │ │82 - pub fn build(self: *View, constraint: layout.Constraint, root_focus: *Focus) !void { │ │82 + pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │83 self.clearGrid(); │ │84 for (self.box.children.keys(), self.box.children.values()) |id, *child| { │ │85 const tb: ?*wgt.TextBox(ui.Widget) = switch (child.widget) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 94 .hidden; │ │ 95 } │ │ 96 } │ │ 97 - try self.box.build(constraint, root_focus); │ │ 97 + try self.box.build(allocator, constraint, root_focus); │ │ 98 } │ │ 99 │ │100 - pub fn input(self: *View, key: inp.Key, root_focus: *Focus) !void { │ │100 + pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │101 + _ = allocator; │ │102 const current_tab = self.currentTabIndex() orelse return; │ │103 var new_tab = current_tab; │ │104 switch (key) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Home/Repos.zig│ ╰─────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │47 pub fn init(allocator: std.mem.Allocator, data: *const Self) !View {│ │48 var self = blk: { │ │49 var list = try ui.SelectableList.init(allocator); │ │50 - errdefer list.deinit(); │ │50 + errdefer list.deinit(allocator); │ │51 │ │52 break :blk View{ │ │53 .list = list, │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯