╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────╮ │12 pub const Users = @import("./Home/Users.zig"); │ │13 pub const Repos = @import("./Home/Repos.zig"); │ │14 pub const Header = @import("./Home/Header.zig");│ │15 +pub const Ansi = @import("./Home/Ansi.zig"); │ │16 pub const Auth = @import("./Home/Auth.zig"); │ │17 │ │18 header: Header, │ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────╮ │19 users: Users, │ │20 repos: Repos, │ │21 +ansi: Ansi, │ │22 auth: Auth, │ │23 │ │24 const Self = @This();│ ╰─────────────────────────╯ ╭───────────────────────────────────────────────────────────────────╮ │32 .header = try Header.init(arena), │ │33 .users = try Users.init(repo_opts, arena, haxy_moment),│ │34 .repos = try Repos.init(repo_opts, arena, haxy_moment),│ │35 + .ansi = Ansi.init(), │ │36 .auth = Auth.init(), │ │37 }; │ │38 } │ ╰───────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │76 } │ │77 │ │78 { │ │79 + var ansi_view = try Ansi.View.init(allocator, &data.ansi, session); │ │80 + errdefer ansi_view.deinit(allocator); │ │81 + try stack.children.put(allocator, ansi_view.getFocus().id, .{ .home_ansi = ansi_view });│ │82 + } │ │83 + │ │84 + { │ │85 var auth_view = try Auth.View.init(allocator, &data.auth, session, users_tab_id); │ │86 errdefer auth_view.deinit(allocator); │ │87 try stack.children.put(allocator, auth_view.getFocus().id, .{ .home_auth = auth_view });│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────╮ │114 self.session.data.current_page = switch (index) {│ │115 0 => .home_users, │ │116 1 => .home_repos, │ │108 - 2 => .home_auth, │ │117 + 2 => .home_ansi, │ │118 + 3 => .home_auth, │ │119 else => .home_users, │ │120 }; │ │121 } │ ╰──────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │150 const at_top = switch (selected_widget.*) { │ │151 .home_users => |*v| v.getSelectedIndex() == 0,│ │152 .home_repos => |*v| v.getSelectedIndex() == 0,│ │153 + .home_ansi => |*v| v.getSelectedIndex() == 0, │ │154 .home_auth => |*v| v.getSelectedIndex() == 0, │ │155 else => false, │ │156 }; │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │25 pub const View = struct { │ │26 box: wgt.Box(ui.Widget), │ │27 data: *const Self, │ │28 - tab_ids: [3]usize, │ │28 + tab_ids: [4]usize, │ │29 │ │30 - const auth_tab_index: usize = 2; │ │30 + const ansi_tab_index: usize = 2; │ │31 + const auth_tab_index: usize = 3; │ │32 // the auth slot must fit either "login" or "logout" │ │33 const auth_tab_min_width: usize = @as(usize, "logout".len) + 2;│ │34 │ ╰───────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │36 var box = wgt.Box(ui.Widget).init(.{ .border_style = .hidden, .rounded_corners = true, .direction = .horiz });│ │37 errdefer box.deinit(allocator); │ │38 │ │38 - var tab_ids: [3]usize = undefined; │ │39 + var tab_ids: [4]usize = undefined; │ │40 │ │41 // title sits to the left of the tabs │ │42 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │60 }); │ │61 } │ │62 │ │62 - // fixed tabs: users, repos │ │63 + // fixed tabs │ │64 for ( │ │64 - [_][]const u8{ "users", "repos" }, │ │65 - [_][]const u8{ "a:/users", "a:/repos" }, │ │65 + [_][]const u8{ "users", "repos", "ANSI" }, │ │66 + [_][]const u8{ "a:/users", "a:/repos", "a:/ansi" }, │ │67 0.., │ │68 ) |name, focus_name, i| { │ │69 var text_box = try wgt.TextBox(ui.Widget).init(allocator, name, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────╮ │109 switch (session.data.current_page) {│ │110 .home_users => 0, │ │111 .home_repos => 1, │ │111 - .home_auth => 2, │ │112 + .home_ansi => ansi_tab_index, │ │113 + .home_auth => auth_tab_index, │ │114 } │ │115 ]; │ │116 return self; │ ╰─────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯