Skip to content
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

feat: クエスト詳細ページの簡易実装を追加 #461

Merged
merged 5 commits into from
Jun 30, 2024

Conversation

tatsutakein
Copy link
Member

@tatsutakein tatsutakein commented Jun 30, 2024

Issue

概要

クエスト詳細ページの簡易実装を追加します。

レビュー観点

レビューレベル

  • Lv0: まったく見ないで Approve する
  • Lv1: ぱっとみて違和感がないかチェックして Approve する
  • Lv2: 仕様レベルまで理解して、仕様通りに動くかある程度検証して Approve する
  • Lv3: 実際に環境で動作確認したうえで Approve する

レビュー優先度

  • すぐに見てもらいたい ( hotfix など ) 🚀
  • 今日中に見てもらいたい 🚗
  • 今日〜明日中で見てもらいたい 🚶
  • 数日以内で見てもらいたい 🐢

参考リンク

スクリーンショット

Before After

Summary by CodeRabbit

  • 新機能

    • クエストの詳細に新しいフィールド(開始日時、終了日時、カテゴリ、ステータス、カバー画像URL、ノート)を追加。
  • バグ修正

    • クエストの名前フィールドをタイトルに変更。
  • 改善

    • クエスト詳細ページでQuestContentSafeAreaで囲むように変更。
  • 翻訳

    • クエスト詳細に関連する日本語のローカリゼーション文字列を追加。

@tatsutakein tatsutakein requested a review from a team as a code owner June 30, 2024 14:37
@github-actions github-actions bot added @core/common core common package @core/data core data package @core/database core database package @core/domain core domain package @core/model core model package @core/network core network package @feature/home feature home package @app/catalog Catalog development @feature/quest feature quest package @core/ui core ui package @core/database_isar core database_isar package @core/network_ferry labels Jun 30, 2024
Copy link

coderabbitai bot commented Jun 30, 2024

Walkthrough

この変更は、クエスト詳細機能の拡張に焦点を当てています。クエストデータに新たなフィールドを追加し、これに関連するすべてのクラスや関数もアップデートしました。さらに、ローカリゼーションファイルに新しいラベルとプレースホルダーが追加されました。詳細ページはSafeAreaにラップされ、ユーザーエクスペリエンスが向上します。

Changes

ファイルパス 変更概要
...component/quest_list_tile.dart Questオブジェクトの初期化に新フィールド追加
core/common/lib/extension.dart 新しいモジュール (receiver.dart, string.dart) をエクスポート
core/common/lib/src/extension/string.dart 文字列のtoCamelCase()メソッドを追加
core/data/lib/src/quest_repository.dart insertmergesメソッドに新しいパラメータを追加
core/database/lib/src/quest/quest_dao.dart QuestDaoのメソッド署名を更新して新しいパラメータを追加
core/database_isar/lib/src/quest/isar_quest_dao.dart updateおよびmergesメソッドのパラメータと処理を更新
core/database_isar/lib/src/quest/model/quest.dart プロパティの名前変更と新しいフィールド追加
core/domain/lib/src/use_case/quest/add_quest_use_case.dart 追加パラメータをインポートし、insertメソッドに渡す
core/model/lib/quest.dart 新しいクエストファイルをエクスポート
core/model/lib/src/quest/quest.dart 新しいフィールドとインポートを追加
core/model/lib/src/quest/quest.freezed.dart プロパティとメソッドシグネチャを更新
core/model/lib/src/quest/quest_status.dart 新しいQuestStatus列挙型を追加
...network/model/network_main_quest.dart 新しいフィールドを追加し、型を更新
...network/model/network_main_quest.freezed.dart 新しいフィールドを追加し、copyWithメソッドを更新
.../ferry_network_main_quest_transformer.dart transformメソッドに新しいフィールドを追加
core/ui/lib/src/quest_list_tile.dart _quest.name_quest.titleに変更
...component/recent_quest_list_section.dart quest.namequest.titleに変更
.../l10n/l10n.dart, l10n_en.dart, l10n_ja.dart, app_en.arb クエスト詳細フィールド用の新しいローカリゼーションストリングを追加
.../quest_detail_page.dart QuestContentSafeAreaでラップする
...add_quest_use_case.g.dart _$addQuestUseCaseHash()メソッドのハッシュ値を更新

Assessment against linked issues

Objective Addressed Explanation
クエスト詳細ページの簡易実装を追加 (#460)

Poem

クエストが始まる、新たな光
詳細が増え、世界が拡がり
タイトルもノートも、欠かさずに
データは豊かに、夢の旅路へ
🐇✨🌟


Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.
  • OSS projects are always opted into early access features.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tatsutakeinjp-bot
Copy link
Contributor

tatsutakeinjp-bot bot commented Jun 30, 2024

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

https://asis-quest-catalog-dev--pr461-feature-gh-460-wiq29oxl.web.app

(expires Sun, 07 Jul 2024 14:43:56 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 5aa3b98f0f68e3358ab4b28a7b45d288ba01e139

@tatsutakeinjp-bot tatsutakeinjp-bot bot added the ignore for release Exclude from Release Notes label Jun 30, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 11

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b26e928 and fbdedb9.

Files selected for processing (25)
  • catalog/lib/ui/component/quest_list_tile.dart (1 hunks)
  • core/common/lib/extension.dart (1 hunks)
  • core/common/lib/src/extension/string.dart (1 hunks)
  • core/data/lib/src/quest_repository.dart (4 hunks)
  • core/database/lib/src/quest/quest_dao.dart (1 hunks)
  • core/database_isar/lib/src/quest/isar_quest_dao.dart (2 hunks)
  • core/database_isar/lib/src/quest/model/quest.dart (2 hunks)
  • core/database_isar/lib/src/quest/model/quest.g.dart (30 hunks)
  • core/domain/lib/src/use_case/quest/add_quest_use_case.dart (2 hunks)
  • core/model/lib/quest.dart (1 hunks)
  • core/model/lib/src/quest/quest.dart (2 hunks)
  • core/model/lib/src/quest/quest.freezed.dart (8 hunks)
  • core/model/lib/src/quest/quest_status.dart (1 hunks)
  • core/network/lib/src/quest/model/network_main_quest.dart (1 hunks)
  • core/network/lib/src/quest/model/network_main_quest.freezed.dart (11 hunks)
  • core/network_ferry/lib/src/quests/ferry_network_main_quest_transformer.dart (1 hunks)
  • core/ui/lib/src/quest_list_tile.dart (1 hunks)
  • feature/home/lib/src/ui/page/home/component/recent_quest_list_section.dart (1 hunks)
  • feature/quest/lib/src/gen/l10n/l10n.dart (1 hunks)
  • feature/quest/lib/src/gen/l10n/l10n_en.dart (1 hunks)
  • feature/quest/lib/src/gen/l10n/l10n_ja.dart (1 hunks)
  • feature/quest/lib/src/l10n/app_en.arb (1 hunks)
  • feature/quest/lib/src/l10n/app_ja.arb (1 hunks)
  • feature/quest/lib/src/ui/page/detail/component/quest_content.dart (2 hunks)
  • feature/quest/lib/src/ui/page/detail/quest_detail_page.dart (1 hunks)
Files not summarized due to errors (1)
  • core/database_isar/lib/src/quest/model/quest.g.dart: Error: Message exceeds token limit
Files skipped from review due to trivial changes (4)
  • core/common/lib/extension.dart
  • core/model/lib/quest.dart
  • core/model/lib/src/quest/quest_status.dart
  • feature/home/lib/src/ui/page/home/component/recent_quest_list_section.dart
Additional comments not posted (76)
core/network/lib/src/quest/model/network_main_quest.dart (1)

14-19: 新しいフィールドの追加

新しいフィールドが NetworkMainQuest クラスに追加されました。これらのフィールドは、クエストの詳細を表すために必要です。

core/model/lib/src/quest/quest.dart (1)

15-22: 新しいフィールドの追加

新しいフィールドが Quest クラスに追加されました。これらのフィールドは、クエストの詳細を表すために必要です。

core/ui/lib/src/quest_list_tile.dart (1)

17-17: プロパティの変更

QuestListTile クラスの title プロパティが _quest.name から _quest.title に変更されました。この変更は、新しい Quest クラスのフィールドに一致しています。

core/common/lib/src/extension/string.dart (1)

1-24: 新しいメソッドの追加

StringX 拡張に文字列をキャメルケースに変換するメソッドが追加されました。このメソッドは正しく動作し、パフォーマンスも適切です。

feature/quest/lib/src/ui/page/detail/quest_detail_page.dart (1)

23-24: LGTM!

SafeArea を使用して、コンテンツが安全領域内に表示されるようにする変更は適切です。

catalog/lib/ui/component/quest_list_tile.dart (1)

13-23: LGTM!

Quest エンティティに新しいフィールドを追加する変更は適切です。これにより、クエストの詳細情報が正しく表示されます。

feature/quest/lib/src/l10n/app_ja.arb (1)

5-14: LGTM!

クエストの詳細に関する新しいローカライズ文字列の追加は適切です。これにより、ユーザーインターフェースが改善されます。

feature/quest/lib/src/l10n/app_en.arb (1)

5-14: LGTM!

クエストの詳細に関する新しいローカライズ文字列の追加は適切です。これにより、ユーザーインターフェースが改善されます。

core/network_ferry/lib/src/quests/ferry_network_main_quest_transformer.dart (1)

20-25: 新しいフィールドを追加する際の確認

新しいフィールド begunAt, endedAt, categoryId, status, coverImageUrl, notetransformToNetworkMainQuest メソッドに追加されました。これらのフィールドが正しくマッピングされていることを確認してください。

全体的に見て、これらの変更は問題ないようです。

core/domain/lib/src/use_case/quest/add_quest_use_case.dart (1)

24-31: 新しいフィールドを追加する際の確認

新しいフィールド userId, begunAt, endedAt, categoryId, status, coverImageUrlinsert メソッドに追加されました。これらのフィールドが正しく渡されていることを確認してください。

全体的に見て、これらの変更は問題ないようです。

core/database/lib/src/quest/quest_dao.dart (1)

31-36: 新しいフィールドを追加する際の確認

merges メソッドに新しいフィールド begunAt, endedAt, categoryId, status, coverImageUrl, note が追加されました。これらのフィールドが正しく処理されていることを確認してください。

全体的に見て、これらの変更は問題ないようです。

core/database_isar/lib/src/quest/model/quest.dart (4)

12-19: 新しいフィールドを追加する際の確認

Quest クラスに新しいフィールド title, begunAt, endedAt, categoryId, status, coverImageUrl, note が追加されました。これらのフィールドが正しく初期化されていることを確認してください。

全体的に見て、これらの変更は問題ないようです。


23-30: 新しいフィールドを追加する際の確認

Quest クラスのフィールド title, begunAt, endedAt, categoryId, status, coverImageUrl, note が正しく宣言されていることを確認してください。

全体的に見て、これらの変更は問題ないようです。


36-43: 新しいフィールドを追加する際の確認

QuestExtensionasModel メソッドに新しいフィールド title, begunAt, endedAt, categoryId, status, coverImageUrl, note が追加されました。これらのフィールドが正しくマッピングされていることを確認してください。

全体的に見て、これらの変更は問題ないようです。


50-57: 新しいフィールドを追加する際の確認

QuestModelExtensionasDbModel メソッドに新しいフィールド title, begunAt, endedAt, categoryId, status, coverImageUrl, note が追加されました。これらのフィールドが正しくマッピングされていることを確認してください。

全体的に見て、これらの変更は問題ないようです。

feature/quest/lib/src/gen/l10n/l10n_ja.dart (10)

18-19: 新しい翻訳を確認してください
questDetailContentBegunAtLabel の翻訳は「開始日時」となっていますが、これは適切な日本語です。


21-22: 新しい翻訳を確認してください
questDetailContentBegunAtEmptyText の翻訳は「設定されていません」となっていますが、これは適切な日本語です。


24-25: 新しい翻訳を確認してください
questDetailContentEndedAtLabel の翻訳は「終了日時」となっていますが、これは適切な日本語です。


27-28: 新しい翻訳を確認してください
questDetailContentEndedAtEmptyText の翻訳は「設定されていません」となっていますが、これは適切な日本語です。


30-31: 新しい翻訳を確認してください
questDetailContentCategoryLabel の翻訳は「カテゴリ」となっていますが、これは適切な日本語です。


33-34: 新しい翻訳を確認してください
questDetailContentCategoryEmptyText の翻訳は「設定されていません」となっていますが、これは適切な日本語です。


36-37: 新しい翻訳を確認してください
questDetailContentStatusLabel の翻訳は「ステータス」となっていますが、これは適切な日本語です。


39-40: 新しい翻訳を確認してください
questDetailContentStatusEmptyText の翻訳は「設定されていません」となっていますが、これは適切な日本語です。


42-43: 新しい翻訳を確認してください
questDetailContentNoteLabel の翻訳は「ノート」となっていますが、これは適切な日本語です。


45-46: 新しい翻訳を確認してください
questDetailContentNoteEmptyText の翻訳は「設定されていません」となっていますが、これは適切な日本語です。

feature/quest/lib/src/gen/l10n/l10n_en.dart (10)

18-19: New translation check
The translation for questDetailContentBegunAtLabel as "Begun At" is appropriate.


21-22: New translation check
The translation for questDetailContentBegunAtEmptyText as "Not set" is appropriate.


24-25: New translation check
The translation for questDetailContentEndedAtLabel as "Ended At" is appropriate.


27-28: New translation check
The translation for questDetailContentEndedAtEmptyText as "Not set" is appropriate.


30-31: New translation check
The translation for questDetailContentCategoryLabel as "Category" is appropriate.


33-34: New translation check
The translation for questDetailContentCategoryEmptyText as "Not set" is appropriate.


36-37: New translation check
The translation for questDetailContentStatusLabel as "Status" is appropriate.


39-40: New translation check
The translation for questDetailContentStatusEmptyText as "Not set" is appropriate.


42-43: New translation check
The translation for questDetailContentNoteLabel as "Note" is appropriate.


45-46: New translation check
The translation for questDetailContentNoteEmptyText as "Not set" is appropriate.

core/data/lib/src/quest_repository.dart (6)

39-39: 新しいパラメータの追加を確認してください
userId パラメータが追加されました。これは正しいです。


42-43: 新しいパラメータの追加を確認してください
begunAtendedAt パラメータが追加されました。これは正しいです。


44-45: 新しいパラメータの追加を確認してください
categoryIdstatus パラメータが追加されました。これは正しいです。


46-46: 新しいパラメータの追加を確認してください
coverImageUrl パラメータが追加されました。これは正しいです。


61-66: 新しいパラメータの追加を確認してください
merges メソッドに新しいフィールドが追加されました。これは正しいです。


93-102: 新しいフィールドの追加を確認してください
sync メソッドに新しいフィールドが追加されました。これは正しいです。

core/database_isar/lib/src/quest/isar_quest_dao.dart (3)

70-72: 新しいパラメータの追加を確認してください
update メソッドに新しいフィールドが追加されました。これは正しいです。


98-108: 新しいフィールドの追加を確認してください
merges メソッドに新しいフィールドが追加されました。これは正しいです。


118-125: 新しいフィールドの追加を確認してください
merges メソッドのマッピングに新しいフィールドが追加されました。これは正しいです。

feature/quest/lib/src/gen/l10n/l10n.dart (10)

117-121: ローカリゼーション文字列の追加

questDetailContentBegunAtLabel は適切に追加されています。特に問題はありません。


123-127: ローカリゼーション文字列の追加

questDetailContentBegunAtEmptyText は適切に追加されています。特に問題はありません。


129-133: ローカリゼーション文字列の追加

questDetailContentEndedAtLabel は適切に追加されています。特に問題はありません。


135-139: ローカリゼーション文字列の追加

questDetailContentEndedAtEmptyText は適切に追加されています。特に問題はありません。


141-145: ローカリゼーション文字列の追加

questDetailContentCategoryLabel は適切に追加されています。特に問題はありません。


147-151: ローカリゼーション文字列の追加

questDetailContentCategoryEmptyText は適切に追加されています。特に問題はありません。


153-157: ローカリゼーション文字列の追加

questDetailContentStatusLabel は適切に追加されています。特に問題はありません。


159-163: ローカリゼーション文字列の追加

questDetailContentStatusEmptyText は適切に追加されています。特に問題はありません。


165-169: ローカリゼーション文字列の追加

questDetailContentNoteLabel は適切に追加されています。特に問題はありません。


171-175: ローカリゼーション文字列の追加

questDetailContentNoteEmptyText は適切に追加されています。特に問題はありません。

core/model/lib/src/quest/quest.freezed.dart (7)

20-27: 新しいフィールドの追加

Quest クラスに新しいフィールドが追加されています。特に問題はありません。


38-47: コピーウィズメソッドの更新

Quest クラスの copyWith メソッドが新しいフィールドを反映するように更新されています。特に問題はありません。


64-71: コピーウィズメソッドの更新

Quest クラスの copyWith メソッドが新しいフィールドを反映するように更新されています。特に問題はありません。


121-130: コピーウィズメソッドの更新

Quest クラスの copyWith メソッドが新しいフィールドを反映するように更新されています。特に問題はありません。


145-155: コピーウィズメソッドの更新

Quest クラスの copyWith メソッドが新しいフィールドを反映するように更新されています。特に問題はありません。


202-207: 新しいフィールドの追加

Quest クラスに新しいフィールドが追加されています。特に問題はありません。


218-225: 新しいフィールドの追加

Quest クラスに新しいフィールドが追加されています。特に問題はありません。

core/network/lib/src/quest/model/network_main_quest.freezed.dart (7)

22-27: 新しいフィールドの追加

NetworkMainQuest クラスに新しいフィールドが追加されています。特に問題はありません。


40-49: コピーウィズメソッドの更新

NetworkMainQuest クラスの copyWith メソッドが新しいフィールドを反映するように更新されています。特に問題はありません。


68-73: コピーウィズメソッドの更新

NetworkMainQuest クラスの copyWith メソッドが新しいフィールドを反映するように更新されています。特に問題はありません。


124-133: コピーウィズメソッドの更新

NetworkMainQuest クラスの copyWith メソッドが新しいフィールドを反映するように更新されています。特に問題はありません。


150-155: コピーウィズメソッドの更新

NetworkMainQuest クラスの copyWith メソッドが新しいフィールドを反映するように更新されています。特に問題はありません。


202-210: 新しいフィールドの追加

NetworkMainQuest クラスに新しいフィールドが追加されています。特に問題はありません。


218-229: 新しいフィールドの追加

NetworkMainQuest クラスに新しいフィールドが追加されています。特に問題はありません。

core/database_isar/lib/src/quest/model/quest.g.dart (8)

28-28: フィールド title の追加

title フィールドが Quest スキーマに追加されました。これにより、クエストのタイトルを保存できます。


36-42: フィールド begunAtendedAt の追加

begunAtendedAt フィールドが Quest スキーマに追加されました。これにより、クエストの開始日と終了日を保存できます。


44-56: フィールド categoryIdstatuscoverImageUrlnote の追加

categoryIdstatuscoverImageUrl、および note フィールドが Quest スキーマに追加されました。これにより、クエストのカテゴリ、ステータス、カバー画像URL、およびメモを保存できます。


73-96: シリアライズの更新

新しいフィールド titlebegunAtendedAtcategoryIdstatuscoverImageUrl、および note がシリアライズに追加されました。これにより、クエストオブジェクトのこれらのフィールドを保存できます。


104-145: デシリアライズの更新

新しいフィールド titlebegunAtendedAtcategoryIdstatuscoverImageUrl、および note がデシリアライズに追加されました。これにより、保存されたクエストオブジェクトのこれらのフィールドを読み取ることができます。


Line range hint 551-710: クエリフィルタの更新

新しいフィールド title に対するクエリフィルタが追加されました。これにより、title フィールドを基準にクエストをフィルタリングできます。


895-1789: クエリフィルタの更新

新しいフィールド begunAtendedAtcategoryIdstatuscoverImageUrl、および note に対するクエリフィルタが追加されました。これにより、これらのフィールドを基準にクエストをフィルタリングできます。


Line range hint 2154-2313: プロパティクエリの更新

新しいフィールド titlebegunAtendedAtcategoryIdstatuscoverImageUrl、および note に対するプロパティクエリが追加されました。これにより、これらのフィールドを直接クエリできます。

Comment on lines +77 to +81
Text(l10n.questDetailContentCategoryLabel),
if (quest.categoryId != null)
Text(quest.categoryId!)
else
Text(l10n.questDetailContentCategoryEmptyText),
Copy link

Choose a reason for hiding this comment

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

カテゴリの表示

quest.categoryId が存在しない場合のプレースホルダーを追加することを検討してください。

- if (quest.categoryId != null)
-   Text(quest.categoryId!)
- else
-   Text(l10n.questDetailContentCategoryEmptyText),
+ Text(quest.categoryId ?? l10n.questDetailContentCategoryEmptyText),
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Text(l10n.questDetailContentCategoryLabel),
if (quest.categoryId != null)
Text(quest.categoryId!)
else
Text(l10n.questDetailContentCategoryEmptyText),
Text(l10n.questDetailContentCategoryLabel),
Text(quest.categoryId ?? l10n.questDetailContentCategoryEmptyText),

Comment on lines +21 to +22
final provider = questStreamByIdUseCaseProvider(id: _questId);
final quest = ref.watch(provider);
Copy link

Choose a reason for hiding this comment

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

プロバイダの型を指定してください

final provider = questStreamByIdUseCaseProvider(id: _questId); の型を明示的に指定することで、コードの可読性と保守性が向上します。

- final provider = questStreamByIdUseCaseProvider(id: _questId);
+ final StreamProvider<Quest?> provider = questStreamByIdUseCaseProvider(id: _questId);
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
final provider = questStreamByIdUseCaseProvider(id: _questId);
final quest = ref.watch(provider);
final StreamProvider<Quest?> provider = questStreamByIdUseCaseProvider(id: _questId);
final quest = ref.watch(provider);

Comment on lines +87 to +88
Text(l10n.questDetailContentStatusLabel),
Text(quest.status.name),
Copy link

Choose a reason for hiding this comment

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

ステータスの表示

quest.status.name を表示していますが、ユーザーフレンドリーなラベルを表示することを検討してください。

- Text(quest.status.name),
+ Text(l10n.questStatusLabel(quest.status)),
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Text(l10n.questDetailContentStatusLabel),
Text(quest.status.name),
Text(l10n.questDetailContentStatusLabel),
Text(l10n.questStatusLabel(quest.status)),

Comment on lines +1 to +4
import 'package:core_designsystem/component.dart';
import 'package:core_domain/quest_use_case.dart';
import 'package:core_model/quest.dart';
import 'package:core_ui/quest_list_title.dart';
import 'package:feature_quest/src/gen/l10n/l10n.dart';
Copy link

Choose a reason for hiding this comment

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

不要なインポートを削除してください

import 'package:core_designsystem/component.dart';import 'package:core_domain/quest_use_case.dart'; が使用されていないようです。不要なインポートは削除することをお勧めします。

- import 'package:core_designsystem/component.dart';
- import 'package:core_domain/quest_use_case.dart';
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import 'package:core_designsystem/component.dart';
import 'package:core_domain/quest_use_case.dart';
import 'package:core_model/quest.dart';
import 'package:core_ui/quest_list_title.dart';
import 'package:feature_quest/src/gen/l10n/l10n.dart';
import 'package:core_model/quest.dart';
import 'package:feature_quest/src/gen/l10n/l10n.dart';

Comment on lines +26 to +28
if (quest == null) {
return const SizedBox.shrink();
}
Copy link

Choose a reason for hiding this comment

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

クエストが null の場合のハンドリング

if (quest == null) の場合に SizedBox.shrink() を返していますが、ユーザーにフィードバックを提供するためにエラーメッセージやプレースホルダーを表示することを検討してください。

- if (quest == null) {
-   return const SizedBox.shrink();
- }
+ if (quest == null) {
+   return Center(child: Text(l10n.questDetailContentNotFound));
+ }
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (quest == null) {
return const SizedBox.shrink();
}
if (quest == null) {
return Center(child: Text(l10n.questDetailContentNotFound));
}

),

// 説明
if (quest.description.isNotEmpty) Text(quest.description),
Copy link

Choose a reason for hiding this comment

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

説明の表示

quest.description.isNotEmpty の場合にテキストを表示していますが、quest.description が存在しない場合のプレースホルダーを追加することを検討してください。

- if (quest.description.isNotEmpty) Text(quest.description),
+ if (quest.description.isNotEmpty) 
+   Text(quest.description),
+ else 
+   Text(l10n.questDetailContentDescriptionEmptyText),
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (quest.description.isNotEmpty) Text(quest.description),
if (quest.description.isNotEmpty)
Text(quest.description),
else
Text(l10n.questDetailContentDescriptionEmptyText),

Comment on lines +45 to +49
if (quest.coverImageUrl != null)
ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.network(quest.coverImageUrl!),
),
Copy link

Choose a reason for hiding this comment

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

カバー画像のエラーハンドリング

Image.network を使用していますが、画像のロードに失敗した場合のエラーハンドリングを追加することを検討してください。

- Image.network(quest.coverImageUrl!),
+ Image.network(
+   quest.coverImageUrl!,
+   errorBuilder: (context, error, stackTrace) {
+     return Icon(Icons.error);
+   },
+ ),
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (quest.coverImageUrl != null)
ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.network(quest.coverImageUrl!),
),
if (quest.coverImageUrl != null)
ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.network(
quest.coverImageUrl!,
errorBuilder: (context, error, stackTrace) {
return Icon(Icons.error);
},
),
),

Comment on lines +94 to +95
Text(l10n.questDetailContentNoteLabel),
Text(quest.note),
Copy link

Choose a reason for hiding this comment

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

ノートのプレースホルダー

quest.note が存在しない場合のプレースホルダーを追加することを検討してください。

- Text(quest.note),
+ Text(quest.note.isNotEmpty ? quest.note : l10n.questDetailContentNoteEmptyText),
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Text(l10n.questDetailContentNoteLabel),
Text(quest.note),
Text(l10n.questDetailContentNoteLabel),
Text(quest.note.isNotEmpty ? quest.note : l10n.questDetailContentNoteEmptyText),

Comment on lines +57 to +61
Text(l10n.questDetailContentBegunAtLabel),
if (quest.begunAt != null)
Text(quest.begunAt!.toIso8601String())
else
Text(l10n.questDetailContentBegunAtEmptyText),
Copy link

Choose a reason for hiding this comment

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

開始日時のフォーマット

quest.begunAt!.toIso8601String() ではなく、ユーザーフレンドリーなフォーマットで日時を表示することを検討してください。

- Text(quest.begunAt!.toIso8601String())
+ Text(DateFormat.yMMMd().format(quest.begunAt!))
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Text(l10n.questDetailContentBegunAtLabel),
if (quest.begunAt != null)
Text(quest.begunAt!.toIso8601String())
else
Text(l10n.questDetailContentBegunAtEmptyText),
Text(l10n.questDetailContentBegunAtLabel),
if (quest.begunAt != null)
Text(DateFormat.yMMMd().format(quest.begunAt!))
else
Text(l10n.questDetailContentBegunAtEmptyText),

Comment on lines +67 to +71
Text(l10n.questDetailContentEndedAtLabel),
if (quest.endedAt != null)
Text(quest.endedAt!.toIso8601String())
else
Text(l10n.questDetailContentEndedAtEmptyText),
Copy link

Choose a reason for hiding this comment

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

終了日時のフォーマット

quest.endedAt!.toIso8601String() ではなく、ユーザーフレンドリーなフォーマットで日時を表示することを検討してください。

- Text(quest.endedAt!.toIso8601String())
+ Text(DateFormat.yMMMd().format(quest.endedAt!))
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Text(l10n.questDetailContentEndedAtLabel),
if (quest.endedAt != null)
Text(quest.endedAt!.toIso8601String())
else
Text(l10n.questDetailContentEndedAtEmptyText),
Text(l10n.questDetailContentEndedAtLabel),
if (quest.endedAt != null)
Text(DateFormat.yMMMd().format(quest.endedAt!))
else
Text(l10n.questDetailContentEndedAtEmptyText),

Copy link

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fbdedb9 and 5c53790.

Files selected for processing (1)
  • core/domain/lib/src/use_case/quest/add_quest_use_case.g.dart (1 hunks)
Files skipped from review due to trivial changes (1)
  • core/domain/lib/src/use_case/quest/add_quest_use_case.g.dart

@tatsutakein tatsutakein merged commit 94239c6 into main Jun 30, 2024
13 checks passed
@tatsutakein tatsutakein deleted the feature/GH-460 branch June 30, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@app/catalog Catalog development @core/common core common package @core/data core data package @core/database_isar core database_isar package @core/database core database package @core/domain core domain package @core/model core model package @core/network core network package @core/ui core ui package @feature/home feature home package @feature/quest feature quest package ignore for release Exclude from Release Notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: クエスト詳細ページの簡易実装を追加
1 participant