Skip to content

Conversation

@lucaseduoli
Copy link
Collaborator

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:

  • Added useUpdateOnboardingStateMutation hook to handle updates to onboarding state via API, replacing previous localStorage usage. (frontend/app/api/mutations/useUpdateOnboardingStateMutation.ts)
  • Extended the Settings interface to include a new onboarding property with all relevant onboarding state fields. (frontend/app/api/queries/useGetSettingsQuery.ts)

Component updates to use backend state:

  • Refactored OnboardingContent, OnboardingCard, and OnboardingUpload components 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]
  • Updated onboarding step completion logic in chat/page.tsx to check backend onboarding state instead of localStorage. (frontend/app/chat/page.tsx) [1] [2]

Cleanup and removal of localStorage dependencies:

  • Removed all references to localStorage and related constants from onboarding components and utility files. (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]

@lucaseduoli lucaseduoli requested a review from phact December 23, 2025 16:23
@lucaseduoli lucaseduoli self-assigned this Dec 23, 2025
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.

3 participants