╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │30 arena: *std.heap.ArenaAllocator, │ │31 session: *ui.Session, │ │32 haxy_moment: evt.AdminDB.HashMap(.read_only), │ │35 - // pagination window start for each list tab; the inactive tab gets 0.│ │33 + // pagination window start for the users tab │ │34 users_start: usize, │ │37 - repos_start: usize, │ │35 ) !Self { │ │36 const about = try About.init(arena, session); │ │37 return .{ │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │38 .header = try Header.init(arena, about.title), │ │39 .about = about, │ │40 .users = try Users.init(arena, haxy_moment, users_start), │ │44 - .repos = try Repos.init(arena, haxy_moment, session.userId(), repos_start),│ │41 .settings = Settings.init(), │ │42 .auth = Auth.init(), │ │43 .quit = Quit.init(), │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │70 var about_view = try About.View.init(allocator, &data.about, session); │ │71 errdefer about_view.deinit(allocator); │ │72 try stack.children.put(allocator, about_view.getFocus().id, .{ .home_about = about_view });│ │77 - } │ │78 - │ │79 - { │ │80 - var repos_view = try Repos.View.init(allocator, &data.repos, !session.is_terminal); │ │81 - errdefer repos_view.deinit(allocator); │ │82 - try stack.children.put(allocator, repos_view.getFocus().id, .{ .home_repos = repos_view });│ │73 } │ │74 │ │75 { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────╮ │10 const Focus = xitui.focus.Focus; │ │11 │ │12 const about_tab_label = "about"; │ │13 -const repos_tab_label = "repos"; │ │13 const users_tab_label = "users"; │ │14 const settings_tab_label = "settings";│ │15 │ ╰──────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │90 // link (rather than position) keeps this robust to tab changes. │ │91 const current_tag = std.meta.activeTag(session.data.current_page); │ │92 const about_link = try ui.inPageTabLink(session, .home_about, current_tag == .home_about); │ │94 - const repos_link = try ui.inPageTabLink(session, .{ .home_repos = 0 }, current_tag == .home_repos);│ │93 const users_link = try ui.inPageTabLink(session, .{ .home_users = 0 }, current_tag == .home_users);│ │94 const settings_link = try ui.inPageTabLink(session, .home_settings, current_tag == .home_settings);│ │95 const auth_link = try ui.inPageTabLink(session, .home_auth, current_tag == .home_auth); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────╮ │96 const current_link: []const u8 = switch (current_tag) {│ │99 - .home_repos => repos_link, │ │97 .home_users => users_link, │ │98 .home_settings => settings_link, │ │99 .home_auth => auth_link, │ ╰───────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │113 .widget = .{ .text_box = text_box }, │ │114 .rect = null, │ │115 .min_size = .{ .width = about_tab_label.len + 2, .height = null }, │ │119 - }); │ │120 - } │ │121 - │ │122 - // repos tab │ │123 - { │ │124 - var text_box = try wgt.TextBox.init(allocator, repos_tab_label, .{ .border_style = .single, .round_corners = true, .wrap_kind = .none });│ │125 - errdefer text_box.deinit(allocator); │ │126 - text_box.getFocus().mode = .all; │ │127 - text_box.getFocus().kind = .{ .custom = repos_link }; │ │128 - try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │129 - if (std.mem.eql(u8, repos_link, current_link)) selected_tab = text_box.getFocus().id; │ │130 - try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │131 - .widget = .{ .text_box = text_box }, │ │132 - .rect = null, │ │133 - .min_size = .{ .width = repos_tab_label.len + 2, .height = null }, │ │116 }); │ │117 } │ │118 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ removed ────────────╮ │src/ui/Home/Repos.zig│ ╰─────────────────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │246 owner_name = ""; │ │247 } else { │ │248 const haxy_moment = session.haxy_moment orelse return error.NoMoment; │ │249 - const found = (try evt.Repo.readByOwnerAndName(DB, hash_kind, haxy_moment, arena, repo_identity.owner, repo_identity.name)) orelse return error.NotFound; │ │249 + const io = session.io orelse return error.NoMoment; │ │250 + const repos_dir = session.repos_dir orelse return error.NoMoment; │ │251 + const found = (try evt.readRepoByOwnerAndName(io, arena.child_allocator, arena, haxy_moment, repos_dir, repo_identity.owner, repo_identity.name)) orelse return error.NotFound;│ │252 // a repo the session can't read doesn't exist to it │ │253 if (evt.Repo.roleOf(found.repo, session.userId()) == .none) return error.NotFound; │ │254 repo = found.repo; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────╮ │260 owner_name = owner.event.name; │ │261 │ │262 // the repo's working copy lives at <repos_dir>/<hex event id>. │ │261 - if (session.repos_dir) |repos_dir| { │ │262 - const hex = std.fmt.bytesToHex(found.event_id, .lower); │ │263 - source = .{ │ │264 - .path = try std.fs.path.join(arena.allocator(), &.{ repos_dir, &hex }),│ │265 - .repo_kind = .xit, │ │266 - }; │ │267 - } │ │263 + const hex = std.fmt.bytesToHex(found.event_id, .lower); │ │264 + source = .{ │ │265 + .path = try std.fs.path.join(arena.allocator(), &.{ repos_dir, &hex }), │ │266 + .repo_kind = .xit, │ │267 + }; │ │268 } │ │269 │ │270 // open the repo once for every tab. files and changes share a ref or revision. │ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯