Repository navigation
fix: dark-theme visualizations sit on an opaque box with no padding - #160940
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs maintainer review before merge. Reviewed September 29, 2026, 12:40 AM ET / 04:40 UTC (Revision 3). ClawSweeper reviewWhat this changesThis PR makes the isolated widget proxy follow Control UI theme messages, updates visualization guidance about agent-browser checks, and adds a dark-theme browser assertion. Merge readiness✅ Ready for maintainer review Keep open. Current main still leaves the sandbox proxy without the host’s dark color scheme; the branch addresses that visible defect with credible browser proof. I found no introduced correctness or security defect. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI sends theme messages through a Gateway-served sandbox proxy to an isolated widget document. Those nested frames display widgets in chat and dashboards while separating widget HTML from the Control UI. flowchart LR
A[Control UI theme] --> B[Theme message]
B --> C[Parent origin check]
C --> D[Sandbox proxy color scheme]
D --> E[Isolated widget document]
E --> F[Chat and dashboard display]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7, Tests +9, Docs +4. Total +20 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Inline and dashboard widgets should inherit the viewer’s light or dark theme through the isolated proxy while retaining its origin checks and sandbox constraints. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source leaves the middle proxy without a theme, and the inspected before/after Chromium captures plus the existing browser flow provide a high-confidence reproduction path; this read-only review did not execute it. Is this the best way to solve the issue? Yes. Applying the already forwarded, origin-checked theme message to the proxy fixes the mismatch at the frame that causes it without changing widget permissions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ed82c2c25ba1. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
aa0d7d8 to
a41dc57
Compare
In the dark theme every inline show_widget frame showed an opaque slab behind the widget, so its content looked flush against a box with no padding. The sandbox proxy page between the Control UI and the widget document declared no color-scheme, so Chromium painted an opaque canvas wherever the light proxy sat between dark documents. The proxy now adopts the host theme mode from the widget theme messages it already forwards. The visualize skill also told agents to inspect rendered widgets with their own browser tools, which reach a sign-in page instead of the viewer's Control UI. It now says so and points at the existing post-render script error reports.
a41dc57 to
88ad128
Compare
|
Merged via squash.
|
In the dark theme every inline show_widget frame showed an opaque slab behind the widget, so its content looked flush against a box with no padding. The sandbox proxy page between the Control UI and the widget document declared no color-scheme, so Chromium painted an opaque canvas wherever the light proxy sat between dark documents. The proxy now adopts the host theme mode from the widget theme messages it already forwards. The visualize skill also told agents to inspect rendered widgets with their own browser tools, which reach a sign-in page instead of the viewer's Control UI. It now says so and points at the existing post-render script error reports.
What Problem This Solves
Fixes: inline visualizations in the Control UI dark theme sit on a flat dark box whose edges touch the content, so they look like cards with no padding. The same happens in every host that embeds widgets (chat, sidebar, dashboards). Light mode was unaffected.
It also stops agents from opening the Control UI in their own browser to "verify" a widget, which lands on a sign-in page and posts that screenshot into the chat.
User Impact
User impact: dark-theme widgets now render on the normal chat or dashboard background, matching light mode. Agents no longer produce stray sign-in-page screenshots after drawing a visualization.
Why This Change Was Made
Widget documents run inside a sandbox proxy page, nested between the Control UI and the widget. The proxy declared no color scheme, so it counted as light while both the Control UI and the widget were dark. Browsers paint an opaque backdrop behind a frame whose color scheme differs from its embedder, which produced the slab. The proxy already receives and forwards the host's widget theme messages; it now adopts their light/dark mode for its own page, so every layer matches and stays transparent.
The browser part came from the
visualizeskill, which told agents to inspect the rendered result with any available browser tool. Agent browsers run in a separate profile without the viewer's Control UI session, so for inline widgets that check can only reach sign-in. The guidance now says not to use it there and notes that script errors after rendering are already reported back to the session.Scope and behavior notes
prefers-color-scheme, so a staticcolor-scheme: light darkon the proxy would follow the OS setting rather than the Control UI theme. That is why the proxy follows the theme message.Evidence
Dark theme, a synthetic widget rendered through the real widget document shell and sandbox proxy (mock Gateway):
Light-theme captures are byte-identical before and after.
getComputedStyleprobes: before, Control UIdark→ proxynormal→ widgetdark; after, all threedark(and alllightin light mode). Forcing only the proxy to dark removed the slab; forcing only the widget tonormalexposed a white proxy slab instead, which confirms both boundaries.ui/src/e2e/chat-widget-sandbox.e2e.test.tsnow asserts that the proxy page follows the widget into dark mode. It fails on the old proxy withexpected 'normal' to be 'dark'and passes with the fix. Cost: the added assertion is a single poll that resolves immediately; the file ran 134 s wall locally, most of it the bundle build, with the test case at about 12 s.src/gateway/mcp-app-sandbox-http.test.ts,src/gateway/board-sandbox.test.ts,src/agents/mcp-ui-resource.test.ts,src/gateway/server-methods/canvas.test.ts: 70 tests pass.tsgo:core, oxlint and oxfmt are clean.