Conversation
…ng-contnet-api # Conflicts: # app/src/main/java/com/flint/data/api/UserApi.kt # app/src/main/java/com/flint/domain/repository/UserRepository.kt
📝 Walkthrough워크스루온보딩 프로필 닉네임 중복 체크 API 연동 및 검색 콘텐츠 기능을 구현했습니다. 새로운 DTO, 매퍼, 도메인 모델을 추가하고 의존성 주입을 통해 OnboardingViewModel 상태 관리를 개선했으며, 공유 ViewModel 인스턴스를 사용하는 복합 그래프 구조로 온보딩 네비게이션을 재구성했습니다. 변경 사항
시퀀스 다이어그램sequenceDiagram
actor User
participant UI as OnboardingProfileScreen
participant ViewModel as OnboardingViewModel
participant UserRepo as UserRepository
participant UserAPI as UserApi
participant Network as Backend
User->>UI: 닉네임 입력 및 확인 클릭
UI->>ViewModel: checkNicknameDuplication()
ViewModel->>UserRepo: checkNickname(nickname)
UserRepo->>UserAPI: checkNickname(nickname)
UserAPI->>Network: GET /api/v1/users/nickname/check
Network-->>UserAPI: NicknameCheckResponseDto
UserAPI-->>UserRepo: BaseResponse<NicknameCheckResponseDto>
UserRepo->>UserRepo: toModel() 매핑
UserRepo-->>ViewModel: Result<NicknameCheckModel>
ViewModel->>ViewModel: uiState 업데이트
ViewModel-->>UI: isNicknameAvailable 반영
UI-->>User: 중복 여부 표시
sequenceDiagram
participant Lifecycle as Composition
participant UI as OnboardingContentScreen
participant ViewModel as OnboardingViewModel
participant SearchRepo as SearchRepository
participant SearchAPI as SearchApi
participant Network as Backend
Lifecycle->>UI: 화면 진입
UI->>ViewModel: getSearchContentList(keyword)
ViewModel->>SearchRepo: getSearchContentList(keyword)
SearchRepo->>SearchAPI: getSearchContentList(keyword)
SearchAPI->>Network: GET /api/v1/search/contents
Network-->>SearchAPI: BaseResponse<SearchContentsResponseDto>
SearchAPI-->>SearchRepo: SearchContentsResponseDto
SearchRepo->>SearchRepo: toModel() 매핑
SearchRepo-->>ViewModel: Result<SearchContentListModel>
ViewModel->>ViewModel: uiState.searchResults 업데이트
ViewModel-->>UI: 콘텐츠 목록 표시
User->>UI: 콘텐츠 선택
UI->>ViewModel: updateSelectedContent()
ViewModel-->>UI: 선택 상태 반영
예상 코드 리뷰 노력🎯 4 (복잡함) | ⏱️ ~50분 관련 PR
제안 검토자
시
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
nahy-512
left a comment
There was a problem hiding this comment.
굿! 머지하고 회원가입 마무리 이슈 파고 작업 진행해주시죠
| // TODO: null 처리를 어떻게? 어떤거가 null가능인지 | ||
| @Serializable | ||
| data class ContentItemDto( | ||
| @SerialName("contentId") val contentId: Long?, | ||
| @SerialName("title") val title: String?, | ||
| @SerialName("author") val author: String?, | ||
| @SerialName("posterUrl") val posterUrl: String?, | ||
| @SerialName("year") val year: Int?, | ||
| ) |
There was a problem hiding this comment.
이거 서버샘들께 여쭤본 거 아니었나요? 👀
왜 다 nullable이죠
There was a problem hiding this comment.
shelf에서 바꾸다가 까먹어서 nullable은 다 제거했습니당
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app/src/main/java/com/flint/core/common/extension/NavBackStackEntryExt.kt`:
- Around line 17-21: Wrap the call to
navController.getBackStackEntry(navGraphRoute) in a try-catch (or runCatching)
that handles IllegalArgumentException and falls back to returning
hiltViewModel() without a parent; specifically, protect the remember block that
initializes parentEntry (and the subsequent return hiltViewModel(parentEntry))
so that if getBackStackEntry throws or cannot find navGraphRoute you return
hiltViewModel() instead, using the symbols navController.getBackStackEntry,
navGraphRoute, parentEntry, and hiltViewModel to locate and update the code.
🧹 Nitpick comments (1)
app/src/main/java/com/flint/presentation/onboarding/OnboardingProfileScreen.kt (1)
132-135: 알림: TODO 항목 - 닉네임 중복 체크 결과 토스트연결된 이슈
#150에서언급된 것처럼 닉네임 중복 체크 결과에 대한 토스트 알림이 구현되지 않았습니다.isNicknameAvailable파라미터가 전달되지만 현재 UI에서 사용되지 않습니다.토스트 알림 구현 코드를 생성하거나, 이 작업을 추적하기 위한 새 이슈를 열어드릴까요?
| val navGraphRoute = destination.parent?.route ?: return hiltViewModel() | ||
| val parentEntry = remember(this) { | ||
| navController.getBackStackEntry(navGraphRoute) | ||
| } | ||
| return hiltViewModel(parentEntry) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find and examine the NavBackStackEntryExt.kt file
find . -name "NavBackStackEntryExt.kt" -type fRepository: imflint/Flint-Android
Length of output: 140
🏁 Script executed:
#!/bin/bash
# Read the full content of the extension file to understand the complete context
if [ -f "app/src/main/java/com/flint/core/common/extension/NavBackStackEntryExt.kt" ]; then
cat -n "app/src/main/java/com/flint/core/common/extension/NavBackStackEntryExt.kt"
else
find . -name "NavBackStackEntryExt.kt" -type f -exec cat -n {} \;
fiRepository: imflint/Flint-Android
Length of output: 899
🏁 Script executed:
#!/bin/bash
# Search for usages of sharedViewModel extension function
rg -n --type=kt 'sharedViewModel' -C 3Repository: imflint/Flint-Android
Length of output: 91
🏁 Script executed:
#!/bin/bash
# Search for sharedViewModel usages without type filter
rg -n 'sharedViewModel' -C 3Repository: imflint/Flint-Android
Length of output: 7825
🏁 Script executed:
#!/bin/bash
# Search for any try-catch or error handling around getBackStackEntry in the codebase
rg -n 'getBackStackEntry' -C 5Repository: imflint/Flint-Android
Length of output: 1088
getBackStackEntry()가 IllegalArgumentException을 던질 수 있습니다.
navController.getBackStackEntry(navGraphRoute)는 해당 경로가 백 스택에 없을 경우 예외를 던집니다. 네비게이션 전환 중이나 백 스택 상태가 변경될 때 런타임 크래시가 발생할 수 있습니다. 현재 코드는 부모 경로가 null인 경우만 방어하고 있어 실제 크래시 시나리오를 방지하지 못합니다.
try-catch로 감싸거나 runCatching을 사용하여 예외를 처리하는 것을 권장합니다.
🤖 Prompt for AI Agents
In `@app/src/main/java/com/flint/core/common/extension/NavBackStackEntryExt.kt`
around lines 17 - 21, Wrap the call to
navController.getBackStackEntry(navGraphRoute) in a try-catch (or runCatching)
that handles IllegalArgumentException and falls back to returning
hiltViewModel() without a parent; specifically, protect the remember block that
initializes parentEntry (and the subsequent return hiltViewModel(parentEntry))
so that if getBackStackEntry throws or cannot find navGraphRoute you return
hiltViewModel() instead, using the symbols navController.getBackStackEntry,
navGraphRoute, parentEntry, and hiltViewModel to locate and update the code.
📮 관련 이슈
📌 작업 내용
📸 스크린샷
😅 미구현
🫛 To. 리뷰어
Summary by CodeRabbit
릴리스 노트
새로운 기능
개선 사항
✏️ Tip: You can customize this high-level summary in your review settings.