Skip to content

feat: add analytics and usage metrics to dashboard (review counts, finding trends, adoption) #48

Description

@charannyk06

Priority: P3 — Low

Problem

The dashboard has placeholder usage sections but no real analytics or metrics. There is no way to see:

  • How many reviews have been run over time
  • What types of findings are most common (security vs bugs vs architecture)
  • Which files/directories have the most issues
  • Review completion rate and timing

Solution

1. Collect metrics at review time

In chainreview-api, when syncing review results:

  • Count findings by severity and agent type
  • Record review duration
  • Record file count analyzed

2. Dashboard analytics page

Add charts to the dashboard (Recharts is already a dependency):

Review Activity
[Bar chart: reviews per day last 30 days]

Finding Distribution
[Pie chart: Security 40% | Bugs 35% | Architecture 25%]

Severity Breakdown
[Stacked bar: Critical/High/Medium/Low per week]

Top Issue Files
[List: src/auth/login.ts - 8 findings | src/api/routes.ts - 5 findings]

3. Trend line

Show improvement over time: "↓ 23% fewer high severity findings this month"

4. Export data

Allow downloading analytics as CSV for external analysis.

Note on Privacy

All analytics are aggregated — no code content is sent. File paths may optionally be excluded for sensitive repos (setting: chainreview.analytics.excludeFilePaths).

Acceptance Criteria

  • Review metrics stored in Supabase on each sync
  • Dashboard shows review activity chart
  • Finding distribution by type and severity
  • Top files by finding count
  • Export to CSV

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions