@src/components/filters/GlobalFilterBar.tsx /asignees 画面で、グローバルフィルターに PROJECT…
- User
@src/components/filters/GlobalFilterBar.tsx
/asignees画面で、グローバルフィルターに PROJECT フィルターを追加する。 これはプロジェクトに遷移するのではなく、ステータスのフィルターと同じく、最初は全てのプロジェクトがONになっており、任意のプロジェクトボタンをOFFにすると、課題一覧からOFFにしたプロジェクトが非表示になる。 Assistant
まず、プロジェクトの概要と関連ファイルを確認します。
The user wants to add a PROJECT filter to the global filter bar on the
/assigneespage. This filter should work similarly to the status filter - all projects are ON by default, and toggling a project OFF hides issues from that project in the issue list.Let me first read the overview document and then explore the relevant files.
Assistant
次に、
/assigneesページと関連するコンポーネントを確認します。Now let me explore the
/assigneespage and its related components to understand how the current filtering works.Assistant
レイアウトファイルとコンテキストファイルの全体を確認します。
Now I have a good understanding of the codebase. Let me also read the full layout.tsx and ProjectDataContext.tsx to understand the complete picture.
Assistant
全体像が把握できました。プランを作成します。
Now I have a thorough understanding of the codebase. Let me create a plan for adding a PROJECT filter to the GlobalFilterBar on the
/assigneespage.The key points are:
- The
/assigneespage currently shows all projects' issues grouped by assignee - The GlobalFilterBar currently has:
- Project tabs (only on projects view, not on assignees view)
- Assignee shortcuts (only on assignees view)
- Status filters (on both views)
- We need to add a PROJECT filter on the assignees view, similar to the status filter:
- All projects ON by default
- Toggle individual projects OFF to hide their issues
- This is NOT navigation (like the project tabs), but a toggle filter
My implementation approach: I'll add
activeProjectsstate toProjectDataContextas a Set of active project names, then pass project filter options and handlers toGlobalFilterBarso it can render a PROJECT filter row when on the assignees view, and finally wire everything together inlayout.tsx.Then I need to apply this filter when grouping issues by assignee and make sure the assignee sidebar respects the project filter too.
- The
- User
フィルターの順番はProject>Human>Statusにして
Assistant
プランのUIイメージ部分を更新します。
Assistant
また、GlobalFilterBar.tsx 内の描画順も合わせて更新します。
Assistant
プランを更新しました。GlobalFilterBar 内のフィルター行の表示順を Project > Human > Status に変更しています。
- Project: 新規追加のプロジェクトトグルフィルター(最上段)
- Human: 既存の担当者ショートカット(中段)
- Status: 既存のステータスフィルター(最下段)
この内容でよろしければ、実装を開始します。
- User
Assistant
実装を開始します。まず最初のタスクから取り掛かります。
Let me implement the plan step by step. I'll start with the first todo: adding
activeProjects/setActiveProjectstoProjectDataContext.Assistant
1. ProjectDataContext に activeProjects を追加
Assistant
データ取得後に全プロジェクトを初期選択状態にします。
Assistant
filteredAssigneeOptionsにactiveProjectsフィルターを追加します。Assistant
コンテキストの value に
activeProjects/setActiveProjectsを追加します。Assistant
2. GlobalFilterBar にプロジェクトトグルフィルターを追加
Assistant
関数の引数に新しい props を追加します。
Assistant
toggleProject関数とプロジェクトフィルターの UI を追加します。Assistant
JSX にプロジェクトトグルフィルター行を追加します。表示順は Project > Human > Status です。
Assistant
3. layout.tsx で新しいフィルター props を GlobalFilterBar に渡す
Assistant
4. assignees/page.tsx に activeProjects フィルターを適用
Assistant
リンターエラーを確認します。
Assistant
変更後のファイルを最終確認します。
Assistant
全ファイルの変更が正しく反映されています。
Assistant
全4タスクが完了しました。変更内容をまとめます。
変更ファイルと内容
1.
src/contexts/ProjectDataContext.tsxactiveProjects: Set<string>state とsetActiveProjectsを追加- データ取得完了時に全プロジェクト名で初期化
filteredAssigneeOptionsの算出でactiveProjectsフィルターを適用(OFF にしたプロジェクト固有の担当者がサイドバーからも消える)- コンテキスト value に
activeProjects/setActiveProjectsを公開
2.
src/components/filters/GlobalFilterBar.tsxshowProjectToggleFilter,projectFilterOptions,activeProjects,onProjectFilterChangeの 4 つの props を追加toggleProject関数を追加(ステータスと同じトグルパターン)- 担当者ショートカット(Human)の上にプロジェクトトグルフィルター行を描画(表示順: Project > Human > Status)
- 「All」ボタンで全プロジェクト ON、個別ボタンでトグル ON/OFF
3.
src/app/(dashboard)/layout.tsxuseProjectData()からactiveProjects/setActiveProjectsを取得GlobalFilterBarにshowProjectToggleFilter={isAssigneesView}など新 props を渡す
4.