-
Notifications
You must be signed in to change notification settings - Fork 0
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
♻️ スケジュール詳細画面のリファクタリング #173
Conversation
Walkthrough参加者のステータス処理に関連する論理変更が行われました。具体的には、参加者のステータスを取得し、ストリームする新しいユースケースが導入され、既存の関数が更新または名前が変更されました。スケジュールの詳細画面も、新しい依存関係に基づいて更新されています。 Changes
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? TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (18)
- app/ios-combined/src/iosTest/kotlin/club/nito/ios/combined/EntryPointTest.kt (2 hunks)
- app/ios/Modules/Sources/Schedule/ComposeScheduleDetailScreen.swift (1 hunks)
- core/data/src/commonMain/kotlin/club/nito/core/data/DefaultParticipantRepository.kt (1 hunks)
- core/data/src/commonMain/kotlin/club/nito/core/data/ParticipantRepository.kt (1 hunks)
- core/domain/src/commonMain/kotlin/club/nito/core/domain/MyParticipantStatusStreamUseCase.kt (1 hunks)
- core/domain/src/commonMain/kotlin/club/nito/core/domain/ParticipateUseCase.kt (1 hunks)
- core/domain/src/commonMain/kotlin/club/nito/core/domain/ScheduleParticipantsStreamUseCase.kt (1 hunks)
- core/domain/src/commonMain/kotlin/club/nito/core/domain/ScheduleStreamUseCase.kt (1 hunks)
- core/domain/src/commonMain/kotlin/club/nito/core/domain/di/UseCaseModule.kt (3 hunks)
- core/network/src/commonMain/kotlin/club/nito/core/network/participation/FakeParticipantRemoteDataSource.kt (1 hunks)
- core/network/src/commonMain/kotlin/club/nito/core/network/participation/ParticipantRemoteDataSource.kt (1 hunks)
- core/network/src/commonMain/kotlin/club/nito/core/network/participation/SupabaseParticipantRemoteDataSource.kt (1 hunks)
- core/network/src/commonMain/kotlin/club/nito/core/network/participation/model/NetworkParticipant.kt (1 hunks)
- feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/detail/ScheduleDetailIntent.kt (1 hunks)
- feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/detail/ScheduleDetailScreen.kt (8 hunks)
- feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/detail/ScheduleDetailScreenUiState.kt (1 hunks)
- feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/detail/ScheduleDetailStateMachine.kt (3 hunks)
- feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/di/ScheduleFeatureModule.kt (1 hunks)
Additional comments: 28
feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/detail/ScheduleDetailScreenUiState.kt (1)
- 13-16:
participantSchedule
の名前変更と新しいプロパティscheduleWithPlace
とusers
の追加は適切です。ただし、myParticipantStatus
の型がFetchSingleContentResult<ParticipantStatus>
からParticipantStatus
に変更されているため、この変更が新しいデータ処理戦略と一致していることを確認してください。feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/di/ScheduleFeatureModule.kt (1)
- 17-25:
scheduleFeatureModule
内のfactory
宣言で、パラメータ名id
がscheduleId
に変更され、新しい依存関係scheduleStream
,scheduleParticipantsStream
,myParticipantStatusStream
が追加されています。これらの依存関係がモジュールで適切に提供されていることを確認してください。feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/detail/ScheduleDetailIntent.kt (1)
- 12-22:
ClickParticipantStatusChip
クラスからschedule
プロパティが削除され、そのサブクラスParticipate
,Absent
,Hold
がデータクラスからオブジェクトに変換されています。これらの変更が意図した使用法と一致していることを確認してください。core/domain/src/commonMain/kotlin/club/nito/core/domain/MyParticipantStatusStreamUseCase.kt (1)
- 13-29: 新しいインターフェース
MyParticipantStatusStreamUseCase
とその実装FetchMyParticipantStatusExecutor
が追加されました。この実装がリアクティブストリームのベストプラクティスに従っていることを確認してください。core/network/src/commonMain/kotlin/club/nito/core/network/participation/model/NetworkParticipant.kt (1)
- 28-32:
NetworkParticipant
クラスに新しい関数toNetworkModel
が追加され、Participant
をNetworkParticipant
に変換します。この関数が正しく実装されていることを確認してください。app/ios/Modules/Sources/Schedule/ComposeScheduleDetailScreen.swift (1)
- 17-23:
ComposeScheduleDetailScreen
構造体内のScheduleDetailStateMachine
初期化で、依存関係fetchParticipantScheduleById
とfetchMyParticipantStatus
がscheduleStream
,scheduleParticipantsStream
,myParticipantStatusStream
に置き換えられています。新しい依存関係が正しく注入されていることを確認してください。core/domain/src/commonMain/kotlin/club/nito/core/domain/ScheduleStreamUseCase.kt (1)
- 16-37: 新しいインターフェース
ScheduleStreamUseCase
とその実装ScheduleStreamExecutor
が追加されました。この実装がエラーハンドリングとリアクティブストリームのベストプラクティスに従っていることを確認してください。core/network/src/commonMain/kotlin/club/nito/core/network/participation/ParticipantRemoteDataSource.kt (1)
- 46-48: 関数
insertParticipate
がupsertParticipate
に名前変更され、パラメータdeclaration
がparticipant
に変更されています。これにより明確さと一貫性が向上していることを確認してください。core/domain/src/commonMain/kotlin/club/nito/core/domain/ScheduleParticipantsStreamUseCase.kt (1)
- 16-40: 新しいインターフェース
ScheduleParticipantsStreamUseCase
とその実装ScheduleParticipantsStreamExecutor
が追加されました。この実装がエラーハンドリングとリアクティブストリームのベストプラクティスに従っていることを確認してください。core/network/src/commonMain/kotlin/club/nito/core/network/participation/FakeParticipantRemoteDataSource.kt (1)
- 39-45:
FakeParticipantRemoteDataSource
クラスで、関数insertParticipate
がupsertParticipate
に名前変更され、パラメータdeclaration
がparticipant
に変更されています。関数本体がparticipant
のプロパティを正しく使用していることを確認してください。core/data/src/commonMain/kotlin/club/nito/core/data/ParticipantRepository.kt (1)
- 52-73:
ParticipantRepository
インターフェースに新しい関数participantStatusStream
が追加され、関数upsertLocalParticipate
がupsertParticipate
に名前変更されています。これらの変更が一貫性を持っていることを確認してください。app/ios-combined/src/iosTest/kotlin/club/nito/ios/combined/EntryPointTest.kt (1)
- 48-48: インポート文とドメインユースケースの使用法が
EntryPointTest.kt
で変更されています。FetchMyParticipantStatusUseCase
の使用がMyParticipantStatusStreamUseCase
に置き換えられているため、新しいユースケースが正しくインスタンス化されていることを確認してください。core/domain/src/commonMain/kotlin/club/nito/core/domain/di/UseCaseModule.kt (1)
- 36-41:
UseCaseModule
に新しいクラスが追加され、MyParticipantStatusStreamUseCase
,ScheduleParticipantsStreamUseCase
,ScheduleStreamUseCase
がそれぞれのエグゼキュータにバインドされています。これらの追加とバインディングが適切であることを確認してください。core/domain/src/commonMain/kotlin/club/nito/core/domain/ParticipateUseCase.kt (4)
14-19: 新しいパラメータ
oldStatus
とnewStatus
がParticipateUseCase
インターフェースに追加されました。これにより、参加者の状態変更が明確になり、リファクタリングの目的に合致しています。33-37:
cachedParticipant
変数を使用して、例外が発生した場合に元の参加者ステータスを復元するロジックが追加されました。この変更は状態の一貫性を保つために良い実践です。ただし、例外処理のロジック全体を検証することをお勧めします。40-47:
invoke
メソッド内でupsertLocalParticipate
とupsertParticipate
が使用されており、参加者データの扱いが改善されていることが示唆されます。これらのメソッドの実装詳細を検証することをお勧めします。49-66: 例外処理ロジックが
CancellationException
とその他の例外を区別しており、これはKotlinコルーチンでの良い実践です。ドメインエラーの正しい使用を検証することをお勧めします。core/data/src/commonMain/kotlin/club/nito/core/data/DefaultParticipantRepository.kt (3)
41-41:
upsertLocalParticipate
メソッドが追加され、ローカルデータの扱いが改善されていると考えられます。43-47:
upsertParticipate
メソッドが追加され、リモートデータソースを更新した後にローカルデータベースを更新するようになりました。データの一貫性を保つために、このデータフローを検証することをお勧めします。49-60:
updateParticipate
メソッドがローカルデータベースを先に更新するように変更されました。リモート更新が失敗した場合の一貫性の問題を含め、操作の順序と潜在的な一貫性の問題の処理を検証することをお勧めします。core/network/src/commonMain/kotlin/club/nito/core/network/participation/SupabaseParticipantRemoteDataSource.kt (1)
- 78-83:
insertParticipate
がupsertParticipate
に名前が変更され、パラメータがdeclaration
からparticipant
に変更されました。これはメソッドの新しい機能に合わせており、挿入と更新の両方の操作を処理するようになっています。feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/detail/ScheduleDetailStateMachine.kt (3)
29-37: コンストラクタのパラメータが新しいストリームユースケースを受け入れるように変更されました。これはよりリアクティブなアーキテクチャへの移行を示している可能性があります。
63-76:
uiState
プロパティが新しいステートフローを組み込むように再構築されました。これはコンストラクタの変更と一致し、リアクティブなアプローチに沿っています。93-111: ユーザーインテントの処理が新しい
participate
関数を使用するようにリファクタリングされました。新しいパラメータoldStatus
とnewStatus
を考慮すると、この変更は論理的です。feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/detail/ScheduleDetailScreen.kt (4)
51-59: インポートされたモジュールと
schedule
変数の型に関連する変更があります。これらの変更はリファクタリングと一致しています。110-110:
schedule
変数の型がScheduleWithPlace
に変更され、UIコンポーネントがそれに応じて更新されました。データモデルの強化を示唆しており、UIコンポーネントがこの変更を反映するように更新されています。132-147: UIのレイアウトとパディングが調整され、
schedule
データに基づいて新しいUIコンポーネントが追加されました。これらはユーザーエクスペリエンスを向上させるための小さな改善のようです。459-502: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [423-500]
BottomParticipateBar
コンポーザブル関数が新しいstatus
を処理し、参加ステータスのためのクリッカブルなチップを提供するように更新されました。これは新しい参加者ステータスの処理に一致し、UIの対話性を向上させます。
Issue
概要
スケジュール詳細画面のリファクタリングを実施します.
レビュー観点
特になし
レビューレベル
レビュー優先度
参考リンク
スクリーンショット
Summary by CodeRabbit
新機能
機能改善
バグ修正
ドキュメント
リファクタリング
スタイル