Skip to content

Commit f53a8d0

Browse files
fix(react): carry the 18 form-view spec keys the bridge silently dropped (#6365)
`spec-bridge/bridges/form-view.ts` states in its own docblock that "every serializable spec key is either mapped onto the `object-form` node or listed here with an explicit reason for being ignored — the bridge must never silently drop spec configuration (#2545)". Measured against `@objectstack/spec` 17.2.0 that was false for 18 keys: 2 on `FormViewSchema`, 2 on `FormSectionSchema`, 14 on `FormFieldSchema`. Seventeen have a real destination the receiving layer already reads, so they are mapped; the eighteenth is an explained refusal, which is what "not silently" asks for: buttons / defaults -> `ObjectFormSchema` declares both slots and `ObjectForm` folds them at render. section.pane -> `ObjectFormSection.pane`, read by `SplitForm`'s `paneOf`; dropped, every authored placement fell back to the positional rule. section.visibleOn -> folded onto `visibleWhen`, reproducing the contract's own `normalizeVisibleWhen` for the never-parsed input class this bridge serves. 13 field keys -> same-name copies onto the runtime FormField, at the destinations `normalizeSectionField` already pins. field.publicPicker -> NOT carried: a server-side public-lookup authorization opt-in with no client destination. The conformance test is why it stayed green: its completeness loop iterated `Object.keys(FIXTURE)`, so a key nobody remembered to write into the fixture was a key it never asked about. Its key set is now derived from the contract's own shape at all three levels, every key must be claimed by a behavioral row or a reasoned ignore entry, and the fixture is asserted spec-valid before any row runs. Claude-Session: https://claude.ai/code/session_011SfZeFWrhGLHmfq61xbz4q Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9180fd1 commit f53a8d0

3 files changed

Lines changed: 558 additions & 96 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
'@object-ui/react': patch
3+
---
4+
5+
fix(react): stop the form-view bridge silently dropping 18 spec keys
6+
7+
`spec-bridge/bridges/form-view.ts` promised (#2545) that "every serializable
8+
spec key is either mapped onto the `object-form` node or listed here with an
9+
explicit reason for being ignored". Measured against `@objectstack/spec` 17.2.0
10+
the promise was false for 18 keys, because the conformance test enforcing it ran
11+
its completeness loop over its own hand-written fixture rather than the
12+
contract's key set.
13+
14+
Seventeen of them now reach the node, at the destinations the receiving layer
15+
already reads:
16+
17+
- `FormViewSchema.buttons` / `.defaults` — `ObjectFormSchema` declares both and
18+
`ObjectForm` folds them at render (action-button visibility/labels, and
19+
create-mode initial values).
20+
- `FormSection.pane` — explicit split-pane placement; without it a spec-authored
21+
split form fell back to the positional rule, so reordering sections moved them
22+
across the divider.
23+
- `FormSection.visibleOn` — the deprecated spelling now folds onto `visibleWhen`,
24+
matching the contract's own parse-time normalisation and the field path.
25+
- Thirteen `FormFieldSchema` keys — `maxLength`, `minLength`, `min`, `max`,
26+
`precision`, `scale`, `multiple`, `immutable`, `span`, `language`, `keyField`,
27+
`disclosure`, `fields` — so authored constraints, composite config and field
28+
width survive the bridge instead of ending there.
29+
30+
`publicPicker` is deliberately not carried and now says so: it is a server-side
31+
public-lookup authorization opt-in with no client destination.
32+
33+
The conformance test's key set is now derived from the contract's own shape at
34+
all three levels, so a spec key that is neither mapped nor explained fails the
35+
suite by construction.

0 commit comments

Comments
 (0)