╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │49 tabs_id: usize, │ │50 first_group_width: usize, │ │51 │ │52 - pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │52 + pub fn init(allocator: std.mem.Allocator, data: *const Self, commit_count: ?u64, session: *ui.Session) !View { │ │53 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = .hidden, .rounded_corners = true, .direction = .horiz });│ │54 errdefer box.deinit(allocator); │ │55 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │68 const ref_name = std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.ref_or_oid_value)); │ │69 const bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), ref_name); │ │70 const bottom_label_width = try xitui.width.displayWidth(bottom_label); │ │71 + const commits_label = if (commit_count) |count| try std.fmt.allocPrint(aa, "commits ({d})", .{count}) else "commits";│ │72 + const commits_label_width = try xitui.width.displayWidth(commits_label); │ │73 var first_group_width = try data.title.width(); │ │74 │ │75 // the user's name (local mode has no user pages to link to) │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │171 │ │172 // commits tab │ │173 { │ │172 - var text_box = try wgt.TextBox.init(allocator, "commits", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none, .bottom_label = bottom_label }); │ │174 + var text_box = try wgt.TextBox.init(allocator, commits_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none, .bottom_label = bottom_label });│ │175 errdefer text_box.deinit(allocator); │ │176 text_box.getFocus().focusable = true; │ │177 text_box.getFocus().kind = .{ .custom = commits_link }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │180 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │181 .widget = .{ .text_box = text_box }, │ │182 .rect = null, │ │181 - .min_size = .{ .width = @max("commits".len, bottom_label_width) + 2, .height = null }, │ │183 + .min_size = .{ .width = @max(commits_label_width, bottom_label_width) + 2, .height = null },│ │184 }); │ │185 } │ │186 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯