diff --git a/plugins/ms-ai-architect/playground/ms-ai-architect-v3.html b/plugins/ms-ai-architect/playground/ms-ai-architect-v3.html index 02219e1..4090b21 100644 --- a/plugins/ms-ai-architect/playground/ms-ai-architect-v3.html +++ b/plugins/ms-ai-architect/playground/ms-ai-architect-v3.html @@ -5,6 +5,21 @@ ms-ai-architect — Playground v3 + + + @@ -1456,6 +1471,9 @@ const crumbHtml = (orgName || crumb) ? '' + (orgName ? escapeHtml(orgName) : '') + (orgName && crumb ? ' · ' : '') + (crumb || '') + '' : ''; + const currentTheme = document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark'; + const themeLabel = currentTheme === 'light' ? 'Lys' : 'Mørk'; + const themeNext = currentTheme === 'light' ? 'mørk' : 'lys'; return ( '
' + '
' + @@ -1470,6 +1488,9 @@ '' + '' + '' + + '' + '' + '
' ); @@ -3625,6 +3646,25 @@ ACTIONS['goto-catalog'] = function () { navigate('catalog'); }; ACTIONS['goto-onboarding'] = function () { navigate('onboarding'); }; + // Theme toggle (Step 13). Veksler data-theme på , persisterer i + // localStorage('ms-ai-architect-theme'). Tar høyde for begrensning fra + // file:// + privatmodus. Re-renderer ikke surfaces — endrer kun attributt + // og synkroniserer alle [data-theme-label]-elementer in-place. + ACTIONS['toggle-theme'] = function () { + const current = document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark'; + const next = current === 'dark' ? 'light' : 'dark'; + document.documentElement.setAttribute('data-theme', next); + try { localStorage.setItem('ms-ai-architect-theme', next); } catch (e) { /* ignore */ } + const labels = document.querySelectorAll('[data-theme-label]'); + for (let i = 0; i < labels.length; i++) { + labels[i].textContent = next === 'dark' ? 'Mørk' : 'Lys'; + } + const buttons = document.querySelectorAll('[data-action="toggle-theme"]'); + for (let j = 0; j < buttons.length; j++) { + buttons[j].setAttribute('aria-label', 'Bytt til ' + (next === 'dark' ? 'lys' : 'mørk') + ' modus'); + } + }; + ACTIONS['open-project'] = function (ev, el) { const id = el.dataset.projectId; if (!id) return;