feat/discovery
safeviewing older commit6e3f255 · incrementalPR #305reviewed 2026-07-20 16:46 UTC0H · 0M · 0L · 1IThe branch
- Purpose
- Feature Discovery v1 — contextual spotlights and Descubre hub for existing users, flag-gated off by default
- Goal
- Land spotlights, hub, and first-run tour behind `feature-discovery-spotlights` flag; prior adversarial review fixed two prod blockers (preview-bypass + self-destruct) before this diff
- Sub-goals
- SG-1: Ambient spotlights (server-decided, paced ≤1/20h, retire-on-dismiss)
- SG-2: Descubre hub (gap list + consent-first pull via ?descubre param)
- SG-3: First-run guided tour (5-step, once, skippable)
- SG-4: DiscoveryFCIS backend (pure decisions + shell, discovery_state table)
- SG-5: Analytics + i18n (PostHog events, es/en messages)
- SG-6 (this diff): Extract pure pull-branch helpers; add pacing exemption; origin tracking
The changes (whole branch)
- What
- Two commits: (1) `fix(discovery)`: `report()` now returns early for pull cards so a hub-summoned coachmark never burns the ambient pacing budget — PostHog track still fires; `origin` ('pull'|'ambient') added to all 4 analytics events. (2) `test(discovery)`: `shouldRenderPull` and `urlWithoutParam` extracted to `spotlight-catalog.ts` as pure helpers; new `pull-branch.test.ts` pins all gate conditions and URL edge cases.
- Why
- Prior review revealed the pull branch was burning the 20h ambient budget (a `seen` would silence the real nudge) and retiring the key on dismiss — both wrong for a user-initiated action. Also pins the pull gate and URL-stripping logic as pure functions so they're testable without the full React provider tree.
- Areas
- apps/platform/src/components/discovery+112−34packages/analytics/src/events.ts+6−0
- Blast
- 5 files, +118/-34 in this window. Scoped to the discovery component tree and analytics types. No DB, no API contract, no i18n changes.
flag-gated: feature-discovery-spotlights (OFF by default — zero prod impact until flipped)
➖typecheck· not available via runner➖ci· GraphQL check-rollup not accessible➖coderabbit· no .coderabbit.yaml
Findings · 1
tests1
info
Pacing-exemption branch not unit-tested
apps/platform/src/components/discovery/FeatureSpotlight.tsx
The `if (pulled) return` early-exit in `report` (which prevents a pull card from burning the 20h ambient budget) has no unit test. The file comment acknowledges this: URL-stripping was the higher-risk regression path. Risk is low because `pulled` is a static prop (the component is keyed, so it never flips mid-mount), but a future refactor could miss the exemption silently.
History · 36 commits
- c1fe7b7needs attentionincremental3H · 4M · 3L2026-07-27 06:02
- 414db56safeincremental0H · 0M · 2L2026-07-23 00:52
- ea68968needs attentionincremental0H · 4M · 7L2026-07-22 23:01
- 4bdb2c9needs attentionincremental1H · 3M · 5L2026-07-21 23:22
- 6e3f255safeincremental0H · 0M · 0L2026-07-20 16:46current
- cc41079blockedincremental5H · 5M · 3L2026-07-20 16:25
- 2451ee0needs attentionincremental0H · 5M · 6L2026-07-20 16:09
- ab7c103needs attentionincremental0H · 1M · 6L2026-07-20 15:52
- 7eff611needs attentionincremental0H · 1M · 2L2026-07-18 00:41
- 246c67csafeincremental0H · 0M · 0L2026-07-17 23:58
- 7521b17safeincremental0H · 0M · 0L2026-07-17 23:35
- 1847ec8needs attentionincremental0H · 2M · 4L2026-07-17 23:28
- 5d3175cneeds attentionincremental3H · 6M · 4L2026-07-17 19:31
- d3f875dneeds attentionincremental1H · 2M · 4L2026-07-17 18:01
- 47d25faneeds attentionincremental1H · 1M · 2L2026-07-17 00:46
- 440d838needs attentionincremental4H · 9M · 9L2026-07-17 00:27
- 7466f97needs attentionincremental0H · 1M · 5L2026-07-16 23:20
- b686d58needs attentionincremental0H · 2M · 2L2026-07-16 14:24
- 9ea1446blockedincremental2H · 7M · 10L2026-07-16 13:44
- 6f39bb9needs attentionincremental0H · 2M · 7L2026-07-14 21:53
- 2eadf2aneeds attentionincremental0H · 1M · 2L2026-07-14 20:12
- 97bd08fneeds attentionincremental0H · 2M · 5L2026-07-14 19:40
- a48e3ffneeds attentionincremental5H · 8M · 6L2026-07-14 18:22
- 69473b7needs attentionincremental2H · 5M · 3L2026-07-14 01:34
- 92e4235needs attentionincremental2H · 1M · 3L2026-07-14 01:04
- 6be8018safeincremental0H · 0M · 3L2026-07-14 00:15
- 090b4daneeds attentionincremental1H · 3M · 5L2026-07-13 23:50
- fa7683bneeds attentionincremental1H · 4M · 3L2026-07-13 18:55
- d64cd72needs attentionincremental2H · 3M · 2L2026-07-13 16:27
- c1f337bneeds attentionincremental3H · 7M · 14L2026-07-13 13:30
- 46e32b2safeincremental0H · 0M · 3L2026-07-11 02:54
- 3b30949needs attentionincremental0H · 2M · 3L2026-07-11 02:39
- 9f8dbdfneeds attentionincremental3H · 5M · 5L2026-07-11 02:32
- 23191eeneeds attentionincremental5H · 12M · 7L2026-07-11 02:18
- fa9b88fneeds attentionincremental0H · 1M · 2L2026-07-11 01:30
- 6a8bf42blockedfull8H · 11M · 8L2026-07-11 01:08