╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Patches.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1049 .remove => remove_tab_label, 1050 .resolve => resolve_tab_label, 1051 else => new_tab_label, 1052 }; 1053 try header.addTab(allocator, label, link, View.viewIndex(.new)); 1054 } 1055 1056 // drafts belong to the logged-in user and are not available locally 1057 if (session.data.host_kind != .local) { 1058 const route = ui.RoutablePage.repoPatchesDraftsRoute(data.identity) orelse return error.RouteTooLong; 1059 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.drafts)); 1060 var label_buf: [64]u8 = undefined; 1061 const label = try std.fmt.bufPrint(&label_buf, drafts_tab_label ++ " ({d})", .{data.drafts.count}); 1062 try header.addTab(allocator, label, link, View.viewIndex(.drafts)); 1063 } 1064 1065 // conflicts tab, labeled with the conflict count 1066 if (data.conflicts.count > 0) { 1067 const route = ui.RoutablePage.repoPatchesConflictsRoute(data.identity, "") orelse return error.RouteTooLong; 1068 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.conflicts)); 1069 var label_buf: [64]u8 = undefined; 1070 const label = try std.fmt.bufPrint(&label_buf, conflicts_tab_label ++ " ({d})", .{data.conflicts.count}); 1071 try header.addTab(allocator, label, link, View.viewIndex(.conflicts)); 1072 } 1073 1074 header.select(View.viewIndex(data.view)); 1075 return header; 1076 } 1077