Skip to content

Feature/user profile switching - #580

Open
hausmanj wants to merge 6 commits into
andrewrabert:mainfrom
hausmanj:feature/user-profile-switching
Open

Feature/user profile switching#580
hausmanj wants to merge 6 commits into
andrewrabert:mainfrom
hausmanj:feature/user-profile-switching

Conversation

@hausmanj

@hausmanj hausmanj commented Jul 3, 2026

Copy link
Copy Markdown

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

image image image

John Hausman and others added 5 commits July 3, 2026 16:42
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
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>
@hausmanj

hausmanj commented Jul 11, 2026

Copy link
Copy Markdown
Author

I realized during testing that there are two additional User Settings areas, one at the bottom of the hamburger menu on the left side, and the Dashboard avatar menu on the top right. I've now added Select User settings in both of those as well - way more user friendly since its easier to find.

image

Hamburger Menu

image

Dashboard avatar menu

Re-tested across Mac, Windows, Fedora, Ubuntu X11 and Wayland

@andrewrabert andrewrabert added the enhancement New feature or request label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants