Skip to content

feat(frontend): integrate ScoreGauge into dashboard + staggered entry animations (#962)#967

Merged
ericsocrat merged 1 commit intomainfrom
feat/962-scoregauge-animations
Mar 19, 2026
Merged

feat(frontend): integrate ScoreGauge into dashboard + staggered entry animations (#962)#967
ericsocrat merged 1 commit intomainfrom
feat/962-scoregauge-animations

Conversation

@ericsocrat
Copy link
Owner

Summary

Closes #962 — Integrates the existing ScoreGauge component into the dashboard hero and QuickWinCard, adds a distribution legend below the band bar, and applies staggered fade-in-up entry animations to all dashboard sections.

Changes

ScoreGauge Integration

  • HealthSummary: Replaced plain text score circle with <ScoreGauge score={...} size="lg" /> wrapped in a animate-scale-in wrapper
  • QuickWinCard: Replaced both plain <span> score circles (from/to) with <ScoreGauge score={...} size="sm" />
  • Removed unused getScoreBand import, worstBand, and altBand variables from QuickWinCard

Distribution Legend

  • Added a compact legend below the distribution bar in HealthSummary showing non-zero bands with colored dots, localized labels, and counts (e.g., "● Excellent (3) ● Good (2)")

Staggered Entry Animations

  • Wrapped all 5 dashboard sections in animate-fade-in-up divs with staggered delays: 0ms (greeting), 50ms (health summary), 100ms (quick win), 150ms (recently viewed), 200ms (quick actions)
  • Hero gauge additionally gets animate-scale-in for emphasis
  • No CSS changes needed — all animation keyframes and prefers-reduced-motion handling already exist in globals.css

Files Changed (6 files, +127/-46)

  • frontend/src/components/dashboard/HealthSummary.tsx — ScoreGauge + legend
  • frontend/src/components/dashboard/QuickWinCard.tsx — ScoreGauge + cleanup
  • frontend/src/app/app/page.tsx — Staggered animation wrappers
  • frontend/src/components/dashboard/HealthSummary.test.tsx — ScoreGauge mock, 2 new tests (legend + scale-in), testid updates
  • frontend/src/components/dashboard/QuickWinCard.test.tsx — ScoreGauge mock
  • frontend/src/app/app/page.test.tsx — Staggered animation delay test

Verification

npx tsc --noEmit              → 0 errors
npx vitest run                → 5,840 passed (352 files)

Test Coverage

  • New tests (3): Distribution legend rendering, scale-in animation class, staggered animation delays
  • Updated tests (3): HealthSummary score circle → ScoreGauge testids
  • Mock pattern: ScoreGauge mocked to render 100 - score as plain text for assertion simplicity

Copilot AI review requested due to automatic review settings March 19, 2026 17:37
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@vercel
Copy link

vercel bot commented Mar 19, 2026

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

Project Deployment Actions Updated (UTC)
tryvit Ready Ready Preview, Comment Mar 19, 2026 5:43pm

@github-actions
Copy link

github-actions bot commented Mar 19, 2026

📸 PR Screenshots

Captured 2 screenshots (1 mobile, 1 desktop) for 1 changed page(s):

  • dashboard

📥 Download screenshots from workflow artifacts.

Captured by PR Screenshots workflow • 2026-03-19

@github-actions
Copy link

github-actions bot commented Mar 19, 2026

Bundle Size Report

Metric Value
Main baseline 0 KB
This PR 0 KB
Delta +0 KB (+0%)
JS chunks 0
Hard limit 4000 KB

✅ Bundle size is within acceptable limits.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Integrates the existing ScoreGauge visual component into the dashboard (HealthSummary + QuickWinCard), adds a compact band distribution legend, and introduces staggered fade-in entry animations for dashboard sections to improve perceived UI polish.

Changes:

  • Replace dashboard score “circles” with ScoreGauge in HealthSummary and QuickWinCard.
  • Add a non-zero-only score band legend under the HealthSummary distribution bar.
  • Wrap dashboard sections with animate-fade-in-up and staggered animationDelay, with accompanying unit tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/src/components/dashboard/HealthSummary.tsx Uses ScoreGauge for the hero score and adds a distribution legend under the band bar.
frontend/src/components/dashboard/QuickWinCard.tsx Replaces from/to score circles with ScoreGauge and removes obsolete band styling logic.
frontend/src/app/app/page.tsx Adds staggered entry animation wrappers and delays around dashboard sections.
frontend/src/components/dashboard/HealthSummary.test.tsx Updates tests for ScoreGauge, adds legend + scale-in wrapper coverage.
frontend/src/components/dashboard/QuickWinCard.test.tsx Mocks ScoreGauge for assertions in QuickWinCard tests.
frontend/src/app/app/page.test.tsx Adds a test asserting staggered animation delays are applied.

Comment on lines +72 to 75
{/* Score gauge */}
<div className="animate-scale-in" data-testid="health-score-gauge">
<ScoreGauge score={100 - avgTryVit} size="lg" />
</div>
Comment on lines +122 to +126
className="inline-block h-2 w-2 rounded-full"
style={{
backgroundColor:
SCORE_BAND_HEX[d.band as keyof typeof SCORE_BAND_HEX],
}}
Comment on lines +121 to +127
<span
className="inline-block h-2 w-2 rounded-full"
style={{
backgroundColor:
SCORE_BAND_HEX[d.band as keyof typeof SCORE_BAND_HEX],
}}
/>
@ericsocrat ericsocrat force-pushed the feat/962-scoregauge-animations branch from c9e53c5 to 5da57f2 Compare March 19, 2026 17:41
@ericsocrat ericsocrat merged commit 264ce46 into main Mar 19, 2026
18 checks passed
@ericsocrat ericsocrat deleted the feat/962-scoregauge-animations branch March 19, 2026 17:47
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.

feat(dashboard): ScoreGauge integration + staggered entry animations (#960)

2 participants