Onboarding#11
Conversation
Onboarding (wires the dead stub): - 4 steps: value intro → base currency → tap popular brands (real logos) → confirm/edit prices with a live spend total → one "Add N" button bulk-adds via the create workflow → into the app. - Gate: signed-in users without the local has_onboarded flag are redirected to /onboarding; "Skip" also completes it. Route registered in the root Stack. lib/onboarding flag helpers + curated constants/onboardingBrands with indicative default prices. - Dev-only "Reset onboarding" in Settings to re-trigger the flow. - PostHog: onboarding_started/completed/skipped (counts only). Fixes: - Notification deep-link no longer navigates on cold start before the router is mounted (was throwing "path.split is not a function"); keeps the live tap listener, deferred a tick. - Sign-in shows friendly inline errors (no account / wrong password) instead of a console.error dev overlay, with the sign-up nudge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…aming - Guest-first: onboarding runs before any auth wall; Home/Settings show guest state (Sign in vs Sign out) with a backup/sync nudge. - Onboarding brand grid now derives from ALL brand icons (not a hardcoded subset), with default prices/categories. - Confirm step: replace the Monthly/Yearly toggle with a single tappable cycle chip -> PickerSheet over all real billing cycles, so the spend reveal and reminders are correct for weekly/quarterly/etc. Framed as "Quick add (optional)" with hand-holding copy pointing to the detail screen for the rest. - Fix react-native-css path.split crash: price TextInput uses auth-input class + inline style. - Remove dev seed (db/seed.ts) so no phantom subscriptions; add clearAllSubscriptions + clearAllData and dev "Clear all data" / "Reset onboarding" helpers in Settings. - Update PRODUCTION_PLAN.md to current decisions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Onboarding is now a guided funnel with progress, motion, and a payoff,
built with core Animated + react-native-svg (no new dependencies):
- Steps intro -> goal -> currency -> pick -> confirm -> analyzing -> done,
each spring-transitioning in, with a top progress bar (n/N).
- A branded guide bubble delivers one short line per step (replaces the
paragraph subtitles); a "What brings you here?" goal step lightly
tailors later copy and fires onboarding_goal_selected.
- Confirm reveal counts up (eased) to the real monthly spend; an
"analyzing your spend" anticipation beat precedes an SVG checkmark +
confetti celebration with a success haptic.
- Intro shows a single brand mark (fixes the double-"R"); copy rewritten
to short human lines; type scale enlarged.
- Home: one-time "+" pulse until the first add (persisted via lib/nudges),
success haptic + count-up hero on add, chevron affordance on cards.
New: components/AnimatedCounter, components/onboarding/{GuideBubble,
ProgressBar,CelebrationOverlay}, lib/haptics, lib/nudges. Character +
one asset renderer (Rive) deferred to the rebrand.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
Summary by CodeRabbit
WalkthroughThe PR replaces placeholder onboarding with a multi-step guest-first flow, adds onboarding persistence and routing, creates subscriptions from onboarding selections, removes development seeding, adds data clearing, and updates authentication, home, settings, insights, notifications, and product-plan documentation. ChangesGuest-first onboarding
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/onboarding.tsx`:
- Around line 216-242: Update addSelected to catch failures from addSubscription
during the selectedBrands loop, surface an appropriate error to the user, and
stop the success flow so setStep("analyzing") is not reached after a partial
write. Preserve successfully persisted subscriptions and ensure the failure path
exits cleanly without reporting an inaccurate added count.
- Line 141: Update the price parsing used by priceFor and addSelected to
normalize comma decimal separators to periods before parsing, so inputs such as
12,99 are preserved correctly. Ensure the “Add N subscriptions” label derives
its count from the same parsed-price validity rule as addSelected, excluding
items whose parsed prices are less than or equal to zero.
In `@components/AnimatedCounter.tsx`:
- Line 23: Replace the render-phase ref initialization in
components/AnimatedCounter.tsx at lines 23-23 with lazy useState initialization
for anim. Apply the same change to addPulse in app/(tabs)/index.tsx at lines
44-44, preserving the existing initial values of 0 and 1 respectively.
In `@components/onboarding/CelebrationOverlay.tsx`:
- Around line 39-63: The CelebrationOverlay animation effect can replay and
invoke completion multiple times when onDone changes identity. In
components/onboarding/CelebrationOverlay.tsx:39-63, keep the animation trigger
independent of the unstable callback by storing the latest onDone in a ref and
stopping the sequence during cleanup; in app/onboarding.tsx:491-497, memoize the
callback passed to CelebrationOverlay with useCallback based on addedCount so
incidental re-renders do not restart the sequence.
In `@PRODUCTION_PLAN.md`:
- Around line 140-142: Update the economics section’s annual revenue assumption
to match the Pro annual price of $39.99/year, approximately $3.33/month, and
ensure the corrected figure is used consistently in downstream COGS and
conversion calculations.
- Around line 23-24: Define and document a migration policy for changing the
app-wide base currency in PRODUCTION_PLAN.md before permitting that setting.
Because existing stored numeric amounts are formatted by lib/notifications.ts
and lib/reminders.ts, either lock the currency once data exists, require a reset
and re-entry of amounts, or explicitly introduce conversion; do not allow
changes that merely relabel existing values.
- Around line 302-303: Update the account and data-boundary plan near the “Data
leak across accounts on one device” and “Clear all data” entries to explicitly
define sign-out behavior: either forbid account switching on a device or require
clearing/namespacing local SQLite data on sign-out, including coverage in the
clear-all-data flow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: bb56338c-586a-4ede-bb6c-97508062bd0e
📒 Files selected for processing (20)
PRODUCTION_PLAN.mdapp/(auth)/sign-in.tsxapp/(tabs)/_layout.tsxapp/(tabs)/index.tsxapp/(tabs)/settings.tsxapp/_layout.tsxapp/onboarding.tsxcomponents/AnimatedCounter.tsxcomponents/SubscriptionCard.tsxcomponents/onboarding/CelebrationOverlay.tsxcomponents/onboarding/GuideBubble.tsxcomponents/onboarding/ProgressBar.tsxconstants/onboardingBrands.tscontext/SubscriptionsContext.tsxdb/seed.tsdb/subscriptionsRepo.tsglobal.csslib/haptics.tslib/nudges.tslib/onboarding.ts
💤 Files with no reviewable changes (1)
- db/seed.ts
Two quick wins from the reference-flow scan: - SubscriptionFormModal: after a create, keep the modal open on a "Subscription added" prompt with Add another / Done, so users can add several in a row (edits still close immediately). - Insights: show "On trial" and "Cancelled" counts alongside the existing spend/active/saved stats. Also record the net-new reference-scan ideas (social login, spend-over-time chart, next-month projection, payment history, catalog filters, date grouping, add-another) into PRODUCTION_PLAN.md, and explicitly reject the wallet/pay/top-up/transfer payment features as conflicting with our no-bank-login, local-first positioning. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Docs (PRODUCTION_PLAN.md):
- Define base-currency change policy (lock once data exists / reset to
change; no relabel, no FX), naming the enforcement point + formatters.
- Correct the annual-plan revenue assumption ($8.66 -> $3.33/mo from
$39.99/yr) and reconcile the downstream COGS figures.
- Define sign-out / account-boundary behavior (no account switching;
sign-out keeps local data; only Clear-all-data wipes; namespace by
user id when sync ships).
Code:
- CelebrationOverlay: read onDone via a ref, run the sequence once on
mount, fire onDone only when finished, stop on cleanup; memoize the
callback in onboarding so re-renders don't restart it / double-navigate.
- onboarding: normalize comma decimal separators in price parsing
("12,99"); derive the "Add N" CTA count from the same price > 0 rule
addSelected uses.
- Lazy useState init for Animated.Value (AnimatedCounter anim, Home
addPulse) instead of per-render construction.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No description provided.