Skip to content

fix: always use chonkDarkTheme in gsAdmin#104338

Merged
JonasBa merged 3 commits intomasterfrom
tkdodo/fix/rollout-chonk-for-gsAdmin
Dec 3, 2025
Merged

fix: always use chonkDarkTheme in gsAdmin#104338
JonasBa merged 3 commits intomasterfrom
tkdodo/fix/rollout-chonk-for-gsAdmin

Conversation

@TkDodo
Copy link
Copy Markdown
Collaborator

@TkDodo TkDodo commented Dec 3, 2025

No description provided.

@TkDodo TkDodo marked this pull request as ready for review December 3, 2025 19:12
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 3, 2025
themes[themeName] ?? lightTheme,
toggleTheme,
] as const;
return [themeName === 'darkTheme', themes[themeName], toggleTheme] as const;
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.

Bug: Missing fallback for invalid localStorage theme value

The removal of the fallback ?? lightTheme creates a potential issue. If localStorage contains an invalid value for getsentryAdminTheme (not 'darkTheme' or 'lightTheme'), themes[themeName] will be undefined since the as ThemeName cast doesn't validate the actual value at runtime. This would cause theme to be undefined when passed to ThemeProvider, potentially breaking the admin layout. The original fallback protected against corrupted or manually modified localStorage values.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is a fallback to localStorage.getItem above which initializes to lightTheme. This line can only be hit if we store or read a corrupt value from localstorage. We can dismiss this comment

@TkDodo TkDodo requested a review from a team as a code owner December 3, 2025 19:25
@JonasBa JonasBa enabled auto-merge (squash) December 3, 2025 19:32
auto-merge was automatically disabled December 3, 2025 19:36

Invalid email address

@JonasBa JonasBa merged commit 0c23706 into master Dec 3, 2025
48 checks passed
@JonasBa JonasBa deleted the tkdodo/fix/rollout-chonk-for-gsAdmin branch December 3, 2025 19:49
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants