Flt 21 컬렉션 상세 UI 개편#213
Hidden character warning
Conversation
…to FLT-21-컬렉션-상세-UI-개편
- DELETE /api/v1/collections/{collectionId} API 연결
- 삭제 성공 시 이전 화면으로 이동 및 "컬렉션을 삭제했어요" 토스트 표시
- BaseEmptyResponse로 data 필드 없는 응답 처리
|
Warning Review limit reached
More reviews will be available in 41 minutes and 42 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthrough컬렉션 수정(PUT)·삭제(DELETE) API 및 리포지토리 메서드를 추가하고, Changes컬렉션 편집·삭제 기능 및 상세 화면 리팩터링
Sequence Diagram(s)sequenceDiagram
actor 사용자
participant CollectionDetailScreen
participant CollectionDetailViewModel
participant CollectionRepository
participant CollectionDetailNavigation
participant MainNavHost
rect rgba(255, 100, 100, 0.5)
Note over 사용자, MainNavHost: 삭제 흐름
사용자->>CollectionDetailScreen: 삭제 메뉴 클릭
CollectionDetailScreen->>CollectionDetailScreen: showDeleteModal = true
사용자->>CollectionDetailScreen: 모달 확인
CollectionDetailScreen->>CollectionDetailViewModel: deleteCollection()
CollectionDetailViewModel->>CollectionRepository: deleteCollection(collectionId)
CollectionRepository-->>CollectionDetailViewModel: Result.success
CollectionDetailViewModel-->>CollectionDetailScreen: DeleteCollectionSuccess SideEffect
CollectionDetailScreen->>CollectionDetailNavigation: navigateUpWithDeleteSuccess()
CollectionDetailNavigation->>CollectionDetailNavigation: savedStateHandle[KEY] = true
CollectionDetailNavigation->>MainNavHost: navigateUp()
MainNavHost->>MainNavHost: showDeleteSuccessToast 렌더링
end
rect rgba(100, 150, 255, 0.5)
Note over 사용자, CollectionDetailViewModel: 편집 흐름
사용자->>CollectionDetailScreen: 편집 메뉴 클릭
CollectionDetailScreen->>CollectionDetailNavigation: navigateToCollectionEdit(collectionId)
CollectionDetailNavigation->>CollectionDetailNavigation: Route.CollectionCreateGraph(collectionId)
CollectionDetailNavigation->>CollectionDetailViewModel: loadCollectionForEdit()
CollectionDetailViewModel->>CollectionRepository: getCollectionDetail(collectionId)
CollectionRepository-->>CollectionDetailViewModel: CollectionDetailModelNew
CollectionDetailViewModel-->>CollectionDetailNavigation: _createSuccess emit
CollectionDetailNavigation->>CollectionDetailNavigation: navigateToCollectionDetail(showEditSuccessToast=true)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 7
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/flint/presentation/collectioncreate/component/CollectionCreateContentImage.kt (1)
58-82:⚠️ Potential issue | 🟠 Major | ⚡ Quick win기존 이미지 삭제 시 페이저 스크롤 처리 누락
LaunchedEffect가imageUris.size만 추적하고 있어서existingImageUrls가 변경될 때(기존 이미지 삭제 시) 페이저 스크롤 조정이 동작하지 않습니다. 마지막 기존 이미지를 삭제하면 페이저 상태가 유효하지 않은 페이지를 가리킬 수 있습니다.💡 수정 제안
- LaunchedEffect(imageUris.size) { + LaunchedEffect(images.size) { if (prevSize == -1) { - prevSize = imageUris.size + prevSize = images.size return@LaunchedEffect } - if (imageUris.isEmpty()) { + if (images.isEmpty()) { prevSize = 0 return@LaunchedEffect } - val isAdded = imageUris.size > prevSize + val isAdded = images.size > prevSize val targetIndex = if (isAdded) { - imageUris.size - 1 + images.size - 1 } else { - minOf(deletedIndex, imageUris.size - 1) + minOf(deletedIndex, images.size - 1) } - prevSize = imageUris.size + prevSize = images.size // 새로운 size 기준으로 targetIndex에 해당하는 가장 가까운 절대 페이지 계산 - val base = (pagerState.currentPage / imageUris.size) * imageUris.size + val base = (pagerState.currentPage / images.size) * images.size val targetPage = base + targetIndex if (isAdded) { pagerState.animateScrollToPage(targetPage) } else { pagerState.scrollToPage(targetPage) } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/main/java/com/flint/presentation/collectioncreate/component/CollectionCreateContentImage.kt` around lines 58 - 82, The LaunchedEffect in the CollectionCreateContentImage composable only tracks changes to imageUris.size, but it needs to also respond to changes in existingImageUrls. When existing images are deleted, the LaunchedEffect does not trigger, causing the pager to point to an invalid page. Add existingImageUrls as an additional dependency parameter to the LaunchedEffect (alongside imageUris.size) so that pager scroll adjustments occur whenever either the size changes or the existing images are modified.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@app/src/main/java/com/flint/data/dto/collection/response/CollectionUpdateResponseDto.kt`:
- Around line 1-6: The CollectionUpdateResponseDto class is an unused empty
class that can be safely removed. Since CollectionApi.updateCollection returns
BaseEmptyResponse instead of this class, there are no actual references to
CollectionUpdateResponseDto anywhere in the codebase. Delete the entire file at
app/src/main/java/com/flint/data/dto/collection/response/CollectionUpdateResponseDto.kt
to clean up unused code.
In `@app/src/main/java/com/flint/domain/repository/CollectionRepository.kt`:
- Around line 44-57: The updateCollection and deleteCollection methods in
CollectionRepository have a return type mismatch. Both methods are declared to
return Result<Unit> but their suspendRunCatching blocks only call API methods
that return BaseEmptyResponse (a data class), resulting in
Result<BaseEmptyResponse> instead. Fix this by explicitly returning Unit at the
end of each suspendRunCatching block: in updateCollection, after the
apiService.updateCollection call, add Unit on a new line; in deleteCollection,
after the apiService.deleteCollection call, add Unit on a new line. This matches
the pattern used in UserRepository methods like updateNickname and
updateProfileImage.
In
`@app/src/main/java/com/flint/presentation/collectioncreate/CollectionCreateViewModel.kt`:
- Around line 117-166: The loadCollectionForEdit function lacks error handling
for the getCollectionDetail API call. Add an onFailure handler after the
onSuccess block to handle cases where the collection detail fails to load.
Include appropriate error logging (or log the exception) and consider updating
the UI state to reflect the failure (such as showing an error message or
disabling the edit form) so users receive feedback instead of seeing a blank
screen when the API call fails.
In
`@app/src/main/java/com/flint/presentation/collectiondetail/CollectionDetailScreen.kt`:
- Around line 116-118: The onReportClick callback in the CollectionDetailScreen
is currently empty with only a TODO comment, causing the report feature to be
non-functional when users tap it. Either implement the
navigateToCollectionReport(collectionDetail.id) call once the
Route.CollectionReport is available, or temporarily disable the report menu item
by hiding it from the UI or showing a "Coming Soon" feedback message to users.
In
`@app/src/main/java/com/flint/presentation/collectiondetail/CollectionDetailViewModel.kt`:
- Around line 226-227: The async operation retrieving USER_ID via
preferencesManager.getString(USER_ID).first() at lines 226-227 causes the entire
runCatching block to fail if USER_ID retrieval fails, which then fails the
entire detail data loading even if other data is available. Instead of letting
this failure propagate, wrap the USER_ID retrieval in error handling (such as
getOrNull() or try-catch) so that when USER_ID retrieval fails, the isMine
calculation falls back to false at the usage location (line 235) rather than
failing the entire operation. This allows the detail data to display even if
user identification fails.
In
`@app/src/main/java/com/flint/presentation/collectiondetail/component/CollectionDetailTopAppBar.kt`:
- Around line 50-57: The clickable Icon composables in CollectionDetailTopAppBar
are missing accessibility labels, making them inaccessible to screen readers.
Replace the contentDescription = null parameter with meaningful descriptive
strings for both affected icons: the back icon (around lines 50-57) should have
contentDescription describing the back navigation action, and the icon at lines
63-69 should have contentDescription describing its purpose (likely "More
options" or similar). This ensures assistive devices can properly announce the
purpose of these interactive elements to users.
In
`@app/src/main/java/com/flint/presentation/collectiondetail/component/PeopleWhoSavedThisCollection.kt`:
- Around line 56-63: The clickable icon for the more options menu has
accessibility issues: the contentDescription is null which prevents screen
readers from describing it, and the touch target size of 24dp is below the
recommended 48dp minimum. Replace the Icon composable with clickable modifier
with an IconButton composable, which provides proper touch target sizing. Then
provide a meaningful contentDescription string that describes the action (such
as "More options") instead of null to ensure the element is properly exposed to
accessibility services.
---
Outside diff comments:
In
`@app/src/main/java/com/flint/presentation/collectioncreate/component/CollectionCreateContentImage.kt`:
- Around line 58-82: The LaunchedEffect in the CollectionCreateContentImage
composable only tracks changes to imageUris.size, but it needs to also respond
to changes in existingImageUrls. When existing images are deleted, the
LaunchedEffect does not trigger, causing the pager to point to an invalid page.
Add existingImageUrls as an additional dependency parameter to the
LaunchedEffect (alongside imageUris.size) so that pager scroll adjustments occur
whenever either the size changes or the existing images are modified.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ea1cfa83-ccad-471d-bc74-3e10d2519514
📒 Files selected for processing (31)
app/src/main/java/com/flint/core/designsystem/component/progressbar/UnderImageProgressBar.ktapp/src/main/java/com/flint/core/navigation/Route.ktapp/src/main/java/com/flint/data/api/CollectionApi.ktapp/src/main/java/com/flint/data/dto/collection/request/CollectionCreateRequestDto.ktapp/src/main/java/com/flint/data/dto/collection/response/CollectionDetailResponseDto.ktapp/src/main/java/com/flint/data/dto/collection/response/CollectionUpdateResponseDto.ktapp/src/main/java/com/flint/domain/mapper/collection/CollectionDetailMapper.ktapp/src/main/java/com/flint/domain/model/collection/CollectionDetailModel.ktapp/src/main/java/com/flint/domain/model/content/ContentModel.ktapp/src/main/java/com/flint/domain/repository/CollectionRepository.ktapp/src/main/java/com/flint/presentation/collectioncreate/CollectionCreateScreen.ktapp/src/main/java/com/flint/presentation/collectioncreate/CollectionCreateViewModel.ktapp/src/main/java/com/flint/presentation/collectioncreate/component/CollectionCreateContentImage.ktapp/src/main/java/com/flint/presentation/collectioncreate/navigation/CollectionCreateNavigation.ktapp/src/main/java/com/flint/presentation/collectioncreate/uistate/CollectionCreateUiState.ktapp/src/main/java/com/flint/presentation/collectiondetail/CollectionDetailScreen.ktapp/src/main/java/com/flint/presentation/collectiondetail/CollectionDetailViewModel.ktapp/src/main/java/com/flint/presentation/collectiondetail/component/CollectionCopyrightFooter.ktapp/src/main/java/com/flint/presentation/collectiondetail/component/CollectionDetailContent.ktapp/src/main/java/com/flint/presentation/collectiondetail/component/CollectionDetailDeleteModal.ktapp/src/main/java/com/flint/presentation/collectiondetail/component/CollectionDetailDescription.ktapp/src/main/java/com/flint/presentation/collectiondetail/component/CollectionDetailDropdownMenuItem.ktapp/src/main/java/com/flint/presentation/collectiondetail/component/CollectionDetailThumbnail.ktapp/src/main/java/com/flint/presentation/collectiondetail/component/CollectionDetailTopAppBar.ktapp/src/main/java/com/flint/presentation/collectiondetail/component/PeopleWhoSavedThisCollection.ktapp/src/main/java/com/flint/presentation/collectiondetail/navigation/CollectionDetailNavigation.ktapp/src/main/java/com/flint/presentation/collectiondetail/sideeffect/CollectionDetailSideEffect.ktapp/src/main/java/com/flint/presentation/collectiondetail/uistate/CollectionDetailUiState.ktapp/src/main/java/com/flint/presentation/main/MainNavHost.ktapp/src/main/java/com/flint/presentation/main/MainNavigator.ktapp/src/main/res/drawable/ic_kebab.xml
💤 Files with no reviewable changes (1)
- app/src/main/java/com/flint/core/designsystem/component/progressbar/UnderImageProgressBar.kt
📮 관련 이슈
📌 작업 내용
📸 스크린샷
😅 미구현
🫛 To. 리뷰어
Summary by CodeRabbit
릴리스 노트
새 기능
UI 개선