diff --git a/docs/todo.md b/docs/todo.md index 75b2384..3afe5a5 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -44,7 +44,7 @@ - [x] Onboarding flow with persona selection (Learner/Creator/Curator) - [x] Empty states with helpful prompts for new users - [x] Help center/FAQ section (with beta development notice) -- [ ] Tutorial/walkthrough for first deck creation +- [x] Tutorial/walkthrough for first deck creation **SEO & Meta:** diff --git a/web/src/App.tsx b/web/src/App.tsx index 31ce4cd..cf585f1 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,7 +1,7 @@ import { AppLayout } from "$components/layout/AppLayout"; import { OnboardingDialog } from "$components/OnboardingDialog"; import type { Persona } from "$lib/model"; -import { authStore, preferencesStore } from "$lib/store"; +import { authStore, prefStore } from "$lib/store"; import About from "$pages/About"; import DeckNew from "$pages/DeckNew"; import DeckView from "$pages/DeckView"; @@ -26,19 +26,19 @@ const ProtectedRoute: Component<{ component: Component }> = (props) => { onMount(async () => { if (authStore.isAuthenticated()) { - await preferencesStore.fetchPreferences(); + await prefStore.fetchPrefs(); } }); createEffect(() => { - if (preferencesStore.needsOnboarding()) { + if (prefStore.needsOnboarding()) { setShowOnboarding(true); } }); const handleOnboardingComplete = (_persona: Persona) => { setShowOnboarding(false); - preferencesStore.fetchPreferences(); + prefStore.fetchPrefs(); }; return ( diff --git a/web/src/components/DeckEditor.tsx b/web/src/components/DeckEditor.tsx index de55418..0c67abf 100644 --- a/web/src/components/DeckEditor.tsx +++ b/web/src/components/DeckEditor.tsx @@ -2,6 +2,7 @@ import { fadeIn, scaleIn } from "$lib/animations"; import { api } from "$lib/api"; import type { Card, CardType, CreateDeckPayload, Visibility } from "$lib/model"; import { toast } from "$lib/toast"; +import { useTutorialTarget } from "$lib/TutorialProvider"; import { Button } from "$ui/Button"; import { createSignal, For, Show } from "solid-js"; import { Motion } from "solid-motionone"; @@ -19,6 +20,14 @@ export function DeckEditor(props: { onSave?: (deck: CreateDeckPayload) => void } const [cards, setCards] = createSignal([]); const [showCardEditor, setShowCardEditor] = createSignal(false); + const registerTutorialTarget = (id: string) => { + try { + return useTutorialTarget(id); + } catch { + return () => {}; + } + }; + const handleSubmit = async (e: Event) => { e.preventDefault(); @@ -80,6 +89,7 @@ export function DeckEditor(props: { onSave?: (deck: CreateDeckPayload) => void }
void }