Files
lefarcenandGitHub 579db9e8c7 feat(analytics): unify page_name + onboarding/design-system page_views (#2390)
Doc v2 row 12 (settings) was renamed `page` -> `page_name` in the doc;
mirror that in code so every event surface uses the same field name on
the wire. Drops `TrackingSettingsPage` as a separate discriminator and
merges 'settings' into `TrackingPageName` so `page_name='settings'`
sits beside the product surfaces.

Adds two new page_view surfaces from the v2 doc:

- `page_name=onboarding`: one emission per step exposure in the
  Connect / About you / Design system / Generation 4-step funnel.
  `onboarding_session_id` is generated once in sessionStorage so the
  4th step (which fires from `DesignSystemDetailView` after onboarding
  navigates away) stays attributable. Cleared on onboarding finish
  so a later unrelated DS visit doesn't inherit the id.

- `page_name=design_system_project | design_systems`: multi-surface
  DS page_view. Wires the page-level emissions (list / create /
  generation / preview); the module / popover / panel exposures
  inside home and studio are intentionally left for a follow-up so
  this PR doesn't blur with the unresolved "page_view vs surface_view
  for non-page exposures" question raised with product.

`PageViewProps` becomes a discriminated union (`GenericPageViewProps |
OnboardingPageViewProps | DesignSystemsPageViewProps`) so each surface
gets its own typed contract. `design_system_source` is a new field on
the DS page_view; it shares the name from the v2 doc with the
existing run_created/run_finished field, but the value set is
disjoint so a new `TrackingDesignSystemOrigin` type carries it.
2026-05-20 16:20:48 +08:00
..
2026-05-19 21:36:51 +08:00
2026-05-19 18:27:05 +08:00