╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1108 }, │ │1109 // every repo route stores the same identity, so it always fits │ │1110 .repo => repoFilesRoute(self.repoIdentity() orelse return self, null, "", "", 0) orelse self,│ │1111 + .fork => blk: { │ │1112 + const f = self.forkRoute() orelse break :blk self; │ │1113 + break :blk forkPatchRoute(f.name.slice(), f.id.slice()) orelse self; │ │1114 + }, │ │1115 }; │ │1116 } │ │1117 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1120 .home_users, .home_repos, .home_settings, .home_auth => .home, │ │1121 .user_repos, .user_forks, .user_settings, .user_auth => .user, │ │1122 .repo_files, .repo_commits, .repo_refs, .repo_issues, .repo_patches, .repo_discussions, .repo_events, .repo_settings, .repo_auth => .repo,│ │1123 + .fork_patch, .fork_files, .fork_commits, .fork_settings, .fork_auth => .fork, │ │1124 }; │ │1125 } │ │1126 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1392 std.mem.eql(u8, a_e.selected.slice(), b.repo_events.selected.slice()), │ │1393 .repo_settings => |a_name| std.mem.eql(u8, a_name.slice(), b.repo_settings.slice()), │ │1394 .repo_auth => |a_name| std.mem.eql(u8, a_name.slice(), b.repo_auth.slice()), │ │1395 + .fork_patch => |a_f| std.mem.eql(u8, a_f.name.slice(), b.fork_patch.name.slice()) and std.mem.eql(u8, a_f.id.slice(), b.fork_patch.id.slice()), │ │1396 + .fork_files => |a_f| std.mem.eql(u8, a_f.fork.name.slice(), b.fork_files.fork.name.slice()) and │ │1397 + std.mem.eql(u8, a_f.fork.id.slice(), b.fork_files.fork.id.slice()) and │ │1398 + std.mem.eql(u8, a_f.oid.slice(), b.fork_files.oid.slice()) and │ │1399 + std.mem.eql(u8, a_f.path.slice(), b.fork_files.path.slice()) and │ │1400 + a_f.line == b.fork_files.line, │ │1401 + .fork_commits => |a_c| std.mem.eql(u8, a_c.fork.name.slice(), b.fork_commits.fork.name.slice()) and │ │1402 + std.mem.eql(u8, a_c.fork.id.slice(), b.fork_commits.fork.id.slice()) and │ │1403 + std.mem.eql(u8, a_c.oid.slice(), b.fork_commits.oid.slice()) and │ │1404 + switch (a_c.content) { │ │1405 + .diff => |a_d| switch (b.fork_commits.content) { │ │1406 + .diff => |b_d| a_d.start == b_d.start and std.mem.eql(u8, a_d.path.slice(), b_d.path.slice()), │ │1407 + .message => false, │ │1408 + }, │ │1409 + .message => std.meta.activeTag(b.fork_commits.content) == .message, │ │1410 + }, │ │1411 + .fork_settings => |a_f| std.mem.eql(u8, a_f.name.slice(), b.fork_settings.name.slice()) and std.mem.eql(u8, a_f.id.slice(), b.fork_settings.id.slice()),│ │1412 + .fork_auth => |a_f| std.mem.eql(u8, a_f.name.slice(), b.fork_auth.name.slice()) and std.mem.eql(u8, a_f.id.slice(), b.fork_auth.id.slice()), │ │1413 else => true, │ │1414 }; │ │1415 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │1422 a.repo_refs.from.len == 0 and b.repo_refs.from.len == 0) │ │1423 return !std.mem.eql(u8, a.repo_refs.name.slice(), b.repo_refs.name.slice());│ │1424 return !a.eql(b); │ │1425 + } │ │1426 + │ │1427 + pub fn forkPageChanged(a: RoutablePage, b: RoutablePage) bool { │ │1428 + return a.parent() == .fork and b.parent() == .fork and !a.eql(b); │ │1429 } │ │1430 │ │1431 // true when `a` and `b` are the same user paginated to a different repos │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2014 // a link to a different parent page always navigates; within a page, a │ │2015 // files-directory / commits-page / list-window change navigates while tab │ │2016 // links stay in-page. │ │1783 - if (route.parent() != current.parent() or RoutablePage.repoPageChanged(route, current) or RoutablePage.homePageChanged(route, current) or RoutablePage.userPageChanged(route, current)) return route; │ │2017 + if (route.parent() != current.parent() or RoutablePage.repoPageChanged(route, current) or RoutablePage.forkPageChanged(route, current) or RoutablePage.homePageChanged(route, current) or RoutablePage.userPageChanged(route, current)) return route;│ │2018 return null; │ │2019 } │ │2020 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │2251 .home => |*p| .{ .home = try .init(allocator, p, session) },│ │2252 .user => |*p| .{ .user = try .init(allocator, p, session) },│ │2253 .repo => |*p| .{ .repo = try .init(allocator, p, session) },│ │2254 + .fork => |*p| .{ .fork = try .init(allocator, p, session) },│ │2255 }; │ │2256 │ │2257 chooseAnsiArtForNavigation(session); │ ╰──────────────────────────────────────────────────────────────────────────╯