Skip to content

Commit fb218e6

Browse files
committed
docs(objectui): give the 3 singular section: examples in layout-dsl.mdx a name anchor
`layout-dsl.mdx` teaches form sections both as a `sections:` sequence and as a singular `section:` mapping. The sequence examples were given `name` anchors in the YAML-arm sweep; the three singular ones were outside that population and stayed nameless, so each renders its authored label in every locale on a page whose job is to teach the opposite. The third site is not a copy of the other two -- it carries no `label:` at all, so it takes a descriptive `name` and no invented label: the "Rendered Grid" diagram directly below it draws no section header. `FormSectionSchema.name` stays `.optional()`; no schema moves. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
1 parent 8c6a7fc commit fb218e6

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
"@objectstack/docs": patch
3+
---
4+
5+
fix(docs): give the three singular `section:` form-section examples in `layout-dsl.mdx` a `name` i18n anchor (#13759)
6+
7+
`content/docs/protocol/objectui/layout-dsl.mdx` teaches form sections twice over: as a
8+
`sections:` **sequence**, and as a singular `section:` **mapping** — one section on its
9+
own. The sequence examples were given `name` anchors in the sweep that added the gate's
10+
YAML arm (#13761); the three singular ones were outside that sweep's population and stayed
11+
nameless. `FormSectionSchema.name` is the "Stable identifier for translation lookup", so a
12+
nameless section has no anchor and renders its authored label in every locale — on pages
13+
whose whole job is to teach the convention.
14+
15+
Three sites, and they are **not** three copies of one edit:
16+
17+
| fence | before | added |
18+
|:---|:---|:---|
19+
| `### Basic Grid Layout` | `label: Contact Information` | `name: contact_information` |
20+
| `### Custom Span Widths` | `label: Product Details` | `name: product_details` |
21+
| `### Responsive Breakpoints` | **no `label:`** — only `columns:` + `fields:` | `name: responsive_grid` |
22+
23+
The first two take the snake_case of their own label, which is the convention #13761 used
24+
for the sequence examples on this same page (`contact_information`, `basic_info`,
25+
`billing_information`). The third has no label to snake_case: it is deliberately minimal so
26+
the breakpoint discussion is about `columns` collapsing, and none of the three fences' ASCII
27+
"Rendered Grid" diagrams draw a section header. So it gets a descriptive `name` and **no
28+
invented `label:`** — adding one would have desynchronised the diagram directly below it,
29+
and the i18n symptom the other two carry does not even arise for a section with no heading
30+
to mis-render.
31+
32+
`FormSectionSchema.name` stays `z.string().optional()` — no schema moves here, per #10709
33+
and #10830.
34+
35+
**These three sites are correct now and still unguarded**, deliberately.
36+
`check-docs-section-name` judges `sections:` sequences in both of its arms; a singular
37+
`section:` mapping is outside both, which is how these three drifted in the first place.
38+
Widening the gate means deciding which YAML keys introduce a form section at all — a
39+
population question fenced out of this PR by the #13759 triage ruling and filed separately.

content/docs/protocol/objectui/layout-dsl.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ All layouts use a responsive grid that divides space into columns.
232232
{/* os:check-yaml FormSectionSchema key=section */}
233233
```yaml
234234
section:
235+
name: contact_information
235236
label: Contact Information
236237
columns: 2 # two fields per row (50% width each)
237238
fields:
@@ -260,6 +261,7 @@ field from its widget type and the current column count.
260261
{/* os:check-yaml FormSectionSchema key=section */}
261262
```yaml
262263
section:
264+
name: product_details
263265
label: Product Details
264266
columns: 3
265267
fields:
@@ -292,6 +294,7 @@ Grid automatically collapses on smaller screens:
292294
{/* os:check-yaml FormSectionSchema key=section */}
293295
```yaml
294296
section:
297+
name: responsive_grid
295298
columns: 3 # Desktop: 3 columns, Tablet: 2 columns, Mobile: 1 column
296299
fields: [field_a, field_b, field_c, field_d, field_e, field_f]
297300
```

0 commit comments

Comments
 (0)