╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │842 const word = params.scanTail(&segments) catch return null; │ │843 if (word) |last| { │ │844 if (!params.only(&.{})) return null; │ │869 - if (std.mem.eql(u8, last, "new")) return repoDiscussionCommentNewRoute(pair, discussion_id, comment_id); │ │870 - if (std.mem.eql(u8, last, "edit")) return repoDiscussionCommentEditRoute(pair, discussion_id, comment_id); │ │845 + if (std.mem.eql(u8, last, "new")) return repoThreadCommentNewRoute(.discussion, pair, discussion_id, comment_id); │ │846 + if (std.mem.eql(u8, last, "edit")) return repoThreadCommentEditRoute(.discussion, pair, discussion_id, comment_id);│ │847 return null; │ │848 } │ │849 if (!params.only(&.{.start})) return null; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │874 - return repoDiscussionCommentRoute(pair, discussion_id, comment_id, params.start() orelse return null); │ │850 + return repoThreadCommentRoute(.discussion, pair, discussion_id, comment_id, params.start() orelse return null);│ │851 } │ │852 } │ │853 const word = params.scanTail(&segments) catch return null; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │854 if (word) |tail| { │ │879 - if (std.mem.eql(u8, tail, "new")) return if (params.only(&.{})) repoDiscussionCommentNewRoute(pair, discussion_id, "") else null; │ │880 - if (std.mem.eql(u8, tail, "edit")) return if (params.only(&.{})) repoDiscussionsEditRoute(pair, discussion_id) else null; │ │881 - if (std.mem.eql(u8, tail, "description")) return if (params.only(&.{})) repoDiscussionsDescriptionRoute(pair, discussion_id) else null; │ │855 + if (std.mem.eql(u8, tail, "new")) return if (params.only(&.{})) repoThreadCommentNewRoute(.discussion, pair, discussion_id, "") else null; │ │856 + if (std.mem.eql(u8, tail, "edit")) return if (params.only(&.{})) repoThreadEditRoute(.discussion, pair, discussion_id) else null; │ │857 + if (std.mem.eql(u8, tail, "description")) return if (params.only(&.{})) repoThreadDescriptionRoute(.discussion, pair, discussion_id) else null;│ │858 return null; │ │859 } │ │860 if (!params.only(&.{.start})) return null; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │885 - return repoDiscussionCommentsRoute(pair, discussion_id, params.start() orelse return null); │ │861 + return repoThreadCommentsRoute(.discussion, pair, discussion_id, params.start() orelse return null);│ │862 } │ │863 if (std.mem.eql(u8, tab, "issues")) { │ │864 // the word is a list view; a filter with neither is never emitted. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │873 } │ │874 if (!params.only(&.{.tag})) return null; │ │875 if (std.meta.stringToEnum(evt.Issue.Status, w)) |status| return repoIssuesRoute(pair, status, tag_value, "");│ │900 - if (std.mem.eql(u8, w, "tags")) return repoIssuesTagsRoute(pair, tag_value); │ │901 - if (std.mem.eql(u8, w, "new")) return if (tag_value.len == 0) repoIssuesNewRoute(pair) else null; │ │876 + if (std.mem.eql(u8, w, "tags")) return repoThreadTagsRoute(.issue, pair, tag_value); │ │877 + if (std.mem.eql(u8, w, "new")) return if (tag_value.len == 0) repoThreadNewRoute(.issue, pair) else null; │ │878 return null; │ │879 } │ │880 if (std.mem.eql(u8, tab, "discussions")) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │883 const view = word orelse return if (params.only(&.{})) repoDiscussionsRoute(pair, "", "") else null; │ │884 if (!params.only(&.{.tag})) return null; │ │885 if (std.mem.eql(u8, view, "all")) return repoDiscussionsRoute(pair, tag_value, ""); │ │910 - if (std.mem.eql(u8, view, "tags")) return repoDiscussionsTagsRoute(pair, tag_value); │ │911 - if (std.mem.eql(u8, view, "new")) return if (tag_value.len == 0) repoDiscussionsNewRoute(pair) else null; │ │886 + if (std.mem.eql(u8, view, "tags")) return repoThreadTagsRoute(.discussion, pair, tag_value); │ │887 + if (std.mem.eql(u8, view, "new")) return if (tag_value.len == 0) repoThreadNewRoute(.discussion, pair) else null;│ │888 return null; │ │889 } │ │890 if (std.mem.eql(u8, tab, "events")) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Comment.zig│ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │337 } │ │338 │ │339 fn commentsRoute(kind: evt.EventKind, identity: []const u8, thread_id: []const u8, selected_id: ?[]const u8, start: usize) ?ui.RoutablePage { │ │340 - return switch (kind) { │ │341 - .issue => if (selected_id) |id| ui.RoutablePage.repoCommentsRoute(identity, thread_id, id, start) else ui.RoutablePage.repoIssueCommentsRoute(identity, thread_id, start), │ │342 - .discussion => if (selected_id) |id| ui.RoutablePage.repoDiscussionCommentRoute(identity, thread_id, id, start) else ui.RoutablePage.repoDiscussionCommentsRoute(identity, thread_id, start),│ │343 - else => null, │ │344 - }; │ │340 + return if (selected_id) |id| │ │341 + ui.RoutablePage.repoThreadCommentRoute(kind, identity, thread_id, id, start) │ │342 + else │ │343 + ui.RoutablePage.repoThreadCommentsRoute(kind, identity, thread_id, start); │ │344 } │ │345 │ │346 fn commentNewRoute(kind: evt.EventKind, identity: []const u8, thread_id: []const u8, parent_id: []const u8) ?ui.RoutablePage { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │348 - return switch (kind) { │ │349 - .issue => ui.RoutablePage.repoCommentNewRoute(identity, thread_id, parent_id), │ │350 - .discussion => ui.RoutablePage.repoDiscussionCommentNewRoute(identity, thread_id, parent_id), │ │351 - else => null, │ │352 - }; │ │347 + return ui.RoutablePage.repoThreadCommentNewRoute(kind, identity, thread_id, parent_id); │ │348 } │ │349 │ │350 fn commentEditRoute(kind: evt.EventKind, identity: []const u8, thread_id: []const u8, comment_id: []const u8) ?ui.RoutablePage {│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │356 - return switch (kind) { │ │357 - .issue => ui.RoutablePage.repoCommentEditRoute(identity, thread_id, comment_id), │ │358 - .discussion => ui.RoutablePage.repoDiscussionCommentEditRoute(identity, thread_id, comment_id), │ │359 - else => null, │ │360 - }; │ │351 + return ui.RoutablePage.repoThreadCommentEditRoute(kind, identity, thread_id, comment_id); │ │352 } │ │353 │ │354 pub fn linkBox(allocator: std.mem.Allocator, session: *ui.Session, text: []const u8, route: ui.RoutablePage) !wgt.TextBox(ui.Widget) {│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────────╮ │src/ui/Repo/Discussions.zig│ ╰───────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │290 │ │291 // tags tab, labeled with the active tag filter │ │292 { │ │293 - const tags_route = ui.RoutablePage.repoDiscussionsTagsRoute(data.identity, data.tag) orelse return error.RouteTooLong; │ │293 + const tags_route = ui.RoutablePage.repoThreadTagsRoute(.discussion, data.identity, data.tag) orelse return error.RouteTooLong;│ │294 const tags_link = try std.fmt.allocPrint(aa, "ai:{s}", .{try tags_route.toUrl(session.page_arena)}); │ │295 const label = if (data.tag.len == 0) "tags" else blk: { │ │296 const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.tag)); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯