Add onboarding wizard for teaching the record key #301
Reference in New Issue
Block a user
Delete Branch "claude/sleepy-dijkstra-ffvu14"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements a comprehensive first-run onboarding wizard that teaches users the core functionality of llink—the record key (backtick). The wizard is rendered as a full-screen overlay above the main app to prevent keyboard handler conflicts and guides users through five interactive lessons before they start using the app.
Key Changes
useHoldGesture: Detects press-and-hold with visual progress feedback (600ms for teaching vs. 250ms real threshold)useTapGesture: Counts discrete key taps, supporting both single-tap (audio/video toggle) and multi-tap (start/stop) scenariosHOLD_THRESHOLD_MS(250ms) to lib/constants for consistency between onboarding and actual recording behaviorNotable Implementation Details
requestAnimationFramefor smooth progress visualization and respectsisTypingTarget()to avoid interfering with text inputshttps://claude.ai/code/session_01A9AHySdLb1zfZAEm6SuaQP
Summary by CodeRabbit
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Free
Run ID:
28072598-94dd-4fc2-a04b-059d7de66473📥 Commits
Reviewing files that changed from the base of the PR and between 5801ca4098104dc236fc6618f1ea2a884257a0d2 and
e6bf024729.📒 Files selected for processing (13)
js/desktop/src/App.tsxjs/desktop/src/features/compose/compose-overlay.tsxjs/desktop/src/features/onboarding/hold-step.tsxjs/desktop/src/features/onboarding/onboarding-keyboard.tsxjs/desktop/src/features/onboarding/onboarding-overlay.tsxjs/desktop/src/features/onboarding/onboarding-step.tsxjs/desktop/src/features/onboarding/permission-step.tsxjs/desktop/src/features/onboarding/tap-step.tsxjs/desktop/src/features/onboarding/toggle-step.tsxjs/desktop/src/features/onboarding/use-hold-gesture.tsjs/desktop/src/features/onboarding/use-tap-gesture.tsjs/desktop/src/lib/constants.tsjs/desktop/src/stores/onboarding-store.ts✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (12)
📝 Walkthrough
Walkthrough
Adds a first-run onboarding wizard that gates the authenticated desktop UI behind a five-step full-screen overlay teaching keyboard shortcuts. Introduces
useHoldGestureanduseTapGesturehooks, sharedOnboardingStep/OnboardingKeyboardUI primitives, four gesture-driven step components, auseOnboardingStoreZustand store withlocalStoragepersistence, and wires the overlay intoApp.tsx.Changes
First-run onboarding wizard
js/desktop/src/stores/onboarding-store.ts,js/desktop/src/lib/constants.ts,js/desktop/src/features/compose/compose-overlay.tsxuseOnboardingStorewithhasCompletedOnboarding,markComplete, andresetbacked bylocalStorage. AddsHOLD_THRESHOLD_MS = 250to the shared constants module and removes the duplicate inline definition fromcompose-overlay.tsx, updating its import accordingly.js/desktop/src/features/onboarding/use-hold-gesture.ts,js/desktop/src/features/onboarding/use-tap-gesture.tsuseHoldGesturetracksidle → holding → successwithrequestAnimationFrame-driven progress, key-repeat/typing-target guards, andpreventDefault.useTapGesturecounts discrete keydowns up to a threshold and exposes{ taps, satisfied }with a liveonTapref.js/desktop/src/features/onboarding/onboarding-step.tsx,js/desktop/src/features/onboarding/onboarding-keyboard.tsxOnboardingStepexportsSUCCESS_DWELL_MS = 2000and renders a shared layout witharia-live="polite"status and optional slots.OnboardingKeyboardrenders a small keyboard with aKeyCapsubcomponent that applies state-based styling and a progress fill bar.js/desktop/src/features/onboarding/hold-step.tsx,js/desktop/src/features/onboarding/tap-step.tsx,js/desktop/src/features/onboarding/toggle-step.tsx,js/desktop/src/features/onboarding/permission-step.tsxHoldStepteaches backquote hold at 600 ms.TapSteprequires two backquote taps.ToggleStepuses a'v'tap to switchrecordingModeand restores it on unmount.PermissionStepcallsrequestLabels(), auto-advances on grant, and offers "Continue anyway" on denial. All share the dwell-then-advance pattern.js/desktop/src/features/onboarding/onboarding-overlay.tsx,js/desktop/src/App.tsxOnboardingOverlaysequenceswelcome → hold → tap → toggle → permissionwithgoNext/goBack, focus management for gesture steps, and a globalkeydownhandler (Escskips,Enteradvances from welcome, arrow/backspace/delete go back).App.tsxrenders the overlay instead of the authenticated UI whenhasCompletedOnboardingis false.Sequence Diagram(s)
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Comment
@coderabbitai helpto get the list of available commands and usage tips.