From e8f9f285ce5dcd3fedbc4945b6a9d361c8181c62 Mon Sep 17 00:00:00 2001 From: JackeryTU <243411584+JackeryTU@users.noreply.github.com> Date: Fri, 23 Oct 2026 16:08:18 +0800 Subject: [PATCH 1/6] fix(adapter-codex): keep wallpaper shell rounded and overlays readable - stop forcing border-radius: 0 on the left panel, main surface and home hero - keep tooltips on the host dark surface instead of a white fill that hid light labels - make the Radix popper wrapper transparent so rounded menus keep their shape - show the wallpaper through full-page webview routes (host and guest CSS) - keep composer bands, the notice, scroll fade and content-route surfaces tint-free --- .../src/renderer/background-runtime.js | 70 +++++++++++++++++++ .../adapter-codex/src/renderer/background.css | 70 +++++++++++++++++-- 2 files changed, 135 insertions(+), 5 deletions(-) diff --git a/packages/adapter-codex/src/renderer/background-runtime.js b/packages/adapter-codex/src/renderer/background-runtime.js index abc5579..8b97935 100644 --- a/packages/adapter-codex/src/renderer/background-runtime.js +++ b/packages/adapter-codex/src/renderer/background-runtime.js @@ -53,6 +53,73 @@ const root = document.documentElement; const previous = window.__BEAUTICODE_BG__; + // Full-page ChatGPT routes (Plugins, Skills, Library, Plans) live in an + // Electron . Host CSS cannot cross that document boundary, so clear + // the guest's opaque shell tokens from the host through executeJavaScript. + // Controls keep their own borders and foregrounds; only page-sized surfaces + // are made transparent so the full-window wallpaper remains the base layer. + const GUEST_STYLE_ID = "beauticode-guest-wallpaper-style"; + const GUEST_CSS = ` + html, body { + background: transparent !important; + background-color: transparent !important; + background-image: none !important; + } + body > #root, + body > #__next { + background-color: transparent !important; + background-image: none !important; + } + `; + const guestExpression = `(() => { + const id = ${JSON.stringify(GUEST_STYLE_ID)}; + let style = document.getElementById(id); + if (!style) { + style = document.createElement("style"); + style.id = id; + (document.head || document.documentElement).appendChild(style); + } + style.textContent = ${JSON.stringify(GUEST_CSS)}; + return true; + })()`; + const clearGuestExpression = `(() => { + document.getElementById(${JSON.stringify(GUEST_STYLE_ID)})?.remove(); + return true; + })()`; + const installGuestTransparency = (webview) => { + if (!webview || typeof webview.executeJavaScript !== "function") return; + try { + const result = webview.executeJavaScript(guestExpression); + if (result && typeof result.catch === "function") result.catch(() => {}); + } catch (_) {} + if (!webview.__beauticodeGuestTransparencyBound) { + webview.__beauticodeGuestTransparencyBound = true; + const refresh = () => installGuestTransparency(webview); + try { webview.addEventListener("dom-ready", refresh); } catch (_) {} + try { webview.addEventListener("did-finish-load", refresh); } catch (_) {} + } + }; + const syncGuestTransparency = () => { + try { + document.querySelectorAll('webview:not([src^="codex-sandbox:"])') + .forEach(installGuestTransparency); + } catch (_) {} + }; + const clearGuestTransparency = () => { + try { + document.querySelectorAll('webview:not([src^="codex-sandbox:"])') + .forEach((webview) => { + if (typeof webview.executeJavaScript !== "function") return; + try { + const result = webview.executeJavaScript(clearGuestExpression); + if (result && typeof result.catch === "function") { + result.catch(() => {}); + } + } catch (_) {} + }); + } catch (_) {} + }; + // ---- Same-generation short-circuit (critical anti-flash) ---- // The tray watch loop re-publishes the active payload every ~1s. Rebuilding // the stage on every poll creates stacked