Skip to content

finding(plugin-timeline): the timeline renderer reads seven keys TimelineSchema does not declare, and declares three it never reads #6170

Description

@yinlianghui-tw

Filed unassigned out of #6086 round 3. That round was naming the shape on property tables that named none; this table could not be named because the only candidate contradicts it.

The fact

content/docs/plugins/plugin-timeline.mdx's ## Properties table lists 8 keys. The only shape the tree names for a timeline node is TimelineSchema (packages/types/src/data-display.ts:1204), and it agrees on 1 of 8.

keys
the docs table claimsvariant, items, dateFormat, timeScale, rowLabel, minDate, maxDate, className
TimelineSchema declarestype, events (required), orientation, position, plus BaseSchema

Only className (inherited) is common to both.

Why it type-checks anyway

TimelineRenderer (packages/plugin-timeline/src/renderer.tsx:250) is typed schema: TimelineSchema and destructures variant, items, dateFormat straight off it, then reads schema.scale ?? schema.timeScale, schema.minDate, schema.maxDate, schema.rowLabel further down. That compiles only because BaseSchema carries an index signature (packages/types/src/base.ts:318), so any key reads as any. The annotation therefore constrains nothing, and the declared/read divergence is invisible to tsc.

The registration's own inputs metadata (renderer.tsx, the ComponentRegistry.register('timeline', ...) config) declares variant / items / dateFormat / … — i.e. the designer's vocabulary agrees with the docs and the renderer, and only the exported type disagrees.

TimelineSchema's events, orientation and position have no read point in packages/plugin-timeline.

Why it is worth a card

This is the same disease #6086 recorded, arriving from the source side: an exported type that is neither what authors write nor what the renderer reads, held together by an index signature that suppresses the only mechanical judge that would notice. @objectstack/spec also ships ui/TimelineConfig.json whose axis key is scale — which the renderer already prefers over timeScale — so there is a third vocabulary in play and the retirement/alias story needs deciding, not guessing.

Reproduce

sed -n '1199,1220p' packages/types/src/data-display.ts
grep -n 'schema\.' packages/plugin-timeline/src/renderer.tsx
sed -n '108,125p' content/docs/plugins/plugin-timeline.mdx
grep -n '\[key: string\]' packages/types/src/base.ts

Refs: #6086.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions