Conversation
📝 WalkthroughWalkthrough홈 추천 굿즈 조회 흐름에 artistId 일관성 검증(validateArtistId)과 이를 반영하는 상태( Changes
Sequence Diagram(s)(생성 조건에 부합하지 않아 다이어그램을 생략했습니다.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
|
✅ Ktlint check passed. Run: https://github.com/team-poti/POTI-ANDROID/actions/runs/21284409081 |
There was a problem hiding this comment.
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)
app/src/main/java/com/poti/android/presentation/party/product/productcategory/ProductCategoryScreen.kt (1)
77-95: 정렬 바텀시트 노출 조건을 isMyArtsit와 동기화하세요.
정렬 버튼을 숨겨도, 상태가 남아 있으면 바텀시트가 노출될 수 있습니다. “다른 굿즈 구경하기”에서는 정렬 옵션이 절대 보이지 않도록 조건을 강화하는 편이 안전합니다.✅ 제안 수정
- if (isSortBottomSheetVisible) { + if (isMyArtsit && isSortBottomSheetVisible) { GoodsSortBottomSheet( selectedSortType = selectedSortType, onSelect = onSortSelect, onDismissRequest = onSortDismiss, ) }
🤖 Fix all issues with AI agents
In `@app/src/main/java/com/poti/android/presentation/party/home/HomeViewModel.kt`:
- Around line 51-59: In validateArtistId(), avoid calling first() on an empty
myGroupItems and ensure artistIdToNull is reset when items are uniform: retrieve
content via getSuccessDataOrNull(), if content?.myGroupItems.isNullOrEmpty()
then call updateState { copy(artistIdToNull = false) } and return; otherwise
compare all items against first()/firstOrNull() safely to compute diff, and call
updateState { copy(artistIdToNull = true) } when diff is true and updateState {
copy(artistIdToNull = false) } when diff is false so the state is always
consistent.
| private fun validateArtistId() { | ||
| uiState.value.homeContentLoadState.getSuccessDataOrNull()?.let { content -> | ||
| val diff = content.myGroupItems.any { item -> | ||
| item.artistId != content.myGroupItems.first().artistId | ||
| } | ||
|
|
||
| if (diff) { | ||
| updateState { copy(artistIdToNull = true) } | ||
| } |
There was a problem hiding this comment.
빈 리스트 처리 및 상태 재설정이 필요합니다.
first()는 빈 리스트에서 크래시가 나며, diff가 false일 때 artistIdToNull이 복구되지 않아 이후 동작이 잘못될 수 있습니다.
🛠️ 제안 수정
- private fun validateArtistId() {
- uiState.value.homeContentLoadState.getSuccessDataOrNull()?.let { content ->
- val diff = content.myGroupItems.any { item ->
- item.artistId != content.myGroupItems.first().artistId
- }
-
- if (diff) {
- updateState { copy(artistIdToNull = true) }
- }
- }
- }
+ private fun validateArtistId() {
+ val items = uiState.value.homeContentLoadState
+ .getSuccessDataOrNull()
+ ?.myGroupItems
+ .orEmpty()
+
+ val firstArtistId = items.firstOrNull()?.artistId ?: run {
+ updateState { copy(artistIdToNull = false) }
+ return
+ }
+
+ val diff = items.any { it.artistId != firstArtistId }
+ updateState { copy(artistIdToNull = diff) }
+ }📝 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.
| private fun validateArtistId() { | |
| uiState.value.homeContentLoadState.getSuccessDataOrNull()?.let { content -> | |
| val diff = content.myGroupItems.any { item -> | |
| item.artistId != content.myGroupItems.first().artistId | |
| } | |
| if (diff) { | |
| updateState { copy(artistIdToNull = true) } | |
| } | |
| private fun validateArtistId() { | |
| val items = uiState.value.homeContentLoadState | |
| .getSuccessDataOrNull() | |
| ?.myGroupItems | |
| .orEmpty() | |
| val firstArtistId = items.firstOrNull()?.artistId ?: run { | |
| updateState { copy(artistIdToNull = false) } | |
| return | |
| } | |
| val diff = items.any { it.artistId != firstArtistId } | |
| updateState { copy(artistIdToNull = diff) } | |
| } |
🤖 Prompt for AI Agents
In `@app/src/main/java/com/poti/android/presentation/party/home/HomeViewModel.kt`
around lines 51 - 59, In validateArtistId(), avoid calling first() on an empty
myGroupItems and ensure artistIdToNull is reset when items are uniform: retrieve
content via getSuccessDataOrNull(), if content?.myGroupItems.isNullOrEmpty()
then call updateState { copy(artistIdToNull = false) } and return; otherwise
compare all items against first()/firstOrNull() safely to compute diff, and call
updateState { copy(artistIdToNull = true) } when diff is true and updateState {
copy(artistIdToNull = false) } when diff is false so the state is always
consistent.
Related issue 🛠️
Work Description ✏️
Screenshot 📸
default.mp4
Uncompleted Tasks 😅
To Reviewers 📢
키보드 올라올 때 bottomPadding값이 분기로 변경되는데요
이때 바텀시트가 리컴포지션 되면서 뽀잉 하는 효과가 생깁니다
개선 방법을 찾기 어려워 일단 디쌤한테 갠찮다고 확인받고 올려요
Summary by CodeRabbit
릴리스 노트
버그 수정
새로운 기능
개선사항
✏️ Tip: You can customize this high-level summary in your review settings.