fix(spec-bridge/form): stop dropping spec FormViewSchema keys; normalize legacy groups → sections (#2545)#2552
Merged
Conversation
…normalize legacy groups → sections From the #2545 evaluation against the published @objectstack/spec package (14.6.0 / 15.0.0 — identical FormViewSchema key sets): type-level alignment was already ~80% done, but the bridge pipeline silently dropped spec configuration and the legacy `groups` key was dead in the renderer. - spec-bridge form-view: pass through all same-name spec keys (layout, columns, title, description, defaultTab, tabPosition, allowSkip, showStepIndicator, split*, drawer*, modalSize, subforms); mapField now preserves type/options/reference; mapSection now preserves name (i18n anchor), description, and visibleWhen (ADR-0089) - groups → sections normalization at both consumers: the bridge folds spec `groups` (legacy alias per spec source) into `sections`; ObjectForm derives sections from a groups-only schema (title→label, defaultCollapsed→collapsed) — previously such metadata silently rendered an ungrouped form - ObjectView.buildFormSchema: forward `form.sections` (was dropped) - types: @deprecated on ObjectFormSchema.groups + key taxonomy header ([spec-aligned] / [ObjectUI extension] / [runtime-only]) - docs: ObjectFormSchema reference gains a "Spec alignment & extension keys" section; example fixed to use section `label` and drop the misleading groups block - tests: FormViewSpecConformance round-trip (every spec key mapped or explicitly ignored with reason), groups-alias rendering + precedence, updated the old pass-groups-through bridge test to the normalized behavior Refs #2545. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ln4gqtxXuymoQmyy4iRM2z
|
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.
Phase 1 + 2 of #2545 (ObjectFormSchema ↔ spec
FormViewSchemaalignment), based on auditing the published@objectstack/specpackage (14.6.0 / 15.0.0 — identicalFormViewSchemakey sets).Problem
The evaluation in #2545 found type-level alignment was already ~80% done, but two pipeline gaps silently lost spec configuration:
bridgeFormViewonly mappedsections/groups/formType/data/defaultSort/submitBehavior/sharing/aria— spec-conformant view JSON lostlayout,columns,title,description, all tabbed/wizard/split/drawer/modal options, andsubforms.mapFielddroppedtype/options/reference;mapSectiondroppedname(i18n anchor),description, andvisibleWhen(ADR-0089).groupswas a dead key. Spec source definesgroupsas "Legacy support → alias to sections", but ObjectForm only consumessections— a groups-only schema silently rendered an ungrouped form, while the bridge and ObjectView passed the key around to nowhere.Changes
packages/react/src/spec-bridge/bridges/form-view.ts: pass through every same-name spec key (PASSTHROUGH_KEYS);mapField+type/options/reference;mapSection+name/description/visibleWhen; foldgroupsintosections(prefersectionswhen both set) and stop emitting the deadgroupskey.packages/plugin-form/src/ObjectForm.tsx: normalize a groups-only schema intosectionsbefore FLS gating (legacy shape:title→label,defaultCollapsed→collapsed) — legacy metadata now actually renders grouped.packages/plugin-view/src/ObjectView.tsx:buildFormSchemaforwardsform.sections(previously dropped).packages/types/src/objectql.ts:@deprecatedonObjectFormSchema.groups; key-taxonomy header ([spec-aligned]/[ObjectUI extension]/[runtime-only]).content/docs/api/schema-reference.md: new "Spec alignment & extension keys" section for ObjectFormSchema; example fixed (sectionlabel, misleadinggroupsblock removed);groupsdocumented as deprecated alias.Tests
FormViewSpecConformance.test.ts: a fixture carrying every top-level spec FormViewSchema key round-trips through the bridge — each key must land on the node or be explicitly listed inIGNORED_SPEC_KEYSwith a reason (no silent drops); plus section/field detail assertions and groups→sections normalization/precedence.groupsAlias.test.tsx(plugin-form): groups-only schema renders its group as a section;sectionswins when both are declared.types/react/plugin-form/plugin-viewbuilds clean.Not in this PR (later phases of #2545): upstreaming button-config/
initialValuesinto the spec (framework repo), spec pin bump to ^15 + CI spec installation, FormRenderer dual-path convergence.Refs #2545.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ln4gqtxXuymoQmyy4iRM2z
Generated by Claude Code