Skip to content

fix: prevent component variables with plain-text values from breaking pages - #483

Merged
ysamcode merged 4 commits into
mainfrom
develop
Jul 31, 2026
Merged

fix: prevent component variables with plain-text values from breaking pages#483
ysamcode merged 4 commits into
mainfrom
develop

Conversation

@ysamcode

Copy link
Copy Markdown
Collaborator

Summary

Release develop to main. Fixes a crash caused by component text variables stored as bare strings, and documents previously hidden MCP design capabilities so agents can build richer visuals without workarounds.

Changes

Fix: guard string component variable values (#480)

  • Normalize bare-string default_value inputs from the MCP component tools into the proper { type, data } object shape before storing them
  • Coerce already-persisted string values when resolving component overrides and extracting Tiptap content, so existing broken data renders instead of throwing
  • Guard against primitive values when resolving rich-text image assets in the page fetcher

Docs: surface undocumented MCP design capabilities (#482)

  • Document backgroundImage, backgroundSize/Position/Repeat, filter, backdropFilter, and mixBlendMode design properties in the MCP agent instructions
  • Explain that htmlEmbed runs in a sandboxed, auto-resizing iframe and steer agents toward native layers for overlays and page custom code for scripts
  • Note that CSS outside the design schema (e.g. pointer-events) can be set via custom_attributes

Test plan

  • Create a component via MCP with a text variable whose default_value is a bare string — the page using it should render the text instead of erroring
  • Verify existing components with string-valued variables render correctly on published pages
  • Check the MCP server instructions include the new backgrounds/effects properties and the htmlEmbed sandbox note

Made with Cursor

ysamcode and others added 4 commits July 30, 2026 10:55
A component variable `default_value` is untyped in the MCP tool schema, so an
agent can store a bare string where the renderer expects
`{ type: 'dynamic_text', data: { content } }`. Probing that primitive with the
`in` operator threw, `fetchPageByPath` swallowed the error, and every page
using the component fell back to the starter template — both in the builder
preview and on the published site.

Coerce strings to `dynamic_text` at render time so existing bad data recovers
without a migration, and wrap them at the MCP boundary so new writes are
stored in the correct shape.

Co-authored-by: Cursor <cursoragent@cursor.com>
…e-values

fix: guard string component variable values
The design guide sent to agents omitted several properties the schema and
class mapper already support (mixBlendMode, filter, backdropFilter, raw
backgroundImage values), so agents assumed blend-mode overlays required
custom code. Also documents that htmlEmbed renders as a sandboxed iframe
on published sites and the custom_attributes style escape hatch for CSS
with no design field (e.g. pointer-events).
docs: surface undocumented MCP design capabilities in agent instructions
@ysamcode ysamcode added the Bug Something isn't working label Jul 31, 2026
@ysamcode ysamcode self-assigned this Jul 31, 2026
@ysamcode ysamcode added the Bug Something isn't working label Jul 31, 2026
@ysamcode
ysamcode merged commit 2436e24 into main Jul 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant