Skip to content
This repository was archived by the owner on Sep 7, 2026. It is now read-only.
This repository was archived by the owner on Sep 7, 2026. It is now read-only.

list-all-documentation never surfaces component @summary; listing lines truncate mid-description #389

Description

@onurorhon

Summary

list-all-documentation builds each listing line from component.summary ?? description, truncating the description at 90 characters. Nothing populates component.summary: docgen extracts a component-level @summary JSDoc tag into reactDocgenTypescript.tags.summary, but no code path reads it from there. So the tag has no effect and every listing line is truncated description.

Related: #367. Same drop point (component-level JSDoc tags parsed but not carried into formatter output), different tag and tool.

Versions

  • storybook 10.3.6
  • @storybook/mcp 0.7.0; behavior unchanged on current main (packages/mcp/src/utils/manifest-formatter/markdown.ts)
  • react-vite, reactDocgen: 'react-docgen-typescript'

Reproduction

/**
 * Segmented control for selecting exactly one value from a small set of mutually
 * exclusive options. Not for switching content panels; use Tabs for that.
 *
 * @summary selects one value from a set, as a form input (not for content switching; use Tabs)
 */
export const SegmentedControl = /* ... */

Built components.json entry:

{
  "jsDocTags": {},
  "reactDocgenTypescript": {
    "tags": { "summary": "selects one value from a set, as a form input (not for content switching; use Tabs)" }
  }
  // no top-level "summary" field
}

list-all-documentation output:

- SegmentedControl (example-segmentedcontrol): Segmented control for selecting exactly one value from a small set of mutually exclusive o...

Expected

The listing line uses the @summary text.

Actual

The listing line is the first 90 characters of the description. Checked across a ~60-component library: no component entry has a top-level summary, and every jsDocTags is {}.

Impact

Agents pick components from the listing. "Not for X, use Y" guidance (recommended by the Storybook AI best-practices docs) usually sits past the first 90 characters of a description, so truncation removes it from the selection surface. The only current workaround is rewriting descriptions so the first 90 characters stand alone.

Code pointers

  • packages/mcp/src/utils/manifest-formatter/markdown.ts: listing line is component.summary ?? description.slice(0, MAX_SUMMARY_LENGTH).
  • Storybook core manifest generation never writes the top-level summary field, though the schema types it as optional.
  • parseComponentDocLike returns only { props }, dropping component-level tags (same as get-documentation omits component JSDoc tags (@deprecated) from its output #367).

Possible fixes

  1. In this repo: fall back to reactDocgenTypescript.tags.summary (and jsDocTags.summary for the docgen-server path) before truncating the description.
  2. In storybookjs/storybook: promote @summary into the manifest's top-level summary field at generation time, which fixes it for all manifest consumers.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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