Skip to content

Conversation

@KL2400040448
Copy link

Closes #2842

PR Type

  • Bugfix

What is the current behavior?

When the application is set to follow the system theme, any change in the system's theme (e.g., from Light to Dark) causes the ThemeService to save the resolved theme ("Dark") to the settings file. This locks the application to that specific theme and prevents it from following any subsequent system theme changes.

What is the new behavior?

This change moves the theme-saving logic from the internal theme-changed handler (InternalSetThemeOnUIThread) to the public SetThemeAsync method.

This ensures that the theme preference is only saved to settings when a user explicitly calls SetThemeAsync with a specific theme (Light or Dark). The application now correctly follows the system theme by default without writing to the settings file, which resolves the original issue.

PR Checklist

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template. (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

@CLAassistant
Copy link

CLAassistant commented Oct 20, 2025

CLA assistant check
All committers have signed the CLA.

@KL2400040448
Copy link
Author

review

@KL2400040448
Copy link
Author

merge approve

{
try
{
_settings.Set(CurrentThemeSettingsKey, theme.ToString());
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for removing this line and leaving an empty try block


// Make sure initialization completes before attempting to set new theme
await _initialization.Task;
if (theme != AppTheme.System)
Copy link
Contributor

Choose a reason for hiding this comment

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

We would still need the await _initialization.Task here, no?

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