Uh oh!
There was an error while loading. Please reload this page.
docs(ui): name the 5 remaining nameless form sections in content/docs/ui - #10827
Merged
Conversation
A section without `name` has no i18n anchor: the heading resolves through `objects.<object>._sections.<name>.label`, so a nameless section renders its authored label in every locale. `name` is `.optional()` in the schema, so nothing rejects these — they are valid, just silently un-localizable. Adds `name` to the five section literals under content/docs/ui/** that still lacked one, following the convention the already-named examples in these same files establish: snake_case, derived from the label, placed first in the literal (ahead of `label`). forms.mdx 'Tell us about yourself' -> about_you forms.mdx 'About you' -> about_you forms.mdx 'Lead' -> lead views.mdx 'Basic Information' -> basic_information views.mdx 'Details' -> details No section that already had a `name` is renamed, no example restructured, no surrounding prose touched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
os-zhuang
marked this pull request as ready for review
August 21, 2026 13:18
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#10709
A form section without
namehas no i18n anchor: the heading resolves throughobjects.<object>._sections.<name>.label, so a nameless section renders its authoredlabel in every locale. This adds the missing
nameto the section examples undercontent/docs/ui/**that still lacked one.Is
namerequired, or conventional?Conventional — not schema-required.
packages/spec/src/ui/component.zod.ts:825:So these examples were valid, not invalid — the weaker framing is the correct one.
What nudges authors is
packages/lint'stranslation-section-name-missing(
packages/lint/src/validate-translatable-sections.ts:95), and its severity is'warning'— "one heading stays in the source locale; nothing breaks".That also answers why nothing caught these. Two mechanisms could have, and neither can:
collectionEntries,walkPageComponents,viewContainerSites. It never sees an.mdxcode fence.{/* os:check */}fences are type-checked against the live spec bypackages/spec/scripts/check-skill-examples.ts— andforms.mdx's first block ismarked. But because
nameis.optional(), a nameless section type-checks clean.So the docs could drift from the convention indefinitely without a single gate reddening.
The census — re-derived, and it differs from the card
Multi-line-aware: bracket-match each
sections: [ … ], split into top-level objectliterals, check each for a
namekey at its own depth-1. (Script:/tmp/.../issue-10709/census.py, reproduced in the issue report.)sections: [arrayb6bb2ee454^)f4e5d916d6)The card undercounted by exactly one, and it is
content/docs/ui/forms.mdx:244(label: 'About you'). That literal is writtensections: [{— the opening brace on the same line as the[. The card's scan wasmulti-line-aware enough to find the sites its predecessor #10579 missed, but still
required
{to start a fresh line, so it reproduced a smaller copy of the sameinstrument error it was filed to correct. Per the dispatch ("trust yours and say so"),
this PR fixes five sites, not four.
Per-page, on this PR's base:
forms.mdx3 nameless of 3 ·views.mdx2 of 5 ·create-vs-edit-form.mdx0 of 5 ·field-grouping-and-order.mdx0 of 2 ·public-data-collection.mdx0 of 1. After: 0 of 16.(Two further
sections: [arrays informs.mdxare elided —[/* … */]— and hold noobject literals, so they carry no
nameto add. Counted as arrays, not as examples.)Sites, before and after
forms.mdx:68Tell us about yourselfname: 'about_you'forms.mdx:244About youname: 'about_you'← not in the card's tableforms.mdx:328Leadname: 'lead'views.mdx:352Basic Informationname: 'basic_information'views.mdx:363Detailsname: 'details'Whole diff is +5 lines, 0 deletions.
The naming convention followed
Not invented — read off the 11 already-named sections in these same files. It is
consistent, so there was no dominant form to choose between:
label— all 11 do thisThe single-word noun labels transliterate directly, which fixes four of the five:
views.mdx:53{ name: 'task', label: 'Task' },views.mdx:475name: 'details', label: 'Details'(same file, same spelling this PR givesviews.mdx:363), pluscontact/work/status/notesincreate-vs-edit-form.mdx:69-72.The two
about_yousites lean on a stronger precedent than convention:public-data-collection.mdx:24already carries{ name: 'about_you', label: 'Tell us about yourself' }— the identical label, for thesame public
contact-usform thatforms.mdx:68documents. That is the siblingdeclaration, not a guess.
basic_informationis the only judgment call. Rejected:basics, which has realrepo precedent (
packages/cli/test/i18n-section-coverage.test.ts:372uses{ name: 'basics', label: 'Basic Information' }, and app-showcase hasstep_basics/'Basics'). Chosen against because withincontent/docs/ui/**theshortening rule applies only to interrogative sentence labels (
'Who is this?'→who,'Tell us about yourself'→about_you); every noun-phrase label transliterateswhole, including the two-word case (
'Budget & Schedule'→budget_scheduleinapp-showcase).
Basic Informationis a noun phrase.Scope
#10579's three sites (
views.mdx:53,create-vs-edit-form.mdx:82,public-data-collection.mdx:24) are untouched — all three were already addressed by the#10616 sweep (
b6bb2ee454) and stay as that card left them. No section that already had anameis renamed, no example restructured, no surrounding prose edited.Verification
node scripts/pm/dispatch-gates.mjs(no paths — it derives its own change set) named 14families for
content/docs/ui/{forms,views}.mdx. All 14 run green at3b9d3ecce1,the final commit; exit codes captured before any pipe (
cmd > file 2>&1; ec=$?):check:doc-formula-expressionsfailed once on first run withERR_MODULE_NOT_FOUND: @objectstack/formula/dist/index.mjs— the unbuilt dependencyclosure in a fresh worktree, not this change. After
pnpm --filter '@objectstack/lint^...' buildit reportsself-test: 30 cases passedand22 record-scoped formula example(s) across 416 files / 1443 TS blocks judged clean.No ablation applies — this is docs-only with no guard under test, so there is nothing
to mutate and re-measure. Correctness is carried by the census re-run instead: 5 nameless
before the edit, 0 after, same script, same tree.
Control-character scan of both changed files:
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]'→ exit 1, no matches.skip-changeset: confirmed for the files actually touched, not defaulted —content/docs/**is consumed only byapps/docs, whosepackage.jsonis"private": true. Nothing publishes.Lint & Repo Gatesmay be red fromscripts/pm/git-history.mjs --self-test(#10807,patch in flight as #10811) — pre-existing on
main, unrelated to this PR.Generated by Claude Code
Generated by Claude Code