-
Notifications
You must be signed in to change notification settings - Fork 33
Description
We currently preload certain theme variables to style things that show up before a user session has started (e.g. login page, loading spinner, random plot animation, etc.). The variables are loaded from
- localStorage if they were persisted from a previous session
- fallback to the
DEFAULT_PRELOAD_DATA_VARIABLESconst if nothing has been cached. This only supports default dark theme and uses values fromDEFAULT_DARK_THEME_PALETTE.
Allow setting theme via query string parameter #2203 introduced a theme query string parameter that can be used to explicitly set the theme. In cases where the user loads the page with one key and then reloads the page with another, there is a flicker of mismatched theme colors due to the preload cache from the first load. We should fix this so that the cache is ignored when the theme query param is set, and the preload is based on the dark / light theme specified. This will improve the UX for consumers of embed widget (e.g. vscode-deephaven extension).
- Implement
DEFAULT_LIGHT_THEME_PALETTEmapping based onDEFAULT_DARK_THEME_PALETTE - Rename
DEFAULT_PRELOAD_DATA_VARIABLESto something likeDEFAULT_DARK_THEME_PRELOAD_DATA_VARIABLES - Create a new
DEFAULT_LIGHT_THEME_PRELOAD_DATA_VARIABLESmapping - Update
ThemeUtils.preloadTheme()to pick the appropriate theme in cases where thethemequery string param is set instead of using the cached data (this will require clearing localStorageTHEME_CACHE_LOCAL_STORAGE_KEYto remove any cached preload data.