Feature/user profile switching - #580
Open
hausmanj wants to merge 6 commits into
Open
Conversation
Add a "Select User" entry to the preferences menu and a "Who's watching?" picker that switches between saved Jellyfin user profiles without re-entering credentials. Profiles (server + token + display info) are captured into localStorage as users sign in; switching swaps the active credentials and reloads. Includes an add-user flow with a "Back to user selection" cancel path, keyboard-focusable rows, and resilience so a switch that transiently lands on the login screen re-asserts a still-valid token and returns home. Implemented as an injected web script (src/web/user-switch.js) registered through the existing embedded-JS injection pipeline. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A same-layer navigation (e.g. a profile switch or login reload) reloads the document without changing the active layer, so the active-layer refocus never runs. On X11 OSR the reloaded page comes up unfocused: an input is document.activeElement (typing works) but does not match :focus, so it renders with no caret and no focus ring. Re-assert set_focus(true) in Inner::on_load_end for main-frame loads, but only when the loaded layer is the current top, so a background layer's load can't steal focus from an overlay. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Stop clearing the injection profile on RenderProcessHandler::OnBrowserDestroyed so injected web scripts are still present when the renderer recreates the browser, rather than silently dropping out. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On libmpv builds without Wayland support (HAVE_EGL_WAYLAND=0, e.g. wayland-client < 1.23 on Ubuntu 24.04) the gpu-context=wayland option does not exist. Match on MPV_ERROR_OPTION_NOT_FOUND/OPTION_ERROR and skip instead of propagating the error, so mpv auto-selects a context (X11/EGL via XWayland) rather than failing to boot to a black screen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hausmanj
marked this pull request as ready for review
July 4, 2026 02:25
"Select User" was only injected on the My Preferences page. Add it to the two other account menus so profile switching is reachable everywhere the account actions are, verified on macOS, Windows, and Linux (jellyfin-web 10.11): - Left navigation drawer (a.navMenuOption rows): inserted directly below Select Server, above Settings / Sign Out. - Top-right avatar user menu. On jellyfin-web 10.11 this is a React/MUI <Menu> (ul.MuiMenu-list > li.MuiMenuItem-root with an inline SVG icon), not the classic actionSheet, so clone a real item to preserve its styling, swap the SVG path + label, close the menu via its modal backdrop, then open the picker. A classic-actionSheet installer is kept as a fallback for older web builds. Shared helpers findInRows() / wireSelectUserRow(); ICON_STRUCTURAL and setRowLabel taught about the drawer's navMenuOption classes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary: One thing missing has been easy profile switching in the app, similar to other popular streaming apps. This PR adds fast switching between saved user profiles on the same server, so you can move between accounts without signing in again.
A Select User item in preferences under the User section opens a "Who's watching?" picker. You can also add a new user from there and back out of the login screen if you change your mind.
It's implemented as an injected web script (src/web/user-switch.js) wired through the existing embedded-JS injection pipeline, with a small amount of native focus handling.
This also includes the fixes that were needed to run the client on Linux during development. The most important one fixes a black screen on load under Parallels: on libmpv builds without Wayland support (Ubuntu 24.04, wayland-client < 1.23) the gpu-context=wayland option doesn't exist, so setting it aborted startup — now it falls back to X11/EGL via XWayland. The others keep injected scripts alive across a browser destroy and filter control characters out of Wayland keyboard events.
Note: If only one profile is logged in the Select User Screen does not appear, but the Select User setting is still there where you can add users.
Tested on Windows 25H.2, Mac 26.6, X11, Wayland and Fedora