╭ changed ──────╮ │src/ui/User.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────╮ │36 settings: Settings, │ │37 auth: Auth, │ │38 quit: Quit, │ │39 -route_name: ui.RoutablePage.Array(evt.User.name_max_len),│ │39 │ │40 const Self = @This(); │ │41 │ ╰─────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────╮ │154 .settings = Settings.init(),│ │155 .auth = Auth.init(), │ │156 .quit = Quit.init(), │ │158 - .route_name = name, │ │157 }; │ │158 } │ │159 │ ╰─────────────────────────────────────────╯ ╭───────────────────────────────────────╮ │160 pub const View = struct { │ │161 box: wgt.Box(ui.Widget), │ │164 - data: *const Self, │ │165 - session: *ui.Session, │ │162 │ │163 const header_index: usize = 0;│ │164 const stack_index: usize = 1; │ ╰───────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │250 try box.children.put(allocator, stack.getFocus().id, .{ .widget = .{ .stack = stack }, .rect = null, .min_size = null });│ │251 } │ │252 │ │257 - var self = View{ .box = box, .data = data, .session = session }; │ │253 + var self = View{ .box = box }; │ │254 self.getFocus().child_id = box.children.keys()[header_index]; │ │255 return self; │ │256 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │264 const header = &self.box.children.values()[header_index].widget.user_header; │ │265 const stack = &self.box.children.values()[stack_index].widget.stack; │ │266 │ │271 - // each header tab maps 1:1 to a stack child by position. mirror the │ │272 - // selection into current_page so the host can push the matching url; │ │273 - // all user tabs share the .user parent, so this stays on the page │ │274 - // rather than navigating. │ │275 - if (header.getSelectedIndex()) |index| { │ │267 + // each header tab maps 1:1 to a stack child by position │ │268 + if (header.getSelectedIndex()) |index| │ │269 stack.getFocus().child_id = stack.children.keys()[index]; │ │277 - const name = self.data.route_name; │ │278 - switch (index) { │ │279 - 0 => self.session.data.current_page = .{ .user_repos = .{ .name = name, .start = self.data.repos_start } },│ │280 - 1 => self.session.data.current_page = .{ .user_forks = .{ .name = name, .start = self.data.forks_start } },│ │281 - else => switch (std.meta.activeTag(stack.children.values()[index])) { │ │282 - .home_settings => self.session.data.current_page = .{ .user_settings = name }, │ │283 - .home_auth => self.session.data.current_page = .{ .user_auth = name }, │ │284 - // the quit tab is tty-only and not a route, so leave current_page │ │285 - // alone (nothing to mirror into the url). │ │286 - .quit => {}, │ │287 - else => {}, │ │288 - }, │ │289 - } │ │290 - } │ │270 try self.box.build(allocator, constraint, root_focus); │ │271 } │ │272 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯