feat(app-shell): metadata-driven Validations/Hooks/Actions config panels in Studio Data tab#2344
Merged
Merged
Conversation
…els in Studio Data tab The object Validations, Hooks and Actions sub-tabs of the Studio Data pillar are now no-code config panels driven by the corresponding metadata, each able to create new entries: - Validations: author every spec rule type — not just `script` but also `cross_field`, `state_machine`, `format`, `json_schema` and `conditional` (previously read-only "maintain in code"). The New menu adds any type seeded with a valid never-firing skeleton, and a rule's type is switchable in place (replacing stale type-specific keys). CEL predicates reuse the shared ConditionBuilder fed the object's draft fields. - Hooks: feed the live `hook` JSONSchema from /meta/types to SchemaForm instead of synthesising a form from the value shape. - Actions: pass the live `action` JSONSchema to ActionDefaultInspector as serverSchema so its "More fields" section can edit any uncurated property. DataPillar resolves the per-type schemas once (useMetadataTypes) and passes them down. Updates the Validations panel tests and console guide docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LnU2XsAYisR96vUMCqfWVm
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…unction editor Browser-testing the Studio Data → Hooks tab surfaced two gaps in the generic SchemaForm: the target object could not be *selected* (it rendered as a free-text box), and the handler function had no dedicated code input. Add a curated HookDefaultInspector (registered for `hook`, mirroring ActionDefaultInspector) and use it in ObjectHooksPanel: - Object(s) this hook fires on — a multi-select PICKER (checkbox list of objects + an "All objects (*)" toggle), normalising to the spec `string | string[] | '*'` shape; an already-selected object missing from the live catalog is preserved so it is never dropped. - Events — grouped write/query lifecycle-event checkboxes. - Function — language (expression / sandboxed JS) + a dedicated handler-body code editor. - Options — priority, async, and a CEL run condition (ConditionBuilder). - Advanced props fall through to a SchemaForm fed the live `hook` JSONSchema. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LnU2XsAYisR96vUMCqfWVm
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
What & why
Under an object in Studio's Data pillar (
/studio/:packageId/data), the Validations, Hooks and Actions sub-tabs should each be a config panel driven by the corresponding metadata and support adding new entries. Actions already had a type-aware inspector; Validations and Hooks lagged. This brings all three to that bar.Changes
Validations (
ObjectValidationsPanel.tsx) — wasscript-only, with every other rule type surfaced read-only ("maintain in code"). Now authors every specValidationRuleSchematype:scriptConditionBuilder)cross_fieldstate_machineformatjson_schemaconditionalthen/otherwise(JSON)The New menu adds any type (seeded with a valid, never-firing skeleton so the object-draft save never 422s); a rule's type is switchable in place, replacing stale type-specific keys.
Hooks (
ObjectHooksPanel.tsx) —SchemaFormis now fed the livehookJSONSchema from/meta/typesinstead of synthesising a form from the value shape, so its fields/enums match the running server's contract.Actions (
ObjectActionsPanel.tsx) —ActionDefaultInspectornow receives the liveactionJSONSchema asserverSchema, so its "More fields" section can edit any uncurated spec property.Wiring (
StudioDesignSurface.tsx) —DataPillarresolves per-type schemas once viauseMetadataTypesand passeshookSchema/actionSchemadown.Also: new
engine.studio.rules.*i18n keys (en-US + zh-CN), rewritten Validations panel tests, and a console guide section documenting the Data-tab config panels.Testing
packages/app-shellunit tests: 1047 passed (9 new/rewritten Validations tests).type-check: clean across all 29 packages.react-hooks/static-componentserrors are the repo's pre-existinggetIcon/inspector-in-render baseline, unchanged by this PR).../frameworkbackend is available in this environment, so a full click-through E2E wasn't run; panels are exercised via render/interaction tests.Notes
Validations and Actions persist with the object's own Save draft; Hooks (a distinct metadata type) save per-hook. Nothing goes live until the package is published.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LnU2XsAYisR96vUMCqfWVm
Generated by Claude Code