Skip to content

feat(analytics): fallback KPI delta comparison to last active period#30

Merged
romahawk merged 1 commit intomainfrom
feat/pr5-mobile-log-cards
Feb 15, 2026
Merged

feat(analytics): fallback KPI delta comparison to last active period#30
romahawk merged 1 commit intomainfrom
feat/pr5-mobile-log-cards

Conversation

@romahawk
Copy link
Copy Markdown
Owner

Summary

  • Improves KPI deltas by falling back to the nearest earlier period with data when immediate previous window is empty.
  • Adds explicit delta source labels to improve interpretability.

Changes

  • src/pages/Dashboard.jsx
    • Added backward comparison-window search (up to 6 windows).
    • Emits comparison source: prev, last_active, or none.
  • src/pages/dashboard/AnalyticsSection.jsx
    • Wires comparison KPI/source into KPI tiles.
  • src/components/KpiTiles.jsx
    • Renders delta labels as vs prev or vs last active.
    • Keeps n/a when no baseline exists.

Validation

  • npm run lint
  • npm run build
  • Visual checks:
    • normal windows show vs prev
    • sparse windows show vs last active
    • no historical data shows n/a

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 15, 2026

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

Project Deployment Actions Updated (UTC)
smartshooter Ready Ready Preview, Comment Feb 15, 2026 6:56pm

@romahawk romahawk merged commit c9995ad into main Feb 15, 2026
6 checks passed
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