Skip to content

fix(workbench): fix mobile preview spacing, control labels, and PiP console noise - #28

Merged
petekp merged 3 commits into
mainfrom
pkp/dogfood-followup-no-provisional-tests
Mar 14, 2026
Merged

fix(workbench): fix mobile preview spacing, control labels, and PiP console noise#28
petekp merged 3 commits into
mainfrom
pkp/dogfood-followup-no-provisional-tests

Conversation

@petekp

@petekp petekp commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Fixes

  • add accessible labels to the icon-only send/reset/clear controls
  • top-align isolated non-desktop previews so mobile preview does not show a large empty band
  • stop OPENAI globals messages from leaking into the MCP transport and polluting the console during PiP/mode changes

Verification

  • pnpm lint
  • pnpm exec tsc --noEmit
  • pnpm exec tsx --test $(rg --files -g '*test.ts' -g '*test.tsx')
  • browser repro on localhost:3002 confirming the labels are present and PiP no longer logs non-JSON-RPC errors

Supersedes #27.

@vercel

vercel Bot commented Mar 14, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: mcp-app-studio-starter.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread lib/workbench/hmr/preview.html Outdated
const message = event.data;
if (!message || typeof message !== "object") return;
if (message.type !== "OPENAI_SET_GLOBALS") return;
event.stopImmediatePropagation?.();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 lint
  • pnpm exec tsc --noEmit
  • full tsx --test suite
  • browser repro confirming PiP still stays free of the non-JSON-RPC console noise

@petekp petekp changed the title fix(workbench): address dogfood issues without provisional tests fix(workbench): fix mobile preview spacing, control labels, and PiP console noise Mar 14, 2026
Base automatically changed from pkp/workbench-live-channels to main March 14, 2026 15:31
@petekp
petekp merged commit 5344060 into main Mar 14, 2026
3 of 4 checks passed
@petekp
petekp deleted the pkp/dogfood-followup-no-provisional-tests branch March 14, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant