╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────╮ │15 pub const Files = @import("./Repo/Files.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 Settings = @import("./Settings.zig"); │ │20 pub const Auth = @import("./Auth.zig"); │ │21 pub const Quit = @import("./Quit.zig"); │ ╰──────────────────────────────────────────────────────╯ ╭───────────────────────╮ │27 files: Files, │ │28 commits: Commits, │ │29 refs: Refs, │ │30 +issues: Issues, │ │31 settings: Settings,│ │32 auth: Auth, │ │33 quit: Quit, │ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │64 .repo_settings, .repo_auth => |n| n.slice(), │ │65 .repo_commits => |c| c.name.slice(), │ │66 .repo_refs => |r| r.name.slice(), │ │67 + .repo_issues => |i| i.name.slice(), │ │68 else => return error.UnexpectedRoute, │ │69 }; │ │70 const rf = ui.RoutablePage.RepoFiles.parse(name_str) orelse return error.NotFound;│ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │107 const refs_after: usize = switch (route) { │ │108 .repo_refs => |r| r.after, │ │109 else => 0, │ │110 + }; │ │111 + // the issue the issues tab's window is rooted at ("" = the first window). │ │112 + const issues_selected: []const u8 = switch (route) { │ │113 + .repo_issues => |i| i.selected.slice(), │ │114 + else => "", │ │115 }; │ │116 │ │117 const found = (try evt.Repo.readByOwnerAndName(DB, hash_kind, haxy_moment, arena, rf.owner, rf.name)) orelse return error.NotFound;│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │147 .files = files, │ │148 .commits = commits, │ │149 .refs = try Refs.init(arena, session, &found.event_id, rf.identity, refs_kind, refs_after),│ │150 + .issues = try Issues.init(arena, session, &found.event_id, rf.identity, issues_selected), │ │151 .settings = Settings.init(), │ │152 .auth = Auth.init(), │ │153 .quit = Quit.init(), │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │206 try stack.children.put(allocator, refs_view.getFocus().id, .{ .repo_refs = refs_view }); │ │207 } │ │208 │ │209 + // issues — the repo's issue tracker. │ │210 { │ │211 + var issues_view = try Issues.View.init(allocator, &data.issues, session); │ │212 + errdefer issues_view.deinit(allocator); │ │213 + try stack.children.put(allocator, issues_view.getFocus().id, .{ .repo_issues = issues_view }); │ │214 + } │ │215 + │ │216 + { │ │217 var settings_view = try Settings.View.init(allocator, session); │ │218 errdefer settings_view.deinit(allocator); │ │219 try stack.children.put(allocator, settings_view.getFocus().id, .{ .home_settings = settings_view });│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │260 .repo_commits => self.session.data.current_page = .{ .repo_commits = .{ .name = self.data.commits_route_name, .after = self.data.commits_after } }, │ │261 // the refs tab mirrors this page's paginated column + offset. │ │262 .repo_refs => self.session.data.current_page = .{ .repo_refs = .{ .name = self.data.identity, .kind = self.data.refs.kind, .after = self.data.refs.after } }, │ │263 + // the issues tab mirrors the issue this page's window is rooted at. │ │264 + .repo_issues => self.session.data.current_page = ui.RoutablePage.repoIssuesRoute(self.data.identity.slice(), self.data.issues.selected_id) orelse self.session.data.current_page,│ │265 .home_settings => self.session.data.current_page = .{ .repo_settings = self.data.identity }, │ │266 .home_auth => self.session.data.current_page = .{ .repo_auth = self.data.identity }, │ │267 // the quit tab is tty-only and not a route, so leave current_page │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │294 .repo_files => |*v| v.getSelectedIndex() == 0, │ │295 .repo_commits => |*v| v.getSelectedIndex() == 0, │ │296 .repo_refs => |*v| v.getSelectedIndex() == 0, │ │297 + .repo_issues => |*v| v.getSelectedIndex() == 0, │ │298 .home_settings => |*v| v.getSelectedIndex() == 0,│ │299 .home_auth => |*v| v.getSelectedIndex() == 0, │ │300 .quit => |*v| v.getSelectedIndex() == 0, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯