feat(studio): a page button created in Studio can be given an action (#2997) - #3028
Merged
Merged
Conversation
…2997) element:button renders inert without an `action`, and Studio had no way to add one. The curated BLOCK_CONFIG entry listed label/variant/size/icon and no `action`, and the generic "Advanced" section is not a fallback for that: it enumerates the keys the block ALREADY has (Object.keys(blockProps)). So it could edit an action authored in source and never add one to a button dragged from the palette. Adds a `json` field kind — the same InspectorJsonField editor Advanced uses, reachable for a property that does not exist yet — plus an `action` field on element:button whose placeholder shows the expected shape. An empty JSON textarea is otherwise the entire affordance, so `placeholder` is threaded through to the textarea and asserted for every json field. Raw JSON rather than typed sub-fields deliberately: the spec declares the prop as InlineActionSchema (objectstack#4135) and the inspector cannot render a nested schema as fields yet. A JSON box the author can use beats a curated form modelling a fraction of the shape. The existing field-kind allowlist test caught the new kind on first run, which is the ratchet working; `json` is added there too. app-shell metadata-admin: 968 tests / 111 files green; tsc clean with deps built. Refs #2997 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Jul 30, 2026
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.
The last piece of #2997. Independent of the spec work (objectstack-ai/objectstack#4135, merged) — this table is hand-written, not derived from the props schema.
The gap
element:buttonrenders inert without anaction, and Studio had no way to add one.Two things had to both be true, and they were:
block-config.ts:216) listedlabel,variant,size,icon— noaction.So Advanced could edit an
actionthat source had authored, and never add one to a button dragged from the palette. (This also corrects the framing in my own analysis on #2997, which said Studio "cannot author it" — it can edit an existing one; what it cannot do is create one.)The change
A
jsonfield kind — the sameInspectorJsonFieldeditor Advanced already uses, made reachable for a property that does not exist yet — plus anactionfield onelement:button:The placeholder is not decoration. An empty JSON textarea is the entire affordance a raw-JSON editor offers, so
placeholderis now threaded through to the<textarea>and asserted for everyjsonfield — ajsonfield without one is a blank box, which is worse than no field.Raw JSON rather than typed sub-fields, deliberately. The spec declares the prop as
InlineActionSchema, and the inspector cannot render a nested schema as fields yet. A JSON box an author can actually use beats a curated form that modelstypeandtargetand silently omitsparams,openIn,confirmTextand the rest. The placeholder shows the canonical pair, which covers the common case.The existing ratchet caught the new kind
block-config.test.tsasserts every field'skindis in an allowlist, and it failed on first run:That is the guard doing its job;
jsonis added to the allowlist in the same change. Two new assertions go with it —element:buttonmust expose anactionfield, and everyjsonfield must carry a placeholder.Verification
app-shellmetadata-admin: 968 tests across 111 files, green (12 inblock-config.test.ts, up from 10).tsc --noEmit: 0 errors with workspace deps built. (Without them the package reports 727, allCannot find module '@object-ui/*'cascades — worth stating, because the 4 that land inPageBlockInspector.tsxunbuilt are of that class, not from this change.)eslint: 0 errors on both touched files.Refs #2997, objectstack-ai/objectstack#4135
🤖 Generated with Claude Code