╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Patches.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
850 .resolve => "resolve", 851 else => "new", 852 }; 853 try header.addTab(allocator, label, link, View.viewIndex(.new)); 854 } 855 856 // drafts belong to the logged-in user and are not available locally 857 if (session.local == null) { 858 const route = ui.RoutablePage.repoPatchesDraftsRoute(data.identity) orelse return error.RouteTooLong; 859 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.drafts)); 860 var label_buf: [64]u8 = undefined; 861 const label = try std.fmt.bufPrint(&label_buf, "drafts ({d})", .{data.drafts.count}); 862 try header.addTab(allocator, label, link, View.viewIndex(.drafts)); 863 } 864 865 // conflicts tab, labeled with the conflict count 866 if (data.conflicts.count > 0) { 867 const route = ui.RoutablePage.repoPatchesConflictsRoute(data.identity, "") orelse return error.RouteTooLong; 868 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.conflicts)); 869 var label_buf: [64]u8 = undefined; 870 const label = try std.fmt.bufPrint(&label_buf, "conflicts ({d})", .{data.conflicts.count}); 871 try header.addTab(allocator, label, link, View.viewIndex(.conflicts)); 872 } 873 874 header.select(View.viewIndex(data.view)); 875 return header; 876 } 877