Skip to content

feat(programs): compliance trend chart with per-bucket outcome breakdown#64

Merged
Taleef7 merged 2 commits into
mainfrom
feat/compliance-trend-view
Jun 8, 2026
Merged

feat(programs): compliance trend chart with per-bucket outcome breakdown#64
Taleef7 merged 2 commits into
mainfrom
feat/compliance-trend-view

Conversation

@Taleef7
Copy link
Copy Markdown
Owner

@Taleef7 Taleef7 commented Jun 8, 2026

Summary

  • Extended ProgramTrendPoint with compliant, dueSoon, overdue, missingData, excluded counts alongside the existing complianceRate + totalEvaluated
  • Updated trend SQL: outcome_based branch adds five COUNT(*) FILTER expressions; run_based branch uses 0 for the per-bucket fields (aggregate run rows only store compliant + non_compliant)
  • Frontend: replaced the hand-rolled SVG sparkline with a recharts AreaChart — compliance rate on Y-axis (0–100%), run dates as X-axis labels, gradient fill, tooltip showing % formatted value

What changed

File Change
ProgramService.java Extended ProgramTrendPoint (4→9 fields); updated SQL + row mapper
ProgramControllerTest.java Fixed test ProgramTrendPoint constructors to match new record
programs/[measureId]/page.tsx Added recharts AreaChart imports; added ComplianceTrendChart component; replaced <Sparkline> call

Test plan

  • ProgramControllerTest#returnsTrend passes (constructor updated)
  • ./gradlew.bat compileJava compileTestJava — BUILD SUCCESSFUL
  • npm run build — ✓ Compiled successfully
  • npm run lint — 0 errors

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 8, 2026

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

Project Deployment Actions Updated (UTC)
workwell-measure-studio Ready Ready Preview, Comment Jun 8, 2026 5:03pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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>
@Taleef7 Taleef7 merged commit c843bb1 into main Jun 8, 2026
30 checks passed
@Taleef7 Taleef7 deleted the feat/compliance-trend-view branch June 8, 2026 17:20
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