╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │242 issues.repo_source = source; │ │243 + discussions.repo_source = source; │ │244 │ │245 // each tab mirror carries this page's route for that tab; tabs not targeted│ │246 // by the incoming route fall back to their root/first-page route. the files│ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │261 return .{ │ │262 // files and commits resolve the same ref, so either's serves the header, │ │263 // which points both tabs at it. │ │239 - .header = try Header.init(arena, repo.event.name, owner_name, files.ref_or_oid, files.ref_or_oid_value, issues_tag), │ │264 + .header = try Header.init(arena, repo.event.name, owner_name, files.ref_or_oid, files.ref_or_oid_value, issues_tag, discussions_tag),│ │265 .repo = repo, │ │266 .files = files, │ │267 .commits = commits, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────╮ │268 .refs = refs, │ │269 .issues = issues, │ │270 + .discussions = discussions, │ │271 .events = events, │ │272 .settings = Settings.init(),│ │273 .auth = Auth.init(), │ ╰─────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │330 try stack.children.put(allocator, issues_view.getFocus().id, .{ .repo_issues = issues_view }); │ │331 } │ │332 │ │333 + // discussions and their comment permalinks. │ │334 { │ │335 + var discussions_view = try Discussions.View.init(allocator, &data.discussions, session); │ │336 + errdefer discussions_view.deinit(allocator); │ │337 + try stack.children.put(allocator, discussions_view.getFocus().id, .{ .repo_discussions = discussions_view });│ │338 + } │ │339 + │ │340 + { │ │341 var events_view = try Events.View.init(allocator, &data.events, session); │ │342 errdefer events_view.deinit(allocator); │ │343 try stack.children.put(allocator, events_view.getFocus().id, .{ .repo_events = events_view }); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │396 // the issues tab mirrors this page's tag filter (issue urls │ │397 // themselves never carry the tag). │ │398 .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, │ │399 + .repo_discussions => self.session.data.current_page = ui.RoutablePage.repoDiscussionsRoute(self.data.identity.slice(), self.data.discussions.tag, "") orelse self.session.data.current_page,│ │400 .repo_events => self.session.data.current_page = ui.RoutablePage.repoEventsRoute(self.data.identity.slice(), self.data.events.view, null, "") orelse self.session.data.current_page, │ │401 .home_settings => { │ │402 if (ui.RoutablePage.Array(ui.RoutablePage.repo_route_max_len).from(self.data.identity.slice())) |identity| │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │438 .repo_commits => |*v| v.getSelectedIndex() == 0, │ │439 .repo_refs => |*v| v.getSelectedIndex() == 0, │ │440 .repo_issues => |*v| v.getSelectedIndex() == 0, │ │441 + .repo_discussions => |*v| v.getSelectedIndex() == 0,│ │442 .repo_events => |*v| v.getSelectedIndex() == 0, │ │443 .home_settings => |*v| v.getSelectedIndex() == 0, │ │444 .home_auth => |*v| v.getSelectedIndex() == 0, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Comment.zig│ ╰───────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │146 const gap_index: usize = 2; │ │147 const metadata_first_link_index: usize = 1; │ │148 │ │149 - pub fn init(allocator: std.mem.Allocator, session: *ui.Session, identity: []const u8, entry: CommentWithId) !Item { │ │149 + pub fn init(allocator: std.mem.Allocator, session: *ui.Session, identity: []const u8, thread_kind: evt.EventKind, entry: CommentWithId) !Item {│ │150 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .vert }); │ │151 errdefer box.deinit(allocator); │ │152 var remove_button_id: ?usize = null; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │163 errdefer author.deinit(allocator); │ │164 try bar.children.put(allocator, author.getFocus().id, .{ .widget = .{ .text_box = author }, .rect = null, .min_size = null, .shrink = true }); │ │165 │ │166 - var reply = try linkBox(allocator, session, "new reply", ui.RoutablePage.repoCommentNewRoute(identity, &entry.comment.event.thread_id, &entry.id) orelse return error.RouteTooLong);│ │166 + var reply = try linkBox(allocator, session, "new reply", commentNewRoute(thread_kind, identity, &entry.comment.event.thread_id, &entry.id) orelse return error.RouteTooLong); │ │167 errdefer reply.deinit(allocator); │ │168 try bar.children.put(allocator, reply.getFocus().id, .{ .widget = .{ .text_box = reply }, .rect = null, .min_size = .{ .width = "new reply".len + 2, .height = null } }); │ │169 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │170 if (!entry.comment.removed) { │ │171 - var edit = try linkBox(allocator, session, "edit comment", ui.RoutablePage.repoCommentEditRoute(identity, &entry.comment.event.thread_id, &entry.id) orelse return error.RouteTooLong);│ │171 + var edit = try linkBox(allocator, session, "edit comment", commentEditRoute(thread_kind, identity, &entry.comment.event.thread_id, &entry.id) orelse return error.RouteTooLong); │ │172 errdefer edit.deinit(allocator); │ │173 try bar.children.put(allocator, edit.getFocus().id, .{ .widget = .{ .text_box = edit }, .rect = null, .min_size = .{ .width = "edit comment".len + 2, .height = null } }); │ │174 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │175 │ │176 - var permalink = try linkBox(allocator, session, "permalink", ui.RoutablePage.repoCommentsRoute(identity, &entry.comment.event.thread_id, &entry.id, 0) orelse return error.RouteTooLong);│ │176 + var permalink = try linkBox(allocator, session, "permalink", commentsRoute(thread_kind, identity, &entry.comment.event.thread_id, &entry.id, 0) orelse return error.RouteTooLong); │ │177 errdefer permalink.deinit(allocator); │ │178 try bar.children.put(allocator, permalink.getFocus().id, .{ .widget = .{ .text_box = permalink }, .rect = null, .min_size = .{ .width = "permalink".len + 2, .height = null } }); │ │179 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯