fix: theme toggle not switching between light and dark mode (#98)
* fix: theme toggle not switching between light and dark mode
Two bugs prevented the light/dark toggle from working:
1. toggleColorScheme() used `m&&m[1]==='light'` which evaluates to null
(falsy) when no cookie exists yet, causing the first toggle click to
set cookie to 'light' instead of 'dark' — a no-op since light is the
default. Fixed by extracting current scheme before toggling.
2. FALLBACK_THEME always used neobrutal-light tokens regardless of color
scheme. When no dark theme is configured in the policy, toggling to
dark changed the icon but kept light-colored tokens. Added
fallbackForScheme() that returns neobrutal-dark tokens for dark mode.
https://claude.ai/code/session_01CnyPWgayLMmPZ2Ritq2Lcj
* test: add regression coverage for toggle logic and dark-scheme fallback paths
Add pinning test for the corrected toggleColorScheme script to prevent
silent reversion to the null-evaluating m&&m[1]==='light' pattern.
Add dark-scheme network exception test for resolveTheme to verify
fallbackForScheme() returns dark tokens on all fallback paths, not just
the !policyRes.ok path that was previously the only dark-scheme test.
---------
Co-authored-by: Claude <noreply@anthropic.com>