╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │72 return switch (route.parent()) { │ │73 .home => .{ .home = try Home.init(arena, session, session.haxy_moment orelse return error.NoMoment, switch (route) {│ │74 .home_users => |start| start, │ │75 - else => 0, │ │76 - }, switch (route) { │ │77 - .home_repos => |start| start, │ │75 else => 0, │ │76 }) }, │ │77 .user => blk: { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │109 pub const RoutablePage = union(enum) { │ │110 home_about, │ │111 home_users: usize, // 0 = first page │ │115 - home_repos: usize, // 0 = first page │ │112 home_settings, │ │113 home_auth, │ │114 user_repos: struct { name: Array(evt.User.name_max_len), start: usize = 0 },│ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1015 return switch (self) { │ │1016 .home_about => "/", │ │1017 .home_users => |start| if (start == 0) @as([]const u8, "/users") else try std.fmt.allocPrint(arena.allocator(), "/users/" ++ start_seg ++ "{d}", .{start}),│ │1022 - .home_repos => |start| if (start == 0) @as([]const u8, "/repos") else try std.fmt.allocPrint(arena.allocator(), "/repos/" ++ start_seg ++ "{d}", .{start}),│ │1018 .home_settings => "/settings", │ │1019 .home_auth => "/auth", │ │1020 .user_repos => |u| if (u.start == 0) │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1243 var segments = std.mem.splitScalar(u8, path[1..], '/'); │ │1244 const first = segments.next() orelse return null; │ │1245 if (std.mem.eql(u8, first, "users")) return .{ .home_users = listStart(&segments) orelse return null };│ │1251 - if (std.mem.eql(u8, first, "repos")) return .{ .home_repos = listStart(&segments) orelse return null };│ │1246 if (std.mem.eql(u8, first, "settings")) return if (segments.next() == null) .home_settings else null; │ │1247 if (std.mem.eql(u8, first, "auth")) return if (segments.next() == null) .home_auth else null; │ │1248 // "user/<name>[/repos[/start:<n>]|/settings|/auth]" │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1257 if (std.mem.eql(u8, sub, "auth")) return if (segments.next() == null) .{ .user_auth = parsed } else null;│ │1258 return null; // unknown sub-path │ │1259 } │ │1266 - // "fork/<username>/<reponame>/patch:<id>[/files|/commits]"; the │ │1260 + // "fork/<forker>/<reponame>/patch:<id>[/files|/commits]"; the │ │1261 // patch branch is implicit, while object ids and view-specific params │ │1262 // use the same tails as the repo files and commits routes. │ │1263 if (std.mem.eql(u8, first, "fork")) { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1397 │ │1398 pub fn parent(self: RoutablePage) PageKind { │ │1399 return switch (self) { │ │1406 - .home_about, .home_users, .home_repos, .home_settings, .home_auth => .home, │ │1400 + .home_about, .home_users, .home_settings, .home_auth => .home, │ │1401 .user_repos, .user_forks, .user_settings, .user_auth => .user, │ │1402 .repo_files, .repo_commits, .repo_diff, .repo_refs, .repo_issues, .repo_patches, .repo_discussions, .repo_events, .repo_undo, .repo_settings, .repo_auth => .repo,│ │1403 .fork_patch, .fork_diff, .fork_files, .fork_commits, .fork_settings, .fork_auth => .fork, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1682 if (std.meta.activeTag(a) != std.meta.activeTag(b)) return false; │ │1683 return switch (a) { │ │1684 .home_users => |a_start| a_start == b.home_users, │ │1691 - .home_repos => |a_start| a_start == b.home_repos, │ │1685 .user_repos => |a_u| std.mem.eql(u8, a_u.name.slice(), b.user_repos.name.slice()) and a_u.start == b.user_repos.start,│ │1686 .user_forks => |a_u| std.mem.eql(u8, a_u.name.slice(), b.user_forks.name.slice()) and a_u.start == b.user_forks.start,│ │1687 .user_settings => |a_name| std.mem.eql(u8, a_name.slice(), b.user_settings.slice()), │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │1805 } │ │1806 │ │1807 // true when `a` and `b` are the same home list tab paginated to a different│ │1815 - // window. switching between the users/repos tabs is in-page (the home page │ │1816 - // holds both lists), so only a changed `after` on the same tab navigates. │ │1808 + // window. switching tabs is in-page, so only a changed `start` on the same │ │1809 + // tab navigates. │ │1810 pub fn homePageChanged(a: RoutablePage, b: RoutablePage) bool { │ │1811 return switch (a) { │ │1812 .home_users => |aa| switch (b) { │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────╮ │1813 .home_users => |bb| aa != bb,│ │1814 else => false, │ │1815 }, │ │1823 - .home_repos => |aa| switch (b) { │ │1824 - .home_repos => |bb| aa != bb,│ │1825 - else => false, │ │1826 - }, │ │1816 else => false, │ │1817 }; │ │1818 } │ ╰───────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────╮ │1953 // local mode has no accounts, so it has no user id│ │1954 user_id: ?[evt.event_id_size]u8 = null, │ │1955 role: evt.Repo.Role, │ │1956 + // the repo owner's id, which local mode lacks │ │1957 + repo_user_id: ?[evt.event_id_size]u8 = null, │ │1958 }; │ │1959 │ │1960 pub const Authorization = union(enum) { │ ╰─────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯