Skip to content

chore(spindle-ui,spindle-hooks): optimize Storybook for AI#1975

Open
herablog wants to merge 1 commit intomainfrom
chore/optimize-story
Open

chore(spindle-ui,spindle-hooks): optimize Storybook for AI#1975
herablog wants to merge 1 commit intomainfrom
chore/optimize-story

Conversation

@herablog
Copy link
Copy Markdown
Member

概要

Storybook AI Best Practices に基づき、AIエージェント(addon-mcp経由)へのコンテキスト提供を最適化しました。

  • reactDocgenreact-docgen-typescript に変更し、プロップ情報をマニフェストに反映
  • 全MDXファイルの <Meta> タグに summary を追加
  • 全ストーリーの meta に component を追加し、プロップ抽出を有効化

確認方法

  1. pnpm install && pnpm --filter spindle-ui storybook:start
  2. Storybook MCP経由でコンポーネント情報を取得し、Props情報やsummaryが返ることを確認
    mcp__storybook__get-documentation({ id: "button" })
    
  3. VRT(Visual Regression Test)に影響がないことを確認
    • 見た目の変更は含まれないため、スナップショットの差分は出ない想定

今回未対応の項目(別PRで対応予定)

  • コンポーネント・プロップへのJSDocコメント追加(Props情報の説明文を充実させる)
  • ストーリーレベルの description 追加(各ストーリーに「なぜ・いつ使うか」を記述)
  • !manifest タグによるマニフェストのキュレーション(VRT用ストーリーの除外など)

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 25, 2026

⚠️ No Changeset found

Latest commit: ce8a94e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 25, 2026

Visit the preview URL for this PR (updated for commit ce8a94e):

https://ameba-spindle-hooks--pr1975-chore-optimize-story-mjkyke6l.web.app

(expires Fri, 24 Apr 2026 10:17:50 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 7dd86a3c25a55dbb81dd4fa259473bf50648140b

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 25, 2026

Visit the preview URL for this PR (updated for commit ce8a94e):

https://ameba-spindle--pr1975-chore-optimize-story-omeiuujx.web.app

(expires Fri, 24 Apr 2026 10:18:18 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e7521619a2dd5c653490c8246e81ec2a5c8f1435

- reactDocgenをreact-docgen-typescriptに変更し、プロップ情報をマニフェストに反映
- 全MDXファイルのMetaタグにsummaryを追加し、AIエージェントへのコンテキスト提供を強化
- 全ストーリーのmetaにcomponentを追加し、プロップ抽出を有効化
@herablog herablog force-pushed the chore/optimize-story branch from 1cd1262 to ce8a94e Compare March 25, 2026 10:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Storybook AI Best Practices に沿って、Storybook(addon-mcp 経由)から取得できるコンポーネント/ドキュメントのメタ情報(Props 抽出・summary)を増やし、AI エージェント向けコンテキストを充実させるPRです。

Changes:

  • Storybook の TypeScript docgen を react-docgen-typescript に切り替え
  • 各コンポーネントの MDX <Meta>summary を追加
  • 各 story の meta に component を追加して Props 抽出を有効化

Reviewed changes

Copilot reviewed 64 out of 64 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/spindle-ui/.storybook/main.js reactDocgenreact-docgen-typescript に変更
packages/spindle-ui/storybook/UserNotificationTypes.mdx <Meta>summary を追加
packages/spindle-ui/src/Toast/Toast.stories.tsx story meta に component を追加
packages/spindle-ui/src/Toast/Toast.mdx <Meta>summary を追加
packages/spindle-ui/src/TextLink/TextLink.mdx <Meta>summary を追加
packages/spindle-ui/src/TextButton/TextButton.mdx <Meta>summary を追加
packages/spindle-ui/src/Table/Table.stories.tsx story meta に component を追加
packages/spindle-ui/src/Table/Table.mdx <Meta>summary を追加
packages/spindle-ui/src/SubtleButton/SubtleButton.mdx <Meta>summary を追加
packages/spindle-ui/src/StackNotificationManager/StackNotificationManager.stories.tsx story meta に component を追加
packages/spindle-ui/src/StackNotificationManager/StackNotificationManager.mdx <Meta>summary を追加
packages/spindle-ui/src/SnackBar/SnackBar.stories.tsx story meta に component を追加
packages/spindle-ui/src/SnackBar/SnackBar.mdx <Meta>summary を追加
packages/spindle-ui/src/SegmentedControl/SegmentedControl.mdx <Meta>summary を追加
packages/spindle-ui/src/Rating/Rating.mdx <Meta>summary を追加
packages/spindle-ui/src/Pagination/Pagination.stories.tsx story meta に component を追加
packages/spindle-ui/src/Pagination/Pagination.mdx <Meta>summary を追加
packages/spindle-ui/src/NavigationTab/UnderlineTab/UnderlineTab.stories.tsx story meta に component を追加
packages/spindle-ui/src/NavigationTab/UnderlineTab/UnderlineTab.mdx <Meta>summary を追加
packages/spindle-ui/src/Modal/SemiModal/SemiModal.stories.tsx story meta に component を追加
packages/spindle-ui/src/Modal/SemiModal/SemiModal.mdx <Meta>summary を追加
packages/spindle-ui/src/Modal/AppealModal/AppealModal.stories.tsx story meta に component を追加
packages/spindle-ui/src/Modal/AppealModal/AppealModal.mdx <Meta>summary を追加
packages/spindle-ui/src/List/MoreLink.stories.tsx story meta に component を追加
packages/spindle-ui/src/List/MoreLink.mdx <Meta>summary を追加
packages/spindle-ui/src/LinkButton/LinkButton.stories.tsx story meta に component を追加
packages/spindle-ui/src/LinkButton/LinkButton.mdx <Meta>summary を追加
packages/spindle-ui/src/InlineNotification/InlineNotification.stories.tsx story meta に component を追加
packages/spindle-ui/src/InlineNotification/InlineNotification.mdx <Meta>summary を追加
packages/spindle-ui/src/IconButton/IconButton.stories.tsx story meta に component を追加
packages/spindle-ui/src/IconButton/IconButton.mdx <Meta>summary を追加
packages/spindle-ui/src/Icon/index.stories.tsx story meta に component を追加
packages/spindle-ui/src/Icon/index.mdx <Meta>summary を追加
packages/spindle-ui/src/HeroCarousel/HeroCarousel.stories.tsx story meta に component を追加
packages/spindle-ui/src/HeroCarousel/HeroCarousel.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/ToggleSwitch/ToggleSwitch.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/TextField/TextField.stories.tsx story meta に component を追加
packages/spindle-ui/src/Form/TextField/TextField.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/TextArea/TextArea.stories.tsx story meta に component を追加
packages/spindle-ui/src/Form/TextArea/TextArea.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/Radio/Radio.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/InvalidMessage/InvalidMessage.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/InputLabel/InputLabel.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/InlineDropDown/InlineDropDown.stories.tsx story meta に component を追加
packages/spindle-ui/src/Form/InlineDropDown/InlineDropDown.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/DropDown/DropDown.stories.tsx story meta に component を追加
packages/spindle-ui/src/Form/DropDown/DropDown.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/Checkbox/Checkbox.mdx <Meta>summary を追加
packages/spindle-ui/src/Form/ButtonSwitch/ButtonSwitch.mdx <Meta>summary を追加
packages/spindle-ui/src/DropdownMenu/DropdownMenu.stories.tsx story meta に component を追加
packages/spindle-ui/src/DropdownMenu/DropdownMenu.mdx <Meta>summary を追加
packages/spindle-ui/src/Dialog/Dialog.stories.tsx story meta に component を追加
packages/spindle-ui/src/Dialog/Dialog.mdx <Meta>summary を追加
packages/spindle-ui/src/ButtonGroup/ButtonGroup.stories.tsx story meta に component を追加
packages/spindle-ui/src/ButtonGroup/ButtonGroup.mdx <Meta>summary を追加
packages/spindle-ui/src/Button/Button.stories.tsx story meta に component を追加
packages/spindle-ui/src/Button/Button.mdx <Meta>summary を追加
packages/spindle-ui/src/Breadcrumb/Breadcrumb.stories.tsx story meta に component を追加
packages/spindle-ui/src/Breadcrumb/Breadcrumb.mdx <Meta>summary を追加
packages/spindle-ui/src/BottomButton/BottomButton.stories.tsx story meta に component を追加
packages/spindle-ui/src/BottomButton/BottomButton.mdx <Meta>summary を追加
packages/spindle-hooks/.storybook/main.js reactDocgenreact-docgen-typescript に変更
packages/spindle-hooks/src/useTimeDistance/useTimeDistance.mdx <Meta>summary を追加
packages/spindle-hooks/src/useCarousel/useCarousel.mdx <Meta>summary を追加

Comment thread packages/spindle-ui/src/Modal/SemiModal/SemiModal.stories.tsx
Comment thread packages/spindle-ui/storybook/UserNotificationTypes.mdx
Comment thread packages/spindle-ui/src/Dialog/Dialog.stories.tsx
Comment thread packages/spindle-ui/src/DropdownMenu/DropdownMenu.stories.tsx
Comment thread packages/spindle-ui/src/Modal/AppealModal/AppealModal.stories.tsx
@reg-suit
Copy link
Copy Markdown

reg-suit Bot commented Mar 25, 2026

reg-suit detected visual differences.

Check this report, and review them.

🔴 Changed 🔵 Passing
2 256
How can I change the check status? If reviewers approve this PR, the reg context status will be green automatically.

@herablog herablog requested a review from yasuda-shin March 25, 2026 10:22
@herablog herablog marked this pull request as ready for review March 25, 2026 10:22
@herablog herablog enabled auto-merge March 25, 2026 10:23
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce8a94eb2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/spindle-ui/src/Dialog/Dialog.stories.tsx

const meta: Meta<typeof SemiModal.Frame> = {
title: 'Modal/SemiModal',
component: SemiModal.Frame,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copilotの指摘にもあるように react-docgen-typescript に変更したことによってコンポーネントを解決できずPropsが取得されないケースあるんですかね?

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.

3 participants