Skip to content

feat: dashboard analytics and interaction telemetry (issue #15)#28

Merged
WFord26 merged 1 commit intomainfrom
issue/15-dashboard-analytics-telemetry
Apr 6, 2026
Merged

feat: dashboard analytics and interaction telemetry (issue #15)#28
WFord26 merged 1 commit intomainfrom
issue/15-dashboard-analytics-telemetry

Conversation

@WFord26
Copy link
Copy Markdown
Owner

@WFord26 WFord26 commented Apr 6, 2026

Summary

Implements structured analytics telemetry for key dashboard interactions as described in issue #15.

Changes

hooks/useAnalytics.ts

Added useDashboardTelemetry() hook with stable callbacks for all instrumented events:

Callback Event Name Description
trackFilterChanged dashboard_filter_changed Any filter change (fuel type, region, etc.)
trackTimeRangeChanged time_range_changed Historical chart time range selector
trackStateDrilldown state_drilldown_opened Map state click → state page
trackChartAnnotationOpened chart_annotation_opened Event annotation marker click
trackStoryCardOpened story_card_opened Market story card actioned
trackCompareModeEnabled compare_mode_enabled Compare mode activated (ready for future UI)
trackPanelExpanded panel_expanded Collapsible panel opened (ready for future UI)

pages/Dashboard.tsx

  • Fuel type toggle buttons emit dashboard_filter_changed with previous value
  • Map onStateClick emits state_drilldown_opened with state abbr + fuel type
  • Story card onAction emits story_card_opened with card id, title, and category

pages/Historical.tsx

  • Time range buttons emit time_range_changed with previous range
  • Chart event reference lines carry id/category metadata and emit chart_annotation_opened on click

components/charts/PriceLineChart.tsx

  • Extended ChartReferenceLine with id and category fields
  • Added optional onAnnotationClick prop to enable clickable annotation markers

test/useAnalytics.test.ts

12 tests covering all event shapes, optional fields, and callback stability.

Acceptance Criteria

  • Key dashboard interactions emit structured analytics events
  • Event names and payloads are documented and consistent
  • Instrumentation covers public dashboard adoption beyond page views

Closes #15

@WFord26 WFord26 merged commit 273fd9c into main Apr 6, 2026
1 check passed
@WFord26 WFord26 deleted the issue/15-dashboard-analytics-telemetry branch April 6, 2026 02:51
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.

Dashboard analytics and interaction telemetry

1 participant