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