-
Notifications
You must be signed in to change notification settings - Fork 5
Add "すべて" (All) tab to library page #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
- Added "all" status to ReadingStatus type - Added "すべて" tab with bookmarks icon to status metadata - Updated readingStatusOrder to include "all" as the first tab - Modified database query to fetch books from all statuses when "all" is selected - Updated page validation to support "all" status - Added empty state message for "all" status Resolves #172 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: arrow2nd / tanida <[email protected]>
Walkthroughライブラリ機能に「all」ステータスを追加。型・バリデーション・定数(表示順/メタデータ/メッセージ)・DB検索条件・ページのバリデーション利用箇所を更新し、ライブラリ横断検索に対応。 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant P as Library/[status] Page
participant V as libraryReadingStatusSchema
participant Q as searchBooksFromLibrary
participant DB as Database
U->>P: アクセス / 検索 (status, q)
P->>V: status検証
alt 検証OK
P->>Q: searchBooksFromLibrary(status, q)
alt status == "all"
Note over Q: 3状態(want_read, reading, read)で検索
Q->>DB: WHERE status IN (...)
else その他
Q->>DB: WHERE status = status
end
DB-->>Q: 結果
Q-->>P: 書籍一覧
P-->>U: レンダリング
else 検証NG
P-->>U: 404/リダイレクト等(既存フロー)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/types/readingStatus.ts (1)
17-20: スキーマの重複を検討してください。
readingStatusSchemaWithoutNoneとlibraryReadingStatusSchemaは現在、同じフィルタ条件(v !== "none"を除外)を使用しており、機能的に等価です。この重複が将来的にメンテナンスの負担になる可能性があります。もし両者が将来的に異なる動作を持つ予定であれば問題ありませんが、そうでない場合は統合を検討してください。または、コメントで使い分けの意図を明記することをお勧めします。
src/app/(framed)/library/[status]/page.tsx (1)
13-13: 重複バリデーションスキーマを整理
readingStatusSchemaWithoutNoneはlibraryReadingStatusSchemaとフィルタ条件(v !== "none")が同一かつコードベースで未使用です。不要であれば削除するか、使い分けの意図をドキュメント化してください。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/app/(framed)/library/[status]/page.tsx(3 hunks)src/constants/library-message.ts(1 hunks)src/constants/status.tsx(2 hunks)src/db/queries/status.ts(2 hunks)src/types/readingStatus.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/types/*.ts
⚙️ CodeRabbit configuration file
全体で使用する型定義を格納しています
Files:
src/types/readingStatus.ts
🧬 Code graph analysis (4)
src/constants/status.tsx (4)
src/types/readingStatus.ts (1)
ReadingStatus(11-11)src/components/BookReadingStatusForm/index.tsx (1)
BookReadingStatusForm(31-95)src/components/BookReadingStatusForm/ReadingStatusButton.tsx (1)
BookReadingStatusButton(15-40)src/app/(framed)/library/[status]/_components/Tab/index.tsx (1)
Tab(12-24)
src/app/(framed)/library/[status]/page.tsx (1)
src/types/readingStatus.ts (1)
libraryReadingStatusSchema(20-20)
src/constants/library-message.ts (1)
src/actions/updateReadingStatus.ts (1)
updateReadingStatus(24-94)
src/types/readingStatus.ts (3)
src/actions/updateReadingStatus.ts (1)
updateReadingStatus(24-94)src/hooks/useUpdateReadingStatus.ts (2)
useUpdateReadingStatus(10-41)bookIdentifiers(14-36)src/components/BookReadingStatusForm/index.tsx (1)
BookReadingStatusForm(31-95)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: storybook-test
🔇 Additional comments (7)
src/constants/library-message.ts (1)
10-10: LGTM!「すべて」タブの空メッセージが「よんだ」タブと同じ「ナニモナイ」になっていますが、意図的な設計と判断します。
src/app/(framed)/library/[status]/page.tsx (1)
35-35: バリデーションロジックは正常に動作します。
libraryReadingStatusSchemaを使用してステータスのバリデーションを行っています。"all" を含むライブラリ専用のスキーマが正しく適用されており、実装に問題はありません。Also applies to: 61-61
src/db/queries/status.ts (1)
71-75: "none" ステータスの除外を確認してください。"all" ステータスの条件では
["want_read", "reading", "read"]のみを含め、"none" を除外しています。これは意図的な設計でしょうか?ユーザーの期待として、「すべて」タブでは "none"(よんでない)も含めた全ての書籍が表示されると解釈される可能性があります。現在の実装では、「よんでない」ステータスの書籍はライブラリに登録されていないため除外されるのが正しい動作かもしれませんが、仕様として明確にしておくことをお勧めします。
src/constants/status.tsx (3)
56-63: LGTM!"all" ステータスのメタデータが正しく定義されています。ラベル「すべて」と対応するアイコンが設定されており、実装に問題はありません。
6-7: アイコンファイルの存在を確認しました
src/assets/icons/bookmarks.svg と src/assets/icons/bookmarks-filled.svg が存在します。
66-66:readingStatusOrderはBookReadingStatusFormで参照されていません
リポジトリ内に該当コンポーネントが存在せず、"all" が誤って表示される心配はありません。Likely an incorrect or invalid review comment.
src/types/readingStatus.ts (1)
6-6: updateReadingStatus に “all” ステータスが渡らないことを保証してください。
コード検索では関数呼び出し箇所が検出できず、API 経由で“all”が誤って処理される可能性を排除できませんでした。リクエスト入力で“all”を拒否またはエラー化するバリデーションを実装済みか手動でご確認ください。
Summary
This PR adds a new "すべて" (All) tab to the library page that displays all books across all reading statuses.
Changes
Testing
Resolves #172
🤖 Generated with Claude Code
Summary by CodeRabbit