Conversation
- MainNavigator 시작 화면 Splash로 변경 - SplashScreenContainer, IntroScreenContainer 라우팅 설정
|
""" Walkthrough이번 변경에서는 앱의 네비게이션 그래프에 Splash 및 Intro 화면이 추가되었습니다. Splash 화면에서는 토큰 존재 여부를 비동기적으로 확인하여, 토큰이 있으면 Home 화면으로, 없으면 Intro 화면으로 이동하도록 분기하는 로직이 구현되었습니다. 관련 데이터 소스, 리포지토리, 도메인 계층, 프레젠테이션 계층이 모두 확장되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant SplashScreen
participant SplashViewModel
participant HasTokenUseCase
participant AuthRepository
App->>SplashScreen: 진입(Splash Route)
SplashScreen->>SplashViewModel: 초기화
SplashViewModel->>HasTokenUseCase: invoke()
HasTokenUseCase->>AuthRepository: hasToken()
AuthRepository-->>HasTokenUseCase: Boolean
HasTokenUseCase-->>SplashViewModel: Boolean
SplashViewModel->>SplashScreen: SideEffect(NavigateToHome/Intro)
SplashScreen->>App: 네비게이션 콜백 실행
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(해당 변경에서 요구사항과 무관한 기능적 코드 변경은 발견되지 않았습니다.) Poem
""" ✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/src/main/java/com/threegap/bitnagil/MainNavHost.kt (1)
29-31: 인트로 화면 구현 확인 및 향후 개선사항인트로 화면이 정상적으로 추가되었습니다. 다만 향후 인트로 화면에서 로그인 화면으로 이동하는 네비게이션 로직이 필요할 수 있으니 고려해보세요.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
app/src/main/java/com/threegap/bitnagil/MainNavHost.kt(2 hunks)app/src/main/java/com/threegap/bitnagil/MainNavigator.kt(1 hunks)app/src/main/java/com/threegap/bitnagil/Route.kt(1 hunks)core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStore.kt(1 hunks)core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthLocalDataSource.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthLocalDataSourceImpl.kt(1 hunks)data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/auth/repository/AuthRepository.kt(1 hunks)domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/HasTokenUseCase.kt(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/intro/IntroScreen.kt(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashScreen.kt(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashIntent.kt(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashSideEffect.kt(1 hunks)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashState.kt(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
app/src/main/java/com/threegap/bitnagil/MainNavHost.kt (2)
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashScreen.kt (1)
SplashScreenContainer(14-28)presentation/src/main/java/com/threegap/bitnagil/presentation/intro/IntroScreen.kt (1)
IntroScreenContainer(12-15)
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt (1)
presentation/src/main/java/com/threegap/bitnagil/presentation/common/mviviewmodel/MviViewModel.kt (2)
sendSideEffect(23-23)sendIntent(30-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (26)
app/src/main/java/com/threegap/bitnagil/Route.kt (1)
7-12: 새로운 라우트 추가가 적절합니다.
Splash와Intro라우트가 기존 패턴과 일관성 있게 구현되었습니다. 직렬화 어노테이션과 data object 패턴이 올바르게 적용되어 있습니다.presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashSideEffect.kt (1)
5-8: MVI 사이드 이펙트 구현이 올바릅니다.
SplashSideEffect가 MVI 패턴을 올바르게 따르고 있으며, 네비게이션 사이드 이펙트들이 명확하게 정의되어 있습니다.data/src/main/java/com/threegap/bitnagil/data/auth/datasource/AuthLocalDataSource.kt (1)
4-4: 토큰 존재 확인 메서드 추가가 적절합니다.
hasToken()메서드가 suspend 함수로 올바르게 정의되어 있으며, 스플래시 화면의 자동 로그인 로직을 지원하는 데 적합합니다.app/src/main/java/com/threegap/bitnagil/MainNavigator.kt (1)
11-11: 시작 목적지 변경이 적절합니다.시작 목적지가
Route.Splash로 변경되어 새로운 스플래시 화면 플로우와 일치합니다. 이는 스플래시 화면에서 토큰 존재 여부에 따라 적절한 화면으로 네비게이션하는 로직을 지원합니다.domain/src/main/java/com/threegap/bitnagil/domain/auth/repository/AuthRepository.kt (1)
8-8: 리포지토리 인터페이스에 토큰 확인 메서드 추가가 적절합니다.
hasToken()메서드가 도메인 계층에서 올바르게 정의되어 있으며, 데이터 계층과 일관성을 유지하고 있습니다. 스플래시 화면의 자동 로그인 로직을 위한 도메인 유스케이스를 지원합니다.data/src/main/java/com/threegap/bitnagil/data/auth/repositoryimpl/AuthRepositoryImpl.kt (1)
19-19: 레포지토리 계층에서의 토큰 확인 메서드 구현이 적절합니다.데이터 소스로의 간단한 위임 패턴을 따르고 있어 클린 아키텍처 원칙에 부합합니다.
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStore.kt (1)
9-9: 인터페이스 메서드 선언이 적절합니다.suspend 함수 패턴을 따르고 있으며, Boolean 반환 타입이 토큰 존재 여부 확인에 적합합니다.
data/src/main/java/com/threegap/bitnagil/data/auth/datasourceimpl/AuthLocalDataSourceImpl.kt (1)
11-11: 데이터 소스 계층에서의 토큰 확인 구현이 적절합니다.데이터 스토어로의 위임 패턴이 일관되고 깔끔합니다.
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashState.kt (1)
1-9: 스플래시 화면의 상태 모델 구현이 적절합니다.MVI 아키텍처 패턴을 올바르게 따르고 있으며, @parcelize 애노테이션과 기본값 설정이 적절합니다.
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt (2)
6-6: 필요한 import가 적절하게 추가되었습니다.kotlinx.coroutines.flow.first import가 hasToken() 메서드 구현에 필요합니다.
13-20: 토큰 존재 여부 확인 메서드 구현이 견고합니다.dataStore.data.first()를 사용하여 현재 토큰을 가져오고, accessToken과 refreshToken 모두 null이 아니고 비어있지 않은지 확인하는 로직이 적절합니다. 예외 처리도 false를 반환하여 안전하게 처리됩니다.
app/src/main/java/com/threegap/bitnagil/MainNavHost.kt (2)
8-10: 새로운 네비게이션 화면 추가 확인됨IntroScreenContainer와 SplashScreenContainer 임포트가 정확하게 추가되었습니다.
22-27: 스플래시 화면 네비게이션 로직 검토스플래시 화면에서 인트로 화면과 홈 화면으로의 네비게이션 콜백이 적절하게 구현되었습니다. 토큰 유무에 따른 자동 로그인 로직이 잘 반영되었네요.
domain/src/main/java/com/threegap/bitnagil/domain/auth/usecase/HasTokenUseCase.kt (1)
6-10: 클린 아키텍처 원칙을 잘 따른 Use Case 구현HasTokenUseCase가 단일 책임 원칙을 따르며 의존성 주입이 적절히 구현되었습니다. suspend 함수로 비동기 처리도 올바르게 되어 있네요.
presentation/src/main/java/com/threegap/bitnagil/presentation/intro/IntroScreen.kt (3)
12-15: Container 패턴을 활용한 적절한 구조IntroScreenContainer에서 실제 화면 구현을 분리하는 Container 패턴을 잘 활용했습니다.
18-26: 기본적인 UI 구현 확인플레이스홀더 형태의 기본 UI가 구현되었습니다. 한국어 텍스트 사용이 적절하네요. 향후 실제 인트로 화면 디자인이 적용될 예정이라는 점을 고려하면 현재 구현이 적절합니다.
28-32: Preview 컴포저블 추가로 개발 편의성 확보Preview 컴포저블이 추가되어 개발 중 화면 확인이 용이해졌습니다.
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/model/SplashIntent.kt (1)
5-9: MVI 아키텍처 Intent 모델 구현 확인SplashIntent가 MVI 패턴을 잘 따르고 있습니다. sealed class 사용으로 타입 안전성을 확보했고, 로딩 상태와 네비게이션 의도가 명확하게 분리되어 있습니다.
presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashScreen.kt (4)
14-28: 스플래시 화면 Container 구현 확인SplashScreenContainer가 ViewModel과 적절히 연동되어 있고, side effect 수집을 통한 네비게이션 로직이 잘 구현되었습니다. Hilt를 통한 의존성 주입도 적절합니다.
30-43: 플레이스홀더 UI 구현 확인스플래시 화면의 기본 UI가 적절하게 구현되었습니다. 한국어 플레이스홀더 텍스트("야무진 로고 추가 예정")가 향후 실제 로고로 교체될 예정이라는 점을 고려하면 현재 구현이 적절합니다.
45-49: Preview 컴포저블로 개발 편의성 확보Preview 컴포저블이 추가되어 개발 중 화면 확인이 용이해졌습니다.
20-25: 초기화 트리거 확인 완료 – SplashViewModelinit블록에서checkAutoLogin()호출 중
SplashViewModel의 생성자 내init { checkAutoLogin() }가 자동으로 토큰 확인&네비게이션 로직을 실행하므로, 별도 초기 트리거 추가는 불필요합니다.• 파일: presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt
• 위치:init { … }블록(라인 26–28)presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt (4)
1-15: 임포트 구문이 잘 정리되어 있습니다.필요한 라이브러리들이 적절히 임포트되어 있고, MVI 패턴 구현에 필요한 모든 의존성이 포함되어 있습니다.
17-24: 의존성 주입이 올바르게 구현되었습니다.@hiltviewmodel 어노테이션과 @Inject 생성자를 사용하여 의존성 주입이 적절히 설정되어 있습니다. MviViewModel 상속도 올바른 타입 파라미터로 구성되어 있습니다.
26-28: 초기화 로직이 적절합니다.ViewModel 생성 시 자동으로 로그인 체크를 수행하는 것이 스플래시 화면의 목적에 부합합니다.
30-48: MVI 패턴이 올바르게 구현되었습니다.각 Intent에 대한 상태 변화와 사이드 이펙트 처리가 적절하게 구현되어 있습니다. 네비게이션 시 로딩 상태를 false로 설정하는 것도 올바른 처리입니다.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt (1)
6-6: 사용되지 않는 import를 제거해주세요.
firstimport가 사용되지 않고 있습니다.firstOrNull만 사용되므로 이 import를 제거해주세요.-import kotlinx.coroutines.flow.first
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt (3)
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#25
File: presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt:50-65
Timestamp: 2025-07-11T03:54:23.312Z
Learning: AuthTokenDataStoreImpl.hasToken() 메소드에서 예외 발생 시 false를 반환하도록 이미 예외 처리가 구현되어 있어, 상위 레이어에서 추가적인 예외 처리가 불필요합니다.
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#25
File: presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt:50-65
Timestamp: 2025-07-11T03:54:23.312Z
Learning: AuthTokenDataStoreImpl.hasToken() 메소드에서 예외 발생 시 false를 반환하도록 이미 예외 처리가 구현되어 있어, 상위 레이어에서 추가적인 예외 처리가 불필요합니다.
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#25
File: presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt:50-65
Timestamp: 2025-07-11T03:54:23.312Z
Learning: AuthTokenDataStoreImpl.hasToken() 메소드에서 예외 발생 시 false를 반환하도록 이미 예외 처리가 구현되어 있어, 상위 레이어에서 추가적인 예외 처리가 불필요합니다.
🪛 detekt (1.23.8)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt
[warning] 20-20: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt (1)
14-23: 구현이 잘 되었습니다!
firstOrNull()사용과 예외 처리가 이전 리뷰 논의에 따라 적절히 구현되었습니다. 토큰 존재 여부를 안전하게 확인하는 로직이 올바르게 작동할 것입니다.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt (1)
6-6: firstOrNull 사용 승인!이전 리뷰 피드백에서 논의된 대로
firstOrNull()을 사용하는 것이 좋습니다. 값이 없는 경우도 안전하게 처리할 수 있어 더 나은 접근 방식입니다.
🧹 Nitpick comments (1)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt (1)
13-22: 토큰 확인 로직이 올바르게 구현되었습니다.
hasToken()함수의 구현이 적절합니다:
firstOrNull()사용으로 안전한 토큰 검색- 두 토큰 모두 존재하고 비어있지 않은지 확인
- 예외 발생 시
false반환하는 적절한 예외 처리다만, 디버깅을 위해 예외 로깅을 추가하는 것을 고려해보세요:
override suspend fun hasToken(): Boolean { return try { val currentToken = dataStore.data.firstOrNull() currentToken?.let { !it.accessToken.isNullOrEmpty() && !it.refreshToken.isNullOrEmpty() } ?: false } catch (e: Exception) { + Log.d(TAG, "Failed to check token existence", e) false } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt (3)
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#25
File: presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt:50-65
Timestamp: 2025-07-11T03:54:23.312Z
Learning: AuthTokenDataStoreImpl.hasToken() 메소드에서 예외 발생 시 false를 반환하도록 이미 예외 처리가 구현되어 있어, 상위 레이어에서 추가적인 예외 처리가 불필요합니다.
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#25
File: presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt:50-65
Timestamp: 2025-07-11T03:54:23.312Z
Learning: AuthTokenDataStoreImpl.hasToken() 메소드에서 예외 발생 시 false를 반환하도록 이미 예외 처리가 구현되어 있어, 상위 레이어에서 추가적인 예외 처리가 불필요합니다.
Learnt from: wjdrjs00
PR: YAPP-Github/Bitnagil-Android#25
File: presentation/src/main/java/com/threegap/bitnagil/presentation/splash/SplashViewModel.kt:50-65
Timestamp: 2025-07-11T03:54:23.312Z
Learning: AuthTokenDataStoreImpl.hasToken() 메소드에서 예외 발생 시 false를 반환하도록 이미 예외 처리가 구현되어 있어, 상위 레이어에서 추가적인 예외 처리가 불필요합니다.
🪛 detekt (1.23.8)
core/datastore/src/main/java/com/threegap/bitnagil/datastore/auth/storage/AuthTokenDataStoreImpl.kt
[warning] 19-19: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
[ PR Content ]
앱 진입 시 최초로 보여지는 스플래시 화면 및 자동 로그인 기능 구현
Related issue
Screenshot 📸
Work Description
intro/home화면으로 진입되도록 설정)To Reviewers 📢
Summary by CodeRabbit
신규 기능
UI 개선