Skip to content

Commit f1c8d79

Browse files
committed
docs(objectui): give every YAML form-section example a name i18n anchor
Sweep of the 13 nameless form-section mappings in YAML fences under content/docs/protocol/objectui/**, re-derived with the `yaml` parser on 787d757. A nameless section has no i18n anchor -- its heading resolves through `objects.OBJECT._sections.NAME.label`, so it renders its authored label in every locale. Names are the snake_case of each label; the one deviation is the section labelled "Name" in layout-dsl.mdx, named `full_name` so the teaching example does not read `name: name` beside a `name` field. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
1 parent 787d757 commit f1c8d79

3 files changed

Lines changed: 26 additions & 13 deletions

File tree

content/docs/protocol/objectui/concept.mdx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,15 @@ name: customer_edit
114114
object: customer
115115
layout:
116116
sections:
117-
- label: Contact Information
117+
- name: contact_information
118+
label: Contact Information
118119
columns: 2
119120
fields:
120121
- name
121122
- email
122123
- phone
123-
- label: Address
124+
- name: address
125+
label: Address
124126
columns: 1
125127
fields:
126128
- street
@@ -568,15 +570,18 @@ Show complexity only when needed:
568570
# Simple form for most users
569571
layout:
570572
sections:
571-
- label: Basic Info
573+
- name: basic_info
574+
label: Basic Info
572575
fields: [name, email, phone]
573576

574577
# Advanced section (collapsed by default)
575578
layout:
576579
sections:
577-
- label: Basic Info
580+
- name: basic_info
581+
label: Basic Info
578582
fields: [name, email, phone]
579-
- label: Advanced Settings
583+
- name: advanced_settings
584+
label: Advanced Settings
580585
collapsed: true
581586
fields: [api_key, webhook_url, rate_limit]
582587
```

content/docs/protocol/objectui/index.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ object: customer
165165
mode: edit
166166
layout:
167167
sections:
168-
- label: Basic Information
168+
- name: basic_information
169+
label: Basic Information
169170
columns: 2
170171
fields:
171172
- name
@@ -369,7 +370,8 @@ All layouts use a 12-column grid that adapts automatically:
369370

370371
```yaml
371372
sections:
372-
- label: Contact Info
373+
- name: contact_info
374+
label: Contact Info
373375
columns: 2 # Desktop: 2 columns, Tablet: 1 column, Mobile: 1 column
374376
fields:
375377
- email
@@ -429,7 +431,8 @@ name: customer_edit
429431
object: customer # ← References ObjectQL schema
430432
layout:
431433
sections:
432-
- fields: [name, email, status] # ← Fields auto-validated
434+
- name: basic_information
435+
fields: [name, email, status] # ← Fields auto-validated
433436
```
434437

435438
**What ObjectUI Inherits from ObjectQL:**

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ Sections are collapsible containers for related fields.
342342
{/* os:check-yaml FormSectionSchema[] key=sections */}
343343
```yaml
344344
sections:
345-
- label: Contact Information
345+
- name: contact_information
346+
label: Contact Information
346347
collapsible: true
347348
collapsed: false # Expanded by default
348349
fields:
@@ -370,10 +371,12 @@ Show sections based on field values. The key is **`visibleWhen`** and its value
370371
{/* os:check-yaml FormSectionSchema[] key=sections */}
371372
```yaml
372373
sections:
373-
- label: Basic Info
374+
- name: basic_info
375+
label: Basic Info
374376
fields: [name, email]
375377

376-
- label: Billing Information
378+
- name: billing_information
379+
label: Billing Information
377380
visibleWhen: "record.account_type == 'premium'" # Only show for premium accounts
378381
fields: [payment_method, billing_address]
379382
```
@@ -434,15 +437,17 @@ a field widens itself with `span: full`:
434437
{/* os:check-yaml FormSectionSchema[] key=sections */}
435438
```yaml
436439
sections:
437-
- label: Name
440+
- name: full_name
441+
label: Name
438442
columns: 2 # first_name and last_name share a row
439443
fields:
440444
- field: first_name
441445
placeholder: First
442446
- field: last_name
443447
placeholder: Last
444448
445-
- label: Address
449+
- name: address
450+
label: Address
446451
columns: 3
447452
fields:
448453
- field: street

0 commit comments

Comments
 (0)