Skip to content

fix(dashboards): preserve Chart.js/D3 in cia-entry, wire missing data sources, add per-chart Cypress suite#2462

Merged
pethers merged 3 commits into
mainfrom
copilot/fix-dashboard-pages-data-issues
May 13, 2026
Merged

fix(dashboards): preserve Chart.js/D3 in cia-entry, wire missing data sources, add per-chart Cypress suite#2462
pethers merged 3 commits into
mainfrom
copilot/fix-dashboard-pages-data-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

  • A. CSV-contract registry — single source of truthsrc/browser/cia/csv-contracts.ts declares every CSV consumed by the 10 dashboard pages with its canonical required columns (no legacy fallbacks). 29 contracts covering all dashboards.
  • B. Removed legacy column fallbacks in dashboard code
    • election-cycle.ts renderTimeline: now strictly reads cycle_year + temporal_approval_rate from decision CSV (dropped overall_performance_score/avg_approval_rate/legacy cycle-key fallback).
    • election-cycle.ts renderPartyTierChart: now strictly reads election_cycle_id + ntile_effectiveness (dropped ntile_party_tier/ntile_performance/calendar_year/year fallbacks).
    • election-cycle.ts renderCharts: timeline + party-tier always consume decision data (dropped decision.length > 0 ? decision : comparative fallback).
    • party-dashboard.ts createCoalitionNetwork: dropped legacy partyCoalitionAlignment id; uses only canonical coalitionAlignmentChart id.
  • C. Vitest contract test — 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.
  • D. Runtime validator — src/browser/cia/csv-validator.tsvalidateCsvRows() and friends; called by dashboards via the loader to surface schema regressions as visible banners (not silent empty charts).
  • E. Cypress runtime CSV contract — cypress/e2e/dashboards-per-chart/csv-contracts.cy.js + fixture — hits every CSV via cy.request(), asserts HTTP 200, CSV content-type, canonical header columns present, ≥ minRows data rows. Fixture generated from the canonical TS registry by scripts/build-csv-contracts-fixture.ts (wired into prebuild).
  • Per-chart cypress suite green161/161 tests pass across all 10 dashboard specs + new csv-contracts.cy.js on a freshly-built dist/ with cia-data/ correctly copied.
  • Memory stored: ran npx vite build without postbuild; dist/cia-data/ missing made the preview server return text/html SPA fallback for .csv URLs, garbling PapaParse and producing the empty-chart symptoms — npm run build (or cp -r cia-data dist/cia-data) is the contract.

Copilot AI and others added 2 commits May 13, 2026 16:29
…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>
@github-actions github-actions Bot added documentation Documentation updates dependencies Dependency updates html-css HTML/CSS changes javascript JavaScript code changes translation Translation updates rtl RTL language support (Arabic, Hebrew) testing Test coverage news News articles and content generation size-xl Extra large change (> 1000 lines) labels May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This 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

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

…+ 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>
@github-actions github-actions Bot added refactor Code refactoring labels May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers pethers marked this pull request as ready for review May 13, 2026 17:54
Copilot AI review requested due to automatic review settings May 13, 2026 17:54
@pethers pethers merged commit 54c1aa4 into main May 13, 2026
24 checks passed
@pethers pethers deleted the copilot/fix-dashboard-pages-data-issues branch May 13, 2026 17:54
Copy link
Copy Markdown
Contributor

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates documentation Documentation updates html-css HTML/CSS changes javascript JavaScript code changes news News articles and content generation refactor Code refactoring rtl RTL language support (Arabic, Hebrew) size-xl Extra large change (> 1000 lines) testing Test coverage translation Translation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants