Conversation
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: size-xs Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…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>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
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.jsonfiles to v2.0 schema with World Bank-style datapoints and structuredsource.worldBank[]. - Injected an
economic-dashboardsection intonews/2026-04-20-evening-analysis-en.htmlwith 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. |
| <script src="../js/lib/chart.umd.4.4.1.js"></script> | ||
| <script src="../js/chart-init.js"></script> |
There was a problem hiding this comment.
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).
| <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> |
| <canvas id="econ-nordic-gdp-growth-2024" role="img" aria-label="Nordic GDP Growth (2024)" data-chart-config="{"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}}}}"></canvas> | ||
| </div> | ||
| <div class="dashboard-chart-wrapper"> | ||
| <canvas id="econ-trend-se-unemployment" role="img" aria-label="Sweden: Unemployment Rate Trend" data-chart-config="{"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}}}}"></canvas> |
There was a problem hiding this comment.
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.
| <canvas id="econ-nordic-gdp-growth-2024" role="img" aria-label="Nordic GDP Growth (2024)" data-chart-config="{"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}}}}"></canvas> | |
| </div> | |
| <div class="dashboard-chart-wrapper"> | |
| <canvas id="econ-trend-se-unemployment" role="img" aria-label="Sweden: Unemployment Rate Trend" data-chart-config="{"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}}}}"></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> |
| "source": { | ||
| "worldBank": ["NY.GDP.MKTP.KD.ZG", "SL.UEM.TOTL.ZS", "FP.CPI.TOTL.ZG"], | ||
| "scb": [], | ||
| "imf": [] |
There was a problem hiding this comment.
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.
| "imf": [] | |
| "imf": [], | |
| "other": ["Riksrevisionen HD01MJU21", "Government proposition HD03237", "10,000-officer target"] |
| "source": { | ||
| "worldBank": ["NY.GDP.MKTP.KD.ZG", "NY.GDP.MKTP.CD", "NY.GDP.PCAP.CD", "FP.CPI.TOTL.ZG"], | ||
| "scb": [], | ||
| "imf": [] |
There was a problem hiding this comment.
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.
| "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 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>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
|
@copilot complete all task and fix issues causing TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request) |
|
@copilot complete all remaing task and fix pages, root cause so all test pass failing checks |
…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>
Fixed the root cause of the Vitest failure in Also completed the remaining checklist tasks in the same commit:
Note: the |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…tion-motions pages Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/47d297bc-2d9c-453f-8853-60455eb4d397 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
js/chart-init.js— fix root cause of Vitest failure: usegetAttributefordata-chart-config-idchecknews/2026-04-20-evening-analysis-en.html:data-chart-configwithdata-chart-config-id+ inline<script type="application/json">blobsdeferto Chart.js andchart-init.jsscript tagsanalysis/schemas/economic-data.schema.jsonto allowotheranddocumentsinsource"other"provenance toanalysis/daily/2026-04-20/evening-analysis/economic-data.json"documents"provenance toanalysis/daily/2026-04-19/deep-inspection/economic-data.jsondata-rm-normalized="v9"body attribute tonews/2026-04-21-opposition-motions-{en,sv}.html— fixeshtml-consistency.test.tsfailure