╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Patches.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1068 .remove => remove_tab_label, 1069 .resolve => resolve_tab_label, 1070 else => new_tab_label, 1071 }; 1072 try header.addTab(allocator, label, link, View.viewIndex(.new)); 1073 } 1074 1075 // drafts belong to the logged-in user and are not available locally 1076 if (session.data.host_kind != .local) { 1077 const route = ui.RoutablePage.repoPatchesDraftsRoute(data.identity) orelse return error.RouteTooLong; 1078 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.drafts)); 1079 var label_buf: [64]u8 = undefined; 1080 const label = try std.fmt.bufPrint(&label_buf, drafts_tab_label ++ " ({d})", .{data.drafts.count}); 1081 try header.addTab(allocator, label, link, View.viewIndex(.drafts)); 1082 } 1083 1084 // conflicts tab, labeled with the conflict count 1085 if (data.conflicts.count > 0) { 1086 const route = ui.RoutablePage.repoPatchesConflictsRoute(data.identity, "") orelse return error.RouteTooLong; 1087 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.conflicts)); 1088 var label_buf: [64]u8 = undefined; 1089 const label = try std.fmt.bufPrint(&label_buf, conflicts_tab_label ++ " ({d})", .{data.conflicts.count}); 1090 try header.addTab(allocator, label, link, View.viewIndex(.conflicts)); 1091 } 1092 1093 header.select(View.viewIndex(data.view)); 1094 return header; 1095 } 1096