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