╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │26 // the issues tab's tag filter, url-encoded ("" = unfiltered), so the tab links│ │27 // back to the filtered list. │ │28 issues_tag: []const u8, │ │29 +patches_tag: []const u8, │ │30 discussions_tag: []const u8, │ │31 │ │32 const Self = @This(); │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │33 │ │33 -pub fn init(arena: *std.heap.ArenaAllocator, name: []const u8, owner_name: []const u8, ref_or_oid: RefOrOid, ref_or_oid_value: []const u8, issues_tag: []const u8, discussions_tag: []const u8) !Self { │ │34 +pub fn init(arena: *std.heap.ArenaAllocator, name: []const u8, owner_name: []const u8, ref_or_oid: RefOrOid, ref_or_oid_value: []const u8, issues_tag: []const u8, patches_tag: []const u8, discussions_tag: []const u8) !Self {│ │35 return .{ │ │36 .name = name, │ │37 .owner_name = owner_name, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │40 .ref_or_oid = ref_or_oid, │ │41 .ref_or_oid_value = ref_or_oid_value,│ │42 .issues_tag = issues_tag, │ │43 + .patches_tag = patches_tag, │ │44 .discussions_tag = discussions_tag, │ │45 }; │ │46 } │ ╰─────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │138 const refs_link = try std.fmt.allocPrint(aa, "ai:{s}", .{try refs_route.toUrl(session.page_arena)}); │ │139 const issues_route = ui.RoutablePage.repoIssuesRoute(identity, .open, data.issues_tag, "") orelse return error.RouteTooLong; │ │140 const issues_link = try std.fmt.allocPrint(aa, "ai:{s}", .{try issues_route.toUrl(session.page_arena)}); │ │141 + const patches_route = ui.RoutablePage.repoPatchesRoute(identity, .open, data.patches_tag, "") orelse return error.RouteTooLong; │ │142 + const patches_link = try std.fmt.allocPrint(aa, "ai:{s}", .{try patches_route.toUrl(session.page_arena)}); │ │143 const discussions_route = ui.RoutablePage.repoDiscussionsRoute(identity, data.discussions_tag, "") orelse return error.RouteTooLong;│ │144 const discussions_link = try std.fmt.allocPrint(aa, "ai:{s}", .{try discussions_route.toUrl(session.page_arena)}); │ │145 const events_route = ui.RoutablePage.repoEventsRoute(identity, .active, null, "") orelse return error.RouteTooLong; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────╮ │155 .repo_commits => commits_link, │ │156 .repo_refs => refs_link, │ │157 .repo_issues => issues_link, │ │158 + .repo_patches => patches_link, │ │159 .repo_discussions => discussions_link,│ │160 .repo_events => events_link, │ │161 .repo_settings => settings_link, │ ╰───────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │221 .widget = .{ .text_box = text_box }, │ │222 .rect = null, │ │223 .min_size = .{ .width = "issues".len + 2, .height = null }, │ │224 + }); │ │225 + } │ │226 + │ │227 + // patches tab │ │228 + { │ │229 + var text_box = try wgt.TextBox(ui.Widget).init(allocator, "patches", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │230 + errdefer text_box.deinit(allocator); │ │231 + text_box.getFocus().focusable = true; │ │232 + text_box.getFocus().kind = .{ .custom = patches_link }; │ │233 + try tab_ids.put(allocator, text_box.getFocus().id, {}); │ │234 + if (std.mem.eql(u8, patches_link, current_link)) selected_tab = text_box.getFocus().id; │ │235 + try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │236 + .widget = .{ .text_box = text_box }, │ │237 + .rect = null, │ │238 + .min_size = .{ .width = "patches".len + 2, .height = null }, │ │239 }); │ │240 } │ │241 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯