Skip to content

docs(components): sonner and button-group still document four more props no shipped type declares #6347

Description

@os-warren

Surfaced while implementing objectui#6132 (PR #6345). Not fixed there: that card's ruling enumerates five specific action props, and these four are a different, wider set — the same defect class one level out. Filing rather than widening the ruled PR.

What was measured

objectui#6132 removed the undeclared action props from these two pages. The rest of each page's schema block was not in scope, and still names props no shipped type declares.

content/docs/components/feedback/sonner.mdx

Documents duration?: number; // Auto-close duration (ms).

SonnerSchema (packages/types/src/feedback.ts:204) declares type, message, title, description, variant, buttonLabel, buttonVariant — no duration. The Zod mirror (packages/types/src/zod/feedback.zod.ts:116) matches. BaseSchema does not declare it either. The renderer never passes it:

// packages/components/src/renderers/feedback/sonner.tsx:28-30toastFn(schema.message||schema.title||'Notification',{description: schema.description,});

content/docs/components/basic/button-group.mdx

Documents value?: string | string[] and selectionMode?: 'single' | 'multiple' | 'none', plus a whole Selection Mode section with two demos.

ButtonGroupSchema (packages/types/src/navigation.ts:335) declares only type, buttons, variant, size. The renderer (packages/components/src/renderers/basic/button-group.tsx) has no selection behaviour whatsoever — it maps schema.buttons to plain Button elements and reads variant, size, className only. It does not even wire the declared ButtonGroupButton.onClick (packages/types/src/navigation.ts:325).

So the page teaches a selection capability the component does not implement, and two demos advertise it.

One more on the sonner page

sonner.mdx keeps a With Action section rendering the components-feedback-sonner/toast-with-action catalog entry. That fixture is not a sonner schema at all — it is a button whose onClick is an object:

{
"type": "button",
"label": "Show with Action",
"onClick": { "action": { "label": "View", "onClick": "viewFile" },
"message": "File uploaded", "description": "..." }
}

onClick is declared as a function (packages/types/src/base.ts:608), and objectui#4453 narrowed the runtime to typeof === 'function', so the authored object is dropped. The demo renders a button that does nothing, under a heading promising an action. PR #6345 deliberately left it: removing it touches the catalog/demo-extraction surface (scripts/extract-mdx-demos.mjs), which is a different verification population.

Suggested handling

Same shape as objectui#6132's ruling, and probably the same answer — documentation follows the shipped types, so the undeclared rows come out. The Selection Mode section and the With Action section are the judgement calls, since deleting a section is more than deleting a row, and the button-group case may instead be a real capability gap worth a card of its own rather than a doc deletion.

I did not fix any of it, and did not touch the catalog fixtures.

Refs: objectui#6132 · PR #6345 · objectui#6122 · objectui#4453.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions