Uh oh!
There was an error while loading. Please reload this page.
docs(fields): annotate four Field Schema blocks against the exported *FieldMetadata, and document FieldWidgetComponentProps once - #6146
Merged
yinlianghui-tw merged 1 commit intoAug 24, 2026
Conversation
…*FieldMetadata, and document FieldWidgetComponentProps once The `Field Schema` block on every `content/docs/fields` page declared an interface of its own, so the doc-snippet gate compiled it vacuously: a self-declared interface with no imports type-checks no matter what it says. Each converted block is now a literal annotated with the field type's exported `*FieldMetadata`, so the sealed type's excess-property check judges every documented key. The widget-prop keys the pages carried under the same heading (`value`, `className`, `disabled`) are real exported API filed under the wrong heading, so they move to one new page documenting `FieldWidgetComponentProps` rather than being deleted. Three defects the conversion forced out: `date.mdx` documented `min`/`max` where `DateFieldMetadata` declares `min_date`/`max_date`; `textarea.mdx` named `TextAreaFieldMetadata` where the export is `TextareaFieldMetadata`; and `rich-text.mdx` named a `RichTextFieldMetadata` that does not exist, now resolved against the existing `MarkdownFieldMetadata`/`HtmlFieldMetadata` pair. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
yinlianghui-tw
marked this pull request as ready for review
August 24, 2026 21:18
Uh oh!
There was an error while loading. Please reload this page.
yinlianghui-tw
deleted the
claude/issue-6138-fields-schema-block-parity
branch
August 24, 2026 21:30
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.
Part of #6138 — batch 1 of 2. Deliberately not a closing reference: the card covers all 26
content/docs/fieldspages and this PR converts four of them.What was wrong
Every
content/docs/fieldspage opens with a## Field Schemablock that declares an interface of its own. A self-declared interface with no imports type-checks no matter what it says, because nothing in it refers to anything the packages export.check-doc-snippet-typesreported those pages green and structurally could not see whether the documented shape matched the shipped one.The proof that today's green is vacuous, and that it stops being vacuous
Same page (
content/docs/fields/text.mdx), same wrong key (tooltip, which no exported field type declares), two block forms. The mutation was confirmed on disk by grep before any gate result was read, on both legs, and each leg carried atrap … EXIT INT TERMrestore.Leg A — the pre-fix block, restored from
main(bfdb9f906):A key that exists in no shipped type passes green. That is the vacuity, measured rather than argued.
Leg B — the post-fix annotated literal, same page, same key:
It reddens, and it names the key. Restore leg, confirmed on disk:
'tooltip' occurrences: 0,'interface TextFieldSchema' occurrences: 0,'TextFieldMetadata' occurrences: 3, andgit status --short/git diff HEAD --statboth empty.No build sits between the mutation and the measurement here — the gate reads the
.mdxfrom disk directly. What the builtdist/governs is the types the annotation resolves against, and the gate's own control line proves that (quoted below).Why the widget-prop keys moved instead of being deleted
The round-1 measurement (posted on #6138) found that all 26 pages diverge from their exported
*FieldMetadata, and on 24 of them the divergence is entirelyFieldWidgetComponentPropsmembers — a real, exported, reader-facing surface filed under a heading that says "Field Schema". Deleting them would have deleted correct API. So the two shapes are separated:## Field Schemabecomes a literal annotated with the exported*FieldMetadata, so the sealed type's excess-property check judges every documented key.content/docs/fields/widget-props.mdx, linked from each converted page.The new page carries no hand-maintained key list.
FieldWidgetComponentPropshas 76 members, and a prose restatement of a declared surface with nothing judging it is the defect class #6086 is open for. Instead the page carries a gate-compiledtsxwidget example and a gate-compiledtsblock on the metadata/props distinction, names the type as the source of truth, and describes the five categories the type is assembled from rather than enumerating members. Every member name the prose leans on also appears inside a compiled block, so the compiler judges it.Three defects the conversion forced out
date.mdxdocumented the range bounds asmin/max.DateFieldMetadatadeclaresmin_date/max_date, and the siblingdatetime.mdxalready documented that spelling. Two witnesses agree and one copy diverged, so the docs are corrected and the type is untouched.textarea.mdxnamedTextAreaFieldMetadata; the export isTextareaFieldMetadata(lowercasea). A name that must resolve, so it now does — an annotation that itself errors is the gate's own documented false-green mechanism.rich-text.mdxnamedRichTextFieldMetadata, which does not exist at all. Its own block saystype: 'markdown' | 'html', so it resolves against the existingMarkdownFieldMetadata/HtmlFieldMetadatapair. No type was minted.rich-text.mdxalso documented five editor keys. Measured against the source rather than assumed:RichTextFieldreadsrows(const rows = richField?.rows || 8;, through anas any) and reads none oftoolbar,preview,minHeight,maxHeight— the last two have zero occurrences anywhere inpackages/fields/src. All five come out of the annotated block; the one that is genuinely consumed but declared by neitherMarkdownFieldMetadatanorHtmlFieldMetadatais filed with that measurement as #6140 (open, unassigned, not addressed here).Fence re-derivation on current
origin/mainRe-derived at claim rather than reused from round 1, since #6134 merged in between:
Field Schemablocklocation.mdxtslocation.mdxwas re-fenced by #6134 (merged) — not re-fenced againauto-number.mdxplaintextobject.mdxplaintextSo nothing was left for this PR to re-fence that another claim does not already hold. #5867's in-flight batch (PR #6136) touches
content/docs/blocksandcontent/docs/pluginsonly — no overlap.Verification
Blocks-to-compile identity, written before the run and matched exactly: four conversions are one-block-for-one-block (already
ts-fenced, one block each, before and after), and the new page adds two compiled blocks and zero fragments, so the delta is+2and the declared-fragment count must not move.bfdb9f906)85f3eaea4)Gates at the final commit
85f3eaea4(working tree clean), each quoting its own verdict line, exit codes captured before any pipe:The resolution control line is the proof the annotations bind to the built
dist/*.d.tsrather than tosrc/— the dependency closure was built first (turbo run build, the gate's own--build-filterset,VERDICT command-exit 0).Render check, read back from the served HTML of all five pages (all
HTTP 200): the new page renders its title, itsSlugWidgetexample,toDomProps,aria-requiredand the categories section;text.mdxrendersTextFieldMetadata/pattern_messageand the link to the new page;date.mdxrendersmin_date/max_date;textarea.mdxrendersTextareaFieldMetadata;rich-text.mdxrenders bothMarkdownFieldMetadataandHtmlFieldMetadataand the #6140 reference. Negative assertions on the same HTML:interface TextFieldSchema,DateFieldSchema,TextAreaFieldMetadata,RichTextFieldMetadata,minHeightandmaxHeightare all gone from the rendered pages.Declared narrowing. ESLint's own config (
eslint.config.js) scopes every rule block to**/*.{ts,tsx}; this diff contains 0.ts/.tsxfiles (7 files: 5.mdx, 1.json, 1 changeset.md), so no file in eslint's population changed and no untouched file's verdict can move — type-aware linting is not enabled. Root vitest is not implicated for the same measurement: no source or test file changed. CI runs the full farm regardless.Not done here
FRAGMENT_MARKERwas not used;UNGATED_DOCSand the ledger are untouched; no type was minted; no gate was weakened. The remaining 22 pages are PR 2, and the twoplaintextpages stay with #6137.Generated by Claude Code