╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────╮ │12 pub const Header = @import("./Repo/Header.zig"); │ │13 pub const Files = @import("./Repo/Files.zig"); │ │14 pub const Commits = @import("./Repo/Commits.zig");│ │15 +pub const Refs = @import("./Repo/Refs.zig"); │ │16 pub const Settings = @import("./Settings.zig"); │ │17 pub const Auth = @import("./Auth.zig"); │ │18 pub const Quit = @import("./Quit.zig"); │ ╰──────────────────────────────────────────────────────╯ ╭───────────────────────╮ │23 repo: evt.Repo, │ │24 files: Files, │ │25 commits: Commits, │ │26 +refs: Refs, │ │27 settings: Settings,│ │28 auth: Auth, │ │29 quit: Quit, │ ╰───────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │52 const name_str: []const u8 = switch (route) { │ │53 .repo, .repo_settings, .repo_auth => |n| n.slice(), │ │54 .repo_commits => |c| c.name.slice(), │ │55 + .repo_refs => |r| r.name.slice(), │ │56 else => return error.UnexpectedRoute, │ │57 }; │ │58 const rf = ui.RoutablePage.RepoFiles.parse(name_str) orelse return error.NotFound;│ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │65 // how many diff hunks the commits view's selected commit shows ("load more").│ │66 const commits_after: usize = switch (route) { │ │67 .repo_commits => |c| c.after, │ │68 + else => 0, │ │69 + }; │ │70 + // the refs tab paginates one column at a time: this offset applies to │ │71 + // `refs_kind`'s column, the other stays at its first window. │ │72 + const refs_kind: ui.RoutablePage.RefKind = switch (route) { │ │73 + .repo_refs => |r| r.kind, │ │74 + else => .branch, │ │75 + }; │ │76 + const refs_after: usize = switch (route) { │ │77 + .repo_refs => |r| r.after, │ │78 else => 0, │ │79 }; │ │80 │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 96 // the repo's event id is the on-disk repo directory name │ │ 97 .files = try Files.init(arena, session, &found.event_id, rf.identity, files_dir), │ │ 98 .commits = try Commits.init(arena, session, &found.event_id, rf.identity, commits_start, commits_after),│ │ 99 + .refs = try Refs.init(arena, session, &found.event_id, rf.identity, refs_kind, refs_after), │ │100 .settings = Settings.init(), │ │101 .auth = Auth.init(), │ │102 .quit = Quit.init(), │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │144 var commits_view = try Commits.View.init(allocator, &data.commits, session); │ │145 errdefer commits_view.deinit(allocator); │ │146 try stack.children.put(allocator, commits_view.getFocus().id, .{ .repo_commits = commits_view });│ │147 + } │ │148 + │ │149 + // refs — the repo's branches and tags. │ │150 + { │ │151 + var refs_view = try Refs.View.init(allocator, &data.refs, session); │ │152 + errdefer refs_view.deinit(allocator); │ │153 + try stack.children.put(allocator, refs_view.getFocus().id, .{ .repo_refs = refs_view }); │ │154 } │ │155 │ │156 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │198 // files/commits carry this page's content route (directory / log │ │199 // page); settings/auth carry only "owner/name". │ │200 .repo_commits => self.session.data.current_page = .{ .repo_commits = .{ .name = self.data.commits_route_name } }, │ │201 + // the refs tab mirrors this page's paginated column + offset. │ │202 + .repo_refs => self.session.data.current_page = .{ .repo_refs = .{ .name = self.data.identity, .kind = self.data.refs.kind, .after = self.data.refs.after } },│ │203 .home_settings => self.session.data.current_page = .{ .repo_settings = self.data.identity }, │ │204 .home_auth => self.session.data.current_page = .{ .repo_auth = self.data.identity }, │ │205 // the quit tab is tty-only and not a route, so leave current_page │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │240 const at_top = switch (selected_widget.*) { │ │241 .repo_files => |*v| v.getSelectedIndex() == 0, │ │242 .repo_commits => |*v| v.getSelectedIndex() == 0, │ │243 + .repo_refs => |*v| v.getSelectedIndex() == 0, │ │244 .home_settings => |*v| v.getSelectedIndex() == 0,│ │245 .home_auth => |*v| v.getSelectedIndex() == 0, │ │246 .quit => |*v| v.getSelectedIndex() == 0, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯