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