╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │901 if (std.mem.eql(u8, w, "new")) return if (tag_value.len == 0) repoIssuesNewRoute(pair) else null; │ │902 return null; │ │903 } │ │904 + if (std.mem.eql(u8, tab, "discussions")) { │ │905 + const word = params.scanTail(&segments) catch return null; │ │906 + const tag_value = params.values.get(.tag) orelse ""; │ │907 + const view = word orelse return if (params.only(&.{})) repoDiscussionsRoute(pair, "", "") else null; │ │908 + if (!params.only(&.{.tag})) return null; │ │909 + 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;│ │912 + return null; │ │913 + } │ │914 if (std.mem.eql(u8, tab, "events")) { │ │915 const view = if (segments.next()) |word| │ │916 std.meta.stringToEnum(EventsView, word) orelse return null │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │983 a_i.view == b.repo_issues.view and │ │984 a_i.comments_start == b.repo_issues.comments_start and │ │985 std.mem.eql(u8, a_i.comment.slice(), b.repo_issues.comment.slice()), │ │986 + .repo_discussions => |a_t| std.mem.eql(u8, a_t.name.slice(), b.repo_discussions.name.slice()) and│ │987 + std.mem.eql(u8, a_t.tag.slice(), b.repo_discussions.tag.slice()) and │ │988 + std.mem.eql(u8, a_t.selected.slice(), b.repo_discussions.selected.slice()) and │ │989 + a_t.view == b.repo_discussions.view and │ │990 + a_t.comments_start == b.repo_discussions.comments_start and │ │991 + std.mem.eql(u8, a_t.comment.slice(), b.repo_discussions.comment.slice()), │ │992 .repo_events => |a_e| std.mem.eql(u8, a_e.name.slice(), b.repo_events.name.slice()) and │ │993 a_e.view == b.repo_events.view and │ │994 a_e.kind == b.repo_events.kind and │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────╮ │1857 repo_files_header: Repo.Files.Header.View, │ │1858 repo_commits_header: Repo.Commits.Header.View, │ │1859 repo_issues_header: Repo.Issues.Header, │ │1860 + repo_discussions_header: Repo.Discussions.Header,│ │1861 repo_files: Repo.Files.View, │ │1862 repo_commits: Repo.Commits.View, │ │1863 repo_refs: Repo.Refs.View, │ ╰───────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────╮ │1864 repo_issues: Repo.Issues.View, │ │1865 + repo_discussions: Repo.Discussions.View, │ │1866 repo_events_header: Repo.Events.Header.View,│ │1867 repo_events: Repo.Events.View, │ │1868 repo_comment: Repo.Comment.Item, │ ╰──────────────────────────────────────────────────────╯ ╭ 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 Discussions = @import("./Repo/Discussions.zig");│ │20 pub const Comment = @import("./Repo/Comment.zig"); │ │21 pub const Events = @import("./Repo/Events.zig"); │ │22 pub const Settings = @import("./Settings.zig"); │ ╰──────────────────────────────────────────────────────────────╯ ╭─────────────────────────────╮ │31 commits: Commits, │ │32 refs: Refs, │ │33 issues: Issues, │ │34 +discussions: Discussions,│ │35 events: Events, │ │36 settings: Settings, │ │37 auth: Auth, │ ╰─────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │128 const issues_comments_start: usize = switch (route) { │ │129 .repo_issues => |i| i.comments_start, │ │130 else => 0, │ │131 + }; │ │132 + const discussions_tag: []const u8 = switch (route) { │ │133 + .repo_discussions => |*t| t.tag.slice(), │ │134 + else => "", │ │135 + }; │ │136 + const discussions_selected: []const u8 = switch (route) { │ │137 + .repo_discussions => |*t| t.selected.slice(), │ │138 + else => "", │ │139 + }; │ │140 + const discussions_comment: []const u8 = switch (route) { │ │141 + .repo_discussions => |*t| t.comment.slice(), │ │142 + else => "", │ │143 + }; │ │144 + const discussions_view: ui.RoutablePage.DiscussionsView = switch (route) {│ │145 + .repo_discussions => |t| t.view, │ │146 + else => .all, │ │147 }; │ │148 + const discussions_comments_start: usize = switch (route) { │ │149 + .repo_discussions => |t| t.comments_start, │ │150 + else => 0, │ │151 + }; │ │152 const events_kind: ?evt.EventKind = switch (route) { │ │153 .repo_events => |e| e.kind, │ │154 else => null, │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │203 // route named none), so they end up viewing the same one and either's │ │204 // resolved ref can canonicalize the tab mirror urls below. no filesystem │ │205 // (wasm), nowhere to look, or a failed open: empty tabs. │ │184 - const files, const commits, const refs, var issues, const events = blk: { │ │206 + const files, const commits, const refs, var issues, var discussions, const events = blk: {│ │207 read: { │ │208 const io = session.io orelse break :read; │ │209 const src = source orelse break :read; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │221 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), │ │222 try Refs.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, refs_kind, refs_from), │ │223 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), │ │224 + try Discussions.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, discussions_tag, discussions_selected, discussions_comment, discussions_comments_start, discussions_view),│ │225 try Events.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, events_view, events_kind, events_selected, session.local != null, session.data.sync_failure), │ │226 }; │ │227 }, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │235 try Commits.emptyResult(aa, repo_identity.identity, requested_ref_or_oid orelse .branch, requested_ref_value, commits_content), │ │236 try Refs.emptyResult(arena, repo_identity.identity, refs_kind, refs_from), │ │237 try Issues.emptyResult(aa, repo_identity.identity, issues_tag, issues_selected, issues_comment, issues_comments_start, issues_theirs, issues_view), │ │238 + try Discussions.emptyResult(aa, repo_identity.identity, discussions_tag, discussions_selected, discussions_comment, discussions_comments_start, discussions_view),│ │239 try Events.empty(aa, repo_identity.identity, events_view, session.local != null, session.data.sync_failure), │ │240 }; │ │241 }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯