Skip to content

finding(types): ChatbotSchema pins type to 'chatbot', so chatbot-enhanced and chatbot-floating nodes have no authoring-face type #7655

Description

@claude

Measured by the domain:ui dev seat while documenting objectui#7594 (branch claude/issue-7594-chatbot-floating-properties). Filed unassigned, ungraded. Out of that card's scope, which is documentation of an existing surface.

The fact

packages/plugin-chatbot/src/renderer.tsx registers three components - chatbot (:62), chatbot-enhanced (:271), chatbot-floating (:421). @object-ui/types publishes one authoring-face type for the family, and it pins the discriminant to a single registration:

// packages/types/src/complex.ts:674
export interface ChatbotSchema extends BaseSchema {
  type: 'chatbot';

So ChatbotSchema cannot annotate a chatbot-enhanced or a chatbot-floating node. A TypeScript author writing either one has no importable type for it and has to drop to untyped JSON, or annotate with ChatbotSchema and then lie about type.

How it was measured

While writing the floating documentation for objectui#7594 the natural example - a tsx fence annotating the node an author actually writes - does not compile:

const schema: ChatbotSchema = { type: 'chatbot-floating', /* ... */ };
//                              ~~~~ Type '"chatbot-floating"' is not assignable to type '"chatbot"'.

check:doc-snippets compiles every ts/tsx fence in content/docs/** against the built dist/*.d.ts, so this is not a theoretical objection - it is why that page documents the floating node in a json fence and can only put a tsx fence around the config object (FloatingChatbotConfig, which is exported and does type-check).

Why it is worth a card

The objectui#6169 ruling is quoted in renderer.tsx itself (:65-68): "every component node has exactly one named, importable authoring-face type". Two of these three registrations have none. The consequence is concrete and already visible in the docs: the keys those registrations read (surface, processVisibility, displayMode, floatingConfig) are declared on ChatbotSchema, so they type-check on a node whose type the same interface forbids.

Not a duplicate

Dedup ran against the repo-scoped open-issue list (381 open issues, PRs excluded) with a lit positive control - chatbot-floating returns objectui#7594, so these zeros are real. Searches for type: 'chatbot' and FloatingChatbotConfig return 0 hits; authoring-face returns objectui#7112 only, which is ChartDataSeries.data and unrelated.

Suggested route

Needs a ruling on shape before any code: one interface per registration (ChatbotEnhancedSchema, ChatbotFloatingSchema) versus widening ChatbotSchema['type'] to the union of the three registered keys. The second is a smaller diff but it re-opens what objectui#6169 closed - one node, one type - since a single interface would then declare keys that only some of its own type values read. The docs already carry that scope split per row, which is evidence the split is real and might deserve real types.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions