╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────╮ │16 pub const Commits = @import("./Repo/Commits.zig"); │ │17 pub const Refs = @import("./Repo/Refs.zig"); │ │18 pub const Issues = @import("./Repo/Issues.zig"); │ │19 -pub const Comments = @import("./Repo/Comments.zig");│ │19 +pub const Comment = @import("./Repo/Comment.zig"); │ │20 pub const Settings = @import("./Settings.zig"); │ │21 pub const Auth = @import("./Auth.zig"); │ │22 pub const Quit = @import("./Quit.zig"); │ ╰────────────────────────────────────────────────────────╯ ╭────────────────────────╮ │29 commits: Commits, │ │30 refs: Refs, │ │31 issues: Issues, │ │32 -comments: ?Comments,│ │32 settings: Settings, │ │33 auth: Auth, │ │34 quit: Quit, │ ╰────────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │109 .repo_issues => |*i| i.selected.slice(), │ │110 else => "", │ │111 }; │ │112 + const issues_comment: []const u8 = switch (route) {│ │113 + .repo_issues => |*i| i.comment.slice(), │ │114 + else => "", │ │115 + }; │ │116 const issues_theirs: []const u8 = switch (route) { │ │117 .repo_issues => |*i| i.theirs.slice(), │ │118 else => "", │ ╰────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │167 // route named none), so they end up viewing the same one and either's │ │168 // resolved ref can canonicalize the tab mirror urls below. no filesystem │ │169 // (wasm), nowhere to look, or a failed open: empty tabs. │ │167 - const files, const commits, const refs, var issues, const comments = blk: {│ │170 + const files, const commits, const refs, var issues = blk: { │ │171 read: { │ │172 const io = session.io orelse break :read; │ │173 const src = source orelse break :read; │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │180 inline else => |*opened| { │ │181 // local mode: bring the event db up to date with the events branch │ │182 if (session.local != null) try evt.consume(repo_kind, opened.self_repo_opts, io, gpa, opened, evt.events_ref, &.{}); │ │180 - const comments = switch (route) { │ │181 - .repo_comments => |*c| try Comments.initFromRepo(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, c.thread.slice(), c.selected.slice(), c.start),│ │182 - else => null, │ │183 - }; │ │183 break :blk .{ │ │184 try Files.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, requested_ref_or_oid, requested_ref_value, files_dir, files_line), │ │185 try Commits.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, session.haxy_moment, repo_identity.identity, requested_ref_or_oid, requested_ref_value, commits_content), │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │186 try Refs.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, refs_kind, refs_from), │ │188 - if (comments == null) │ │189 - try Issues.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, issues_tag, issues_selected, issues_comments_start, issues_theirs, issues_view) │ │190 - else │ │191 - try Issues.emptyResult(arena.allocator(), repo_identity.identity, "", "", 0, "", .open), │ │192 - comments, │ │187 + try Issues.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, issues_tag, issues_selected, issues_comment, issues_comments_start, issues_theirs, issues_view),│ │188 }; │ │189 }, │ │190 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │196 try Files.emptyResult(aa, repo_identity.identity, requested_ref_or_oid orelse .branch, requested_ref_value, files_dir), │ │197 try Commits.emptyResult(aa, repo_identity.identity, requested_ref_or_oid orelse .branch, requested_ref_value, commits_content), │ │198 try Refs.emptyResult(arena, repo_identity.identity, refs_kind, refs_from), │ │204 - try Issues.emptyResult(aa, repo_identity.identity, issues_tag, issues_selected, issues_comments_start, issues_theirs, issues_view), │ │205 - null, │ │199 + try Issues.emptyResult(aa, repo_identity.identity, issues_tag, issues_selected, issues_comment, issues_comments_start, issues_theirs, issues_view),│ │200 }; │ │201 }; │ │208 - if (std.meta.activeTag(route) == .repo_comments and comments == null) return error.NotFound; │ │202 issues.repo_source = source; │ │203 │ │204 // each tab mirror carries this page's route for that tab; tabs not targeted │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────╮ │226 .commits = commits, │ │227 .refs = refs, │ │228 .issues = issues, │ │236 - .comments = comments, │ │229 .settings = Settings.init(),│ │230 .auth = Auth.init(), │ │231 .quit = Quit.init(), │ ╰─────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │280 try stack.children.put(allocator, refs_view.getFocus().id, .{ .repo_refs = refs_view }); │ │281 } │ │282 │ │291 - // issues — the repo's issue tracker or a comment permalink. │ │283 + // issues — the repo's issue tracker and comment permalinks. │ │284 { │ │293 - if (data.comments) |*comments| { │ │294 - var comments_view = try Comments.View.init(allocator, comments, session); │ │295 - errdefer comments_view.deinit(allocator); │ │296 - try stack.children.put(allocator, comments_view.getFocus().id, .{ .repo_comments = comments_view });│ │297 - } else { │ │298 - var issues_view = try Issues.View.init(allocator, &data.issues, session); │ │299 - errdefer issues_view.deinit(allocator); │ │300 - try stack.children.put(allocator, issues_view.getFocus().id, .{ .repo_issues = issues_view }); │ │301 - } │ │285 + var issues_view = try Issues.View.init(allocator, &data.issues, session); │ │286 + errdefer issues_view.deinit(allocator); │ │287 + try stack.children.put(allocator, issues_view.getFocus().id, .{ .repo_issues = issues_view }); │ │288 } │ │289 │ │290 // the header only shows the settings tab with a login and the auth │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │340 // the issues tab mirrors this page's tag filter (issue urls │ │341 // themselves never carry the tag). │ │342 .repo_issues => self.session.data.current_page = ui.RoutablePage.repoIssuesRoute(self.data.identity.slice(), .open, self.data.issues.tag, "") orelse self.session.data.current_page,│ │357 - // the comment view mirrors its own content route when built. │ │358 - .repo_comments => {}, │ │343 .home_settings => { │ │344 if (ui.RoutablePage.Array(ui.RoutablePage.repo_route_max_len).from(self.data.identity.slice())) |identity| │ │345 self.session.data.current_page = .{ .repo_settings = identity }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯