Skip to content

Fix report output timestamps and chart downloads#1020

Merged
anth-volk merged 7 commits intomainfrom
codex/report-output-fixes
May 5, 2026
Merged

Fix report output timestamps and chart downloads#1020
anth-volk merged 7 commits intomainfrom
codex/report-output-fixes

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented May 5, 2026

Summary

  • Hydrate calculation cache from persisted report output so completed reports do not unnecessarily rerun on direct load.
  • Prefer backend finished_at, then saved-report updatedAt, then createdAt for the report header timestamp.
  • Add CSV export support to ChartContainer and wire winners/losers decile data to CSV.
  • Pin winners/losers tooltips inside the chart so later deciles remain visible.

Root cause

The report output page displayed the saved UserReport creation time as the run time and did not hydrate completed persisted outputs into the calculation cache. ChartContainer only exposed SVG downloads, and the winners/losers tooltip could follow the cursor off the visible chart area.

Validation

  • npx vitest run src/tests/unit/pages/ReportOutput.page.test.tsx src/tests/unit/components/ChartContainer.test.tsx src/tests/unit/pages/report-output/distributional-impact/WinnersLosersIncomeDecileSubPage.test.tsx src/tests/unit/adapters/ReportAdapter.test.ts
  • npx tsc --noEmit
  • npx eslint src/pages/ReportOutput.page.tsx src/components/ChartContainer.tsx src/pages/report-output/distributional-impact/WinnersLosersIncomeDecileSubPage.tsx src/adapters/ReportAdapter.ts src/types/ingredients/Report.ts src/types/metadata/reportMetadata.ts src/tests/unit/pages/ReportOutput.page.test.tsx src/tests/unit/components/ChartContainer.test.tsx src/tests/unit/pages/report-output/distributional-impact/WinnersLosersIncomeDecileSubPage.test.tsx src/tests/unit/adapters/ReportAdapter.test.ts
  • npx prettier --check src/pages/ReportOutput.page.tsx src/components/ChartContainer.tsx src/pages/report-output/distributional-impact/WinnersLosersIncomeDecileSubPage.tsx src/adapters/ReportAdapter.ts src/types/ingredients/Report.ts src/types/metadata/reportMetadata.ts src/tests/unit/pages/ReportOutput.page.test.tsx src/tests/unit/components/ChartContainer.test.tsx src/tests/unit/pages/report-output/distributional-impact/WinnersLosersIncomeDecileSubPage.test.tsx src/tests/unit/adapters/ReportAdapter.test.ts

Deployment note

@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

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

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment May 5, 2026 8:29pm
policyengine-calculator Ready Ready Preview, Comment May 5, 2026 8:29pm
policyengine-calculator-next Ready Ready Preview, Comment May 5, 2026 8:29pm
policyengine-website Ready Ready Preview, Comment May 5, 2026 8:29pm

Request Review

@anth-volk anth-volk marked this pull request as ready for review May 5, 2026 23:08
@anth-volk anth-volk merged commit 3d30996 into main May 5, 2026
14 checks passed
@anth-volk anth-volk deleted the codex/report-output-fixes branch May 5, 2026 23:09
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.

2 participants