feat(form): SplitForm honours the spec's new FormSection.pane - #3041
Merged
Conversation
A split form's panel assignment was a hardcoded positional rule — first section left, everything else right (slice(0,1)/slice(1)). The rule was invisible in the metadata: nothing in the JSON records the assignment, so reordering sections silently moved them across the divider, and an author (human or AI) could not place two sections in the left pane at all. Sections now declare their panel: `pane: 'primary' | 'secondary'` (@objectstack/spec FormSection.pane, objectstack#4160). Placement follows the KEY, not the array position — reordering paned sections never changes the layout. Omitted keys keep the exact legacy rule (first section primary, rest secondary), so existing metadata renders unchanged. ObjectForm's split dispatch copies the key through its per-key section mapping — the path that once silently dropped `visibleOn` — and ObjectFormSection declares it (it is the "aligns with spec FormSection" runtime type). The spec side rejects `pane` on non-split form types at parse, so the key can never be an accepted-but-ignored no-op. Tests (verified failing against the unfixed renderer first — 3 red / 9 green): sections group by declared pane not position (two sections side by side in the primary pane, previously inexpressible); reversing the section array changes nothing; ObjectForm forwards the key through its mapping. No compile-time dependency on the new spec version — the key arrives as plain JSON — but objectstack#4160 merges first per cross-repo convention. 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 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.
ObjectUI half of objectstack#4160 — closes out the last item from the #2153 follow-up list (the hardcoded
slice(0,1)/slice(1)pane split).What
Sections declare their panel:
pane: 'primary' | 'secondary'(specFormSection.pane). Placement follows the key, not the array position; omitted keys keep the exact legacy rule (first sectionprimary, restsecondary), so existing metadata renders unchanged.Design rationale lives in the spec PR: the positional rule was invisible in the metadata — reordering sections silently moved them across the divider (the class of implicit rule AI authors reliably trip over), and two sections in the left pane was inexpressible. The value names map 1:1 onto
fieldPanes' existing pane keys (#3012), soSplitForm's change is afilterby resolved pane replacing twoslices.Also:
ObjectFormSection(the "aligns with spec FormSection" runtime type in@object-ui/types) declares the key.ObjectForm's split dispatch copies it through its per-key section mapping — the path that once silently droppedvisibleOn; there's now a test pinning the copy.paneon non-split form types at parse, so the key can never be accepted-but-ignored.Tests
3 new cases in
sectionedFormValues.test.tsx, verified failing against the unfixed renderer (3 red / 9 green baseline):ObjectFormforwards the key through its mapping.39 files / 303 tests green across
plugin-form+ the form renderer;turbo type-checkgreen; lint 0 errors.No browser pass this time: the paths exercised (pane grouping →
fieldPanes, panel rendering) are exactly the ones browser-verified in #3012; this PR changes which sections land in which group, which the DOM assertions cover.Sequencing
No compile-time dependency on the new spec version (the key arrives as plain JSON; the type is objectui's own), so CI is green independently — but objectstack#4160 merges first per cross-repo convention. Server-served metadata carries
paneonly once the framework deploys the new spec.🤖 Generated with Claude Code