Skip to content

Tier 3 (#2901): unregistered PageComponentType values, and the ai:chat_window palette trap #2943

Description

@os-zhuang

From the #2901 audit (doc).

This tier fails loudlySchemaRenderer.tsx:365 renders a red role="alert" panel naming the missing type and dumping the schema JSON. That makes it materially cheaper to triage than Tier 1/2: it cannot hide. Filed separately for exactly that reason.

PageComponentType — 24 of 34 registered

Dispatch is a flat Map with exact-key lookup (core/src/registry/Registry.ts:288) — no prefix stripping, so nav:menu will never fall back to a registered navigation-menu.

Hard gaps (no renderer, no placeholder): ai:chat_window, element:filter, element:form.

Soft gaps (dashed placeholder, but only in hosts that call registerPlaceholders() — today just apps/console/src/main.tsx:166; every other host of @object-ui/components gets the red box): app:launcher, nav:menu, nav:breadcrumb, global:search, global:notifications, user:profile, ai:suggestion.

The trap worth fixing first

ai:chat_window is offered by the Studio page palette with a config panelapp-shell/src/views/metadata-admin/previews/block-types.ts:116 (label "AI chat window", Bot icon) and block-config.ts:352. It has no renderer, and components/src/renderers/placeholders.tsx:97 documents a deliberate decision to exclude it so it produces "a loud Unknown component type".

The reasoning is sound in isolation. The palette was never told. An author drags a block Studio offers and gets a red error box.

Either prune it from block-types.ts/block-config.ts, or ship the renderer.

Dashboard chart dispatch

Renderer Missing from ChartTypeSchema (19)
plugin-dashboard/src/DashboardRenderer.tsx:131 gauge, solid-gauge, kpi, bullet
plugin-dashboard/src/DashboardGridLayout.tsx:173 8 types

Note DatasetWidget.tsx:136 covers 19 of 19, and DashboardRenderer.tsx:140 already defines METRIC_LIKE_TYPES = ['gauge','solid-gauge','kpi','bullet'] with a docstring saying they "render as a metric card rather than a chart" — then consults it only to pick a grid span. The renderer sizes the tile correctly and never routes the widget. The knowledge is already there; it just isn't wired to dispatch.

Guard

block-config.test.ts:26 looks like a coverage gate but asserts palette exclusions by hand rather than deriving inclusion from PageComponentType — so it locks the drift in instead of detecting it. Invert it.

Refs #2901

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions