╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │302 // new-discussion tab; an edit or comment url shows its tab in this place │ │303 { │ │304 const route = switch (data.view) { │ │305 - .edit => ui.RoutablePage.repoDiscussionsEditRoute(data.identity, data.selected_id) orelse return error.RouteTooLong, │ │306 - .new_comment => ui.RoutablePage.repoDiscussionCommentNewRoute(data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong, │ │307 - .edit_comment => ui.RoutablePage.repoDiscussionCommentEditRoute(data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong, │ │308 - else => ui.RoutablePage.repoDiscussionsNewRoute(data.identity) orelse return error.RouteTooLong, │ │305 + .edit => ui.RoutablePage.repoThreadEditRoute(.discussion, data.identity, data.selected_id) orelse return error.RouteTooLong, │ │306 + .new_comment => ui.RoutablePage.repoThreadCommentNewRoute(.discussion, data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong, │ │307 + .edit_comment => ui.RoutablePage.repoThreadCommentEditRoute(.discussion, data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong,│ │308 + else => ui.RoutablePage.repoThreadNewRoute(.discussion, data.identity) orelse return error.RouteTooLong, │ │309 }; │ │310 const link = try std.fmt.allocPrint(aa, "ai:{s}", .{try route.toUrl(session.page_arena)}); │ │311 const label: []const u8 = switch (data.view) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Events.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │229 const record = (try readRecord(evt.Issue, hash_kind, arena, haxy_moment, id)) orelse return null; │ │230 item.author = try ui.Author.initFromEmail(admin_moment, arena, record.author_email); │ │231 if (!include_view_url) return item; │ │232 - const route = ui.RoutablePage.repoIssueCommentsRoute(identity, item.id, 0) orelse return error.RouteTooLong; │ │232 + const route = ui.RoutablePage.repoThreadCommentsRoute(.issue, identity, item.id, 0) orelse return error.RouteTooLong;│ │233 item.view_url = try route.toUrl(arena); │ │234 }, │ │235 .discussion => { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │236 const record = (try readRecord(evt.Discussion, hash_kind, arena, haxy_moment, id)) orelse return null; │ │237 item.author = try ui.Author.initFromEmail(admin_moment, arena, record.author_email); │ │238 if (!include_view_url) return item; │ │239 - const route = ui.RoutablePage.repoDiscussionCommentsRoute(identity, item.id, 0) orelse return error.RouteTooLong; │ │239 + const route = ui.RoutablePage.repoThreadCommentsRoute(.discussion, identity, item.id, 0) orelse return error.RouteTooLong;│ │240 item.view_url = try route.toUrl(arena); │ │241 }, │ │242 .comment => { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │246 var thread_id: [evt.event_id_size]u8 = undefined; │ │247 _ = std.fmt.hexToBytes(&thread_id, &record.event.thread_id) catch return error.InvalidEventId; │ │248 const thread_kind = (try evt.readEventKind(hash_kind, kind_map, &thread_id)) orelse return item; │ │249 - const route = switch (thread_kind) { │ │250 - .issue => ui.RoutablePage.repoCommentsRoute(identity, &record.event.thread_id, item.id, 0), │ │251 - .discussion => ui.RoutablePage.repoDiscussionCommentRoute(identity, &record.event.thread_id, item.id, 0), │ │252 - else => null, │ │253 - } orelse return item; │ │249 + const route = ui.RoutablePage.repoThreadCommentRoute(thread_kind, identity, &record.event.thread_id, item.id, 0) orelse return item;│ │250 item.view_url = try route.toUrl(arena); │ │251 }, │ │252 .attach => { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │256 var parent_id: [evt.event_id_size]u8 = undefined; │ │257 _ = std.fmt.hexToBytes(&parent_id, &record.event.parent_id) catch return error.InvalidEventId; │ │258 const parent_kind = (try evt.readEventKind(hash_kind, kind_map, &parent_id)) orelse return item; │ │263 - const route = switch (parent_kind) { │ │264 - .issue => ui.RoutablePage.repoIssueCommentsRoute(identity, &record.event.parent_id, 0), │ │265 - .discussion => ui.RoutablePage.repoDiscussionCommentsRoute(identity, &record.event.parent_id, 0), │ │266 - else => null, │ │267 - } orelse return item; │ │259 + const route = ui.RoutablePage.repoThreadCommentsRoute(parent_kind, identity, &record.event.parent_id, 0) orelse return item;│ │260 item.view_url = try route.toUrl(arena); │ │261 }, │ │262 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │593 │ │594 // tags tab, labeled with the active tag filter │ │595 { │ │596 - const tags_route = ui.RoutablePage.repoIssuesTagsRoute(data.identity, data.tag) orelse return error.RouteTooLong; │ │596 + const tags_route = ui.RoutablePage.repoThreadTagsRoute(.issue, data.identity, data.tag) orelse return error.RouteTooLong;│ │597 const tags_link = try std.fmt.allocPrint(aa, "ai:{s}", .{try tags_route.toUrl(session.page_arena)}); │ │598 const label = if (data.tag.len == 0) "tags" else blk: { │ │599 const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.tag)); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │605 // new-issue tab; an edit or resolve url shows its tab in this place │ │606 { │ │607 const route = switch (data.view) { │ │608 - .edit => ui.RoutablePage.repoIssuesEditRoute(data.identity, data.selected_id) orelse return error.RouteTooLong, │ │609 - .new_comment => ui.RoutablePage.repoCommentNewRoute(data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong, │ │610 - .edit_comment => ui.RoutablePage.repoCommentEditRoute(data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong, │ │608 + .edit => ui.RoutablePage.repoThreadEditRoute(.issue, data.identity, data.selected_id) orelse return error.RouteTooLong, │ │609 + .new_comment => ui.RoutablePage.repoThreadCommentNewRoute(.issue, data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong, │ │610 + .edit_comment => ui.RoutablePage.repoThreadCommentEditRoute(.issue, data.identity, data.selected_id, data.comment_id) orelse return error.RouteTooLong,│ │611 .resolve => ui.RoutablePage.repoIssuesResolveRoute(data.identity, data.selected_id, data.theirs_picks) orelse return error.RouteTooLong, │ │612 - else => ui.RoutablePage.repoIssuesNewRoute(data.identity) orelse return error.RouteTooLong, │ │612 + else => ui.RoutablePage.repoThreadNewRoute(.issue, data.identity) orelse return error.RouteTooLong, │ │613 }; │ │614 const link = try std.fmt.allocPrint(aa, "ai:{s}", .{try route.toUrl(session.page_arena)}); │ │615 const label: []const u8 = switch (data.view) { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Threads.zig│ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │106 } │ │107 │ │108 fn commentsRoute(identity: []const u8, selected: []const u8, start: usize) ?ui.RoutablePage { │ │109 - return switch (kind) { │ │110 - .issue => ui.RoutablePage.repoIssueCommentsRoute(identity, selected, start), │ │111 - .discussion => ui.RoutablePage.repoDiscussionCommentsRoute(identity, selected, start), │ │112 - else => @compileError("unsupported thread event kind"), │ │113 - }; │ │109 + return ui.RoutablePage.repoThreadCommentsRoute(kind, identity, selected, start); │ │110 } │ │111 │ │112 fn commentRoute(identity: []const u8, thread_id: []const u8, comment_id: []const u8, start: usize) ?ui.RoutablePage {│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │117 - return switch (kind) { │ │118 - .issue => ui.RoutablePage.repoCommentsRoute(identity, thread_id, comment_id, start), │ │119 - .discussion => ui.RoutablePage.repoDiscussionCommentRoute(identity, thread_id, comment_id, start),│ │120 - else => @compileError("unsupported thread event kind"), │ │121 - }; │ │113 + return ui.RoutablePage.repoThreadCommentRoute(kind, identity, thread_id, comment_id, start); │ │114 } │ │115 │ │116 fn newCommentRoute(identity: []const u8, thread_id: []const u8, parent_id: []const u8) ?ui.RoutablePage { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │125 - return switch (kind) { │ │126 - .issue => ui.RoutablePage.repoCommentNewRoute(identity, thread_id, parent_id), │ │127 - .discussion => ui.RoutablePage.repoDiscussionCommentNewRoute(identity, thread_id, parent_id), │ │128 - else => @compileError("unsupported thread event kind"), │ │129 - }; │ │117 + return ui.RoutablePage.repoThreadCommentNewRoute(kind, identity, thread_id, parent_id); │ │118 } │ │119 │ │120 fn editCommentRoute(identity: []const u8, thread_id: []const u8, comment_id: []const u8) ?ui.RoutablePage {│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯