Skip to content

finding(docs): accordion.mdx's schema block is stale against the real AccordionSchema/AccordionItem interface #4722

Description

@yinlianghui

Measured while implementing #4652. Filed unassigned. Duplicate-searched (keyword +
accordion.mdx + AccordionSchema): no open issue covers it.

The finding

content/docs/components/disclosure/accordion.mdx's "Schema" section shows:

interface AccordionSchema {
type: 'accordion';
items: Array<{
title: string;
content: string | SchemaNode;
}>;
defaultOpen?: number[];
multiple?: boolean;
}

The real interface, packages/types/src/disclosure.ts, is materially different:

exportinterfaceAccordionItem{value: string;// required — MISSING from the docs block entirelytitle: string;content: SchemaNode|SchemaNode[];disabled?: boolean;// MISSING (as of #4652, now a real, honored key)}exportinterfaceAccordionSchemaextendsBaseSchema{type: 'accordion';items: AccordionItem[];accordionType?: 'single'|'multiple';// docs calls this `multiple?: boolean` — wrong name AND wrong typecollapsible?: boolean;// MISSING from docsdefaultValue?: string|string[];// docs calls this `defaultOpen?: number[]` — wrong name AND wrong typevalue?: string|string[];// MISSING from docsonValueChange?: (value: string|string[])=>void;// MISSING from docsvariant?: 'default'|'bordered'|'separated';// MISSING from docs}

defaultOpen and multiple do not exist anywhere on the real interface — this reads like an early draft of the component that was never updated as the interface evolved, not a columns/fields-style two-name drift.

Impact

The docs page is the corpus authors (including AI authoring tools) read to learn the accordion schema shape, and it currently teaches: a required value key does not exist; the real selection-mode key (accordionType) and default-open key (defaultValue) under different, non-existent names; and omits collapsible/onValueChange/variant/disabled entirely. Not breaking (docs, not a gate), but actively misleading.

Why this is filed separately from #4652

#4652's declared surfaces are the three-way contract (TS interface / Zod mirror / renderer) for exactly the disabled/icon pair. This finding is a different, broader, pre-existing defect class — stale field names and shapes, not a declared-but-unenforced authoring key — spanning fields #4652 never touched (accordionType, collapsible, defaultValue, value, onValueChange, variant). Fixing it there would have been unrelated scope creep on a file already flagged as drifted independent of the disabled/icon settlement.

Options

  1. Rewrite the schema block to match the real AccordionSchema/AccordionItem shape (mechanical — the interface is the source of truth).
  2. Leave as-is (not recommended — actively teaches a non-existent shape).

Related: #4652 (the settlement this finding was measured alongside).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions