╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │145 .selected_id = try aa.dupe(u8, selected_id),│ │146 + .comments_start = comments_start, │ │147 .open = .empty, │ │148 .closed = .empty, │ │149 .conflicts = .empty, │ ╰─────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────╮ │177 identity: []const u8, │ │178 tag: []const u8, │ │179 selected_id: []const u8, │ │180 + comments_start: usize, │ │181 theirs_picks: []const u8, │ │182 view: ui.RoutablePage.IssuesView,│ │183 ) !Self { │ ╰──────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │178 - const empty = try emptyResult(arena.allocator(), identity, tag, selected_id, theirs_picks, view); │ │184 + const empty = try emptyResult(arena.allocator(), identity, tag, selected_id, comments_start, theirs_picks, view);│ │185 │ │186 const aa = arena.allocator(); │ │187 const DB = evt.EventDB(repo_opts.hash); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │296 } │ │297 } │ │298 │ │293 - const open_window = try loadWindow(repo_opts.hash, arena, admin_moment, event_id_to_issue, open_set, open_root, conflict_set); │ │294 - const closed_window = try loadWindow(repo_opts.hash, arena, admin_moment, event_id_to_issue, closed_set, closed_root, conflict_set); │ │295 - const conflicts_window = try loadWindow(repo_opts.hash, arena, admin_moment, event_id_to_issue, conflict_set, conflicts_root, conflict_set); │ │299 + const open_window = try loadWindow(repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_issue, open_set, open_root, conflict_set, empty.selected_id, comments_start); │ │300 + const closed_window = try loadWindow(repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_issue, closed_set, closed_root, conflict_set, empty.selected_id, comments_start); │ │301 + const conflicts_window = try loadWindow(repo_opts.hash, arena, admin_moment, haxy_moment, event_id_to_issue, conflict_set, conflicts_root, conflict_set, empty.selected_id, comments_start);│ │302 if (view == .conflicts and conflicts_window.count > 0) resolved_view = .conflicts; │ │303 │ │304 // every tag in the repo, in the tag map's sorted order. the keys are │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────╮ │325 .identity = empty.identity, │ │326 .tag = empty.tag, │ │327 .selected_id = empty.selected_id,│ │328 + .comments_start = comments_start,│ │329 .open = open_window, │ │330 .closed = closed_window, │ │331 .conflicts = conflicts_window, │ ╰──────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │367 comptime hash_kind: hash.HashKind, │ │368 arena: *std.heap.ArenaAllocator, │ │369 admin_moment: ?evt.AdminDB.HashMap(.read_only), │ │370 + haxy_moment: evt.EventDB(hash_kind).HashMap(.read_only), │ │371 event_id_to_issue: evt.EventDB(hash_kind).HashMap(.read_only),│ │372 set_maybe: ?evt.EventDB(hash_kind).SortedSet(.read_only), │ │373 root_key: ?[]const u8, │ ╰───────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │374 conflict_set: ?evt.EventDB(hash_kind).SortedSet(.read_only),│ │375 + selected_id: []const u8, │ │376 + comments_start: usize, │ │377 ) !Window { │ │378 const set = set_maybe orelse return .empty; │ │379 const DB = evt.EventDB(hash_kind); │ ╰─────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │420 .issue = issue_event, │ │421 .author = try ui.Author.initFromEmail(admin_moment, arena, issue_event.author_email),│ │422 .conflicted = if (conflict_set) |cs| try cs.contains(&order_key) else false, │ │423 + .comments = try Comments.loadWindow( │ │424 + hash_kind, │ │425 + arena, │ │426 + admin_moment, │ │427 + haxy_moment, │ │428 + evt.Comment.thread_id_to_comment_id_set_key, │ │429 + &id_hex, │ │430 + if (std.mem.eql(u8, &id_hex, selected_id)) comments_start else 0, │ │431 + ), │ │432 }); │ │433 } │ │434 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │728 if (win.prev_id) |prev| │ │729 try addRow(allocator, &list_box, "← previous", "", try windowLink(session.page_arena, data, status_maybe, prev)); │ │730 for (win.issues) |entry| { │ │712 - // conflicted issues carry a marker in the status lists │ │713 - const label: []const u8 = if (entry.conflicted and status_maybe != null) "[conflict]" else ""; │ │731 + // conflicts take precedence over the comment count │ │732 + const label: []const u8 = if (entry.conflicted and status_maybe != null) │ │733 + " conflict " │ │734 + else if (entry.comments.count > 0) │ │735 + try std.fmt.allocPrint(session.page_arena.allocator(), " {d} comments ", .{entry.comments.count}) │ │736 + else │ │737 + ""; │ │738 try addRow(allocator, &list_box, entry.issue.event.title, label, try issueRowLink(session.page_arena, data.identity, entry.id));│ │739 } │ │740 if (win.next_id) |next| │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1180 (if (self.data.description_page) │ │1181 ui.RoutablePage.repoIssuesDescriptionRoute(self.data.identity, self.data.selected_id) │ │1182 else │ │1159 - ui.RoutablePage.repoIssuesRoute(self.data.identity, .open, self.data.tag, self.data.selected_id)) │ │1183 + ui.RoutablePage.repoIssueCommentsRoute(self.data.identity, self.data.selected_id, self.data.comments_start))│ │1184 else if (index == tags_view_index) │ │1185 ui.RoutablePage.repoIssuesTagsRoute(self.data.identity, self.data.tag) │ │1186 else │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯