╭ changed ─────────╮ │src/ui/AuthTab.zig│ ╰──────────────────╯ ╭──────────────────────────────────────╮ │ 7 const Key = xitui.input.Key; │ │ 8 const Grid = xitui.grid.Grid; │ │ 9 const Focus = xitui.focus.Focus; │ │10 + │ │11 +const login_tab_label = "login"; │ │12 +const logout_tab_label = "logout";│ │13 │ │14 pub const View = struct { │ │15 text_box: wgt.TextBox, │ ╰──────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │18 bottom_label_buf: [ui.clipped_bottom_label_max_len]u8, │ │19 │ │20 pub fn init(allocator: std.mem.Allocator, session: *ui.Session) !View { │ │18 - var text_box = try wgt.TextBox.init(allocator, "login", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │21 + var text_box = try wgt.TextBox.init(allocator, login_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │22 errdefer text_box.deinit(allocator); │ │23 text_box.getFocus().mode = .all; │ │24 text_box.getFocus().kind = .{ .custom = "ai:/auth" }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │34 } │ │35 │ │36 fn text(self: *const View) []const u8 { │ │34 - return if (self.session.data.user_id == null) "login" else "logout"; │ │37 + return if (self.session.data.user_id == null) login_tab_label else logout_tab_label;│ │38 } │ │39 │ │40 fn bottomLabel(self: *View) []const u8 { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Fork/Header.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────╮ │10 const Grid = xitui.grid.Grid; │ │11 const Focus = xitui.focus.Focus; │ │12 │ │13 +const commits_tab_label = "commits"; │ │14 +const patch_tab_label = "patch"; │ │15 +const diff_tab_label = "diff"; │ │16 +const files_tab_label = "files"; │ │17 +const settings_tab_label = "settings"; │ │18 + │ │19 pub const AuthTab = @import("../AuthTab.zig");│ │20 │ │21 name: []const u8, │ ╰──────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │60 │ │61 const aa = session.page_arena.allocator(); │ │62 const identity = try std.fmt.allocPrint(aa, "{s}/{s}", .{ data.owner_name, data.name }); │ │57 - const commits_label = if (commit_count) |count| try std.fmt.allocPrint(aa, "commits ({d})", .{count}) else "commits"; │ │63 + const commits_label = if (commit_count) |count| try std.fmt.allocPrint(aa, commits_tab_label ++ " ({d})", .{count}) else commits_tab_label;│ │64 var first_group_width = try data.title.width(); │ │65 │ │66 try ui.widget.addBackButton(allocator, &title_box, session); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │102 ui.RoutablePage.forkCommitsRoute(identity, data.id, data.oid, 0, "") orelse return error.RouteTooLong,│ │103 }; │ │104 const tags = [_]std.meta.Tag(ui.RoutablePage){ .fork_patch, .fork_diff, .fork_files, .fork_commits }; │ │ 99 - const labels = [_][]const u8{ "patch", "diff", "files", commits_label }; │ │105 + const labels = [_][]const u8{ patch_tab_label, diff_tab_label, files_tab_label, commits_label }; │ │106 var selected_tab: ?usize = null; │ │107 │ │108 for (routes, tags, labels) |route, tag, label| { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │134 │ │135 // settings are account preferences, so they require a login. │ │136 if (session.data.user_id != null) { │ │131 - var settings = try wgt.TextBox.init(allocator, "settings", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │137 + var settings = try wgt.TextBox.init(allocator, settings_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │138 errdefer settings.deinit(allocator); │ │139 settings.getFocus().mode = .all; │ │140 settings.getFocus().kind = .{ .custom = settings_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │141 try tab_ids.put(allocator, settings.getFocus().id, {}); │ │142 if (current_tag == .fork_settings) selected_tab = settings.getFocus().id; │ │137 - try tabs_box.children.put(allocator, settings.getFocus().id, .{ .widget = .{ .text_box = settings }, .rect = null, .min_size = .{ .width = "settings".len + 2, .height = null } }); │ │143 + try tabs_box.children.put(allocator, settings.getFocus().id, .{ .widget = .{ .text_box = settings }, .rect = null, .min_size = .{ .width = settings_tab_label.len + 2, .height = null } });│ │144 } │ │145 │ │146 // keep authentication within the fork page. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────╮ │ 8 const Key = xitui.input.Key; │ │ 9 const Grid = xitui.grid.Grid; │ │10 const Focus = xitui.focus.Focus; │ │11 + │ │12 +const repos_tab_label = "repos"; │ │13 +const users_tab_label = "users"; │ │14 +const settings_tab_label = "settings"; │ │15 │ │16 pub const AuthTab = @import("./../AuthTab.zig");│ │17 │ ╰────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │90 │ │91 // repos tab │ │92 { │ │89 - var text_box = try wgt.TextBox.init(allocator, "repos", .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none }); │ │93 + var text_box = try wgt.TextBox.init(allocator, repos_tab_label, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ │94 errdefer text_box.deinit(allocator); │ │95 text_box.getFocus().mode = .all; │ │96 text_box.getFocus().kind = .{ .custom = repos_link }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯