Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme override - Light theme preload #2209

Open
bmingles opened this issue Sep 3, 2024 · 0 comments
Open

Theme override - Light theme preload #2209

bmingles opened this issue Sep 3, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@bmingles
Copy link
Contributor

bmingles commented Sep 3, 2024

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.
@bmingles bmingles added enhancement New feature or request triage Issue requires triage labels Sep 3, 2024
@vbabich vbabich added this to the September 2024 milestone Sep 10, 2024
@vbabich vbabich added good first issue Good for newcomers and removed triage Issue requires triage labels Sep 10, 2024
@mofojed mofojed modified the milestones: September 2024, October 2024 Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants