╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │738 } │ │739 const target_branch = item.record.event.target_branch; │ │740 const revision = item.record.event.revision orelse continue;│ │741 + item.commit_count = revision.commit_count; │ │742 item.revision_oid = switch (item.record.event.status) { │ │743 .merged => |oid| oid, │ │744 else => revision.source_oid, │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │844 const patch = (try evt.Patch.readById(evt.EventDB(.sha1), .sha1, moment, arena, &id)) orelse return null; │ │845 const target_branch = patch.event.target_branch; │ │846 const target_oid = try target_repo.readRef(io, .{ .kind = .head, .name = target_branch }); │ │847 + const commit_count: ?u64 = blk: { │ │848 + const newest = evt.PatchRev.readNewest(evt.EventDB(.sha1), .sha1, moment, arena) catch break :blk null;│ │849 + break :blk if (newest) |revision| revision.record.commit_count else 0; │ │850 + }; │ │851 return .{ │ │852 .id = try aa.dupe(u8, &id_hex), │ │853 .record = patch, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ │854 .author = try ui.Author.initFromEmail(admin_moment, arena, patch.author_email), │ │855 .draft = true, │ │856 .revision_oid = try aa.dupe(u8, &fork_oid), │ │857 + .commit_count = commit_count, │ │858 .no_changes = if (target_oid) |oid| std.mem.eql(u8, &oid, &fork_oid) else false,│ │859 .fork_exists = true, │ │860 }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │493 return if (supports_merge) Data.mergeRoute(identity, selected) else null; │ │494 } │ │495 │ │496 - fn forkRoute(identity: []const u8, id: []const u8) ?ui.RoutablePage { │ │497 - return if (supports_forks) Data.forkRoute(identity, id) else null; │ │498 - } │ │499 - │ │496 fn resolveRoute(identity: []const u8, selected: []const u8, picks: []const u8) ?ui.RoutablePage {│ │497 return if (supports_conflicts) Data.resolveRoute(identity, selected, picks) else null; │ │498 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │537 const pa = self.session.page_arena.allocator(); │ │538 │ │539 if (entryHasFork(entry) and self.session.data.current_page.parent() != .fork) { │ │544 - const route = forkRoute(self.data.identity, entry.id) orelse return error.RouteTooLong; │ │545 - try addToolButton(allocator, row, "view fork", "", try std.fmt.allocPrint(pa, "a:{s}", .{try route.toUrl(self.session.page_arena)})); │ │540 const diff_route = ui.RoutablePage.forkDiffRoute(self.data.identity, entry.id, 0, "") orelse return error.RouteTooLong; │ │541 try addToolButton(allocator, row, "view diff", "", try std.fmt.allocPrint(pa, "a:{s}", .{try diff_route.toUrl(self.session.page_arena)}));│ │542 + const commits_route = ui.RoutablePage.forkCommitsRoute(self.data.identity, entry.id, "", 0, "") orelse return error.RouteTooLong; │ │543 + const commit_count = if (supports_forks) entry.commit_count else null; │ │544 + const label = if (commit_count) |count| try std.fmt.allocPrint(pa, "view commits ({d})", .{count}) else "view commits"; │ │545 + try addToolButton(allocator, row, label, "", try std.fmt.allocPrint(pa, "a:{s}", .{try commits_route.toUrl(self.session.page_arena)})); │ │546 } │ │547 │ │548 { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯