╭ changed ────────────╮ │src/ui/Auth/Login.zig│ ╰─────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │32 nav_ids: [3]usize, │ │33 // focus id of the header's "users" tab; on a successful submit we jump│ │34 // focus there so the user isn't stranded on the login button. │ │35 - users_tab_id: usize, │ │35 + success_redirect_tab_id: usize, │ │36 │ │37 const username_index: usize = 0; │ │38 const password_index: usize = 1; │ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │39 const button_index: usize = 2; │ │40 │ │41 - pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session, users_tab_id: usize) !View { │ │41 + pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session, success_redirect_tab_id: usize) !View {│ │42 var box = wgt.Box(ui.Widget).init(.{ .border_style = null, .rounded_corners = true, .direction = .vert }); │ │43 errdefer box.deinit(allocator); │ │44 // marks this subtree as an HTML form scope for the web overlay │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │45 - box.getFocus().kind = .{ .custom = "form:/login" }; │ │45 + box.getFocus().kind = .{ .custom = switch (session.data.current_page) { │ │46 + .user, .user_settings, .user_auth => |name| try std.fmt.allocPrint(session.arena.allocator(), "form:/user/{s}/login", .{name}),│ │47 + else => "form:/login", │ │48 + } }; │ │49 │ │50 var nav_ids: [3]usize = undefined; │ │51 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────╮ │ 95 .data = data, │ │ 96 .session = session, │ │ 97 .nav_ids = nav_ids, │ │ 95 - .users_tab_id = users_tab_id, │ │ 98 + .success_redirect_tab_id = success_redirect_tab_id,│ │ 99 }; │ │100 } │ │101 │ ╰────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │260 │ │261 // jump focus back to the users tab — the login button we │ │262 // just pressed is about to be hidden by the tab-label swap│ │260 - try root_focus.setFocus(self.users_tab_id); │ │263 + try root_focus.setFocus(self.success_redirect_tab_id); │ │264 }, │ │265 } │ │266 } │ ╰────────────────────────────────────────────────────────────────────────────────╯