Skip to content

Studio: follow OS theme by default and apply it on mount - #6405

Merged
Imagineer99 merged 2 commits into
unslothai:mainfrom
Etherll:system-theme
Jun 17, 2026
Merged

Imagineer99 merged 2 commits into
unslothai:mainfrom
Etherll:system-theme

Conversation

@Etherll

@Etherll Etherll commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Studio frontend now defaults to the OS theme instead of light, and the theme store applies the resolved theme to the document on mount. This removes the initial light flash on fresh origins where localStorage is empty.

Changes

  • studio/frontend/src/app/provider.tsx:338: set ThemeProvider to defaultTheme="system" with enableSystem, so the app follows the OS light/dark preference.
  • studio/frontend/src/features/settings/stores/theme-store.ts:53: apply resolveTheme(readStoredTheme()) to the document on subscribe (mount), making the store the single source of truth for the DOM class. Previously the initial paint relied solely on next-themes, which on a fresh origin (e.g. a new Cloudflare --secure link with empty localStorage) fell back to its own default and showed light while the control still read "system".
  • Comment cleanup in setTheme after dropping the defaultTheme="light" reference.

Set ThemeProvider defaultTheme to "system" and enable system preference so the app follows the OS theme. In the theme store, apply the resolved theme to the document immediately on mount so the store is the single source of truth and avoids an initial light flash on fresh origins (e.g. empty localStorage). Minor comment and formatting tweaks in setTheme were also made.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the application's theme provider to use the system theme by default and ensures the theme store acts as the single source of truth by applying the stored theme on mount. Feedback is provided to optimize the theme application inside the subscription callback by checking if the theme class is already present on the document, preventing redundant DOM manipulations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Imagineer99
Imagineer99 merged commit c0cd3a5 into unslothai:main Jun 17, 2026
23 of 29 checks passed
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.

2 participants