╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │13 pub const Header = @import("./User/Header.zig");│ │14 pub const Settings = @import("./Settings.zig"); │ │15 pub const Auth = @import("./Auth.zig"); │ │16 +pub const Quit = @import("./Quit.zig"); │ │17 │ │18 header: Header, │ │19 user: evt.User.Safe, │ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────╮ │20 repos: []const evt.Repo, │ │21 settings: Settings, │ │22 auth: Auth, │ │23 +quit: Quit, │ │24 route_name: ui.RoutablePage.Array(evt.User.name_max_len),│ │25 │ │26 const Self = @This(); │ ╰─────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────╮ │74 .repos = repos.items, │ │75 .settings = Settings.init(),│ │76 .auth = Auth.init(), │ │77 + .quit = Quit.init(), │ │78 .route_name = name, │ │79 }; │ │80 } │ ╰────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 97 { │ │ 98 var header_view = try Header.View.init(allocator, &data.header, session); │ │ 99 errdefer header_view.deinit(allocator); │ │ 97 - repos_tab_id = header_view.tab_ids[0]; │ │100 + repos_tab_id = header_view.tab_ids.keys()[0]; │ │101 try box.children.put(allocator, header_view.getFocus().id, .{ .widget = .{ .user_header = header_view }, .rect = null, .min_size = null });│ │102 } │ │103 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │135 try stack.children.put(allocator, auth_view.getFocus().id, .{ .home_auth = auth_view }); │ │136 } │ │137 │ │138 + if (session.is_terminal) { │ │139 + var quit_view = try Quit.View.init(allocator, &data.quit, session); │ │140 + errdefer quit_view.deinit(allocator); │ │141 + try stack.children.put(allocator, quit_view.getFocus().id, .{ .quit = quit_view }); │ │142 + } │ │143 + │ │144 try box.children.put(allocator, stack.getFocus().id, .{ .widget = .{ .stack = stack }, .rect = null, .min_size = null });│ │145 } │ │146 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │165 if (header.getSelectedIndex()) |index| { │ │166 stack.getFocus().child_id = stack.children.keys()[index]; │ │167 const name = self.data.route_name; │ │159 - self.session.data.current_page = switch (index) { │ │160 - 1 => .{ .user_settings = name }, │ │161 - 2 => .{ .user_auth = name }, │ │162 - else => .{ .user = name }, │ │163 - }; │ │168 + switch (index) { │ │169 + 1 => self.session.data.current_page = .{ .user_settings = name }, │ │170 + 2 => self.session.data.current_page = .{ .user_auth = name }, │ │171 + // the quit tab is tty-only and not a route, so leave current_page│ │172 + // alone (nothing to mirror into the url). │ │173 + 3 => {}, │ │174 + else => self.session.data.current_page = .{ .user = name }, │ │175 + } │ │176 } │ │177 try self.box.build(allocator, constraint, root_focus); │ │178 } │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │206 .flow_box_scroll => |*v| v.getSelectedIndex() == 0,│ │207 .home_settings => |*v| v.getSelectedIndex() == 0, │ │208 .home_auth => |*v| v.getSelectedIndex() == 0, │ │209 + .quit => |*v| v.getSelectedIndex() == 0, │ │210 else => false, │ │211 }; │ │212 if (at_top) { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯