╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │107 const commits_route = ui.RoutablePage.repoCommitsRoute(identity, data.ref_or_oid, data.ref_or_oid_value, 0) orelse return error.RouteTooLong;│ │108 const commits_link = try std.fmt.allocPrint(aa, "ai:{s}", .{try commits_route.urlAlloc(session.page_arena)}); │ │109 const refs_link = try std.fmt.allocPrint(aa, "ai:/repo/{s}/{s}/refs", .{ data.owner_name, data.name }); │ │110 + const issues_link = try std.fmt.allocPrint(aa, "ai:/repo/{s}/{s}/issues", .{ data.owner_name, data.name }); │ │111 const settings_link = try std.fmt.allocPrint(aa, "ai:/repo/{s}/{s}/settings", .{ data.owner_name, data.name }); │ │112 const auth_link = try std.fmt.allocPrint(aa, "ai:/repo/{s}/{s}/auth", .{ data.owner_name, data.name }); │ │113 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │116 const current_link: []const u8 = switch (session.data.current_page) {│ │117 .repo_commits => commits_link, │ │118 .repo_refs => refs_link, │ │119 + .repo_issues => issues_link, │ │120 .repo_settings => settings_link, │ │121 .repo_auth => auth_link, │ │122 else => files_link, │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │168 }); │ │169 } │ │170 │ │171 + // issues tab │ │172 + { │ │173 + var text_box = try wgt.TextBox(ui.Widget).init(allocator, "issues", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │174 + errdefer text_box.deinit(allocator); │ │175 + text_box.getFocus().focusable = true; │ │176 + text_box.getFocus().kind = .{ .custom = issues_link }; │ │177 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │178 + if (std.mem.eql(u8, issues_link, current_link)) selected_tab = text_box.getFocus().id; │ │179 + try box.children.put(allocator, text_box.getFocus().id, .{ │ │180 + .widget = .{ .text_box = text_box }, │ │181 + .rect = null, │ │182 + .min_size = .{ .width = "issues".len + 2, .height = null }, │ │183 + }); │ │184 + } │ │185 + │ │186 // spacer pushes settings + auth to the right │ │187 { │ │188 var spacer = try ui.Spacer.init(allocator); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ added ───────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯