Skip to content

Comments

Fix dashboard initialization failures due to missing dependencies#88

Merged
pethers merged 3 commits intomainfrom
copilot/improve-code-quality-and-tests
Feb 11, 2026
Merged

Fix dashboard initialization failures due to missing dependencies#88
pethers merged 3 commits intomainfrom
copilot/improve-code-quality-and-tests

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Three dashboards (committees, coalition, election-cycle) failed to initialize with ReferenceError: Papa is not defined and Error: This method is not implemented: Check that a complete date adapter is provided.

Changes

Added missing dependencies (69KB, locally hosted):

  • papaparse.5.5.3.min.js (19KB) - CSV parsing for data ingestion
  • chartjs-adapter-date-fns.3.0.0.bundle.min.js (50KB) - Chart.js time-series support

Updated HTML (15 files):

  • index.html + 13 language variants with library script tags
  • Load order: D3 → Chart.js → plugins → adapters → Papa Parse → dashboards

Updated documentation:

  • SECURITY_ARCHITECTURE.md - External dependencies list and risk table
  • ARCHITECTURE.md - Technology stack and dependency diagram

Library loading order

<script src="js/lib/d3.7.9.0.min.js"></script>
<script src="js/lib/chart.umd.4.4.1.js"></script>
<script src="js/lib/chartjs-plugin-annotation.3.0.1.min.js"></script>
<script src="js/lib/chartjs-adapter-date-fns.3.0.0.bundle.min.js"></script>
<script src="js/lib/papaparse.5.5.3.min.js"></script>
<!-- Dashboard scripts -->

Result

Dashboard working without errors

Zero dashboard initialization errors. CSV parsing and time-series charts functional.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.cypress.io
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node node dist/index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Analyze code and HTML for quality improvements and testing Fix dashboard initialization failures due to missing dependencies Feb 11, 2026
Copilot AI requested a review from pethers February 11, 2026 13:11
@pethers pethers requested a review from Copilot February 11, 2026 13:33
@github-actions
Copy link
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

Copy link
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.

Pull request overview

This PR fixes dashboard runtime initialization errors on the static site by vendoring and loading missing client-side JavaScript dependencies (CSV parsing and Chart.js time adapter), and documenting the updated dependency set.

Changes:

  • Added locally hosted third-party libraries: Papa Parse (CSV parsing) and chartjs-adapter-date-fns (Chart.js time scale support).
  • Updated index.html and all language variants to include the missing libraries in the correct load order before dashboard scripts.
  • Updated security and architecture documentation to reflect the expanded locally hosted dependency set.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
js/lib/papaparse.5.5.3.min.js Adds vendored Papa Parse library required by dashboards parsing CSV.
js/lib/chartjs-adapter-date-fns.3.0.0.bundle.min.js Adds vendored Chart.js date-fns adapter required for time-series charts.
index.html Loads the new adapter + Papa Parse before dashboard modules to prevent runtime init failures.
index_sv.html Adds local D3/Chart/annotation/adapter/Papa script tags before the coalition dashboard module.
index_da.html Same dependency script additions as other language variants.
index_no.html Same dependency script additions as other language variants.
index_fi.html Same dependency script additions as other language variants.
index_de.html Same dependency script additions as other language variants.
index_fr.html Same dependency script additions as other language variants.
index_es.html Same dependency script additions as other language variants.
index_nl.html Same dependency script additions as other language variants.
index_ar.html Same dependency script additions as other language variants (RTL page).
index_he.html Same dependency script additions as other language variants (RTL page).
index_ja.html Same dependency script additions as other language variants.
index_ko.html Same dependency script additions as other language variants.
index_zh.html Same dependency script additions as other language variants.
SECURITY_ARCHITECTURE.md Documents the added locally hosted dependencies and dependency management list.
ARCHITECTURE.md Updates architecture docs to include the new libraries in stack/diagrams/risk table.

Comment on lines 259 to +264
- **External Dependencies:**
- Chart.js v4.4.1 (hosted locally on CloudFront/S3 at js/lib/chart.umd.4.4.1.js)
- chartjs-plugin-annotation v3.0.1 (hosted locally on CloudFront/S3 at js/lib/chartjs-plugin-annotation.3.0.1.min.js)
- chartjs-adapter-date-fns v3.0.0 bundle (hosted locally on CloudFront/S3 at js/lib/chartjs-adapter-date-fns.3.0.0.bundle.min.js) - for time-series charts
- D3.js v7.9.0 (hosted locally on CloudFront/S3 at js/lib/d3.7.9.0.min.js)
- Papa Parse v5.5.3 (hosted locally on CloudFront/S3 at js/lib/papaparse.5.5.3.min.js) - for CSV parsing
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The earlier CSP note in this section (around line ~237) still says only Chart.js, D3.js, and chartjs-plugin-annotation are locally hosted. Since this PR adds chartjs-adapter-date-fns and Papa Parse as additional locally hosted dependencies, that note should be updated to include them to avoid documentation drift/inconsistency within the same section.

Copilot uses AI. Check for mistakes.
@pethers pethers marked this pull request as ready for review February 11, 2026 13:54
@pethers pethers merged commit b65997d into main Feb 11, 2026
21 checks passed
@pethers pethers deleted the copilot/improve-code-quality-and-tests branch February 11, 2026 13:54
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