╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────╮ │45 │ │46 pub const View = struct { │ │47 box: wgt.Box(ui.Widget), │ │48 - data: *const Self, │ │49 - session: *ui.Session, │ │48 │ │49 const header_index: usize = 0;│ │50 const stack_index: usize = 1; │ ╰──────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │102 │ │103 var self = View{ │ │104 .box = box, │ │107 - .data = data, │ │108 - .session = session, │ │105 }; │ │106 self.getFocus().child_id = box.children.keys()[header_index];│ │107 return self; │ ╰──────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │116 const header = &self.box.children.values()[header_index].widget.home_header; │ │117 const stack = &self.box.children.values()[stack_index].widget.stack; │ │118 │ │123 - // each header tab maps 1:1 to a stack child by position; mirror the │ │124 - // selected child's page into the url, keyed by its kind │ │125 - if (header.getSelectedIndex()) |index| { │ │119 + // each header tab maps 1:1 to a stack child by position │ │120 + if (header.getSelectedIndex()) |index| │ │121 stack.getFocus().child_id = stack.children.keys()[index]; │ │127 - switch (std.meta.activeTag(stack.children.values()[index])) { │ │128 - // mirror each list tab's built pagination window so the url stays │ │129 - // consistent with what's shown (and so a build doesn't reset it). │ │130 - .home_users => self.session.data.current_page = .{ .home_users = self.data.users.start },│ │131 - .home_repos => self.session.data.current_page = .{ .home_repos = self.data.repos.start },│ │132 - .home_settings => self.session.data.current_page = .home_settings, │ │133 - .home_auth => self.session.data.current_page = .home_auth, │ │134 - // the quit tab is tty-only and not a route, so leave current_page │ │135 - // alone (nothing to mirror into the url). │ │136 - else => {}, │ │137 - } │ │138 - } │ │122 try self.box.build(allocator, constraint, root_focus); │ │123 } │ │124 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯