Skip to content

Selectの修正 - #114

Merged
touyou merged 25 commits into
mainfrom
fix/select
Dec 12, 2025
Merged

Selectの修正#114
touyou merged 25 commits into
mainfrom
fix/select

Conversation

@touyou

@touyou touyou commented Jul 28, 2025

Copy link
Copy Markdown
Member

概要

以下で指摘が入った箇所含め調整
https://www.notion.so/goodpatch-design-div/Select-3386ceea2f3543b49d619d08412d61f4?source=copy_link

変更内容

  • アイコンをFigmaに合わせて調整
  • Focusリングの色を調整
  • その他色で見つけた部分の調整
  • ドキュメントの書き方の最新化
  • 不要なcvaの削除
  • Figma Connect
  • registryの調整
  • Dropdownのスタイル調整(要相談)
  • Select選択後にSelectItemのフォントが使われてしまう問題(未解決)

動作確認

  • pnpm lint を実行
  • pnpm build:package を実行してプロジェクトが正常にビルドされることを確認
  • pnpm test を実行してテストがすべて成功することを確認

関連 Issue

touyou added 9 commits July 28, 2025 09:58
- 不要なスタイル定義を削除し、直接クラス名を使用するように変更
- `item.json`のプロパティの順序を整理
- SelectコンポーネントのargTypesから説明文を削除
- SelectTriggerコンポーネントの型定義を追加
- 使用例を追加し、ドキュメントを更新
- Selectコンポーネントの概要を削除し、SelectTriggerの説明を追加
- Selectコンポーネントの使用目的を明確化
- selectTriggerVariantsのスタイルを改善
- selectContentVariantsのスタイルを改善
- SelectItemコンポーネントのクラス名を更新
- Figmaとの接続を設定
- SelectTriggerコンポーネントのプロパティを自動マッピング
- コード例を提供するための例関数を追加
- selectTriggerVariantsのisInvalidとisDisabledのスタイルを改善
- selectIconVariantsのisDisabledのスタイルを修正
- SelectSeparatorコンポーネントのクラス名を更新
- SelectLabelコンポーネントのテキストカラーを変更
- SelectItemコンポーネントの背景色を変更
- figmaインポートの位置を修正
- Figma Code Connectの対応状況を更新
Copilot AI review requested due to automatic review settings July 28, 2025 02:21
@vercel

vercel Bot commented Jul 28, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
sparkle-design Ready Ready Preview Comment Dec 12, 2025 1:58am

@touyou touyou self-assigned this Jul 28, 2025
@touyou
touyou requested review from Copilot and ore0 and removed request for Copilot July 28, 2025 02:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Adjustments to the Select component based on Figma design specifications, including icon updates, focus ring color corrections, and documentation improvements.

  • Updated icon from "expand_more" to "arrow_drop_down" to match Figma design
  • Modified focus ring colors and various state colors to align with design system
  • Improved component documentation structure and added TypeScript interface definitions

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/components/ui/select/item.json Reordered JSON properties for consistency
src/components/ui/select/index.tsx Updated styling, colors, icon, documentation, and TypeScript interfaces
src/components/ui/select/index.stories.tsx Removed redundant description properties from story controls
src/components/ui/select/index.figma.tsx Added new Figma Connect integration file
README.md Updated Select component status to show Figma Connect as complete

Comment thread src/components/ui/select/index.figma.tsx Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- selectScrollButtonVariantsの削除
- スクロールボタンのクラス名を直接指定
@touyou

touyou commented Aug 27, 2025

Copy link
Copy Markdown
Member Author

@ore0 この観点なのですがsizeの指定場所を増やさずにこれを解決しようと思うとおそらくContextを自分たちで持たなければならず、どうしようかなぁとなっています。

Select選択後にSelectItemのフォントが使われてしまう問題(未解決)

シンプルにするのであればTriggerとValueは一体にしてしまうという方法もなくはなさそうだなと思ったんですがここら辺どう思いますか?

- Selectコンポーネントの概要を追加
- 使用例を追加
- SelectTriggerのドキュメントを整理
- SelectItemPropsインターフェースを追加し、textClassNameプロパティを定義
- SelectItemコンポーネントでtextClassNameを使用するように変更
- ItemTextのクラス名を修正し、flex-1を適用
@touyou

touyou commented Oct 1, 2025

Copy link
Copy Markdown
Member Author

GPT-5-Codexで解決です!
image

- paddingの位置を変更
- アイコンの位置を左側に移動
@touyou

touyou commented Oct 1, 2025

Copy link
Copy Markdown
Member Author
image

Dropdownの修正

@touyou

touyou commented Dec 11, 2025

Copy link
Copy Markdown
Member Author

確認しました!
Figmaと一致しているか?
Invalid状態はFigmaと一致してないです。Invalid Selectの背景色は白です。
ガイドラインに書かれていることが守られているか?
Select Time ZoneのオプションがSelectより長いです、GuidelinesのDon'tと相違しています。
長いオプションを選択されたら、右側の矢印が見えなくなります。
使っているサンプル文言に違和感がないか?
違和感ないです。
触ってみた時にインタラクション面などで違和感・Sparkle Designとしてはこうした方がいいのではないかという観点がないか?
オプションを選択後、Focus状態が残したことは違和感あります。

https://goodpatch.slack.com/archives/C05GB8JH1RP/p1764303722413249?thread_ts=1763613161.511529&cid=C05GB8JH1RP

@coderabbitai

coderabbitai Bot commented Dec 12, 2025

Copy link
Copy Markdown

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Selectコンポーネントの公開プロップ型とレンダリングを変更し、バリアント定義をインライン化。Storybookのメタ/型/argTypesを更新し、Figma Code Connect向けの自動生成ファイルを追加。READMEの表示テキストとヘッダ幅を調整。

Changes

群 / ファイル(s) 変更内容
ドキュメント更新
README.md
コンポーネントステータス表のヘッダセル幅と列整形を調整。SelectのFigma Code Connect表示を に変更(表示上の更新のみ)。
Figma統合(自動生成)
src/components/ui/select/index.figma.tsx
新規追加。Figma Code Connect用のマッピング(size, isInvalid, disabled, value 等)と、3つのオプションを持つレンダリング例を含む自動生成ファイル。
Storybook設定更新
src/components/ui/select/index.stories.tsx
Metaの componentSelectTriggerSelect に切替。subcomponents を拡張して SelectGroupSelectScrollDownButton を追加。argTypes 定数を導入し各ストーリーへ適用、型定義を StoryObj<SelectTriggerProps> 相当に更新、Defaultの表示幅を拡大などの表示調整。
コンポーネント実装変更
src/components/ui/select/index.tsx
新規エクスポート SelectTriggerProps, SelectItemProps を追加。SelectTriggerSelectItem のシグネチャとレンダリングを変更(textClassName 等の新プロップ、矢印アイコンを arrow_drop_down に変更)。複数の variant ヘルパーを削除し、クラス文字列をインライン合成へ置換。

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • 注視ポイント:
    • 追加/変更された SelectTriggerProps / SelectItemProps の型互換性確認
    • variant 削除によるスタイル差異(全サイズ・状態の検証)
    • Storybook meta.subcomponents と per-story argTypes が正しく反映されるか
    • 自動生成された Figma ファイルのプロパティマッピングと例の妥当性

Poem

🐇 ぴょんと跳ねて新しいpropsを抱え、
小さなSelectはFigmaへ向かう。
Storybookの舞台は広がり、
クラスはすっきり、選択は軽やか。
一緒に走ろう、新しい庭へ。


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 7914cda and d575a6c.

📒 Files selected for processing (1)
  • src/components/ui/select/index.tsx (12 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/ai-context.instructions.md)

**/*.{ts,tsx}: Use Japanese first for comments, then English with en: prefix in TypeScript/React files
Follow shadcn/ui patterns with CVA (Class Variance Authority) variants for component styling in React components
Include ARIA labels and use semantic HTML for accessibility in React components

**/*.{ts,tsx}: React components: Write interface properties with bilingual format - Japanese followed by 'en:' and English translation
React components: Write JSDoc with three sections - Overview (日本語/English), Usage Example (executable code), and @PARAM with type only
Interface properties: Separate Japanese and English descriptions with '/' character
Component JSDoc: Usage Example section must contain executable code that demonstrates actual component usage
Component JSDoc: Add one blank line after the Overview section before Usage Example
Component JSDoc @PARAM: Include type information only (e.g., @PARAM {ButtonProps} props), with detailed descriptions provided in the interface definition

Files:

  • src/components/ui/select/index.tsx
src/components/ui/**/index.tsx

📄 CodeRabbit inference engine (.github/instructions/ai-context.instructions.md)

Component implementation files should follow shadcn/ui patterns and include comprehensive TypeScript typing

Files:

  • src/components/ui/select/index.tsx
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/ai-development.instructions.md)

src/**/*.{ts,tsx}: Use CVA (Class Variance Authority) for component styling variants with clear variant types defined
Write comments in Japanese first, then English with 'en:' prefix

Files:

  • src/components/ui/select/index.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Write comments in Japanese followed by English with en: prefix

Files:

  • src/components/ui/select/index.tsx
**/*.{js,ts,jsx,tsx,mjs}

📄 CodeRabbit inference engine (GEMINI.md)

Write comments in Japanese followed by English with en: prefix

Files:

  • src/components/ui/select/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Code comments must follow .github/instructions/comment-style.instructions.md, written in Japanese first, followed by English with en: prefix
Run pnpm lint && pnpm format before committing to ensure code quality

Files:

  • src/components/ui/select/index.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/components/**/*.{ts,tsx}: Follow component creation process and scaffolding guidelines in .github/instructions/new-component.instructions.md
Use TailwindCSS with shadcn/ui patterns for component styling

Files:

  • src/components/ui/select/index.tsx
🧬 Code graph analysis (1)
src/components/ui/select/index.tsx (2)
src/components/ui/icon/index.tsx (1)
  • Icon (36-58)
src/lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (1)
src/components/ui/select/index.tsx (1)

24-24: Invalid/Disabled状態の背景色をFigmaと再確認してください。

以下の組み合わせで背景色が定義されていますが、デザインシステムとの整合性を確認することをお勧めします:

  • Invalid(エラー状態): bg-white(Line 24)
  • Disabled(無効状態): bg-neutral-50(Line 29)
  • Invalid + Disabled: bg-neutral-50(Line 37)

PRコメントでは「Invalid状態の背景色は白」という指摘が取り下げられた経緯があるため、この実装が最終的なデザイン仕様と一致しているか念のため確認してください。

Also applies to: 29-29, 37-37


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/ui/select/index.stories.tsx (1)

34-53: argTypesをmetaレベルで定義することを検討してください。

現在、argTypesは各ストーリーに個別に適用されていますが、metaのargTypes(Line 34)は空のオブジェクトになっています。全ストーリーで共通のargTypesを使用する場合は、metaレベルで定義するとコードが簡潔になります。

以下のように変更できます:

  tags: ["autodocs"],
-  argTypes: {},
+  argTypes: {
+    disabled: {
+      control: "boolean",
+      defaultValue: false,
+    },
+    size: {
+      control: { type: "radio" },
+      options: ["sm", "md", "lg"],
+      defaultValue: "md",
+    },
+    isInvalid: {
+      control: "boolean",
+      defaultValue: false,
+    },
+  },
} satisfies Meta<typeof Select>;

export default meta;
type Story = StoryObj<SelectTriggerProps>;
-const argTypes: Story["argTypes"] = {
-  disabled: {
-    control: "boolean",
-    defaultValue: false,
-  },
-  size: {
-    control: { type: "radio" },
-    options: ["sm", "md", "lg"],
-    defaultValue: "md",
-  },
-  isInvalid: {
-    control: "boolean",
-    defaultValue: false,
-  },
-};

その後、各ストーリーからargTypes: argTypesを削除できます。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 20a4912 and f21f0cb.

⛔ Files ignored due to path filters (1)
  • src/components/ui/select/item.json is excluded by !**/*.json
📒 Files selected for processing (4)
  • README.md (2 hunks)
  • src/components/ui/select/index.figma.tsx (1 hunks)
  • src/components/ui/select/index.stories.tsx (7 hunks)
  • src/components/ui/select/index.tsx (12 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
README.md

📄 CodeRabbit inference engine (.github/instructions/new-component.instructions.md)

Update the 'コンポーネント対応状況' (Component Status) section in README.md after creating a new component

Files:

  • README.md
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Commit messages must follow .github/copilot-commit-message-instructions.md, be written in Japanese with an emoji prefix, and use Conventional Commit format

Files:

  • README.md
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/ai-context.instructions.md)

**/*.{ts,tsx}: Use Japanese first for comments, then English with en: prefix in TypeScript/React files
Follow shadcn/ui patterns with CVA (Class Variance Authority) variants for component styling in React components
Include ARIA labels and use semantic HTML for accessibility in React components

**/*.{ts,tsx}: React components: Write interface properties with bilingual format - Japanese followed by 'en:' and English translation
React components: Write JSDoc with three sections - Overview (日本語/English), Usage Example (executable code), and @PARAM with type only
Interface properties: Separate Japanese and English descriptions with '/' character
Component JSDoc: Usage Example section must contain executable code that demonstrates actual component usage
Component JSDoc: Add one blank line after the Overview section before Usage Example
Component JSDoc @PARAM: Include type information only (e.g., @PARAM {ButtonProps} props), with detailed descriptions provided in the interface definition

Files:

  • src/components/ui/select/index.figma.tsx
  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/ai-development.instructions.md)

src/**/*.{ts,tsx}: Use CVA (Class Variance Authority) for component styling variants with clear variant types defined
Write comments in Japanese first, then English with 'en:' prefix

Files:

  • src/components/ui/select/index.figma.tsx
  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Write comments in Japanese followed by English with en: prefix

Files:

  • src/components/ui/select/index.figma.tsx
  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
**/*.{js,ts,jsx,tsx,mjs}

📄 CodeRabbit inference engine (GEMINI.md)

Write comments in Japanese followed by English with en: prefix

Files:

  • src/components/ui/select/index.figma.tsx
  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Code comments must follow .github/instructions/comment-style.instructions.md, written in Japanese first, followed by English with en: prefix
Run pnpm lint && pnpm format before committing to ensure code quality

Files:

  • src/components/ui/select/index.figma.tsx
  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/components/**/*.{ts,tsx}: Follow component creation process and scaffolding guidelines in .github/instructions/new-component.instructions.md
Use TailwindCSS with shadcn/ui patterns for component styling

Files:

  • src/components/ui/select/index.figma.tsx
  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
**/*.stories.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/ai-development.instructions.md)

Write Storybook stories for component documentation

Files:

  • src/components/ui/select/index.stories.tsx
src/components/ui/**/index.tsx

📄 CodeRabbit inference engine (.github/instructions/ai-context.instructions.md)

Component implementation files should follow shadcn/ui patterns and include comprehensive TypeScript typing

Files:

  • src/components/ui/select/index.tsx
🧬 Code graph analysis (3)
src/components/ui/select/index.figma.tsx (1)
src/components/ui/select/index.tsx (5)
  • SelectTrigger (412-412)
  • Select (409-409)
  • SelectValue (411-411)
  • SelectContent (413-413)
  • SelectItem (415-415)
src/components/ui/select/index.stories.tsx (1)
src/components/ui/select/index.tsx (2)
  • Select (409-409)
  • SelectTriggerProps (143-160)
src/components/ui/select/index.tsx (2)
src/lib/utils.ts (1)
  • cn (4-6)
src/components/ui/icon/index.tsx (1)
  • Icon (36-58)
🔇 Additional comments (6)
src/components/ui/select/index.figma.tsx (1)

1-57: LGTM! Figma Code Connect統合が適切に実装されています。

index.tsxで定義されたSelectTriggerPropsに基づき、size、isInvalid、disabled、valueのマッピングが正しく行われています。過去のレビューで指摘された「isInvaild」のタイポも修正されています。

src/components/ui/select/index.tsx (3)

10-46: LGTM! CVAバリアント定義が適切に構造化されています。

selectTriggerVariantsは、size、isInvalid、isDisabledのバリアントを明確に定義し、compoundVariantsでInvalid + Disabledの組み合わせを適切に処理しています。配列をjoin(" ")で結合するパターンは可読性を向上させています。


142-160: LGTM! SelectTriggerPropsインターフェースが適切に定義されています。

VariantPropsを活用してCVAバリアントから型を抽出し、バイリンガルのJSDocコメント(日本語 + en:プレフィックス付き英語)がコーディングガイドラインに準拠しています。


272-279: LGTM! SelectItemPropsインターフェースが適切に追加されています。

textClassNameプロパティにより、アイテムのテキスト部分のスタイルを柔軟にカスタマイズできます。バイリンガルコメントも適切です。

src/components/ui/select/index.stories.tsx (1)

55-121: PR目標に関する確認: 長いオプションテキストの表示問題

PR Commentsで指摘されている通り、タイムゾーンのオプション(例: "Eastern Standard Time (EST)")がSelectTriggerの幅を超える場合があります。これはGuidelinesの「Don't」に矛盾する可能性があります。

SelectTriggerにoverflow-hidden whitespace-preが設定されていますが、選択後に右側の矢印アイコンが見えなくなる問題が報告されています。

PRコメントで言及された問題を確認するため、長いテキストの切り詰め(text-ellipsis truncateなど)の追加を検討してください。

README.md (1)

251-251: LGTM! コンポーネント対応状況が正しく更新されています。

SelectのFigma Code Connect列が✅に更新され、index.figma.tsxの追加と一致しています。

Comment thread src/components/ui/select/index.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/ui/select/index.stories.tsx (1)

180-226: Storiesのprops順序バグ:isInvalid/disabled{...args} に上書きされます

<SelectTrigger ... isInvalid {...args}> の形だと、controls 側の args.isInvalid(デフォルトfalse等)で上書きされ、Invalid/Disabled系ストーリーが意図通り描画されません。args に寄せるのが一番事故りにくいです。

 export const Invalid: Story = {
-  argTypes: argTypes,
+  args: { isInvalid: true },
+  argTypes: argTypes,
   render: args => (
     <Select>
-      <SelectTrigger className="w-[240px]" isInvalid {...args}>
+      <SelectTrigger className="w-[240px]" {...args}>
         <SelectValue placeholder="選択してください" />
       </SelectTrigger>
       <SelectContent>
         <SelectItem value="1">オプション1</SelectItem>
         <SelectItem value="2">オプション2</SelectItem>
         <SelectItem value="3">オプション3</SelectItem>
       </SelectContent>
     </Select>
   ),
 };

 export const Disabled: Story = {
-  argTypes: argTypes,
+  args: { disabled: true },
+  argTypes: argTypes,
   render: args => (
     <Select>
-      <SelectTrigger className="w-[240px]" disabled {...args}>
+      <SelectTrigger className="w-[240px]" {...args}>
         <SelectValue placeholder="選択してください" />
       </SelectTrigger>
       <SelectContent>
         <SelectItem value="1">オプション1</SelectItem>
         <SelectItem value="2">オプション2</SelectItem>
         <SelectItem value="3">オプション3</SelectItem>
       </SelectContent>
     </Select>
   ),
 };

 export const DisabledWithInvalidState: Story = {
-  argTypes: argTypes,
+  args: { disabled: true, isInvalid: true },
+  argTypes: argTypes,
   render: args => (
     <Select>
-      <SelectTrigger className="w-[240px]" disabled isInvalid {...args}>
+      <SelectTrigger className="w-[240px]" {...args}>
         <SelectValue placeholder="選択してください" />
       </SelectTrigger>
       <SelectContent>
         <SelectItem value="1">オプション1</SelectItem>
         <SelectItem value="2">オプション2</SelectItem>
         <SelectItem value="3">オプション3</SelectItem>
       </SelectContent>
     </Select>
   ),
 };
🧹 Nitpick comments (2)
src/components/ui/select/index.tsx (1)

142-160: SelectTriggerProps のプロパティdoc形式(/ 区切り)とJSDoc構成をガイドラインに揃えたいです

現状の日本語+en: の複数行スタイルだと、提示されている「/ 区切り」ルールとズレています。また、SelectTrigger のJSDocは Usage Example セクションが無いので、ガイドライン準拠を狙うなら追記が必要です。

(コーディングガイドラインに基づき、)

Also applies to: 162-169

src/components/ui/select/index.stories.tsx (1)

16-53: Storybookの型付けとargTypes.defaultValueの効き方は、採用バージョン前提で一度確認したいです

StoryObj<SelectTriggerProps>argTypes.defaultValue の挙動は Storybook のバージョン/設定で差が出やすいので、意図通り controls に反映されるかだけ確認があると安心です(必要なら meta.args / 各storyの args に寄せる)。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between f21f0cb and 7914cda.

📒 Files selected for processing (2)
  • src/components/ui/select/index.stories.tsx (7 hunks)
  • src/components/ui/select/index.tsx (12 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/ai-context.instructions.md)

**/*.{ts,tsx}: Use Japanese first for comments, then English with en: prefix in TypeScript/React files
Follow shadcn/ui patterns with CVA (Class Variance Authority) variants for component styling in React components
Include ARIA labels and use semantic HTML for accessibility in React components

**/*.{ts,tsx}: React components: Write interface properties with bilingual format - Japanese followed by 'en:' and English translation
React components: Write JSDoc with three sections - Overview (日本語/English), Usage Example (executable code), and @PARAM with type only
Interface properties: Separate Japanese and English descriptions with '/' character
Component JSDoc: Usage Example section must contain executable code that demonstrates actual component usage
Component JSDoc: Add one blank line after the Overview section before Usage Example
Component JSDoc @PARAM: Include type information only (e.g., @PARAM {ButtonProps} props), with detailed descriptions provided in the interface definition

Files:

  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/ai-development.instructions.md)

src/**/*.{ts,tsx}: Use CVA (Class Variance Authority) for component styling variants with clear variant types defined
Write comments in Japanese first, then English with 'en:' prefix

Files:

  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
**/*.stories.{ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/ai-development.instructions.md)

Write Storybook stories for component documentation

Files:

  • src/components/ui/select/index.stories.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Write comments in Japanese followed by English with en: prefix

Files:

  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
**/*.{js,ts,jsx,tsx,mjs}

📄 CodeRabbit inference engine (GEMINI.md)

Write comments in Japanese followed by English with en: prefix

Files:

  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Code comments must follow .github/instructions/comment-style.instructions.md, written in Japanese first, followed by English with en: prefix
Run pnpm lint && pnpm format before committing to ensure code quality

Files:

  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/components/**/*.{ts,tsx}: Follow component creation process and scaffolding guidelines in .github/instructions/new-component.instructions.md
Use TailwindCSS with shadcn/ui patterns for component styling

Files:

  • src/components/ui/select/index.stories.tsx
  • src/components/ui/select/index.tsx
src/components/ui/**/index.tsx

📄 CodeRabbit inference engine (.github/instructions/ai-context.instructions.md)

Component implementation files should follow shadcn/ui patterns and include comprehensive TypeScript typing

Files:

  • src/components/ui/select/index.tsx
🧬 Code graph analysis (2)
src/components/ui/select/index.stories.tsx (1)
src/components/ui/select/index.tsx (3)
  • Select (409-409)
  • SelectTriggerProps (143-160)
  • SelectTrigger (412-412)
src/components/ui/select/index.tsx (2)
src/lib/utils.ts (1)
  • cn (4-6)
src/components/ui/icon/index.tsx (1)
  • Icon (36-58)
🔇 Additional comments (4)
src/components/ui/select/index.tsx (4)

48-58: アイコンのdisabled時カラー切替は分かりやすいです

selectIconVariantsisDisabled に応じて色を出し分けているのは意図が明確で良いです。


256-267: SelectLabel のクラス直書きは読みやすくて良いです

バリアント不要な箇所を cn(...) に寄せていて、保守性も上がっていると思います。


272-318: textClassNameItemText に渡す修正はOKです

テキスト領域にだけクラスを当てられるようになっていて、スタイルの責務分離もできています。


66-72: このTailwind構文は実際には有効です — v4の標準形式です

Tailwind v4では、CSS カスタムプロパティの短縮形として max-h-(--var) および origin-(--var) 構文が標準となっており、max-h-[var(--radix-...)] に変換する必要はありません。この形式はビルド互換性の問題を引き起こさず、むしろ v4の推奨される表記法です。コードは正しく記述されています。

Comment thread src/components/ui/select/index.tsx
@touyou

touyou commented Dec 12, 2025

Copy link
Copy Markdown
Member Author
image

memo
ありがとうcoderabbit

@touyou
touyou merged commit bfc5462 into main Dec 12, 2025
4 checks passed
@touyou
touyou deleted the fix/select branch December 12, 2025 02:12
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.

2 participants