╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────────────────────────────╮ │1206 // renders truecolor ANSI art│ │1207 pub const AnsiArt = struct { │ │1196 - focus: Focus, │ │1208 + focus: *Focus, │ │1209 grid: ?Grid, │ │1210 content: []const u8, │ │1211 │ ╰───────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │1200 - pub fn init(content: []const u8) AnsiArt { │ │1212 + pub fn init(allocator: std.mem.Allocator, content: []const u8) !AnsiArt {│ │1213 return .{ │ │1202 - .focus = Focus.init(.container), │ │1214 + .focus = try Focus.create(allocator, .container), │ │1215 .grid = null, │ │1216 .content = content, │ │1217 }; │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │1218 } │ │1219 │ │1220 pub fn deinit(self: *AnsiArt, allocator: std.mem.Allocator) void {│ │1209 - self.focus.deinit(allocator); │ │1221 + self.focus.destroy(allocator); │ │1222 if (self.grid) |*grid| { │ │1223 grid.deinit(); │ │1224 self.grid = null; │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────╮ │1317 } │ │1318 │ │1319 pub fn getFocus(self: *AnsiArt) *Focus { │ │1308 - return &self.focus; │ │1320 + return self.focus; │ │1321 } │ │1322 │ │1323 fn applySgr(style: *Grid.Style, params: []const u8) void {│ ╰────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1374 return e; │ │1375 }; │ │1376 child.* = cw; │ │1365 - return .{ .grid = null, .child = child, .art = AnsiArt.init(art_content), .session = session }; │ │1377 + errdefer { │ │1378 + child.deinit(allocator); │ │1379 + allocator.destroy(child); │ │1380 + } │ │1381 + return .{ .grid = null, .child = child, .art = try AnsiArt.init(allocator, art_content), .session = session };│ │1382 } │ │1383 │ │1384 pub fn deinit(self: *AnsiBackground, allocator: std.mem.Allocator) void { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Auth.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │27 // inner views' focus ids change as login/logout swap; if we exposed those│ │28 // directly, anything keyed off our id at one moment would mismatch the │ │29 // focus tree the next frame. │ │30 - focus: Focus, │ │30 + focus: *Focus, │ │31 login: Login.View, │ │32 logout: Logout.View, │ │33 session: *ui.Session, │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │38 var logout_view = try Logout.View.init(allocator, &data.logout, session, users_tab_id);│ │39 errdefer logout_view.deinit(allocator); │ │40 return .{ │ │41 - .focus = Focus.init(.container), │ │41 + .focus = try Focus.create(allocator, .container), │ │42 .login = login_view, │ │43 .logout = logout_view, │ │44 .session = session, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │46 } │ │47 │ │48 pub fn deinit(self: *View, allocator: std.mem.Allocator) void {│ │49 - self.focus.deinit(allocator); │ │49 + self.focus.destroy(allocator); │ │50 self.login.deinit(allocator); │ │51 self.logout.deinit(allocator); │ │52 } │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────╮ │87 } │ │88 │ │89 pub fn getFocus(self: *View) *Focus { │ │90 - return &self.focus; │ │90 + return self.focus; │ │91 } │ │92 │ │93 pub fn getSelectedIndex(self: View) ?usize {│ ╰────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Auth/Login.zig│ ╰─────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │39 const button_index: usize = 2; │ │40 │ │41 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session, success_redirect_tab_id: usize) !View { │ │42 - var box = wgt.Box(ui.Widget).init(.{ .border_style = null, .rounded_corners = true, .direction = .vert }); │ │42 + var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .rounded_corners = true, .direction = .vert });│ │43 errdefer box.deinit(allocator); │ │44 // marks this subtree as an HTML form scope for the web overlay │ │45 box.getFocus().kind = .{ .custom = switch (session.data.current_page) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯