Skip to content

Commit 05286f4

Browse files
authored
Merge pull request #1884 from Hack23/copilot/cleanup-html-files
Follow-up HTML/UX hardening: dashboard back-to-top, SWOT a11y fallback, chart prefers-reduced-motion, lang= attrs, theme-init SSoT
2 parents 7e25a53 + 7e5797b commit 05286f4

2,736 files changed

Lines changed: 173676 additions & 59969 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-s3.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,39 @@ jobs:
9393
- name: Install dependencies
9494
run: npm ci
9595

96+
- name: Guard against broken HTML regressions
97+
run: |
98+
echo "🔍 Checking committed news articles for known bad patterns…"
99+
FAIL=0
100+
101+
# No raw TypeScript script references in articles
102+
COUNT=$(grep -rl 'src="[^"]*back-to-top\.ts"' news/ 2>/dev/null | wc -l)
103+
if [ "$COUNT" -gt 0 ]; then
104+
echo "❌ $COUNT article(s) still reference back-to-top.ts"
105+
grep -rl 'src="[^"]*back-to-top\.ts"' news/ | head -5
106+
FAIL=1
107+
fi
108+
109+
# No non-existent news-article.js references
110+
COUNT=$(grep -rl 'news-article\.js' news/ 2>/dev/null | wc -l)
111+
if [ "$COUNT" -gt 0 ]; then
112+
echo "❌ $COUNT article(s) still reference news-article.js"
113+
FAIL=1
114+
fi
115+
116+
# No absolute /js/lib/ paths
117+
COUNT=$(grep -rl 'src="/js/lib/' news/ 2>/dev/null | wc -l)
118+
if [ "$COUNT" -gt 0 ]; then
119+
echo "❌ $COUNT article(s) use absolute /js/lib/ path"
120+
FAIL=1
121+
fi
122+
123+
if [ "$FAIL" -eq 0 ]; then
124+
echo "✅ No broken HTML patterns found in news articles."
125+
else
126+
exit 1
127+
fi
128+
96129
- name: Build with Vite
97130
run: npm run build
98131

@@ -121,6 +154,12 @@ jobs:
121154
122155
echo "✅ Build artifacts verified: 'dist' directory, 'dist/index.html', 'dist/rss.xml', and 'dist/sitemap.xml' exist."
123156
157+
if [ ! -d "dist/news" ]; then
158+
echo "❌ Build verification failed: 'dist/news/' directory is missing."
159+
exit 1
160+
fi
161+
echo "✅ dist/news/ directory present."
162+
124163
- name: Copy documentation to build output
125164
run: |
126165
if [ -d "docs" ]; then

daily-readme-updated.png

-420 KB
Binary file not shown.

dashboard/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https:; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; base-uri 'self'; form-action 'self'">
77
<script>(function(){var key='riksdagsmonitor-theme';var t=null;try{t=localStorage.getItem(key);}catch(e){/* storage unavailable */}if(t!=='dark'&&t!=='light'){if(t!==null){try{localStorage.removeItem(key);}catch(e){/* storage unavailable */}}t=(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}());</script>
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9-
<link rel="stylesheet" type="text/css" href="../styles.css">
10-
<link rel="stylesheet" type="text/css" href="styles.css">
9+
<link rel="stylesheet" href="../styles.css">
10+
<link rel="stylesheet" href="styles.css">
1111
<link rel="canonical" href="https://riksdagsmonitor.com/dashboard/index.html">
1212
<link rel="manifest" href="../site.webmanifest">
1313
<meta name="description" content="Interactive Citizen Intelligence Agency (CIA) dashboard: Real-time visualization of Swedish Riksdag data, election 2026 predictions, party performance, MP rankings, and parliamentary analytics.">
@@ -355,7 +355,8 @@ <h3>Languages</h3>
355355

356356
<!-- JavaScript Modules -->
357357
<!-- CIA Dashboard entry point -->
358-
<script src="../js/theme-toggle.js"></script>
358+
<script src="../js/back-to-top.js" defer></script>
359+
<script src="../js/theme-toggle.js" defer></script>
359360
<script type="module" src="/src/browser/cia-entry.ts"></script>
360361
</body>
361362
</html>

dashboard/index_ar.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https:; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; base-uri 'self'; form-action 'self'">
77
<script>(function(){var key='riksdagsmonitor-theme';var t=null;try{t=localStorage.getItem(key);}catch(e){/* storage unavailable */}if(t!=='dark'&&t!=='light'){if(t!==null){try{localStorage.removeItem(key);}catch(e){/* storage unavailable */}}t=(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}());</script>
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9-
<link rel="stylesheet" type="text/css" href="../styles.css">
10-
<link rel="stylesheet" type="text/css" href="styles.css">
9+
<link rel="stylesheet" href="../styles.css">
10+
<link rel="stylesheet" href="styles.css">
1111
<link rel="canonical" href="https://riksdagsmonitor.com/dashboard/index_ar.html">
1212
<link rel="manifest" href="../site.webmanifest">
1313
<meta name="description" content="لوحة معلومات استخباراتية تفاعلية: تصور فوري لبيانات البرلمان السويدي، توقعات انتخابات 2026، أداء الأحزاب، أعضاء البرلمان وتحليلات شاملة.">
@@ -325,7 +325,8 @@ <h3>اللغات</h3>
325325

326326
<!-- JavaScript Modules -->
327327
<!-- CIA Dashboard entry point -->
328-
<script src="../js/theme-toggle.js"></script>
328+
<script src="../js/back-to-top.js" defer></script>
329+
<script src="../js/theme-toggle.js" defer></script>
329330
<script type="module" src="/src/browser/cia-entry.ts"></script>
330331
</body>
331332
</html>

dashboard/index_da.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https:; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; base-uri 'self'; form-action 'self'">
77
<script>(function(){var key='riksdagsmonitor-theme';var t=null;try{t=localStorage.getItem(key);}catch(e){/* storage unavailable */}if(t!=='dark'&&t!=='light'){if(t!==null){try{localStorage.removeItem(key);}catch(e){/* storage unavailable */}}t=(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}());</script>
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9-
<link rel="stylesheet" type="text/css" href="../styles.css">
10-
<link rel="stylesheet" type="text/css" href="styles.css">
9+
<link rel="stylesheet" href="../styles.css">
10+
<link rel="stylesheet" href="styles.css">
1111
<link rel="canonical" href="https://riksdagsmonitor.com/dashboard/index_da.html">
1212
<link rel="manifest" href="../site.webmanifest">
1313
<meta name="description" content="Interaktivt CIA efterretningspanel: Realtidsvisualisering af svensk riksdagsdata, valgprognose 2026, partiydelse, folketingsmedlemmer og omfattende analyser.">
@@ -324,7 +324,8 @@ <h3>Sprog</h3>
324324

325325
<!-- JavaScript Modules -->
326326
<!-- CIA Dashboard entry point -->
327-
<script src="../js/theme-toggle.js"></script>
327+
<script src="../js/back-to-top.js" defer></script>
328+
<script src="../js/theme-toggle.js" defer></script>
328329
<script type="module" src="/src/browser/cia-entry.ts"></script>
329330
</body>
330331
</html>

dashboard/index_de.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https:; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; base-uri 'self'; form-action 'self'">
77
<script>(function(){var key='riksdagsmonitor-theme';var t=null;try{t=localStorage.getItem(key);}catch(e){/* storage unavailable */}if(t!=='dark'&&t!=='light'){if(t!==null){try{localStorage.removeItem(key);}catch(e){/* storage unavailable */}}t=(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}());</script>
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9-
<link rel="stylesheet" type="text/css" href="../styles.css">
10-
<link rel="stylesheet" type="text/css" href="styles.css">
9+
<link rel="stylesheet" href="../styles.css">
10+
<link rel="stylesheet" href="styles.css">
1111
<link rel="canonical" href="https://riksdagsmonitor.com/dashboard/index_de.html">
1212
<link rel="manifest" href="../site.webmanifest">
1313
<meta name="description" content="Interaktives CIA Nachrichtendienst-Dashboard: Echtzeitvisualisierung schwedischer Reichstagsdaten, Wahlprognose 2026, Parteileistung, Abgeordnete und umfassende Analysen.">
@@ -324,7 +324,8 @@ <h3>Sprachen</h3>
324324

325325
<!-- JavaScript Modules -->
326326
<!-- CIA Dashboard entry point -->
327-
<script src="../js/theme-toggle.js"></script>
327+
<script src="../js/back-to-top.js" defer></script>
328+
<script src="../js/theme-toggle.js" defer></script>
328329
<script type="module" src="/src/browser/cia-entry.ts"></script>
329330
</body>
330331
</html>

dashboard/index_es.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https:; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; base-uri 'self'; form-action 'self'">
77
<script>(function(){var key='riksdagsmonitor-theme';var t=null;try{t=localStorage.getItem(key);}catch(e){/* storage unavailable */}if(t!=='dark'&&t!=='light'){if(t!==null){try{localStorage.removeItem(key);}catch(e){/* storage unavailable */}}t=(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}());</script>
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9-
<link rel="stylesheet" type="text/css" href="../styles.css">
10-
<link rel="stylesheet" type="text/css" href="styles.css">
9+
<link rel="stylesheet" href="../styles.css">
10+
<link rel="stylesheet" href="styles.css">
1111
<link rel="canonical" href="https://riksdagsmonitor.com/dashboard/index_es.html">
1212
<link rel="manifest" href="../site.webmanifest">
1313
<meta name="description" content="Panel interactivo de inteligencia CIA: Visualización en tiempo real de datos del Riksdag sueco, pronóstico electoral 2026, rendimiento de partidos, diputados y análisis integrales.">
@@ -324,7 +324,8 @@ <h3>Idiomas</h3>
324324

325325
<!-- JavaScript Modules -->
326326
<!-- CIA Dashboard entry point -->
327-
<script src="../js/theme-toggle.js"></script>
327+
<script src="../js/back-to-top.js" defer></script>
328+
<script src="../js/theme-toggle.js" defer></script>
328329
<script type="module" src="/src/browser/cia-entry.ts"></script>
329330
</body>
330331
</html>

dashboard/index_fi.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https:; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; base-uri 'self'; form-action 'self'">
77
<script>(function(){var key='riksdagsmonitor-theme';var t=null;try{t=localStorage.getItem(key);}catch(e){/* storage unavailable */}if(t!=='dark'&&t!=='light'){if(t!==null){try{localStorage.removeItem(key);}catch(e){/* storage unavailable */}}t=(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}());</script>
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9-
<link rel="stylesheet" type="text/css" href="../styles.css">
10-
<link rel="stylesheet" type="text/css" href="styles.css">
9+
<link rel="stylesheet" href="../styles.css">
10+
<link rel="stylesheet" href="styles.css">
1111
<link rel="canonical" href="https://riksdagsmonitor.com/dashboard/index_fi.html">
1212
<link rel="manifest" href="../site.webmanifest">
1313
<meta name="description" content="Interaktiivinen CIA tiedustelupaneeli: Reaaliaikainen visualisointi Ruotsin valtiopäivädatasta, vaaliennuste 2026, puolueiden suorituskyky, kansanedustajat ja kattavat analyysit.">
@@ -324,7 +324,8 @@ <h3>Kielet</h3>
324324

325325
<!-- JavaScript Modules -->
326326
<!-- CIA Dashboard entry point -->
327-
<script src="../js/theme-toggle.js"></script>
327+
<script src="../js/back-to-top.js" defer></script>
328+
<script src="../js/theme-toggle.js" defer></script>
328329
<script type="module" src="/src/browser/cia-entry.ts"></script>
329330
</body>
330331
</html>

dashboard/index_fr.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https:; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; base-uri 'self'; form-action 'self'">
77
<script>(function(){var key='riksdagsmonitor-theme';var t=null;try{t=localStorage.getItem(key);}catch(e){/* storage unavailable */}if(t!=='dark'&&t!=='light'){if(t!==null){try{localStorage.removeItem(key);}catch(e){/* storage unavailable */}}t=(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}());</script>
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9-
<link rel="stylesheet" type="text/css" href="../styles.css">
10-
<link rel="stylesheet" type="text/css" href="styles.css">
9+
<link rel="stylesheet" href="../styles.css">
10+
<link rel="stylesheet" href="styles.css">
1111
<link rel="canonical" href="https://riksdagsmonitor.com/dashboard/index_fr.html">
1212
<link rel="manifest" href="../site.webmanifest">
1313
<meta name="description" content="Tableau de bord interactif du renseignement CIA: Visualisation en temps réel des données du Riksdag suédois, prévisions électorales 2026, performance des partis, députés et analyses complètes.">
@@ -324,7 +324,8 @@ <h3>Langues</h3>
324324

325325
<!-- JavaScript Modules -->
326326
<!-- CIA Dashboard entry point -->
327-
<script src="../js/theme-toggle.js"></script>
327+
<script src="../js/back-to-top.js" defer></script>
328+
<script src="../js/theme-toggle.js" defer></script>
328329
<script type="module" src="/src/browser/cia-entry.ts"></script>
329330
</body>
330331
</html>

dashboard/index_he.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https:; script-src 'self' 'unsafe-inline' https:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https:; base-uri 'self'; form-action 'self'">
77
<script>(function(){var key='riksdagsmonitor-theme';var t=null;try{t=localStorage.getItem(key);}catch(e){/* storage unavailable */}if(t!=='dark'&&t!=='light'){if(t!==null){try{localStorage.removeItem(key);}catch(e){/* storage unavailable */}}t=(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}());</script>
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9-
<link rel="stylesheet" type="text/css" href="../styles.css">
10-
<link rel="stylesheet" type="text/css" href="styles.css">
9+
<link rel="stylesheet" href="../styles.css">
10+
<link rel="stylesheet" href="styles.css">
1111
<link rel="canonical" href="https://riksdagsmonitor.com/dashboard/index_he.html">
1212
<link rel="manifest" href="../site.webmanifest">
1313
<meta name="description" content="לוח מחוונים מודיעיני אינטראקטיבי: הדמיה בזמן אמת של נתוני הריקסדאג השוודי, תחזית בחירות 2026, ביצועי מפלגות, חברי כנסת וניתוחים מקיפים.">
@@ -325,7 +325,8 @@ <h3>שפות</h3>
325325

326326
<!-- JavaScript Modules -->
327327
<!-- CIA Dashboard entry point -->
328-
<script src="../js/theme-toggle.js"></script>
328+
<script src="../js/back-to-top.js" defer></script>
329+
<script src="../js/theme-toggle.js" defer></script>
329330
<script type="module" src="/src/browser/cia-entry.ts"></script>
330331
</body>
331332
</html>

0 commit comments

Comments
 (0)