╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Patches.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
996 .publish => "publish", 997 .merge => "merge", 998 .new_comment => "reply", 999 .edit_comment => "edit", 1000 .remove => "remove", 1001 .resolve => "resolve", 1002 else => "new", 1003 }; 1004 try header.addTab(allocator, label, link, View.viewIndex(.new)); 1005 } 1006 1007 // drafts belong to the logged-in user and are not available locally 1008 if (session.data.host_kind != .local) { 1009 const route = ui.RoutablePage.repoPatchesDraftsRoute(data.identity) orelse return error.RouteTooLong; 1010 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.drafts)); 1011 var label_buf: [64]u8 = undefined; 1012 const label = try std.fmt.bufPrint(&label_buf, "drafts ({d})", .{data.drafts.count}); 1013 try header.addTab(allocator, label, link, View.viewIndex(.drafts)); 1014 } 1015 1016 // conflicts tab, labeled with the conflict count 1017 if (data.conflicts.count > 0) { 1018 const route = ui.RoutablePage.repoPatchesConflictsRoute(data.identity, "") orelse return error.RouteTooLong; 1019 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.conflicts)); 1020 var label_buf: [64]u8 = undefined; 1021 const label = try std.fmt.bufPrint(&label_buf, "conflicts ({d})", .{data.conflicts.count}); 1022 try header.addTab(allocator, label, link, View.viewIndex(.conflicts)); 1023 } 1024 1025 header.select(View.viewIndex(data.view)); 1026 return header; 1027 } 1028