Repository navigation
docs(spec): a form section's translation TSDoc names both addresses — objects.OBJECT._sections for an object form view, metadataForms for a metadata form - #23815
Conversation
…he `_sections` readers
`FormSectionSchema.name`'s TSDoc sent every form section to
`metadataForms.<type>.sections.<name>`, which holds only for a metadata-editing
form (`defineForm({ schemaId })`, `resolveMetadataFormLabels`). An object-bound
form view's section is keyed at `objects.<object>._sections.<name>`. The TSDoc
now names both addresses and which form each serves; the group-key comment on
the same schema names the object anchor `deriveFieldGroupLayout` keys.
`TranslationDataSchema._sections` named `record:details` as its only reader.
It now names the three surfaces that author a key there and the three readers
on main (`walkObjectSections`, `collectViewRecord`, `translateView`).
`translateFormSections`' docblock said all three rules were its siblings'.
The authored-copy rule is the sections' own, and the sentence now says so.
Comments only: no `.describe()`, no schema, no code.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RD4nZChNGxRzyyWJtvZ8NJ
The edited TSDoc ships: `src/**/*.zod.ts` is in `@objectstack/spec`'s `files[]`, and the new view and translation docblocks appear in the built `dist/**` bundles. So the diff publishes, and it takes a patch changeset rather than `skip-changeset`. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RD4nZChNGxRzyyWJtvZ8NJ
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 142 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 61ef6fe9df483afd93c6aa462786ce01e943153b && git checkout 61ef6fe9df483afd93c6aa462786ce01e943153b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f846cc20202e580fa477e01a9cf11adac106d098 e7ac53b9a1393fb5ea9bf7699a0630566d01d708 && git checkout -B drift-repro f846cc20202e580fa477e01a9cf11adac106d098 && git merge --no-ff e7ac53b9a1393fb5ea9bf7699a0630566d01d708
node scripts/docs-audit/affected-docs.mjs --json f846cc20202e580fa477e01a9cf11adac106d098
|
…ug section lookup The docblock said a section without a stable `name` is returned unchanged for section-level attributes. `translateSection` does otherwise: with no `name` it looks the section up under a slug of its string `label`, and only a section with neither keeps its section-level text. Fields are translated either way. The docblock ships in `dist/system/index.d.ts`, so the changeset gains one sentence. Comment only: no code, no `.describe()`. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RD4nZChNGxRzyyWJtvZ8NJ
席位核对 · ACCEPT · PR #23815 @
|
Fixes #23756
Clause-②: no
What changed
These are TSDoc and comment edits only, at the three locations the card and comment
6205162974name, plus a fourth docblock the seat's review found (item 4). No.describe()text, schema or code changes. Measured at base74b436263.packages/spec/src/ui/view.zod.ts,FormSectionSchema.name. The TSDoc named one address,metadataForms.TYPE.sections.NAME. It now names both addresses and which form each one serves:objects.OBJECT._sections.NAME. OBJECT is the form's owndata.object, else its view's. The i18n extractor (walkObjectSections) scaffolds the key, the translation linter (collectViewRecord) accepts it, andtranslateViewserves it. A section without anamehas no key and keeps its authored text.defineForm({ schemaId })):metadataForms.TYPE.sections.NAME, read byresolveMetadataFormLabels. A nameless section is looked up there under a slug of itslabel.The group-key comment on the same schema (the
:3862site) also namedmetadataForms.…as the anchor. A section'sgrouppoints at an object'sfieldGroups, so its key isderiveFieldGroupLayout'skeyatobjects.OBJECT._sections.KEY, asfield-group-layout.tsdeclares. The comment now says that.packages/spec/src/system/translation.zod.ts,_sections. The TSDoc namedrecord:detailsas the only reader. It now names:sections[].name,record:detailssections[].name, and objectfieldGroups[].key;main:walkObjectSections, which scaffolds the key from all three;collectViewRecord, which accepts a form view's names; andtranslateView, which overlays a served form view'sconfig.sections;descriptionleaf, which the schema already declares;packages/spec/src/system/i18n-resolver.ts,translateFormSections. The docblock said "Three rules, each the one its sibling translators already follow". It now says that rules 1 (ownnamekey) and 3 (a diverged string beats the catalog) are shared withtranslateBulkActionDefs, and that rule 2 (only authored copy is translated) belongs to sections alone.resolveViewDescriptionreturns a catalog description the view never authored, andtranslateBulkActionDefshas no authored-copy guard.packages/spec/src/system/i18n-resolver.ts,resolveMetadataFormLabels(patch round, heade7ac53b9a1). The docblock said a section without a stablenamekeeps its section-level text, which contradicted item 1's new text and the function's owntranslateSection. It now says what the code does: the lookup key is the section'sname, else a slug of its stringlabel(lowercased,&→and, each run of non-alphanumerics →_, edge underscores trimmed). Only a section with neither keeps its section-level text, and its fields are translated either way. The changeset gained one sentence for it.Every reader named above was found by its function name on
mainat74b436263:walkObjectSections:packages/cli/src/utils/i18n-extract.ts:914collectViewRecord:packages/lint/src/validate-translation-references.ts:484translateViewandtranslateFormSections:i18n-resolver.tsresolveMetadataFormLabels:i18n-resolver.ts:3926defineForm:view.zod.ts:7145The card body also lists objectui's form renderers as a reader. This repo does not contain them, so the new text does not name them as a reader.
Changeset:
patch, notskip-changesetThe dispatch hypothesis was that comments do not publish. That was measured false for this diff:
@objectstack/spec'sfiles[]includessrc/**/*.zod.tsanddist.pnpm --filter @objectstack/spec build, the newview.zod.tstext ("one of two addresses, decided by what the form edits") and the newtranslation.zod.tstext ("Three authoring surfaces name a section under this key") both appear indist/**bundles. Thei18n-resolver.tstext appears only insrc.dist/**.So the diff publishes text, and
.changeset/23756-section-translation-tsdoc.mdis apatchfor@objectstack/spec. Theskip-changesetlabel is not applied.Generated artifacts
None carry this text.
git grepfor each replaced sentence returns zero hits after the edit.check:docsran green against the rebuiltdist.Verification (head
58c3d6070f; the patch round's re-runs ate7ac53b9a1are in report6208324935)pnpm --filter @objectstack/spec run typecheckpasses.vitest run src/system/i18n-resolver.test.ts src/system/translation.test.ts src/ui/view.test.ts: 3 files, 974 tests passed.node scripts/pm/dispatch-gates.mjs --commandsderived 79 families; 78 ran and exited 0.pnpm check:dual-build-cjs-loadsexited 3, which means its prerequisite was not met: it needs every workspace package'sdist, and only spec's build closure was built here. It is NOT MEASURED locally and is left to CI.--ranreconciliation: "79 derived famil(ies) accounted for — 78 run, 1 NOT-MEASURED".Acceptance notes
check-plugin-teardown-shape --self-testneeds the full history, because its positive control is pinned to a commit. It ran green aftergit fetch --unshallow.Generated by Claude Code