fix(workbench): fix mobile preview spacing, control labels, and PiP console noise - #28
Conversation
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f49ecbfbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const message = event.data; | ||
| if (!message || typeof message !== "object") return; | ||
| if (message.type !== "OPENAI_SET_GLOBALS") return; | ||
| event.stopImmediatePropagation?.(); |
There was a problem hiding this comment.
Let OPENAI_SET_GLOBALS reach the runtime shim
In the HMR preview path, this inline message listener is installed before runtime-entry.tsx calls installOpenAIShim(), so event.stopImmediatePropagation() here prevents the shim’s own message handler in openai-shim-runtime.ts from receiving subsequent OPENAI_SET_GLOBALS updates. The initial payload may still be cached via __OPENAI_INITIAL_GLOBALS, but later host changes (like edited app props/tool input/widget state) no longer propagate into window.openai, causing host state drift after load.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 15ddea0.
I removed the propagation block from lib/workbench/hmr/preview.html so the later installOpenAIShim() listener still receives OPENAI_SET_GLOBALS updates, and I added a focused behavior test in lib/workbench/hmr/preview.test.ts that proves the preview bootstrap caches the globals without blocking later message listeners.
Re-verified with:
pnpm lintpnpm exec tsc --noEmit- full
tsx --testsuite - browser repro confirming PiP still stays free of the non-JSON-RPC console noise
Fixes
Verification
Supersedes #27.