Skip to content

Theme override - Light theme preload #2209

@bmingles

Description

@bmingles

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

  1. localStorage if they were persisted from a previous session
  2. fallback to the DEFAULT_PRELOAD_DATA_VARIABLES const if nothing has been cached. This only supports default dark theme and uses values from DEFAULT_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_PALETTE mapping based on DEFAULT_DARK_THEME_PALETTE
  • Rename DEFAULT_PRELOAD_DATA_VARIABLES to something like DEFAULT_DARK_THEME_PRELOAD_DATA_VARIABLES
  • Create a new DEFAULT_LIGHT_THEME_PRELOAD_DATA_VARIABLES mapping
  • Update ThemeUtils.preloadTheme() to pick the appropriate theme in cases where the theme query string param is set instead of using the cached data (this will require clearing localStorage THEME_CACHE_LOCAL_STORAGE_KEY to remove any cached preload data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions