Skip to content

Conversation

@dmitri-saricev-3pillargloball
Copy link
Contributor

@dmitri-saricev-3pillargloball dmitri-saricev-3pillargloball commented Dec 11, 2025

Remove localStorage theme persistence and sync theme from Grafana API on login to prevent new users from inheriting previous user's theme preferences.
https://perconadev.atlassian.net/browse/PMM-14624

result:

Screen.Recording.2025-12-10.at.17.02.51.mov

Link to the Feature Build:
Percona-Lab/pmm-submodules#4149
https://pmm.cd.percona.com/blue/organizations/jenkins/pmm3-submodules/detail/pmm3-submodules/2057/pipeline/

If this PR adds, removes or alters one or more API endpoints, please review and add or update the relevant API documentation as well:

  • API Docs updated

If this PR is related to some other PRs in this or other repositories, please provide links to those PRs:

  • Links to related pull requests (optional).

Remove localStorage theme persistence and sync theme from Grafana API on login to prevent new users from inheriting previous user's theme preferences.
};

export const getUserPreferences = async () => {
const res = await grafanaApi.get<UpdatePreferencesBody>('/user/preferences');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type UpdatePreferencesBody isn't probably correct (if it's the same payload you can just export it like so:

export type GetPreferencesResponse = UpdatePreferencesBody;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const res = await grafanaApi.get<UpdatePreferencesBody>('/user/preferences');
const res = await grafanaApi.get<GetPreferencesResponse>('/user/preferences');

- Move GetPreferenceResponse type to user.types.ts
- Update useUser.ts to use GetPreferenceResponse type
- Rename ThemedyProvider to ThemeSyncProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants