╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │13 const Focus = xitui.focus.Focus; │ │14 const inp = @import("../input.zig"); │ │15 const diff3 = @import("../../diff3.zig"); │ │16 +const Comments = @import("Comments.zig"); │ │17 │ │18 const wasm = builtin.target.cpu.arch == .wasm32;│ │19 │ ╰────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────╮ │36 author: ui.Author = .unknown, │ │37 // whether the issue has an unresolved merge conflict │ │38 conflicted: bool = false, │ │39 + comments: Comments.Window = .empty, │ │40 }; │ │41 │ │42 // one side of a conflicted field: its value and who set it│ ╰───────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │84 // the hex event id of the issue its status's window is rooted at ("" = the│ │85 // first window), mirrored into the url. │ │86 selected_id: []const u8, │ │87 +// the selected issue's comment window (0 = the first window). │ │88 +comments_start: usize, │ │89 open: Window, │ │90 closed: Window, │ │91 // the conflicted issues' listing; its count also gates the conflicts tab. │ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │138 } │ │139 │ │140 // an empty listing, for the wasm / no-repo paths. │ │137 -pub fn emptyResult(aa: std.mem.Allocator, identity: []const u8, tag: []const u8, selected_id: []const u8, theirs_picks: []const u8, view: ui.RoutablePage.IssuesView) !Self { │ │141 +pub fn emptyResult(aa: std.mem.Allocator, identity: []const u8, tag: []const u8, selected_id: []const u8, comments_start: usize, theirs_picks: []const u8, view: ui.RoutablePage.IssuesView) !Self {│ │142 return .{ │ │143 .identity = try aa.dupe(u8, identity), │ │144 .tag = try aa.dupe(u8, tag), │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │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, │ ╰───────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯