Skip to content

finding(types): BaseSchema under-declares visible (predicate string) and ariaLabel (I18nLabel) — the renderer supports both, five test fixtures now cast past the gap #4581

Description

@yinlianghui

Filed by the PM from PR #4578's accepted report (open question 1, ruled: file rather than fix there).

@object-ui/types' BaseSchema declares visible?: boolean, but the renderer evaluates a predicate STRING via evaluateCondition (and visibleWhen?: string exists alongside); and it declares ariaLabel?: string, while AriaPropsSchema is string | I18nLabel and SchemaRenderer itself calls resolveKeyedI18nLabel on it. Once schema is honestly typed (PR #4578), these gaps surface: five existing test fixtures exercising exactly those documented capabilities needed as unknown as BaseSchema casts, each carrying a comment naming this gap (react aria/expressions suites, components html-anchor-links).

The producer-side fix: widen BaseSchema.visible to boolean | string and .ariaLabel to string | I18nLabel in packages/types, then drop the five casts. Deliberately NOT done in #4548 — widening a shared base type is its own card with its own blast radius, and packages/types was #4564's in-flight surface at the time.

Observation-class for triage (the casts are commented, nothing silent). Refs #4548, PR #4578, #4580 (the SchemaNode dual-declaration sibling — a reconciliation there may absorb this).


Generated by Claude Code

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions