╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │482 return route.withSearch(query) orelse error.RouteTooLong; │ │483 } │ │484 │ │485 -// a status tab's label: its listing's count, marked when a search capped it │ │486 -pub fn countLabel(buffer: []u8, name: []const u8, win: anytype) ![]const u8 { │ │487 - return std.fmt.bufPrint(buffer, "{s} ({d}{s})", .{ name, win.count, if (win.more) "+" else "" }); │ │485 +// a status tab's bottom label: its listing's count, marked when a search capped it │ │486 +pub fn countLabel(session: *ui.Session, win: anytype) ![]const u8 { │ │487 + return session.page_arena.allocator().print("({d}{s})", .{ win.count, if (win.more) "+" else "" });│ │488 } │ │489 │ │490 // the common sub-header used by each thread page: the search box, then the │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │514 return .{ .box = box, .tab_ids = .empty }; │ │515 } │ │516 │ │517 - pub fn addTab(self: *Header, allocator: std.mem.Allocator, label: []const u8, link: []const u8, view_index: usize) !void { │ │518 - var text_box = try wgt.TextBox.init(allocator, label, .{ .border = .single, .round_corners = true, .wrap_kind = .none }); │ │517 + pub fn addTab(self: *Header, allocator: std.mem.Allocator, label: []const u8, bottom_label: []const u8, link: []const u8, view_index: usize) !void { │ │518 + var text_box = try wgt.TextBox.init(allocator, label, .{ .border = .single, .round_corners = true, .wrap_kind = .none, .bottom_label = .{ .text = bottom_label } });│ │519 errdefer text_box.deinit(allocator); │ │520 text_box.getFocus().mode = .all; │ │521 text_box.getFocus().kind = .{ .custom = link }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │523 try self.box.children.put(allocator, text_box.getFocus().id, .{ │ │524 .widget = .{ .text_box = text_box }, │ │525 .rect = null, │ │526 - .min_size = .{ .width = label.len + 2, .height = null }, │ │526 + .min_size = .{ .width = @max(label.len, bottom_label.len) + 2, .height = null },│ │527 }); │ │528 } │ │529 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯