fix: clear stale onboarding modal session state#1904
Conversation
- Purpose: prevent stale browser session UI state from suppressing onboarding on a later fresh install. - Before: onboardingModalHidden was stored in sessionStorage, so closing or bypassing onboarding in one dev/test session could hide the modal for a new onboarding flow in the same browser session. - Problem: that hidden flag was not authoritative onboarding state and could outlive the install context, creating false negatives where onboarding should appear. - Change: keep isHidden as in-memory Pinia UI state only, clear any legacy onboardingModalHidden session key on mount and during onboarding cleanup, and retain sessionStorage only for the temporary bypass flow. - Verification: added regression coverage for legacy key cleanup and updated modal-visibility tests to assert the new non-persistent behavior.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1904 +/- ##
==========================================
- Coverage 50.78% 50.78% -0.01%
==========================================
Files 1022 1022
Lines 70518 70524 +6
Branches 7647 7649 +2
==========================================
+ Hits 35811 35814 +3
- Misses 34584 34587 +3
Partials 123 123 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughRefactors onboarding modal visibility state from persistent session storage to in-memory ref. Adds a new cleanup function to remove legacy hidden state from sessionStorage on component mount, with corresponding test updates to verify the new storage approach. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
Summary
This PR audits onboarding persistence across the Vue/Pinia layer, browser storage, and the API-backed onboarding tracker, then removes the stale browser-session flag that could suppress onboarding on a later fresh install.
Problem
During testing on a fresh installation, the onboarding modal did not appear because the browser still had this key in sessionStorage:
That key was acting as a persistent UI override even though it was not authoritative onboarding state. In practice, a prior dev/test flow in the same browser session could hide onboarding for a new install.
Root Cause
The onboarding modal visibility store persisted isHidden to sessionStorage under onboardingModalHidden. That value was separate from the real onboarding completion state and could outlive the install context it came from.
The actual source of truth for onboarding completion is server-side in onboarding-tracker.json via the API onboarding tracker service. The browser-hidden flag should never have been able to suppress a new fresh-install flow on its own.
Audit Findings
Pinia / browser state
API-backed state
Existing cleanup behavior
Changes
Why this approach
This keeps the useful pieces of onboarding persistence while removing the risky one:
Testing
Ran:
Result:
Notes
This PR intentionally keeps cleanup for the old onboardingModalHidden key so any browser sessions that already have the stale value get healed automatically after upgrade.
Summary by CodeRabbit
New Features
Bug Fixes