Repository navigation
Add a titlebar button to choose System, Light or Dark appearance - #7
Merged
Merged
Conversation
The app followed the macOS appearance with no way to override it. The new titlebar button cycles System → Light → Dark. The choice is saved in spotter-config.json and applied before the window opens, so the first paint is already right. It sets nativeTheme.themeSource, which is what prefers-color-scheme reports to every page in the app. That themes the app's own screens and the embedded Spotter together: the embed follows the system color scheme unless the user picked a theme in ThoughtSpot itself. The SDK's isDarkMode would let the host force the embed's theme, but it needs ThoughtSpot 26.12. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Since v1.8.0 the app follows the macOS appearance, but there was no way to override it, for example to keep Spotter light on a dark Mac.
What changed
appearanceinspotter-config.jsonand validated against the three modes. It's applied withnativeTheme.themeSourcebefore the window opens, so the first paint already uses it. The existingnativeThemeupdatedhandler repaints the window background when it changes.getAppearance/setAppearance.Appearance Changedwith the chosen mode.How it themes the embed
themeSourceis whatprefers-color-schemereports to every page in the app, so one value themes the app's own screens and the embedded Spotter together. The embed follows the system color scheme by default. If a user has explicitly picked a theme in their ThoughtSpot preferences, the embed may keep that; I haven't checked this.The SDK's
isDarkMode/HostEvent.UpdateThemewould let the host force the embed's theme, but it needs ThoughtSpot 26.12, so it isn't used yet. Once clusters are on 26.12, passing this same choice through it would make the theme authoritative.Testing
On the dev build, against
champagne.thoughtspotstaging.cloud, on a copy of the profile:themeSource, the saved config value and the window background (#FFFFFF/#1F2024).appearance: "light"saved, a relaunch starts withthemeSource=lightand the button shows Light.npm run lintand the production build pass.In one run the button first showed Dark with no saved value. I couldn't reproduce that on a fresh profile copy, and nothing writes
darkwithout a click.🤖 Generated with Claude Code