feat(onboarding): preserve telemetry identity across resume

Merged
WC
2mo ago
+2063-71

Summary

  • persist frontend onboarding attempt and run identity metadata across saved progress
  • emit resume dialog, Continue, and Restart telemetry with the agreed A2/R2 and A1/R2 semantics
  • keep onboarding_step_viewed owned by normal navigation, persist identity before the view event, and suppress post-unmount tracking

Verification

  • bun lint
  • bunx vitest run tests/onboarding-progress-analytics.unit.test.ts tests/user-onboarding-progress.unit.test.ts tests/app-onboarding-progress-integration.unit.test.ts (28 tests)
  • bun run typecheck:frontend
  • bun test:unit (243 files, 1909 tests)
  • git diff --check origin/main...HEAD

Production code delta: 146 changed lines. Tests and planning documents are excluded from the 500-line production-code limit.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features

    • Preserved onboarding attempt identity when users resume saved progress.
    • Added a per-session run identity for consistent onboarding analytics.
    • Recorded whether users viewed, continued, or restarted the resume prompt.
    • Maintained reliable event ordering without duplicating step-view events.
  • Bug Fixes

    • Invalid telemetry metadata is ignored while preserving valid onboarding progress.
    • Improved handling when onboarding is closed during initialization.
    • Prevented conflicting or late progress saves after onboarding has been disposed.
    • Added retry handling for initial persistence failures.