feat(studio): group-properties inspector in the form-layout designer#2347
Draft
os-zhuang wants to merge 1 commit into
Draft
feat(studio): group-properties inspector in the form-layout designer#2347os-zhuang wants to merge 1 commit into
os-zhuang wants to merge 1 commit into
Conversation
Field groups (sections) in Studio's Data → Form → Layout designer could only be
renamed inline — a group had no way to reach its other properties. Each group
header now carries a settings affordance that selects the group into a dedicated
"Group properties" inspector in the right rail, mirroring the field inspector.
The inspector edits the group name and its collapse behaviour — the
spec-canonical `collapse` enum (none / collapsible-expanded /
collapsible-collapsed) that the form renderer consumes via `@objectstack/spec`'s
`deriveFieldGroupLayout`, so the setting takes effect in the actual form/preview.
`readGroups` now preserves all authored group props (icon/description/collapse/…)
instead of narrowing to {key,label}, so a read-modify-write round-trip never
silently drops a property the source set; a new `updateGroup` helper merges a
patch onto one group (dropping keys whose value is undefined so resetting a
default leaves no stale key). icon/description are round-trip-preserved but not
surfaced as controls yet — no renderer consumes them, so no dead metadata.
Selection reuses the existing `fieldSel` plumbing with `kind: 'group'`; the aside
renders ObjectGroupInspector for a group and the shared ObjectFieldInspector for
a field. Adds component tests (group model, inspector, gear selection).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXGMsdYavB3hsjN8aRa2p4
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
Summary
Field groups (sections) in Studio's Data → Form → Layout designer could only be renamed inline — a group had no way to reach its other properties (fields, by contrast, open a full inspector). This adds a Group properties inspector.
Each group header now carries a settings (gear) affordance that selects the group into a dedicated inspector in the right rail, mirroring the field inspector. The inspector edits:
collapseenum (none/ collapsible-expanded / collapsible-collapsed) that the form renderer consumes via@objectstack/spec'sderiveFieldGroupLayout, so the setting takes effect in the actual form/preview.What changed
object-fields-io.ts—readGroupsnow preserves all authored group props (icon/description/collapse/…) instead of narrowing to{key,label}, so a read-modify-write round-trip (rename/reorder/inspector edit) never silently drops a property the source set. NewupdateGroup(groups, key, patch)helper merges a patch onto one group and drops keys whose value isundefined(so resetting a default likecollapse: 'none'leaves no stale key).ObjectGroupInspector.tsx(new) — the panel, built from the shared inspector primitives (InspectorShell/InspectorTextField/InspectorSelectField), consistent withObjectFieldInspector.ObjectFormDesigner.tsx— a gear button per declared group + selection highlight; newselectedGroup/onSelectGroupprops.StudioDesignSurface.tsx— selection reuses the existingfieldSelplumbing withkind: 'group'; the aside rendersObjectGroupInspectorfor a group and the sharedObjectFieldInspectorfor a field.en-US+zh-CN.icon/descriptionexist on the spec but no renderer consumes them yet, so they are round-trip-preserved but not surfaced as controls (no dead metadata, per the repo's contract-first rule).Verification
object-fields-io(readGroups preserves extras;updateGroupset/remove/no-op),ObjectGroupInspector(renders name + collapse, name edit preserves collapse, empty state, readOnly),ObjectFormDesigner(gear selects group by key; hidden without a handler).turbo run type-checkfor@object-ui/app-shell— 29/29 pass.collapse: "collapsed"to only that group'sfieldGroupsentry, leaving siblings untouched.set-state-in-effectwarning, untouched).A changeset is included (
@object-ui/app-shell, minor).🤖 Generated with Claude Code
https://claude.ai/code/session_01JXGMsdYavB3hsjN8aRa2p4
Generated by Claude Code