╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │10 const Grid = xitui.grid.Grid; │ │11 const Focus = xitui.focus.Focus; │ │12 │ │13 +const diff_tab_label = "diff"; │ │14 +const commits_tab_label = "commits"; │ │15 +const files_tab_label = "files"; │ │16 +const refs_tab_label = "refs"; │ │17 +const issues_tab_label = "issues"; │ │18 +const patches_tab_label = "patches"; │ │19 +const discuss_tab_label = "discuss"; │ │20 +const events_tab_label = "events"; │ │21 +const settings_tab_label = "settings"; │ │22 + │ │23 pub const AuthTab = @import("./../AuthTab.zig");│ │24 │ │25 const RefOrOid = ui.RoutablePage.RefOrOid; │ ╰────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │80 const bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), ref_name); │ │81 const bottom_label_width = try xitui.width.displayWidth(bottom_label); │ │82 const changes_label = switch (page.changes) { │ │73 - .diff => "diff", │ │74 - .commits => |c| if (c.commit_count) |count| try std.fmt.allocPrint(aa, "commits ({d})", .{count}) else "commits", │ │83 + .diff => diff_tab_label, │ │84 + .commits => |c| if (c.commit_count) |count| try std.fmt.allocPrint(aa, commits_tab_label ++ " ({d})", .{count}) else commits_tab_label,│ │85 }; │ │86 const changes_label_width = try xitui.width.displayWidth(changes_label); │ │87 var first_group_width = try data.title.width(); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │176 │ │177 // files tab │ │178 { │ │169 - var text_box = try wgt.TextBox.init(allocator, "files", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none, .bottom_label = bottom_label }); │ │179 + var text_box = try wgt.TextBox.init(allocator, files_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none, .bottom_label = bottom_label });│ │180 errdefer text_box.deinit(allocator); │ │181 text_box.getFocus().mode = .all; │ │182 text_box.getFocus().kind = .{ .custom = files_link }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │185 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │186 .widget = .{ .text_box = text_box }, │ │187 .rect = null, │ │178 - .min_size = .{ .width = @max("files".len, bottom_label_width) + 2, .height = null }, │ │188 + .min_size = .{ .width = @max(files_tab_label.len, bottom_label_width) + 2, .height = null },│ │189 }); │ │190 } │ │191 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │206 │ │207 // refs tab │ │208 { │ │199 - var text_box = try wgt.TextBox.init(allocator, "refs", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │209 + var text_box = try wgt.TextBox.init(allocator, refs_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │210 errdefer text_box.deinit(allocator); │ │211 text_box.getFocus().mode = .all; │ │212 text_box.getFocus().kind = .{ .custom = refs_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │215 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │216 .widget = .{ .text_box = text_box }, │ │217 .rect = null, │ │208 - .min_size = .{ .width = "refs".len + 2, .height = null }, │ │218 + .min_size = .{ .width = refs_tab_label.len + 2, .height = null },│ │219 }); │ │220 } │ │221 │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │222 // issues tab │ │223 { │ │214 - var text_box = try wgt.TextBox.init(allocator, "issues", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │224 + var text_box = try wgt.TextBox.init(allocator, issues_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │225 errdefer text_box.deinit(allocator); │ │226 text_box.getFocus().mode = .all; │ │227 text_box.getFocus().kind = .{ .custom = issues_link }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │230 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │231 .widget = .{ .text_box = text_box }, │ │232 .rect = null, │ │223 - .min_size = .{ .width = "issues".len + 2, .height = null }, │ │233 + .min_size = .{ .width = issues_tab_label.len + 2, .height = null },│ │234 }); │ │235 } │ │236 │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │237 // patches tab │ │238 { │ │229 - var text_box = try wgt.TextBox.init(allocator, "patches", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │239 + var text_box = try wgt.TextBox.init(allocator, patches_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │240 errdefer text_box.deinit(allocator); │ │241 text_box.getFocus().mode = .all; │ │242 text_box.getFocus().kind = .{ .custom = patches_link }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │245 try tabs_box.children.put(allocator, text_box.getFocus().id, .{ │ │246 .widget = .{ .text_box = text_box }, │ │247 .rect = null, │ │238 - .min_size = .{ .width = "patches".len + 2, .height = null }, │ │248 + .min_size = .{ .width = patches_tab_label.len + 2, .height = null },│ │249 }); │ │250 } │ │251 │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯