Skip to content

fix: persist completed onboarding tour state in localStorage (#798) - #843

Merged
Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
adesuwa-tech:fix/798-onboarding-completed-flag
Oct 22, 2026
Merged

Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
adesuwa-tech:fix/798-onboarding-completed-flag

Conversation

@adesuwa-tech

Copy link
Copy Markdown

Problem

The onboarding tour displays repeatedly in certain incognito or cross-tab sessions, annoying experienced users.

Approach

Persist the has_completed_onboarding_v1 flag in localStorage and check it on page mount, per the issue's suggested approach.

  • lib/onboarding-storage.ts

    • Adds hasCompletedOnboarding() / markOnboardingCompleted() backed by the has_completed_onboarding_v1 key, using the module's existing safe (memory-fallback) accessors.
    • clearOnboardingState() now also removes the completed flag, so Restart Tour in settings works.
    • Fixes safeRemove to always drop the in-memory fallback copy — previously a cleared key could linger in memory and still read as present (this was a pre-existing failing test: clearOnboardingState > allows the tour to run again after clearing).
  • components/OnboardingTour.tsx

    • Checks the flag on page mount (and re-checks whenever the tour is re-activated) and renders nothing when the user has already completed the tour.
    • Persists the flag when the tour is finished (Finish on the last step) or dismissed (Skip button, header Skip Tour, modal close/Escape).

Tests

  • New coverage in components/OnboardingTour.test.tsx (flag gates rendering; flag written on Finish/Skip/Escape; not written on intermediate Next) and lib/onboarding-storage.test.ts (flag read/write/clear, memory fallback).
  • All 58 onboarding-related tests pass; full suite shows no regressions vs main (the 25 files already failing on main, including app/dashboard/page.tsx type errors, are unchanged).

Closes #798

…-protocol#798)

The tour re-appeared in incognito and cross-tab sessions because the only
persisted state was the step-progress record. Persist a
has_completed_onboarding_v1 flag when the tour is finished or skipped and
check it on page mount so the tour is never re-shown. Also make
clearOnboardingState drop the in-memory fallback copy so "Restart Tour"
clears the flag too.
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.

components/OnboardingTour.tsx: save completed tour state to user profile preferences in localStorage

2 participants