╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │77 errdefer tab_ids.deinit(allocator); │ │78 │ │79 const aa = session.page_arena.allocator(); │ │80 + // the ref or revision files and commits show, above both tabs │ │81 const ref_name = std.Uri.percentDecodeInPlace(try aa.dupe(u8, page.files.patchrev_id orelse data.ref_or_oid_value)); │ │81 - const bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), ref_name); │ │82 - const changes_label = switch (page.changes) { │ │83 - .diff => diff_tab_label, │ │84 - .commits => |c| if (c.commit_count) |count| try aa.print(commits_tab_label ++ " ({d})", .{count}) else commits_tab_label,│ │82 + const ref_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), ref_name); │ │83 + const ref_label_width = try xitui.width.displayWidth(ref_label); │ │84 + const changes_label, const commit_count_label: []const u8 = switch (page.changes) { │ │85 + .diff => .{ diff_tab_label, "" }, │ │86 + .commits => |c| .{ commits_tab_label, if (c.commit_count) |count| try aa.print("({d})", .{count}) else "" }, │ │87 }; │ │86 - const changes_label_width = try xitui.width.displayWidth(changes_label); │ │88 var first_group_width = try data.title.width(); │ │89 │ │90 try ui.widget.addBackButton(allocator, &title_box, session); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │180 │ │181 // files tab │ │182 { │ │182 - var text_box = try wgt.TextBox.init(allocator, files_tab_label, .{ .border = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = .{ .text = bottom_label } });│ │183 + var text_box = try wgt.TextBox.init(allocator, files_tab_label, .{ .border = .single, .round_corners = true, .wrap_kind = .none, .top_label = .{ .text = ref_label } }); │ │184 errdefer text_box.deinit(allocator); │ │185 text_box.getFocus().mode = .all; │ │186 text_box.getFocus().kind = .{ .custom = files_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │189 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │190 .widget = .{ .text_box = text_box }, │ │191 .rect = null, │ │191 - .min_size = .{ .width = files_tab_label.len + 2, .height = null }, │ │192 + .min_size = .{ .width = @max(files_tab_label.len, ref_label_width) + 2, .height = null },│ │193 }); │ │194 } │ │195 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │196 // commits, or the comparison selected by a diff / patchrev url │ │197 { │ │197 - var text_box = try wgt.TextBox.init(allocator, changes_label, .{ .border = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = .{ .text = bottom_label } }); │ │198 + var text_box = try wgt.TextBox.init(allocator, changes_label, .{ .border = .single, .round_corners = true, .wrap_kind = .none, .top_label = .{ .text = ref_label }, .bottom_label = .{ .text = commit_count_label } });│ │199 errdefer text_box.deinit(allocator); │ │200 text_box.getFocus().mode = .all; │ │201 text_box.getFocus().kind = .{ .custom = changes_link }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │204 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │205 .widget = .{ .text_box = text_box }, │ │206 .rect = null, │ │206 - .min_size = .{ .width = changes_label_width + 2, .height = null }, │ │207 + .min_size = .{ .width = @max(changes_label.len, ref_label_width, commit_count_label.len) + 2, .height = null },│ │208 }); │ │209 } │ │210 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │398 for ([_]evt.Issue.Status{ .open, .closed }, status_labels, 0..) |status, status_label, index| { │ │399 const route = try thread.searchRoute(ui.RoutablePage.repoIssuesRoute(data.identity, status, ""), data.search); │ │400 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == index); │ │401 - var label_buf: [64]u8 = undefined; │ │402 - const label = try thread.countLabel(&label_buf, status_label, data.window(status).*); │ │403 - try header.addTab(allocator, label, link, index); │ │401 + try header.addTab(allocator, status_label, try thread.countLabel(session, data.window(status).*), link, index);│ │402 } │ │403 │ │404 // labels tab │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │405 { │ │406 const labels_route = try thread.searchRoute(ui.RoutablePage.repoThreadLabelsRoute(.issue, data.identity), data.search); │ │407 const labels_link = try ui.inPageTabLink(session, labels_route, page_selected and selected_index == View.viewIndex(.labels));│ │410 - try header.addTab(allocator, labels_tab_label, labels_link, View.viewIndex(.labels)); │ │408 + try header.addTab(allocator, labels_tab_label, "", labels_link, View.viewIndex(.labels)); │ │409 } │ │410 │ │411 // new-issue tab; an edit or resolve url shows its tab in this place │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │427 .resolve => resolve_tab_label, │ │428 else => new_tab_label, │ │429 }; │ │432 - try header.addTab(allocator, label, link, View.viewIndex(.new)); │ │430 + try header.addTab(allocator, label, "", link, View.viewIndex(.new));│ │431 } │ │432 │ │433 // conflicts tab, labeled with the conflict count │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │434 if (data.conflicts.count > 0) { │ │435 const route = ui.RoutablePage.repoIssuesConflictsRoute(data.identity, "") orelse return error.RouteTooLong; │ │436 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == View.viewIndex(.conflicts)); │ │439 - var label_buf: [64]u8 = undefined; │ │440 - const label = try std.fmt.bufPrint(&label_buf, conflicts_tab_label ++ " ({d})", .{data.conflicts.count}); │ │441 - try header.addTab(allocator, label, link, View.viewIndex(.conflicts)); │ │437 + try header.addTab(allocator, conflicts_tab_label, try session.page_arena.allocator().print("({d})", .{data.conflicts.count}), link, View.viewIndex(.conflicts));│ │438 } │ │439 │ │440 header.select(View.viewIndex(data.view)); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1005 for ([_]Status{ .open, .closed, .merged }, status_labels, 0..) |status, status_label, index| { │ │1006 const route = try thread.searchRoute(ui.RoutablePage.repoPatchesRoute(data.identity, status, ""), data.search);│ │1007 const link = try ui.inPageTabLink(session, route, page_selected and selected_index == index); │ │1008 - var label_buf: [64]u8 = undefined; │ │1009 - const label = try thread.countLabel(&label_buf, status_label, data.window(status).*); │ │1010 - try header.addTab(allocator, label, link, index); │ │1008 + try header.addTab(allocator, status_label, try thread.countLabel(session, data.window(status).*), link, index);│ │1009 } │ │1010 │ │1011 // labels tab │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯