Skip to content

feat: prebuilt device chrome for MCP-rendered screens#43

Merged
trmquang93 merged 2 commits intomainfrom
feat/2.8-prebuilt-device-chrome
Apr 27, 2026
Merged

feat: prebuilt device chrome for MCP-rendered screens#43
trmquang93 merged 2 commits intomainfrom
feat/2.8-prebuilt-device-chrome

Conversation

@trmquang93
Copy link
Copy Markdown
Collaborator

Summary

Composite iOS / Android device chrome (status bar, dynamic island, home indicator, gesture pill) onto every Satori-rendered screen so MCP-driven flows look like the device they target without the agent authoring chrome HTML by hand.

  • Two new MCP tools — compose_chrome (chrome retroactively) and get_chrome_info (query safe-area before laying out HTML).
  • Persists a { preset, chrome, chromeStyle, safeArea } block on every screen.
  • File format v14 → v15 with one-line backfill in importFlow.js.
  • Reduces device presets from 7 SKU-named variants to 2 generics (iphone, android) — agents now think in terms of "what device" rather than "which model"; chrome geometry keys off these two canonical viewports.
  • Adds 79 tests (chrome subsystem + renderer integration + tool wiring + v15 migration). Repo total: 780/780 passing, lint clean, no new build warnings, no new runtime dependencies.

Closes backlog item 2.8 — Prebuilt Device Chrome Components.

Test plan

  • npm test — 780/780 passing
  • npm run lint — clean
  • npm run build — succeeds, no new warnings
  • CI green on main
  • After merge: wrapper Vite build picks up new src/constants.js / useScreenManager.js / vite.config.js changes without dep mirror (verified no package.json changes)
  • Smoke-test on drawd.app: load an existing v14 flow and confirm v15 backfill leaves screens functional

Composite iOS / Android device chrome (status bar, dynamic island, home
indicator, gesture pill) onto every Satori-rendered screen so MCP-driven
flows look like the device they target without the agent authoring chrome
HTML by hand. Two new tools (compose_chrome, get_chrome_info) let agents
chrome retroactively and query safe-area before laying out HTML. Persists
a {preset, chrome, chromeStyle, safeArea} block on every screen and bumps
the file format v14 -> v15 with a one-line backfill.

Reduces device presets from 7 SKU-named variants to 2 generics (iphone,
android) — agents now think in terms of "what device" not "which model",
and chrome geometry keys off these two canonical viewports.

Adds 79 tests (chrome subsystem + renderer integration + tool wiring +
v15 migration). Repo total: 780/780 passing, lint clean, no new build
warnings, no new runtime dependencies.
The chrome integration tests added in 8194dd4 import the SatoriRenderer,
which dynamically imports `satori`, `satori-html`, and `@resvg/resvg-js`.
These live in mcp-server/package.json, not the root, so a root-only
`npm ci` left them unresolved on CI and the two new test suites failed
to load with ERR_MODULE_NOT_FOUND.

Add a dedicated `npm ci` step against mcp-server/ so Node's bare-import
resolution finds the deps when running the integration tests.
@trmquang93 trmquang93 merged commit c90f42f into main Apr 27, 2026
1 check passed
@trmquang93 trmquang93 deleted the feat/2.8-prebuilt-device-chrome branch April 27, 2026 01:36
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