diff --git a/apps/macos/Sources/Clawdis/Resources/WebChat/bootstrap.js b/apps/macos/Sources/Clawdis/Resources/WebChat/bootstrap.js index 82966f7f0..f4971f697 100644 --- a/apps/macos/Sources/Clawdis/Resources/WebChat/bootstrap.js +++ b/apps/macos/Sources/Clawdis/Resources/WebChat/bootstrap.js @@ -22,6 +22,18 @@ const randomId = () => { return `id-${Math.random().toString(16).slice(2)}-${Date.now()}`; }; +const ensureErrorStyles = () => { + if (document.getElementById("webchat-error-style")) return; + const style = document.createElement("style"); + style.id = "webchat-error-style"; + style.textContent = ` + body.webchat-error { + padding: 28px; + } + `; + document.head.appendChild(style); +}; + class GatewaySocket { constructor(url) { this.url = url; @@ -322,6 +334,8 @@ startChat().catch((err) => { const msg = err?.stack || err?.message || String(err); logStatus(`boot failed: ${msg}`); document.body.dataset.webchatError = "1"; + ensureErrorStyles(); + document.body.classList.add("webchat-error"); document.body.style.color = "#b32d2d"; document.body.style.fontFamily = "SFMono-Regular, Menlo, Consolas, monospace"; document.body.style.padding = "28px"; diff --git a/apps/macos/Sources/Clawdis/Resources/WebChat/webchat.bundle.js b/apps/macos/Sources/Clawdis/Resources/WebChat/webchat.bundle.js index d791e43d0..b82658058 100644 --- a/apps/macos/Sources/Clawdis/Resources/WebChat/webchat.bundle.js +++ b/apps/macos/Sources/Clawdis/Resources/WebChat/webchat.bundle.js @@ -196340,6 +196340,17 @@ const randomId = () => { if (globalThis.crypto?.randomUUID) return globalThis.crypto.randomUUID(); return `id-${Math.random().toString(16).slice(2)}-${Date.now()}`; }; +const ensureErrorStyles = () => { + if (document.getElementById("webchat-error-style")) return; + const style = document.createElement("style"); + style.id = "webchat-error-style"; + style.textContent = ` + body.webchat-error { + padding: 28px; + } + `; + document.head.appendChild(style); +}; var GatewaySocket = class { constructor(url) { this.url = url; @@ -196611,6 +196622,8 @@ startChat().catch((err) => { const msg = err?.stack || err?.message || String(err); logStatus(`boot failed: ${msg}`); document.body.dataset.webchatError = "1"; + ensureErrorStyles(); + document.body.classList.add("webchat-error"); document.body.style.color = "#b32d2d"; document.body.style.fontFamily = "SFMono-Regular, Menlo, Consolas, monospace"; document.body.style.padding = "28px";