╭ changed ──────╮ │src/ui/Fork.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────╮ │19 pub const Patches = @import("./Repo/Patches.zig"); │ │20 pub const Auth = @import("./Auth.zig"); │ │21 pub const Quit = @import("./Quit.zig"); │ │22 -const Viewer = @import("./Repo/Comment.zig").Viewer;│ │22 │ │23 header: Header, │ │24 files: Files, │ ╰────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │56 const aa = arena.allocator(); │ │57 const target_identity = try std.fmt.allocPrint(aa, "{s}/{s}", .{ owner.event.name, target_record.event.name }); │ │58 const id_hex = std.fmt.bytesToHex(id, .lower); │ │59 + // the fork's viewer is the target repo's │ │60 + const handle = ui.RepoHandle{ │ │61 + .location = .{ .fork = .{ .identity = identity.identity, .id = &id_hex } }, │ │62 + .viewer = try ui.Viewer.init(session, arena, target_record), │ │63 + }; │ │64 const fork_path = try fork.forkPath(aa, users_dir, &forker_id, &id); │ │65 // a fork shares its target's hash kind │ │66 var any_fork = try rp.AnyRepo(.xit, .{}).open(io, arena.child_allocator, .{ .path = fork_path, .require_repo_root = true });│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │105 patch_data.repo_source = target_source; │ │106 }, │ │107 .publish => { │ │104 - patch_data = Patches.init(.xit, repo_opts, arena, target_repo, io, haxy_moment, session, target_id, target_identity, target_branch, "", "", &id_hex, "", 0, "", .open, try Viewer.init(session, arena, target_record)) catch |err| switch (err) {│ │108 + patch_data = Patches.init(.xit, repo_opts, arena, target_repo, io, haxy_moment, session, target_id, target_identity, target_branch, "", "", &id_hex, "", 0, "", .open, handle.viewer) catch |err| switch (err) { │ │109 error.NotFound => patch_data, │ │110 else => |other| return other, │ │111 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │140 .fork_commits => |c| c.content, │ │141 else => .{ .diff = .{} }, │ │142 }; │ │139 - const location = ui.RoutablePage.RepoLocation{ .fork = .{ │ │140 - .identity = identity.identity, │ │141 - .id = &id_hex, │ │142 - } }; │ │143 - const files = try Files.init(.xit, repo_opts, arena, fork_repo, io, arena.child_allocator, location, requested_ref, requested_value, files_path, files_line, files_find); │ │144 - var commits = try Commits.init(.xit, repo_opts, arena, fork_repo, io, arena.child_allocator, haxy_moment, location, requested_ref, requested_value, commits_content, &commits_base_oid, "", "");│ │143 + const files = try Files.init(.xit, repo_opts, arena, fork_repo, io, arena.child_allocator, handle, requested_ref, requested_value, files_path, files_line, files_find); │ │144 + var commits = try Commits.init(.xit, repo_opts, arena, fork_repo, io, arena.child_allocator, haxy_moment, handle, requested_ref, requested_value, commits_content, &commits_base_oid, "", ""); │ │145 commits.commit_count = if (newest_revision) |revision| revision.record.commit_count else 0; │ │146 const diff_start: usize = switch (route) { │ │147 .fork_diff => |d| d.start, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯