╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Issues.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
415 }; 416 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.new)); 417 const label: []const u8 = switch (data.view) { 418 .edit => edit_tab_label, 419 .new_comment => reply_tab_label, 420 .edit_comment => edit_tab_label, 421 .remove => remove_tab_label, 422 .resolve => resolve_tab_label, 423 else => new_tab_label, 424 }; 425 try header.addTab(allocator, label, link, View.viewIndex(.new)); 426 } 427 428 // conflicts tab, labeled with the conflict count 429 if (data.conflicts.count > 0) { 430 const route = ui.RoutablePage.repoIssuesConflictsRoute(data.identity, "") orelse return error.RouteTooLong; 431 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.conflicts)); 432 var label_buf: [64]u8 = undefined; 433 const label = try std.fmt.bufPrint(&label_buf, conflicts_tab_label ++ " ({d})", .{data.conflicts.count}); 434 try header.addTab(allocator, label, link, View.viewIndex(.conflicts)); 435 } 436 437 header.select(View.viewIndex(data.view)); 438 return header; 439 } 440