feat(programs): compliance trend chart with per-bucket outcome breakdown#64
Conversation
Extended ProgramTrendPoint to include all 5 outcome counts (compliant, dueSoon, overdue, missingData, excluded). The trend SQL now returns per-bucket counts from outcome_based (full detail) and zeros from run_based (aggregate rows that only carry compliant + non_compliant). Frontend replaces the SVG sparkline with a recharts AreaChart showing compliance rate over time with date labels on the X axis, a gradient fill, and a tooltip that formats the percentage correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3277722ae6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /> | ||
| <Area | ||
| type="monotone" | ||
| dataKey="rate" |
There was a problem hiding this comment.
Render the per-bucket series in the trend chart
In ComplianceTrendChart, the bucket counts are copied into data, but the chart renders only a single <Area dataKey="rate">. Recharts tooltips/legends are driven by rendered series, so compliant, dueSoon, overdue, missingData, and excluded never appear for historical points; the new API fields therefore do not produce the promised per-bucket outcome breakdown in the trend view even when those counts are available.
Useful? React with 👍 / 👎.
Add 5 dashed Area lines (compliant, dueSoon, overdue, missingData, excluded) normalised to % of totalEvaluated so they share the 0-100% Y-axis with the existing compliance-rate area. Add Legend so all series are labelled. Tooltip now shows each bucket's % alongside the overall rate. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
ProgramTrendPointwithcompliant,dueSoon,overdue,missingData,excludedcounts alongside the existingcomplianceRate+totalEvaluatedoutcome_basedbranch adds fiveCOUNT(*) FILTERexpressions;run_basedbranch uses0for the per-bucket fields (aggregate run rows only storecompliant+non_compliant)AreaChart— compliance rate on Y-axis (0–100%), run dates as X-axis labels, gradient fill, tooltip showing%formatted valueWhat changed
ProgramService.javaProgramTrendPoint(4→9 fields); updated SQL + row mapperProgramControllerTest.javaProgramTrendPointconstructors to match new recordprograms/[measureId]/page.tsxComplianceTrendChartcomponent; replaced<Sparkline>callTest plan
ProgramControllerTest#returnsTrendpasses (constructor updated)./gradlew.bat compileJava compileTestJava— BUILD SUCCESSFULnpm run build— ✓ Compiled successfullynpm run lint— 0 errors🤖 Generated with Claude Code