╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │272 const aa = arena.allocator(); │ │273 break :blk .{ │ │274 try Files.emptyResult(aa, location, requested_ref_or_oid orelse .branch, requested_ref_value, files_dir), │ │260 - try Commits.emptyResult(aa, location, requested_ref_or_oid orelse .branch, requested_ref_value, commits_content, commits_base_oid), │ │275 + Changes{ .commits = try Commits.emptyResult(aa, location, requested_ref_or_oid orelse .branch, requested_ref_value, commits_content, commits_base_oid) }, │ │276 try Refs.emptyResult(arena, repo_identity.identity, refs_kind, refs_from), │ │277 try Issues.emptyResult(aa, repo_identity.identity, issues_tag, issues_selected, issues_comment, issues_comments_start, issues_theirs, issues_view), │ │278 try Patches.emptyResult(aa, repo_identity.identity, patches_tag, patches_selected, patches_comment, patches_comments_start, patches_theirs, patches_view),│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │286 discussions.repo_source = source; │ │287 │ │288 return .{ │ │274 - // files and commits resolve the same ref, so either's serves the header, │ │275 - // which points both tabs at it. │ │289 + // use the files tab's resolved ref for the header │ │290 .header = try Header.init(arena, repo.event.name, owner_name, files.ref_or_oid, files.ref_or_oid_value, issues.tag, patches.tag, discussions.tag),│ │291 .repo = repo, │ │292 .files = files, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────╮ │279 - .commits = commits,│ │293 + .changes = changes,│ │294 .refs = refs, │ │295 .issues = issues, │ │296 .patches = patches,│ ╰────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │315 // build the header first so we can grab the files-tab id for the auth │ │316 // view (it focuses there after login). │ │317 { │ │304 - var header_view = try Header.View.init(allocator, &data.header, data.commits.commit_count, data.commits.base_oid, session); │ │318 + var header_view = try Header.View.init(allocator, data, session); │ │319 errdefer header_view.deinit(allocator); │ │320 try box.children.put(allocator, header_view.getFocus().id, .{ .widget = .{ .repo_header = header_view }, .rect = null, .min_size = null });│ │321 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │331 try stack.children.put(allocator, files_view.getFocus().id, .{ .repo_files = files_view }); │ │332 } │ │333 │ │320 - // commits — the current page of the commit log. │ │321 - { │ │322 - var commits_view = try Commits.View.init(allocator, &data.commits, session); │ │323 - errdefer commits_view.deinit(allocator); │ │324 - try stack.children.put(allocator, commits_view.getFocus().id, .{ .repo_commits = commits_view }); │ │334 + switch (data.changes) { │ │335 + .diff => |*diff| { │ │336 + var diff_view = try Diff.View.init(allocator, diff, session); │ │337 + errdefer diff_view.deinit(allocator); │ │338 + try stack.children.put(allocator, diff_view.getFocus().id, .{ .diff_view = diff_view }); │ │339 + }, │ │340 + .commits => |*commits| { │ │341 + var commits_view = try Commits.View.init(allocator, commits, session); │ │342 + errdefer commits_view.deinit(allocator); │ │343 + try stack.children.put(allocator, commits_view.getFocus().id, .{ .repo_commits = commits_view });│ │344 + }, │ │345 } │ │346 │ │347 // refs — the repo's branches and tags. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯