fix(dashboards): preserve Chart.js/D3 in cia-entry, wire missing data sources, add per-chart Cypress suite#2462
Merged
Conversation
…t-build regression test Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/7252a419-1525-4f24-80cf-71c4d2bc002c Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…ata + per-chart cypress suite Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/7252a419-1525-4f24-80cf-71c4d2bc002c Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Contributor
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: documentation,dependencies,html-css,javascript,translation,rtl,testing,size-xl,news Label Categories
For more information, see |
Contributor
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Copilot created this pull request from a session on behalf of
pethers
May 13, 2026 16:50
View session
…+ cypress runtime guard Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/cc0c334a-9dcd-4a13-be44-7b44a2d03864 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Contributor
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
src/browser/cia/csv-contracts.tsdeclares every CSV consumed by the 10 dashboard pages with its canonical required columns (no legacy fallbacks). 29 contracts covering all dashboards.election-cycle.ts renderTimeline: now strictly readscycle_year+temporal_approval_ratefrom decision CSV (droppedoverall_performance_score/avg_approval_rate/legacy cycle-key fallback).election-cycle.ts renderPartyTierChart: now strictly readselection_cycle_id+ntile_effectiveness(droppedntile_party_tier/ntile_performance/calendar_year/yearfallbacks).election-cycle.ts renderCharts: timeline + party-tier always consume decision data (droppeddecision.length > 0 ? decision : comparativefallback).party-dashboard.ts createCoalitionNetwork: dropped legacypartyCoalitionAlignmentid; uses only canonicalcoalitionAlignmentChartid.tests/cia-csv-contracts.test.ts— 90 tests assert every contract: file exists, header row contains every required column, ≥ declared min data rows. All 90 pass.src/browser/cia/csv-validator.ts—validateCsvRows()and friends; called by dashboards via the loader to surface schema regressions as visible banners (not silent empty charts).cypress/e2e/dashboards-per-chart/csv-contracts.cy.js+ fixture — hits every CSV viacy.request(), asserts HTTP 200, CSV content-type, canonical header columns present, ≥ minRows data rows. Fixture generated from the canonical TS registry byscripts/build-csv-contracts-fixture.ts(wired intoprebuild).csv-contracts.cy.json a freshly-builtdist/withcia-data/correctly copied.npx vite buildwithoutpostbuild;dist/cia-data/missing made the preview server returntext/htmlSPA fallback for.csvURLs, garbling PapaParse and producing the empty-chart symptoms —npm run build(orcp -r cia-data dist/cia-data) is the contract.