fix: store onboarding state in backend instead of browser #726
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors onboarding state management in the frontend app to use backend persistence instead of localStorage. The onboarding progress, selected nudge, assistant message, and filter IDs are now stored and retrieved via API calls, improving reliability and enabling multi-device support. Several components have been updated to fetch onboarding state from backend settings and to update it using a new mutation hook.
Backend onboarding state management:
useUpdateOnboardingStateMutationhook to handle updates to onboarding state via API, replacing previous localStorage usage. (frontend/app/api/mutations/useUpdateOnboardingStateMutation.ts)Settingsinterface to include a newonboardingproperty with all relevant onboarding state fields. (frontend/app/api/queries/useGetSettingsQuery.ts)Component updates to use backend state:
OnboardingContent,OnboardingCard, andOnboardingUploadcomponents to read onboarding state from backend settings and update it using the new mutation, removing localStorage usage for assistant messages, selected nudge, and filter IDs. (frontend/app/onboarding/_components/onboarding-content.tsx,frontend/app/onboarding/_components/onboarding-card.tsx,frontend/app/onboarding/_components/onboarding-upload.tsx) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]chat/page.tsxto check backend onboarding state instead of localStorage. (frontend/app/chat/page.tsx) [1] [2]Cleanup and removal of localStorage dependencies:
frontend/app/onboarding/_components/animated-provider-steps.tsx,frontend/app/onboarding/_components/onboarding-upload.tsx,frontend/app/onboarding/_components/onboarding-card.tsx,frontend/app/onboarding/_components/onboarding-content.tsx,frontend/components/chat-renderer.tsx) [1] [2] [3] [4] [5] [6] [7]