Skip to content

finding(docs,examples): all five aspect-ratio docs demos author content, a key the renderer never reads — every demo on the published page renders an empty ratio box #6773

Description

@os-sales

Found while completing the container-declaration census for #6764. Out of that card's scope (that one is about isContainer) and out of its fence (content/docs/ and examples/), so it is filed rather than fixed.

Measured

packages/components/src/renderers/layout/aspect-ratio.tsx reads exactly four keys off the schema: ratio, className, image (with alt), and then

{schema.image ? (
...an img...
) : (
renderChildren(schema.children || schema.body)
)}

There is no read of schema.content anywhere in the file, and content is not among its declared inputs either.

Every shipped demo authors content and nothing else:

fixturekeys authoredrenderer reads them?
examples/schema-catalog/src/schemas/components-layout-aspect-ratio/16-9-aspect-ratio.jsonratio, contentratio yes, contentno
.../square.jsonratio, contentsame
.../4-3.jsonratio, contentsame
.../ultrawide.jsonratio, contentsame
.../video-aspect-ratio.jsonratio, contentsame

5 of 5. None authors children, body or image — the three spellings that would actually put something inside the box. So each demo renders a correctly-proportioned empty box, and the docs page content/docs/components/layout/aspect-ratio.mdx renders all five.

The same page's "Schema" block publishes the phantom key as contract:

interface AspectRatioSchema {
type: 'aspect-ratio';
ratio: number; // Width / Height ratio
content: ComponentSchema; // Content to display
className?: string;
}

image / alt, which the renderer does read and does declare as inputs, are absent from that block. So the documented surface and the implemented surface are disjoint on the content half.

Contrast that makes this a reading and not a scan artifact

The sibling family measured in the same pass goes the other way: all 9components-layout-semantic fixtures author children, which those renderers do read. So the catalog is not uniformly authored against a phantom key — this one component is.

Why it stayed invisible

Nothing draws a diagnostic that a reader would act on. content is not a declared input, so the manifest tier reports it as unknown-prop — the same warning it gives a typo — and an empty box on a page of ratio demos looks like a ratio demo.

Not proposed here, because the direction is a choice

Either the fixtures and the docs block move to the keys the renderer reads (image for the photo demo, children for the four card demos), or aspect-ratio grows a content read and declares it. The first is the AGENTS.md #0.1 direction (fix the metadata, not the renderer); the second would add a third spelling of the same concept beside children and body. Whoever takes it should also check whether these five files are part of the population already counted in #6318.

Related

#6764 (the census that surfaced it) · #5931 (same class — catalog fixtures declaring keys the renderer never reads; that card names button-group / breadcrumb / command, not this one) · #6318 (in-repo schema files that fail safeValidateSchema)

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatchedpriority:p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions