You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Choosing Nord, Solarized Light or High Contrast crashes the app on every launch #781
Pick Nord, Solarized Light, High Contrast, or any imported theme in View → Appearance. The whole window is replaced by "Something went wrong" (Element type is invalid … FeatureButtons).
The choice is saved to localStorage, so every later launch crashes too. "Reload Application" doesn't help. The only way back in is clearing the app's site data. This is in 1.3.0, and in every release since #680.
Found in the UX review on the mock backend (?mock, then View → Appearance → Nord).
Cause
src/components/layout/FeatureButtons.tsx:
constthemeIcons: Record<ThemeMode,typeofSun>={dark: Moon,light: Sun,system: Monitor};
...
constThemeIcon=themeIcons[theme];// theme is any theme id, e.g. "nord"
ThemeMode is string, and theme can be any theme id, but the lookup only knows the three ids the title-bar button cycles through. For any other id, ThemeIcon is undefined, and <ThemeIcon /> throws. themeLabels[theme] is also undefined there, so the tooltip and the screen-reader announcement read "Theme: undefined".
The existing tests mock the theme store with only dark/light/system, which is why this was never caught.
Fix
Fall back to an icon for the theme's base (effectiveTheme light → Sun, otherwise Moon). Label it with the theme's own name, from the built-in list or the user's custom themes. Add tests that render the buttons with every built-in theme and with an imported theme id.
Worth a patch release: 1.3.0 users who pick one of these themes are stuck.
Activity
fix(ui): stop non-default themes crashing the app
fix(ui): stop non-default themes crashing the app (#782)
release: 1.4.0 (#871)