This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
docs(complex): scroll-area.mdx publishes the four rows the declaration has - #8267
Merged
Merged
Conversation
…n has The `Schema` fence was re-derived member by member against `ScrollAreaSchema` (packages/types/src/layout.ts) and `BaseSchema` (packages/types/src/base.ts). Five rows disagreed: - `content?: SchemaNode | SchemaNode[]` named a key no declaration has. Measured: it is not refused by the zod twin either (BaseSchema is `.passthrough()`), it survives parsing and lands on the DOM as a stray attribute on an empty scroll box. - `children?` was labelled "Alternative content prop". It is the only content channel: the renderer's single content read is `renderChildren(schema.children)` and the registration's `defaultProps` ships `children`. - `height?: string` and `width?: string` narrowed rows the declaration writes as `string | number`. A bare number is applied as pixels. - `width`'s "(default: '100%')" annotation named a default that does not exist at render time; omitting `width` leaves the axis unsized. The `'100%'` lives in the registration's designer `defaultProps` only. The "Base properties" group is left as it stands — every row in it is accurate against `BaseSchema`, and it is the same three-row block 16 component pages carry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
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 free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #8234
What was wrong — five things, not two
The
Schemafence oncontent/docs/components/complex/scroll-area.mdxwas re-derived member by member against the declaration, as the claim comment asked. The card named two wrong rows, the PM found two more while verifying, and the full re-derivation turned up a fifth that nobody had flagged.content?: SchemaNode | SchemaNode[]; // Scrollable contentScrollAreaSchema(packages/types/src/layout.ts:505) declares nocontentmember. Neither doesBaseSchema.children?: … // Alternative content propchildrenis the only content channel:packages/components/src/renderers/complex/scroll-area.tsx:34isrenderChildren(schema.children), the single content read in the renderer, and the registration'sdefaultPropsshipschildren.height?: string;layout.ts:510—height?: string | number;width?: string;layout.ts:514—width?: string | number;width?: … // Container width (default: '100%')'100%'exists only in the registration's designerdefaultProps(scroll-area.tsx:50), which the renderer never applies. Measured: omitwidthand the renderedstyleattribute carries nowidthat all.Every other row was checked and is correct, so it is untouched:
type: 'scroll-area'(layout.ts:506);orientationincluding its(default: 'vertical')annotation, which is a real render-time default (scroll-area.tsx:24,const orientation = schema.orientation || 'vertical');className(base.ts:171); and the three Base-properties rows (see the ruling below).Ruling on the "Base properties" section: keep it, unchanged
The card left this to the implementer, so here is the argument rather than a silent default.
1. Every row in it is true against the declaration.
id?: string=base.ts:81.testId?: string=base.ts:424. Andvisible?: boolean | string | { dialect?: string; source: string }is the exact structural expansion ofbase.ts:292'svisible?: boolean | ExpressionWire, sinceExpressionWire = string | { dialect?: string; source: string }(packages/types/src/expression.ts:67). All three arms were measured working end to end — booleanfalse, the predicate string${1 === 2}, and the CEL envelope{ dialect: 'cel', source: 'false' }each render nothing at all (innerHTML length 0), which is what that key promises.2. A curated subset is the right shape; the two alternatives are worse.
BaseSchemahas 21 members. Making the section exhaustive would add 18 rows to this page and to every other component page, several of them inert here (bind,data,placeholder,labelon a scroll box). Deleting the section would remove the only thing on the page that explains whyid/visible/testIdare absent fromScrollAreaSchemaitself.3. It is the repo's existing block, not a local invention. The same three rows with the same
visibleexpansion appear verbatim on 16 component pages (carousel,resizable,data-table,box,page,calendar, …). Rewriting it here would fork a convention across 16 files for a defect that is not this page's.4. Read-ness points the same way for two of three, and the third is not this PR's to fix. Following objectui#8197's discriminator — read-ness, not inheritance —
idandvisibleare read:idreaches the DOM asid="…"plusdata-obj-id, andvisiblegates rendering.testIdis the one row where read-ness and the declaration disagree: nothing in the repo readsschema.testId(the only two mentions areschema-builder.ts:84, which writes it, and its own test), it falls throughSchemaRenderer's metadata destructure, and React writes the raw prop to the DOM as a lowercasetestid="…"attribute — so[data-testid="…"]finds nothing, contradictingbase.ts:421's own "Rendered as data-testid attribute". That is a producer-side defect inpackages/typesor in the renderer, it is repo-wide, and per AGENTS.md #0.1 the fix belongs at the producer. Deleting the row here would make this page disagree with the declaration in order to route around a defect somewhere else — the exact lenient-fallback shape that rule forbids. Reported to the PM as a separate finding instead.Demonstrated end to end, not by grep
Three throwaway probe files were run from the repo root (
pnpm exec vitest run …), read, and deleted; nothing from them is in this diff. Raw readings:A. The zod twin does NOT refuse the old authoring — and that matters.
safeParserefusing the old authoring, and the claim comment asked for the same here. It does not reproduce, for a structural reason:CollapsibleSchemadeclarescontentas required, so omitting it fails — whereasScrollAreaSchema.childrenis optional and the zodBaseSchemais.passthrough()(packages/types/src/zod/base.zod.ts:241), so an unknowncontentkey validates and is preserved in the parsed output. Nothing anywhere rejects it. That makes the doc row more dangerous than #8197's, not less, and it is why the page now says so in prose.B.
height: 200is valid, exactly as the declaration says.A bare number and
'200px'produce the identical style. The page'sstring-only rows would have told an author this is invalid.C. The failure mode the card describes, rendered.
Through
SchemaRendererthe phantom key does not merely do nothing — it is not stripped as metadata, so it is spread as a React prop and lands on the element:D. The
(default: '100%')claim, measured.No
width. The annotation named a default that does not exist.Landing control (
grep -cF, fixed-string)content?: SchemaNodeAlternative content propheight?: string;width?: string;SchemaNode, any lineThe lit control stays lit: the corrected
children?: SchemaNode | SchemaNode[];row is still there, so the four zeroes are a deletion of the wrong rows and not of the fence.Gates — reported as what they are
check:doc-typesreads onlytypestring literals and never judges a member row.check:doc-snippetscompiles onlyts/tsx/typescriptfences (TS_FENCE_LANGUAGES,scripts/check-doc-snippet-types.mjs:548); this block isplaintext. The measurements in the section above are the verification.check:doc-fencescheck:doc-typestypeliterals)check:doc-snippetsPRECONDITION NOT MET, which is "could not run", not a failure.docs:check-linkscheck:control-bytescheck:doc-example-readerscheck:docs-route-closurecheck:changeset-presencecheck:governed-queue-guard --testNo changeset, on the gate's own verdict line plus the landed precedent: PR #8237 (objectui#8197) and #8036 were both single-file
content/docs/**changes and neither carried one.Scope
Only the one
.mdxfile.packages/components/src/renderers/complex/scroll-area.tsxis untouched — the renderer is correct, the page was wrong. objectui#6805 (the demo catalog) is a different, closed card and is not touched.🤖 Generated with Claude Code
https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Generated by Claude Code