╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1264 const status = patch.status orelse continue; │ │1265 const fork_path = try fork.forkPath(allocator, repos_path, &patch_hex); │ │1266 defer allocator.free(fork_path); │ │1249 - try pch.publish(.{}, io, allocator, admin_repo, target_repo, fork_path, .{ │ │1267 + try pch.publish(.{}, io, allocator, admin_repo, &user_repo, target_repo, fork_path, .{│ │1268 .id = patch_hex, │ │1269 .user_id = user_id.*, │ │1270 .repo_id = repo_id.*, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1273 }); │ │1274 │ │1275 if (status == .merged) { │ │1258 - try pch.mergeAndRemoveFork(.{}, io, allocator, repos_path, admin_repo, target_repo, .{│ │1276 + try pch.mergeAndRemoveFork(.{}, io, allocator, repos_path, target_repo, .{ │ │1277 .id = patch_hex, │ │1278 .revision = .source, │ │1279 .author = patch_author, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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) { │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯