╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │77 { │ │78 var settings_view = try Settings.View.init(allocator, &data.settings, session); │ │79 errdefer settings_view.deinit(allocator); │ │80 - try stack.children.put(allocator, settings_view.getFocus().id, .{ .settings = settings_view }); │ │80 + try stack.children.put(allocator, settings_view.getFocus().id, .{ .home_settings = settings_view });│ │81 } │ │82 │ │83 { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │84 var auth_view = try Auth.View.init(allocator, &data.auth, session, users_tab_id); │ │85 errdefer auth_view.deinit(allocator); │ │86 - try stack.children.put(allocator, auth_view.getFocus().id, .{ .auth = auth_view }); │ │86 + try stack.children.put(allocator, auth_view.getFocus().id, .{ .home_auth = auth_view }); │ │87 } │ │88 │ │89 try box.children.put(allocator, stack.getFocus().id, .{ .widget = .{ .stack = stack }, .rect = null, .min_size = null });│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────╮ │113 self.session.data.current_page = switch (index) {│ │114 0 => .home_users, │ │115 1 => .home_repos, │ │116 - 2 => .settings, │ │117 - 3 => .auth, │ │116 + 2 => .home_settings, │ │117 + 3 => .home_auth, │ │118 else => .home_users, │ │119 }; │ │120 } │ ╰──────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │149 const at_top = switch (selected_widget.*) { │ │150 .home_users => |*v| v.getSelectedIndex() == 0, │ │151 .home_repos => |*v| v.getSelectedIndex() == 0, │ │152 - .settings => |*v| v.getSelectedIndex() == 0, │ │153 - .auth => |*v| v.getSelectedIndex() == 0, │ │152 + .home_settings => |*v| v.getSelectedIndex() == 0,│ │153 + .home_auth => |*v| v.getSelectedIndex() == 0, │ │154 else => false, │ │155 }; │ │156 if (at_top) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │100 } │ │101 │ │102 var self = View{ .box = box, .data = data, .tab_ids = tab_ids }; │ │103 - // initial selected tab follows session.data.current_page — the web│ │104 - // layer decides this from the request URL, the TTY uses whatever │ │105 - // the session arrives with — so we don't bake a default here. │ │103 + // initial selected tab │ │104 self.getFocus().child_id = tab_ids[ │ │105 switch (session.data.current_page) { │ │106 .home_users => 0, │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────╮ │107 .home_repos => 1, │ │110 - .settings => 2, │ │111 - .auth => 3, │ │108 + .home_settings => 2,│ │109 + .home_auth => 3, │ │110 + else => 0, │ │111 } │ │112 ]; │ │113 return self; │ ╰─────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Home/Repos.zig│ ╰─────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │62 for (data.repos, 0..) |repo, i| { │ │63 lines[i] = try std.fmt.allocPrint(aa, "{s} - {s}", .{ repo.name, repo.description });│ │64 } │ │65 - try self.list.setItems(allocator, lines); │ │65 + try self.list.setItems(allocator, lines, null); │ │66 │ │67 return self; │ │68 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/ui/Home/Users.zig│ ╰─────────────────────╯ ╭────────────────────────────────────╮ │10 const Grid = xitui.grid.Grid; │ │11 const Focus = xitui.focus.Focus;│ │12 │ │13 -users: []const evt.User, │ │13 +users: []const evt.User.Safe, │ │14 │ │15 const Self = @This(); │ │16 │ ╰────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │20 ) !Self { │ │21 const DB = evt.AdminDB; │ │22 │ │23 - var users: std.ArrayList(evt.User) = .empty; │ │23 + var users: std.ArrayList(evt.User.Safe) = .empty; │ │24 │ │25 const event_id_to_user_cursor = try haxy_moment.getCursor(hash.hashInt(evt.admin_repo_opts.hash, "event-id->user")) orelse return error.NotFound;│ │26 const event_id_to_user = try DB.HashMap(.read_only).init(event_id_to_user_cursor); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │30 const kv = try kv_cursor.readKeyValuePair(); │ │31 const user_map = try DB.HashMap(.read_only).init(kv.value_cursor); │ │32 const user_event = try evt.read(evt.User, DB, evt.admin_repo_opts.hash, arena, user_map);│ │33 - try users.append(arena.allocator(), user_event); │ │33 + try users.append(arena.allocator(), evt.User.Safe.init(user_event)); │ │34 } │ │35 │ │36 return .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯