Skip to content

fix(session): clear persisted theme preference on logout and sync STORAGE_KEYS - #27

Merged
merlik787-droi merged 2 commits into
Riddlrealm:mainfrom
rudra496:fix/issue-8-clear-session-theme
Aug 27, 2026
Merged

merlik787-droi merged 2 commits into
Riddlrealm:mainfrom
rudra496:fix/issue-8-clear-session-theme

Conversation

@rudra496

Copy link
Copy Markdown
Contributor

Closes #8

Summary of Changes

  1. Synchronized STORAGE_KEYS:

    • Added THEME_PREFERENCE: 'mindmint_theme_preference' to STORAGE_KEYS in src/session/storageKeys.ts.
    • Updated src/theme/themeStore.ts to reference STORAGE_KEYS.THEME_PREFERENCE for Zustand persistence instead of a hardcoded string.
  2. Zustand Theme Store Reset & Storage Clearing:

    • Exposed
      esetTheme action in useThemeStore to revert preference back to DEFAULT_THEME_PREFERENCE ('system').
    • Integrated useThemeStore.getState().resetTheme() and useThemeStore.persist.clearStorage() into clearSession() in src/session/clearSession.ts to ensure complete session artifact cleanup across logouts.
  3. Testing & Verification:

    • Added unit test in src/session/clearSession.test.ts verifying that clearSession() resets the theme store and deletes mindmint_theme_preference from localStorage.
    • Verified 100% test pass rate (
      pm test), linting (
      pm run lint), and production build (
      pm run build).

Copilot AI lite review requested due to automatic review settings August 24, 2026 14:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rudra496

Copy link
Copy Markdown
Contributor Author

Same situation as #26: the red check comes from main's broken package-lock.json (#24/#25 left it missing several entries), not from this fix. See #30 for the minimal repair — once it lands, this check should go green.

@merlik787-droi
merlik787-droi merged commit 63d5a39 into Riddlrealm:main Aug 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clearSession leaves the persisted theme behind: logout does not clear every session artifact

3 participants