Repository navigation
Commit b01bdbc
docs(spec): describe the form-section collapse pair on both keys (#19736)
Fixes #19311
Clause-②: no
Why that reading: two `.describe()` strings and one TSDoc block. No key
is added, removed or re-typed, no closed set gains a member, no export
moves and no refinement changes. `check:authorable-surface` and
`check:api-surface` are both green with no delta, and the wizard-step
and `group` co-declaration refusals parse identically before and after.
Grade: `patch`, measured below rather than pattern-matched.
## The defect, re-derived on `origin/main` rather than taken on trust
`FormSectionSchema` declares two authorable booleans with **no
`.describe()` at all**, between neighbours that have one:
```
packages/spec/src/ui/view.zod.ts:3315 collapsible: z.boolean().default(false),
packages/spec/src/ui/view.zod.ts:3316 collapsed: z.boolean().default(false),
```
**Lit control, same file, same instrument:** `view.zod.ts:1054` reads
`collapsed: z.boolean().default(false).describe('Collapse groups by
default (presentation only)')` — a different schema (group-by
presentation). So a describe on a key of this name IS visible to the
grep, and the zero at `:3315–3316` is a reading, not a blind spot.
**Dark control:** `git grep -n "collapsedd"` over the same file → 0
hits, exit 1.
Downstream of that silence, the generated page printed two empty
Description cells (`content/docs/references/ui/view.mdx:334-335`, and
again at `:466-467` and `:482-483`, the three places that page projects
this schema).
**This is NOT the surface the first increment landed on.** PR #19699
(merged `fa29803417`) corrected
`packages/spec/src/data/object.zod.ts:1220` — the `ObjectFieldGroup`
pair, a different schema in a different file, which is why it merged as
`Part of`. Both keys of **this** pair are described here, not just
`collapsed`: describing one of a silent pair recreates the ambiguity one
key over.
## Probe — every sentence measured against the BUILT package
Built with `pnpm --filter @objectstack/spec build`, then probed through
the module the `exports` map resolves
(`require.resolve('@objectstack/spec/ui')` →
`packages/spec/dist/ui/index.js`, printed in the same run).
### A. `FormSectionSchema.safeParse`, one section, all four combinations
| authored | `collapsible` out | `collapsed` out |
| :--- | :--- | :--- |
| neither — **CONTROL (lit)**: default arm must fire | `false` | `false`
|
| `collapsible: true` | `true` | `false` |
| `collapsible: false` | `false` | `false` |
| `collapsed: true` | `false` | `true` |
| `collapsed: false` | `false` | `false` |
| both `true` | `true` | `true` |
| `collapsed: true` + `collapsible: false` | `false` | `true` |
| `collapsed: false` + `collapsible: true` | `true` | `false` |
| both `false` | `false` | `false` |
| `collapsable: true` — **CONTROL (dark)** | REFUSED `unrecognized_keys`
| — |
| `collapsed: 'true'` — **CONTROL (dark)** | REFUSED
`invalid_type@collapsed` | — |
Both lit and both dark controls answered as predicted, so the nine
readings are measurements.
### B. The normalizer question the dispatch asked — answered NO
There is no normalizer, no parse wrapper and no fold between these two
keys. `{ collapsed: true }` parses to `{ collapsible: false, collapsed:
true }`, verbatim, with both keys present in the output
(`.default(false)`), and `safeParseAsync` returns the same. The
section's only `.transform` is `normalizeVisibleWhen`, which touches
`visibleOn` and nothing else.
⇒ That is the **precision limit**, and it is stated in the text rather
than left implied: the implication `collapsed` ⇒ `collapsible` is a
**renderer** rule applied from the declaration, never a parse-time
rewrite. The describes say so explicitly, and say that the parsed
`collapsible` must never be read as "a disclosure control renders". This
is the exact opposite of the `ObjectFieldGroup` pair, where a real
parse-time mapping folds the booleans onto the ADR-0085 `collapse` enum
— the two surfaces share key names and share nothing else, so the
describes name that difference.
### C. The two refusals the describes claim
| input | wizard form | beside `group` |
| :--- | :--- | :--- |
| `collapsed: true` | REFUSED at `sections.0.collapsed` | REFUSED at
`collapsed` |
| `collapsible: true` | REFUSED at `sections.0.collapsible` | REFUSED at
`collapsible` |
| `collapsed: false` | ACCEPTED | ACCEPTED |
| `collapsible: false` | ACCEPTED | ACCEPTED |
| neither — **CONTROL (lit)** | ACCEPTED | ACCEPTED |
| `simple` form + `collapsed: true` — **CONTROL (lit)** | ACCEPTED (the
refusal is wizard-only) | — |
| `group` + `fields` — **CONTROL (dark)** | — | REFUSED at `group` |
1 parent af4f8ee commit b01bdbc
3 files changed
Lines changed: 78 additions & 8 deletions
File tree
- .changeset
- content/docs/references/ui
- packages/spec/src/ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
| 334 | + | |
| 335 | + | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
467 | | - | |
| 466 | + | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
| 482 | + | |
| 483 | + | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3312 | 3312 | | |
3313 | 3313 | | |
3314 | 3314 | | |
3315 | | - | |
3316 | | - | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
3317 | 3365 | | |
3318 | 3366 | | |
3319 | 3367 | | |
| |||
0 commit comments