╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯