main ← fix/admin-viewing-other-user-interface-preferences
opened 10:53PM - 16 Feb 26 UTC
When an admin viewed another user's interface preferences page, the theme, color… palette, text size, and color mode dropdowns all showed the admin's own values instead of the target user's. Saving changes also incorrectly set cookies and applied live previews in the admin's browser.
This happened because the route and controller sourced display values from the current session (DOM meta tags, cookies, session store) rather than from the target user's serialized `user_option`.
The fix checks `isViewingOwnProfile` (already defined on the controller) and branches accordingly:
- Route: sets `themeId`, `textSize`, `selectedColorSchemeId`, and `selectedDarkColorSchemeId` from the target user's `user_option` when viewing another user, and from session/cookies when viewing own profile.
- Controller: guards all live preview side effects (`selectTextSize` DOM class changes, `save()` cookie writes, theme reload, homepage change) behind `isViewingOwnProfile`.
- Hides "Make this the default on all my devices" checkboxes and the "theme will update" alert when viewing another user, since per-device overrides don't apply.
- Removes the now-redundant `init()` color scheme initialization since `setupController` always sets these values.
https://meta.discourse.org/t/387511