Skip to content

feat(signals): analytics dashboard facelift (BETON-350)#66

Draft
nadyyym wants to merge 3 commits intostagingfrom
feature/BETON-350-signal-analytics-facelift
Draft

feat(signals): analytics dashboard facelift (BETON-350)#66
nadyyym wants to merge 3 commits intostagingfrom
feature/BETON-350-signal-analytics-facelift

Conversation

@nadyyym
Copy link
Collaborator

@nadyyym nadyyym commented Feb 25, 2026

Summary

Implements the Signal Analytics Facelift epic (BETON-350) — a complete rebuild of the signal detail page with rich analytics and the foundation for pre-computed signal insights.

What changed

  • DB Migration 025: 5 new tables (signal_analytics_snapshots, signal_cohort_retention, signal_conversion_curves, posthog_property_mappings, attio_deal_mappings) with full RLS policies
  • Signal definitions extended: conversion_type (posthog_event/attio_deal_won/either) and retention_event_name columns
  • 3 new API endpoints: Signal analytics (/api/signals/[id]/analytics), PostHog property mappings, Attio deal mappings
  • Canvas chart library: 4 chart components (RevenueChart, DualLineChart, AreaChart, RetentionTable) with Okabe-Ito colorblind palette, DPR-aware rendering, hover tooltips
  • Signal detail page rebuild: 4 KPI cards (users, conversions, revenue, statistical significance with p-value meter), 6 chart types (revenue breakdown, occurrences, conversion rate, ACV, time-to-conversion, cohort retention heatmap), filter controls (conversion window, time range)
  • Signal list page improvements: Enhanced stats cards with top signal, confidence count, contextual sub-labels
  • Analytics computation engine: Pure functions for monthly snapshots, cohort retention (M0-M8), time-to-conversion curves (P0-P12), chi-squared significance testing
  • Demo mode mock data: Complete analytics dataset matching the design sketch
  • 25 tests: Stats module + computation engine with full coverage

Tasks completed

  • BETON-351: DB migration
  • BETON-352: PostHog property mapping API
  • BETON-353: Attio deal mapping API
  • BETON-354: Signal definition fields
  • BETON-355: Aggregate computation engine
  • BETON-356: Cohort retention engine
  • BETON-357: Signal analytics API
  • BETON-359: Canvas chart components
  • BETON-360: Signal detail page facelift
  • BETON-363: Signal list page improvements
  • BETON-364: Demo mode mock data
  • BETON-365: Computation engine tests

Remaining tasks (follow-up PRs)

  • BETON-358: Signal list API enrichment
  • BETON-361: Export functionality (PDF/JSON/CSV)
  • BETON-362: PostHog Audience + Attio List action buttons
  • BETON-366: API + mappings integration tests
  • BETON-367: PostHog + Intercom analytics events

Test plan

  • npm run build passes
  • 25 analytics computation tests pass (vitest run src/lib/heuristics/analytics/)
  • Verify signal detail page renders in demo mode (visit /signals/sig_001)
  • Verify chart hover tooltips work
  • Verify conversion window filter changes data
  • Verify retention tab/stat toggles work

🤖 Generated with Claude Code

nadyyym and others added 3 commits February 25, 2026 23:32
…tion

Implements the signal analytics facelift (BETON-350) covering:

- Migration 025: signal_analytics_snapshots, signal_cohort_retention,
  signal_conversion_curves, posthog_property_mappings, attio_deal_mappings
  tables with RLS policies and triggers
- Signal definitions: add conversion_type and retention_event_name columns
- Analytics API: GET /api/signals/[id]/analytics with window/range filtering
- PostHog property mappings API: GET/PUT /api/integrations/posthog/mappings
- Attio deal mappings API: GET/PUT /api/integrations/attio/deal-mappings
- Canvas chart components: RevenueChart, DualLineChart, AreaChart, RetentionTable
- Signal detail page facelift: 4 KPI cards, 6 chart types, cohort retention
  heatmap, time-to-conversion curves, filter controls
- Demo mode mock analytics data matching design sketch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Signal list page: enhanced stats cards with top signal, confidence
  count, and contextual sub-labels
- Analytics computation engine: pure functions for computing monthly
  snapshots, cohort retention (M0-M8), and time-to-conversion curves
- Chi-squared statistical significance testing with p-value computation
- Supports all 5 conversion windows + no-limit mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 tests covering:
- Chi-squared test: empty/zero tables, significant/non-significant
  differences, symmetry, large samples
- p-value to significance conversion: edge cases, clamping
- Monthly snapshots: window filtering, occurrence counting,
  conversion rate computation, statistical significance
- Cohort retention: all tab/stat combinations, user tracking
- Conversion curves: period/cumulative consistency, normalization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beton-inspector Ready Ready Preview, Comment Feb 25, 2026 9:55pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant