fix(desktop): send host theme to built canvas artifacts - #78693
Merged
Conversation
|
😎 Merged successfully - details. |
charlesvien
marked this pull request as ready for review
August 6, 2026 06:25
Contributor
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AI### Issue 1
products/desktop/packages/ui/src/features/canvas/freeform/BuiltCanvas.tsx:170-174
**Cover the initial color scheme**
The initial theme is delivered only after the artifact runtime starts its message port, so a dark-themed artifact can first paint its background, native controls, or scrollbars using the light color scheme. Apply the resolved scheme at the iframe level as FreeformCanvas does to cover the pre-runtime paint.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(canvas): mirror host dark mode into ..." | Re-trigger Greptile |
1 task
There was a problem hiding this comment.
Contained desktop-UI theming fix (iframe/message-bridge only, no schema/API/auth/CI/dependency surface); it adds test coverage and the diff directly addresses Greptile's resolved review comment about the pre-paint color-scheme flash via the new iframe colorScheme style.
- 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 69L, 1F substantive, 137L/2F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (137L, 2F, single-area, fix) |
| stamphog 2.0.0b4 | .stamphog/policy.yml @ ada83d8 · reviewed head 54d2833 |
1 task
Member
Author
|
/trunk merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Published canvases render in light mode inside a dark app. Dark mode stopped working when canvases moved to cloud-built artifacts (#76649): the artifact path lost the theme bridge that edit mode still has.
BuiltCanvashost never sends the theme over the artifact bridge.Changes
BuiltCanvasposts aset-themeframe over the bridge port after connect and on every host theme change, matchingFreeformCanvas.#theme=fragment on the artifact URL, so the new runtime themes the first paint instead of waiting for the port. Fragments do not reach the server, so signed URLs stay valid.color-scheme, so the UA does not paint the embedded canvas white before the artifact loads.Note
Existing artifacts embed the old runtime and stay light until their canvas rebuilds with #78694 deployed.
No screenshot: I did not run the desktop app against a real built artifact.
How did you test this code?
BuiltCanvastest: the srcDoc carries the theme fragment, the iframe carriescolor-scheme, and the bridge port receives a dark frame on connect and a light frame on theme change. Catches the host dropping theme wiring again.@posthog/uitypecheck locally.Automatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code session. Skills invoked: canvas-templates, writing-tests, writing-pr-descriptions. I traced the regression to the cloud artifacts port, which swapped the theme-aware sandbox for the artifact path on published builds. Originally one PR with the builder half; split into #78694 when the desktop backend coupling check failed. The pre-paint fragment and iframe color-scheme address a Greptile review comment about the light flash before the bridge connects.