Skip to content

Backfill economic-data.json and dashboard for 2026-04-19 deep-inspection + 2026-04-20 evening-analysis#1896

Merged
pethers merged 6 commits intomainfrom
copilot/update-economic-context-audit
Apr 21, 2026
Merged

Backfill economic-data.json and dashboard for 2026-04-19 deep-inspection + 2026-04-20 evening-analysis#1896
pethers merged 6 commits intomainfrom
copilot/update-economic-context-audit

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

  • Read all 4 review comments
  • Update js/chart-init.js — fix root cause of Vitest failure: use getAttribute for data-chart-config-id check
  • Update news/2026-04-20-evening-analysis-en.html:
    • Replace data-chart-config with data-chart-config-id + inline <script type="application/json"> blobs
    • Add defer to Chart.js and chart-init.js script tags
  • Update analysis/schemas/economic-data.schema.json to allow other and documents in source
  • Add "other" provenance to analysis/daily/2026-04-20/evening-analysis/economic-data.json
  • Add "documents" provenance to analysis/daily/2026-04-19/deep-inspection/economic-data.json
  • Add missing data-rm-normalized="v9" body attribute to news/2026-04-21-opposition-motions-{en,sv}.html — fixes html-consistency.test.ts failure
  • All Vitest tests pass (4334/4334)

Copilot AI linked an issue Apr 21, 2026 that may be closed by this pull request
@github-actions github-actions Bot added the size-xs Extra small change (< 10 lines) label Apr 21, 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: size-xs

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

…20 evening-analysis

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/4bef378e-dbe6-4a47-a19e-740b7053caac

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions Bot added html-css HTML/CSS changes news News articles and content generation size-m Medium change (50-250 lines) labels Apr 21, 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

Copilot AI changed the title [WIP] Fix violations in economic context audit from 2026-04-21 Backfill economic-data.json and dashboard for 2026-04-19 deep-inspection + 2026-04-20 evening-analysis Apr 21, 2026
Copilot AI requested a review from pethers April 21, 2026 08:35
@pethers pethers marked this pull request as ready for review April 21, 2026 08:44
Copilot AI review requested due to automatic review settings April 21, 2026 08:44
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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR backfills economic context artifacts to schema v2.0 and adds an Economic Context dashboard to the 2026-04-20 evening-analysis page to satisfy the economic-context-audit validator (data schema + charts + attribution).

Changes:

  • Updated two economic-data.json files to v2.0 schema with World Bank-style datapoints and structured source.worldBank[].
  • Injected an economic-dashboard section into news/2026-04-20-evening-analysis-en.html with two Chart.js canvases and supporting tables + attribution.
  • Added Chart.js and chart initializer script tags to the evening-analysis HTML.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
news/2026-04-20-evening-analysis-en.html Adds an economic dashboard section and loads Chart.js + initializer scripts.
analysis/daily/2026-04-20/evening-analysis/economic-data.json Converts evening-analysis economic context data to schema v2.0 with structured sources.
analysis/daily/2026-04-19/deep-inspection/economic-data.json Converts deep-inspection economic context data to schema v2.0 with structured sources.

Comment on lines +195 to +196
<script src="../js/lib/chart.umd.4.4.1.js"></script>
<script src="../js/chart-init.js"></script>
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The newly added Chart.js and initializer scripts are not loaded with defer (unlike back-to-top.js). This can unnecessarily block HTML parsing and can also make execution timing more brittle if chart-init.js expects the DOM to be ready. Prefer adding defer to both Chart.js and chart-init.js (ordering is preserved with defer).

Suggested change
<script src="../js/lib/chart.umd.4.4.1.js"></script>
<script src="../js/chart-init.js"></script>
<script src="../js/lib/chart.umd.4.4.1.js" defer></script>
<script src="../js/chart-init.js" defer></script>

Copilot uses AI. Check for mistakes.
Comment on lines +145 to +148
<canvas id="econ-nordic-gdp-growth-2024" role="img" aria-label="Nordic GDP Growth (2024)" data-chart-config="{&quot;type&quot;:&quot;bar&quot;,&quot;data&quot;:{&quot;labels&quot;:[&quot;Sweden&quot;,&quot;Denmark&quot;,&quot;Norway&quot;,&quot;Finland&quot;],&quot;datasets&quot;:[{&quot;label&quot;:&quot;GDP Growth (% annual, 2024)&quot;,&quot;data&quot;:[0.82,3.478,2.097,0.416],&quot;backgroundColor&quot;:[&quot;#00d9ff&quot;,&quot;#ff006e&quot;,&quot;#ffbe0b&quot;,&quot;#83cf39&quot;],&quot;borderColor&quot;:[&quot;#00b8d4&quot;,&quot;#d4004e&quot;,&quot;#d4a00b&quot;,&quot;#6daf2d&quot;],&quot;borderWidth&quot;:1}]},&quot;options&quot;:{&quot;responsive&quot;:true,&quot;maintainAspectRatio&quot;:true,&quot;plugins&quot;:{&quot;title&quot;:{&quot;display&quot;:true,&quot;text&quot;:&quot;Nordic GDP Growth (2024)&quot;,&quot;color&quot;:&quot;#e0e0e0&quot;,&quot;font&quot;:{&quot;size&quot;:14,&quot;weight&quot;:&quot;bold&quot;}},&quot;legend&quot;:{&quot;labels&quot;:{&quot;color&quot;:&quot;#e0e0e0&quot;,&quot;usePointStyle&quot;:true,&quot;padding&quot;:12}},&quot;tooltip&quot;:{&quot;backgroundColor&quot;:&quot;rgba(10,14,39,0.95)&quot;,&quot;titleColor&quot;:&quot;#00d9ff&quot;,&quot;bodyColor&quot;:&quot;#e0e0e0&quot;,&quot;borderColor&quot;:&quot;#00d9ff&quot;,&quot;borderWidth&quot;:1,&quot;cornerRadius&quot;:6,&quot;padding&quot;:10}},&quot;scales&quot;:{&quot;x&quot;:{&quot;grid&quot;:{&quot;color&quot;:&quot;rgba(255,255,255,0.06)&quot;},&quot;ticks&quot;:{&quot;color&quot;:&quot;#b0b0b0&quot;}},&quot;y&quot;:{&quot;grid&quot;:{&quot;color&quot;:&quot;rgba(255,255,255,0.06)&quot;},&quot;ticks&quot;:{&quot;color&quot;:&quot;#b0b0b0&quot;},&quot;beginAtZero&quot;:true}}}}"></canvas>
</div>
<div class="dashboard-chart-wrapper">
<canvas id="econ-trend-se-unemployment" role="img" aria-label="Sweden: Unemployment Rate Trend" data-chart-config="{&quot;type&quot;:&quot;line&quot;,&quot;data&quot;:{&quot;labels&quot;:[&quot;2023&quot;,&quot;2024&quot;,&quot;2025&quot;],&quot;datasets&quot;:[{&quot;label&quot;:&quot;Sweden Unemployment Rate (% of labor force)&quot;,&quot;data&quot;:[7.611,8.4,8.694],&quot;backgroundColor&quot;:&quot;rgba(0, 217, 255, 0.2)&quot;,&quot;borderColor&quot;:&quot;#00d9ff&quot;,&quot;borderWidth&quot;:2,&quot;tension&quot;:0.3,&quot;pointRadius&quot;:4,&quot;pointHoverRadius&quot;:6,&quot;fill&quot;:true}]},&quot;options&quot;:{&quot;responsive&quot;:true,&quot;maintainAspectRatio&quot;:true,&quot;plugins&quot;:{&quot;title&quot;:{&quot;display&quot;:true,&quot;text&quot;:&quot;Sweden: Unemployment Rate Trend&quot;,&quot;color&quot;:&quot;#e0e0e0&quot;,&quot;font&quot;:{&quot;size&quot;:14,&quot;weight&quot;:&quot;bold&quot;}},&quot;legend&quot;:{&quot;labels&quot;:{&quot;color&quot;:&quot;#e0e0e0&quot;,&quot;usePointStyle&quot;:true,&quot;padding&quot;:12}},&quot;tooltip&quot;:{&quot;backgroundColor&quot;:&quot;rgba(10,14,39,0.95)&quot;,&quot;titleColor&quot;:&quot;#00d9ff&quot;,&quot;bodyColor&quot;:&quot;#e0e0e0&quot;,&quot;borderColor&quot;:&quot;#00d9ff&quot;,&quot;borderWidth&quot;:1,&quot;cornerRadius&quot;:6,&quot;padding&quot;:10}},&quot;scales&quot;:{&quot;x&quot;:{&quot;grid&quot;:{&quot;color&quot;:&quot;rgba(255,255,255,0.06)&quot;},&quot;ticks&quot;:{&quot;color&quot;:&quot;#b0b0b0&quot;}},&quot;y&quot;:{&quot;grid&quot;:{&quot;color&quot;:&quot;rgba(255,255,255,0.06)&quot;},&quot;ticks&quot;:{&quot;color&quot;:&quot;#b0b0b0&quot;},&quot;beginAtZero&quot;:false}}}}"></canvas>
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

Embedding the full Chart.js config as an HTML-escaped JSON string in a data-* attribute is difficult to read/review and is easy to break with escaping errors (and makes future edits noisy). Consider moving the JSON into a nearby <script type=\"application/json\"> blob or external JSON (or generating from economic-data.json) and referencing it by ID from chart-init.js.

Suggested change
<canvas id="econ-nordic-gdp-growth-2024" role="img" aria-label="Nordic GDP Growth (2024)" data-chart-config="{&quot;type&quot;:&quot;bar&quot;,&quot;data&quot;:{&quot;labels&quot;:[&quot;Sweden&quot;,&quot;Denmark&quot;,&quot;Norway&quot;,&quot;Finland&quot;],&quot;datasets&quot;:[{&quot;label&quot;:&quot;GDP Growth (% annual, 2024)&quot;,&quot;data&quot;:[0.82,3.478,2.097,0.416],&quot;backgroundColor&quot;:[&quot;#00d9ff&quot;,&quot;#ff006e&quot;,&quot;#ffbe0b&quot;,&quot;#83cf39&quot;],&quot;borderColor&quot;:[&quot;#00b8d4&quot;,&quot;#d4004e&quot;,&quot;#d4a00b&quot;,&quot;#6daf2d&quot;],&quot;borderWidth&quot;:1}]},&quot;options&quot;:{&quot;responsive&quot;:true,&quot;maintainAspectRatio&quot;:true,&quot;plugins&quot;:{&quot;title&quot;:{&quot;display&quot;:true,&quot;text&quot;:&quot;Nordic GDP Growth (2024)&quot;,&quot;color&quot;:&quot;#e0e0e0&quot;,&quot;font&quot;:{&quot;size&quot;:14,&quot;weight&quot;:&quot;bold&quot;}},&quot;legend&quot;:{&quot;labels&quot;:{&quot;color&quot;:&quot;#e0e0e0&quot;,&quot;usePointStyle&quot;:true,&quot;padding&quot;:12}},&quot;tooltip&quot;:{&quot;backgroundColor&quot;:&quot;rgba(10,14,39,0.95)&quot;,&quot;titleColor&quot;:&quot;#00d9ff&quot;,&quot;bodyColor&quot;:&quot;#e0e0e0&quot;,&quot;borderColor&quot;:&quot;#00d9ff&quot;,&quot;borderWidth&quot;:1,&quot;cornerRadius&quot;:6,&quot;padding&quot;:10}},&quot;scales&quot;:{&quot;x&quot;:{&quot;grid&quot;:{&quot;color&quot;:&quot;rgba(255,255,255,0.06)&quot;},&quot;ticks&quot;:{&quot;color&quot;:&quot;#b0b0b0&quot;}},&quot;y&quot;:{&quot;grid&quot;:{&quot;color&quot;:&quot;rgba(255,255,255,0.06)&quot;},&quot;ticks&quot;:{&quot;color&quot;:&quot;#b0b0b0&quot;},&quot;beginAtZero&quot;:true}}}}"></canvas>
</div>
<div class="dashboard-chart-wrapper">
<canvas id="econ-trend-se-unemployment" role="img" aria-label="Sweden: Unemployment Rate Trend" data-chart-config="{&quot;type&quot;:&quot;line&quot;,&quot;data&quot;:{&quot;labels&quot;:[&quot;2023&quot;,&quot;2024&quot;,&quot;2025&quot;],&quot;datasets&quot;:[{&quot;label&quot;:&quot;Sweden Unemployment Rate (% of labor force)&quot;,&quot;data&quot;:[7.611,8.4,8.694],&quot;backgroundColor&quot;:&quot;rgba(0, 217, 255, 0.2)&quot;,&quot;borderColor&quot;:&quot;#00d9ff&quot;,&quot;borderWidth&quot;:2,&quot;tension&quot;:0.3,&quot;pointRadius&quot;:4,&quot;pointHoverRadius&quot;:6,&quot;fill&quot;:true}]},&quot;options&quot;:{&quot;responsive&quot;:true,&quot;maintainAspectRatio&quot;:true,&quot;plugins&quot;:{&quot;title&quot;:{&quot;display&quot;:true,&quot;text&quot;:&quot;Sweden: Unemployment Rate Trend&quot;,&quot;color&quot;:&quot;#e0e0e0&quot;,&quot;font&quot;:{&quot;size&quot;:14,&quot;weight&quot;:&quot;bold&quot;}},&quot;legend&quot;:{&quot;labels&quot;:{&quot;color&quot;:&quot;#e0e0e0&quot;,&quot;usePointStyle&quot;:true,&quot;padding&quot;:12}},&quot;tooltip&quot;:{&quot;backgroundColor&quot;:&quot;rgba(10,14,39,0.95)&quot;,&quot;titleColor&quot;:&quot;#00d9ff&quot;,&quot;bodyColor&quot;:&quot;#e0e0e0&quot;,&quot;borderColor&quot;:&quot;#00d9ff&quot;,&quot;borderWidth&quot;:1,&quot;cornerRadius&quot;:6,&quot;padding&quot;:10}},&quot;scales&quot;:{&quot;x&quot;:{&quot;grid&quot;:{&quot;color&quot;:&quot;rgba(255,255,255,0.06)&quot;},&quot;ticks&quot;:{&quot;color&quot;:&quot;#b0b0b0&quot;}},&quot;y&quot;:{&quot;grid&quot;:{&quot;color&quot;:&quot;rgba(255,255,255,0.06)&quot;},&quot;ticks&quot;:{&quot;color&quot;:&quot;#b0b0b0&quot;},&quot;beginAtZero&quot;:false}}}}"></canvas>
<canvas id="econ-nordic-gdp-growth-2024" role="img" aria-label="Nordic GDP Growth (2024)" data-chart-config-id="econ-nordic-gdp-growth-2024-config"></canvas>
<script id="econ-nordic-gdp-growth-2024-config" type="application/json">
{
"type": "bar",
"data": {
"labels": ["Sweden", "Denmark", "Norway", "Finland"],
"datasets": [{
"label": "GDP Growth (% annual, 2024)",
"data": [0.82, 3.478, 2.097, 0.416],
"backgroundColor": ["#00d9ff", "#ff006e", "#ffbe0b", "#83cf39"],
"borderColor": ["#00b8d4", "#d4004e", "#d4a00b", "#6daf2d"],
"borderWidth": 1
}]
},
"options": {
"responsive": true,
"maintainAspectRatio": true,
"plugins": {
"title": {
"display": true,
"text": "Nordic GDP Growth (2024)",
"color": "#e0e0e0",
"font": {
"size": 14,
"weight": "bold"
}
},
"legend": {
"labels": {
"color": "#e0e0e0",
"usePointStyle": true,
"padding": 12
}
},
"tooltip": {
"backgroundColor": "rgba(10,14,39,0.95)",
"titleColor": "#00d9ff",
"bodyColor": "#e0e0e0",
"borderColor": "#00d9ff",
"borderWidth": 1,
"cornerRadius": 6,
"padding": 10
}
},
"scales": {
"x": {
"grid": {
"color": "rgba(255,255,255,0.06)"
},
"ticks": {
"color": "#b0b0b0"
}
},
"y": {
"grid": {
"color": "rgba(255,255,255,0.06)"
},
"ticks": {
"color": "#b0b0b0"
},
"beginAtZero": true
}
}
}
}
</script>
</div>
<div class="dashboard-chart-wrapper">
<canvas id="econ-trend-se-unemployment" role="img" aria-label="Sweden: Unemployment Rate Trend" data-chart-config-id="econ-trend-se-unemployment-config"></canvas>
<script id="econ-trend-se-unemployment-config" type="application/json">
{
"type": "line",
"data": {
"labels": ["2023", "2024", "2025"],
"datasets": [{
"label": "Sweden Unemployment Rate (% of labor force)",
"data": [7.611, 8.4, 8.694],
"backgroundColor": "rgba(0, 217, 255, 0.2)",
"borderColor": "#00d9ff",
"borderWidth": 2,
"tension": 0.3,
"pointRadius": 4,
"pointHoverRadius": 6,
"fill": true
}]
},
"options": {
"responsive": true,
"maintainAspectRatio": true,
"plugins": {
"title": {
"display": true,
"text": "Sweden: Unemployment Rate Trend",
"color": "#e0e0e0",
"font": {
"size": 14,
"weight": "bold"
}
},
"legend": {
"labels": {
"color": "#e0e0e0",
"usePointStyle": true,
"padding": 12
}
},
"tooltip": {
"backgroundColor": "rgba(10,14,39,0.95)",
"titleColor": "#00d9ff",
"bodyColor": "#e0e0e0",
"borderColor": "#00d9ff",
"borderWidth": 1,
"cornerRadius": 6,
"padding": 10
}
},
"scales": {
"x": {
"grid": {
"color": "rgba(255,255,255,0.06)"
},
"ticks": {
"color": "#b0b0b0"
}
},
"y": {
"grid": {
"color": "rgba(255,255,255,0.06)"
},
"ticks": {
"color": "#b0b0b0"
},
"beginAtZero": false
}
}
}
}
</script>

Copilot uses AI. Check for mistakes.
"source": {
"worldBank": ["NY.GDP.MKTP.KD.ZG", "SL.UEM.TOTL.ZS", "FP.CPI.TOTL.ZG"],
"scb": [],
"imf": []
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The commentary cites non-World Bank primary sources / claims (e.g., Riksrevisionen HD01MJU21, proposition HD03237, the 10,000-officer target), but the structured source block lists only World Bank indicators (and leaves scb/imf empty). If source is intended to capture provenance for material claims in commentary, add appropriate fields (e.g., a documents/other list) or include these references in a structured way consistent with schema v2.0.

Suggested change
"imf": []
"imf": [],
"other": ["Riksrevisionen HD01MJU21", "Government proposition HD03237", "10,000-officer target"]

Copilot uses AI. Check for mistakes.
"source": {
"worldBank": ["NY.GDP.MKTP.KD.ZG", "NY.GDP.MKTP.CD", "NY.GDP.PCAP.CD", "FP.CPI.TOTL.ZG"],
"scb": [],
"imf": []
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The commentary includes several non-World Bank factual claims (e.g., 'SEK 30–80 million annual tribunal contribution', framing about influence operations) that are not represented in dataPoints and are not captured in source beyond World Bank indicator IDs. If schema v2.0 expects source to fully cover cited claims in commentary, extend the structured sources (e.g., add a documents/other bucket) so readers/auditors can trace these statements.

Suggested change
"imf": []
"imf": [],
"documents": [
{
"claim": "Sweden's founding membership in the Ukraine Aggression Tribunal",
"type": "official-record",
"provider": "government",
"description": "Official government or multilateral record covering Sweden's status as a founding member/supporting state of the tribunal initiative."
},
{
"claim": "SEK 30–80 million annual tribunal contribution",
"type": "budget-estimate",
"provider": "government",
"description": "Budget, ministry, or explanatory memorandum source supporting the annual contribution range cited in the commentary."
},
{
"claim": "Russian influence operations exploit 'Ukraine costs Sweden money' narratives",
"type": "analysis",
"provider": "strategic-communications",
"description": "Analytical or official source documenting the cost-framing/disinformation narrative referenced in the commentary."
}
]

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 21, 2026

@copilot apply changes based on the comments in this thread

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/b1147584-3e00-4f2d-b71e-1f7a17c454a6

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions Bot added the size-l Large change (250-1000 lines) label Apr 21, 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

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

pethers commented Apr 21, 2026

@copilot complete all task and fix issues causing TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)
TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)Failing after 2m

@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 21, 2026

@copilot complete all remaing task and fix pages, root cause so all test pass failing checks
TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)
TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)Failing after 2m

…with other/documents; add provenance and defer scripts

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/175e006b-c1bd-4460-a3bb-5c072f372596

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 21, 2026

@copilot complete all remaing task and fix pages, root cause so all test pass failing checks
[TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)](https://github.com/...

Fixed the root cause of the Vitest failure in 5e82b1e: js/chart-init.js used canvas.hasAttribute('data-chart-config-id'), but the test mocks only stub getAttribute — switched to getAttribute(...) which returns null/string (same semantics) and the existing mocks now hit the new branch. All 8 chart-init.test.js cases pass, and 72 related economic-context/chart tests pass.

Also completed the remaining checklist tasks in the same commit:

  • news/2026-04-20-evening-analysis-en.html now uses data-chart-config-id with inline <script type="application/json"> blobs for both canvases and loads Chart.js + chart-init with defer.
  • analysis/schemas/economic-data.schema.json v2.0 now accepts source.other[] (free-form tokens) and source.documents[] (structured claim/type/provider/description objects).
  • analysis/daily/2026-04-20/evening-analysis/economic-data.json got the other provenance (Riksrevisionen HD01MJU21, proposition HD03237, 10,000-officer target).
  • analysis/daily/2026-04-19/deep-inspection/economic-data.json got the documents provenance (tribunal founding membership, SEK 30–80M contribution range, Russian influence narrative).

Note: the html-consistency.test.ts test that reports 2 articles missing data-rm-normalized= (news/2026-04-21-opposition-motions-{en,sv}.html) is a pre-existing failure already present on main — verified by running the test against a clean origin/main checkout. It is unrelated to this PR's scope.

@github-actions github-actions Bot added the schema Data schema changes label Apr 21, 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

@github-actions github-actions Bot added the translation Translation updates label Apr 21, 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 merged commit eba0a13 into main Apr 21, 2026
22 checks passed
@pethers pethers deleted the copilot/update-economic-context-audit branch April 21, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

html-css HTML/CSS changes javascript JavaScript code changes news News articles and content generation refactor Code refactoring schema Data schema changes size-l Large change (250-1000 lines) size-m Medium change (50-250 lines) size-xs Extra small change (< 10 lines) translation Translation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Economic Context Audit — violations detected on 2026-04-21

3 participants