Skip to content

docs(storybook): file 43 orphaned docs pages under their real sections - #1289

Merged
tenphi merged 4 commits into
mainfrom
fix-storybook-docs-hierarchy
Aug 7, 2026
Merged

docs(storybook): file 43 orphaned docs pages under their real sections#1289
tenphi merged 4 commits into
mainfrom
fix-storybook-docs-hierarchy

Conversation

@tenphi

@tenphi tenphi commented Aug 7, 2026

Copy link
Copy Markdown
Member

What

43 .docs.mdx files had no <Meta> at all, so Storybook derived their title from the file path. That produced a stray lowercase components root section in the sidebar mirroring the source tree — components/content/Alert/Alert.docs — with .docs suffixes on every name, plus a lone Components/CollectionItem from the one file that did set a title, just not to a real section.

the components section before

Where the component has a stories file (21 files) — attach with <Meta of={XStories} />, matching what every already-correct doc in this repo does (Tooltip, Menu, Tabs, Layout, …). This also collapses a duplicate: those components previously had both an autodocs "Docs" page and an orphaned hand-written one.

Where there is no stories file (22 files) — set an explicit <Meta title>:

Section Pages
Actions ButtonGroup, MenuTrigger, SubMenuTrigger
Content Content, Divider, Footer, Header, Title, StatsCard
Layout Flex, Flow, Grid, GridProvider, Panel, Prefix, Space, Suffix
Navigation FileTabs
Overlays TooltipProvider, TooltipTrigger
Getting Started Root, CollectionItem

Judgment calls worth a look

  • The organisms/ folder has no matching sidebar section. FileTabs → Navigation (next to Tabs; it is a tab bar) and StatsCard → Content (it extends Card).
  • Root and CollectionItem are cross-cutting rather than per-component, so they go to Getting Started alongside Base Properties / Field Properties, and are slotted into the storySort order rather than falling to the end.
  • Dropped the now-dead 'Components' entry from storySort.

Also

portal.stories.tsxPortal.stories.tsx. It was the only lowercase stories file in the repo, and that casing stopped Storybook from letting the attached MDX replace its autodocs page — Helpers/Portal ended up with two docs entries. Renaming fixed it. Nothing imported it by path.

Verification

Against a freshly indexed Storybook on this branch:

  • 0 entries left under components/* (was 43)
  • no title with more than one Docs entry (was 1)
  • all 43 moved pages present in the index at the intended title, every generated import * as XStories path resolves on disk, and spot-checked pages render (Content/Alert, Helpers/Portal, Layout/Flex, Getting Started/Root, Content/StatsCard, Navigation/FileTabs)
  • no build errors or warnings in the dev server log

Sections after: Forms 421, Content 302, Actions 114, Overlays 68, Getting Started 54, Navigation 39, Layout 38, Helpers 22, Status 10, Other 6.

Docs-only; .docs.mdx is not part of the published package, hence the empty changeset. .docs.mdx is also outside the repo's Prettier/lint-staged globs, so the files are left formatted as they were apart from the added header.

🤖 Generated with Claude Code


Note

Medium Risk
Removing FileTabs is a breaking public API change for any consumer still importing it; Storybook-only doc moves are low risk.

Overview
Storybook docs — Forty-three .docs.mdx files that lacked <Meta> (or used wrong titles) now sit under real sidebar sections instead of a stray components/* tree. Pages with stories use <Meta of={Stories} />; the rest get explicit titles (e.g. Getting Started for Root and CollectionItem, Layout for grid primitives). storySort drops the dead 'Components' entry and adds Root and CollectionItem under Getting Started.

Breaking APIFileTabs, FileTabs.TabPane, and CubeFileTabProps are removed from @cube-dev/ui-kit (minor changeset). Migration: use Tabs with onDelete for close buttons; put dirty indicators in tab title or actions. Implementation, docs, eslint default registry, and fixtures are cleaned up accordingly.

Tooling — ESLint defaults coverage ratchet lowered from 72 → 71 after dropping the FileTabs fixture.

Reviewed by Cursor Bugbot for commit adfc646. Bugbot is set up for automated code reviews on this repo. Configure here.

43 `.docs.mdx` files had no `<Meta>` at all, so Storybook fell back to
deriving their title from the file path. That produced a stray lowercase
`components` root section in the sidebar that mirrored the source tree
(`components/content/Alert/Alert.docs`), with `.docs` suffixes on every
name — alongside a lone `Components/CollectionItem` from the one file that
did set a title, just not to a real section.

Where the component has a stories file, attach the doc to it with
`<Meta of={XStories} />`, matching what every already-correct doc in the
repo does. That also collapses the duplicate: these components previously
had both an autodocs "Docs" page and an orphaned hand-written one.

Where there is no stories file, set an explicit `<Meta title>`:

  Actions      ButtonGroup, MenuTrigger, SubMenuTrigger
  Content      Content, Divider, Footer, Header, Title, StatsCard
  Layout       Flex, Flow, Grid, GridProvider, Panel, Prefix, Space, Suffix
  Navigation   FileTabs
  Overlays     TooltipProvider, TooltipTrigger
  Getting Started  Root, CollectionItem

The `organisms/` folder had no matching section, so FileTabs goes to
Navigation (next to Tabs) and StatsCard to Content (it extends Card).
Root and CollectionItem are cross-cutting rather than per-component, so
they sit in Getting Started and are slotted into the storySort order.

Rename `portal.stories.tsx` to `Portal.stories.tsx` — the only lowercase
stories file in the repo, and the casing kept Storybook from letting the
attached MDX replace its autodocs page, leaving Helpers/Portal with two
docs entries.

Verified against a fresh index: 0 entries left under `components/*`, no
title with more than one Docs entry, and every moved page renders.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: adfc646

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview Aug 7, 2026 8:42pm

Request Review

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📦 NPM canary release

Deployed canary version 0.0.0-canary-616b8f5.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🧪 Storybook is successfully deployed!

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🏋️ Size limit report

Name Size Passed?
All 455.71 KB (-0.27% 🔽👏) Yes 🎉
Tree shaking (just a Button) 118.94 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

@tenphi
tenphi merged commit c7c8579 into main Aug 7, 2026
15 checks passed
@tenphi
tenphi deleted the fix-storybook-docs-hierarchy branch August 7, 2026 20:46
@tenphi tenphi mentioned this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant