╭ changed ──────╮ │src/ui/Fork.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────╮ │15 pub const Header = @import("./Fork/Header.zig"); │ │16 pub const Files = @import("./Repo/Files.zig"); │ │17 pub const Commits = @import("./Repo/Commits.zig");│ │18 +pub const Diff = @import("./Repo/Diff.zig"); │ │19 pub const Patches = @import("./Repo/Patches.zig");│ │20 pub const Settings = @import("./Settings.zig"); │ │21 pub const Auth = @import("./Auth.zig"); │ ╰──────────────────────────────────────────────────────╯ ╭───────────────────────╮ │25 files: Files, │ │26 commits: Commits, │ │27 patch: Patches, │ │28 +diff: Diff, │ │29 settings: Settings,│ │30 auth: Auth, │ │31 quit: Quit, │ ╰───────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │127 } }; │ │128 const files = try Files.init(.xit, .{}, arena, &fork_repo, io, arena.child_allocator, location, requested_ref, requested_value, files_path, files_line); │ │129 const commits = try Commits.init(.xit, .{}, arena, &fork_repo, io, arena.child_allocator, haxy_moment, location, requested_ref, requested_value, commits_content, commits_base_oid);│ │130 + const diff_start: usize = switch (route) { │ │131 + .fork_diff => |d| d.start, │ │132 + else => 0, │ │133 + }; │ │134 + const diff_path = switch (route) { │ │135 + .fork_diff => |*d| try aa.dupe(u8, d.path.slice()), │ │136 + else => "", │ │137 + }; │ │138 │ │139 return .{ │ │140 .header = try Header.init(arena, target_record.event.name, owner.event.name, &id_hex, requested_value), │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │141 .files = files, │ │142 .commits = commits, │ │143 .patch = patch_data, │ │144 + .diff = .{ │ │145 + .route = .{ .fork = .{ .identity = try aa.dupe(u8, identity.identity), .id = try aa.dupe(u8, &id_hex) } }, │ │146 + .path = diff_path, │ │147 + .window = try Diff.render(.xit, .{}, io, arena.child_allocator, aa, &fork_repo, &commits_base_oid, fork_oid, diff_start, diff_path),│ │148 + }, │ │149 .settings = Settings.init(), │ │150 .auth = Auth.init(), │ │151 .quit = Quit.init(), │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │174 errdefer patch_detail.deinit(allocator); │ │175 try stack.children.put(allocator, patch_detail.getFocus().id, .{ .repo_patch_detail = patch_detail });│ │176 { │ │177 + var diff = try Diff.View.init(allocator, &data.diff, session); │ │178 + errdefer diff.deinit(allocator); │ │179 + try stack.children.put(allocator, diff.getFocus().id, .{ .diff_view = diff }); │ │180 + } │ │181 + { │ │182 var files = try Files.View.init(allocator, &data.files, session); │ │183 errdefer files.deinit(allocator); │ │184 try stack.children.put(allocator, files.getFocus().id, .{ .repo_files = files }); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯