Repository navigation
feat(widgets): project full system token set into generated widget iframes - #3589
Open
Raing5Days wants to merge 1 commit into
Open
Raing5Days wants to merge 1 commit into
Raing5Days wants to merge 1 commit into
Conversation
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.
Summary
data-openbitfun-design-system-root+data-density) and fall back to static token values.widget_codeschema description) so the model is told that spacing/radius/typography/motion variables are host-projected system tokens instead of "iframe-local scaffold values".readWidgetAppearancePayload: GenerativeUI widget iframes, the static renderer, DesktopCard custom HTML frames, canvas runtime appearance, and HTML export.Type and Areas
Type: Feature
Areas: Web UI (generative widget appearance payload), Rust core (GenerativeUI tool prompt contract)
Motivation / Impact
Widgets previously rendered radius/spacing/control sizing from frozen iframe scaffold defaults, so they could drift from the active host appearance, density mode, and user font settings. Widgets can now rely on the same resolved system tokens the host uses; no widget authoring change is required, and model-facing guidance no longer instructs the model to treat these variables as iframe-local.
Verification
pnpm --dir src/web-ui run test:run src/tools/generative-widget/appearancePayload.test.ts src/tools/generative-widget/GenerativeWidgetFrame.test.tsx— passed (9 tests, incl. new host-projection test)pnpm --dir src/web-ui run test:run src/tools/openbitfun-canvas/runtime/canvasRuntimeInstaller.test.ts src/tools/openbitfun-canvas/OpenBitFunCanvasPanel.test.tsx src/tools/openbitfun-canvas/runtime/CanvasRuntimeApp.test.tsx— passed (12 tests)cargo test -p openbitfun-core --lib --features agent-runtime,tools-miniapp appearance_prompt— passed (3 tests)pnpm run check:web— passed (canvas:sdk:check + appearance gates + type-check)pnpm run theme:color-audit:all— passed (28 surfaces)pnpm run fmt:rs— passedNot verified: live in-app rendering (widget following density/font changes) — needs a desktop dev run.
Reviewer Notes
Checklist
Generated with OpenBitFun