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