╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │92 const files_link = try std.fmt.allocPrint(aa, "a:{s}", .{try files_route.urlAlloc(session.page_arena)}); │ │93 const commits_route = ui.RoutablePage.repoCommitsRoute(identity, "", 0) orelse return error.RouteTooLong; │ │94 const commits_link = try std.fmt.allocPrint(aa, "a:{s}", .{try commits_route.urlAlloc(session.page_arena)}); │ │95 + const refs_link = try std.fmt.allocPrint(aa, "a:/repo/{s}/{s}/refs", .{ data.owner_name, data.name }); │ │96 const settings_link = try std.fmt.allocPrint(aa, "a:/repo/{s}/{s}/settings", .{ data.owner_name, data.name });│ │97 const auth_link = try std.fmt.allocPrint(aa, "a:/repo/{s}/{s}/auth", .{ data.owner_name, data.name }); │ │98 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │100 // link (rather than position) keeps this robust to tab changes. │ │101 const current_link: []const u8 = switch (session.data.current_page) {│ │102 .repo_commits => commits_link, │ │103 + .repo_refs => refs_link, │ │104 .repo_settings => settings_link, │ │105 .repo_auth => auth_link, │ │106 else => files_link, │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │137 }); │ │138 } │ │139 │ │140 + // refs tab │ │141 + { │ │142 + var text_box = try wgt.TextBox(ui.Widget).init(allocator, "refs", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │143 + errdefer text_box.deinit(allocator); │ │144 + text_box.getFocus().focusable = true; │ │145 + text_box.getFocus().kind = .{ .custom = refs_link }; │ │146 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │147 + if (std.mem.eql(u8, refs_link, current_link)) selected_tab = text_box.getFocus().id; │ │148 + try box.children.put(allocator, text_box.getFocus().id, .{ │ │149 + .widget = .{ .text_box = text_box }, │ │150 + .rect = null, │ │151 + .min_size = .{ .width = "refs".len + 2, .height = null }, │ │152 + }); │ │153 + } │ │154 + │ │155 // spacer pushes settings + auth to the right │ │156 { │ │157 var spacer = try ui.Spacer.init(allocator); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯