Skip to content

fix(smarthome): CSP-safe modal wiring + client i18n keys - #205

Merged
CallMeTechie merged 1 commit into
masterfrom
fix/smarthome-ui-papercuts
Jun 29, 2026
Merged

fix(smarthome): CSP-safe modal wiring + client i18n keys#205
CallMeTechie merged 1 commit into
masterfrom
fix/smarthome-ui-papercuts

Conversation

@CallMeTechie

Copy link
Copy Markdown
Owner

Behebt drei Live-Bugs auf der Smart-Home-Admin-Seite (gemeldet nach #204):

  1. „Gateway verbinden" ohne Funktion — die CSP (script-src-attr 'none') blockt inline onclick=-Handler. Modal öffnen/schließen/abbrechen waren tot. Ersetzt durch id="sh-connect-open" + [data-sh-close], verdrahtet via addEventListener (wireModal()) — wie das CSP-sichere Midea-Muster.
  2. Fehlende i18n-Labels — JS-gerenderte Texte (Power/Helligkeit/Farbe/Sektionen/Test) lasen rohe Keys, weil die smarthome.*-Keys nur server-seitig in en/de.json standen, aber nicht in der Client-Bridge window.GC.t (layout.njk). 13 Keys in allen 3 Layouts ergänzt.
  3. Leeres Routen-Dropdown — Folge von Add CSRF token rotation for sensitive actions #1 (Modal ließ sich nicht öffnen); fillRoutes//api/v1/routes waren korrekt. Befüllt sich nach dem Modal-Fix.

Verifikation: 9/9 betroffene Templates kompilieren sauber; keine inline onclick mehr in smarthome-Templates; alle 13 Keys in en+de vorhanden; smarthome.js Syntax ok.

🤖 Generated with Claude Code

- CSP (script-src-attr 'none') blocked inline onclick → connect/close/cancel
  buttons dead. Replace with id=sh-connect-open + [data-sh-close] wired via
  addEventListener (wireModal), matching midea's CSP-safe pattern.
- Add 13 smarthome.* client keys to GC.t in all 3 layouts (were only in
  en/de.json server-side → JS-rendered labels showed raw keys).
- Route dropdown populates once modal opens (fillRoutes/endpoint already correct).
@CallMeTechie
CallMeTechie merged commit 2b47b0e into master Jun 29, 2026
8 checks passed
@CallMeTechie
CallMeTechie deleted the fix/smarthome-ui-papercuts branch June 29, 2026 19:31
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.

1 participant