Skip to content

feat: 자동 로그인 구현#97

Merged
easyhooon merged 6 commits intodevelopfrom
BOOK-197-feature/#86
Aug 2, 2025
Merged

feat: 자동 로그인 구현#97
easyhooon merged 6 commits intodevelopfrom
BOOK-197-feature/#86

Conversation

@easyhooon
Copy link
Copy Markdown
Contributor

@easyhooon easyhooon commented Aug 2, 2025

🔗 관련 이슈

📙 작업 설명

  • 자동 로그인 구현(구현 방식은 온보딩 완료 체크와 동일)
  • 앱 이름 변경(Booket -> Reed)

🧪 테스트 내역 (선택)

  • 주요 기능 정상 동작 확인
  • 브라우저/기기에서 동작 확인
  • 엣지 케이스 테스트 완료
  • 기존 기능 영향 없음

💬 추가 설명 or 리뷰 포인트 (선택)

  • 제가 확인했을 때는 문제가 없음을 확인했는데, 정상 동작하는지 체크 부탁드림니다!

Summary by CodeRabbit

  • 신규 기능

    • 자동 로그인 상태를 나타내는 새로운 상태(enum) 및 상태 흐름(Flow)이 추가되어, 로그인 여부를 더 세밀하게 반영합니다.
  • 기능 개선

    • 스플래시 화면에서 온보딩 및 자동 로그인 상태를 기반으로 보다 정확한 화면 전환이 이루어집니다.
    • 앱 이름이 "Booket"에서 "Reed"로 변경되었습니다.
  • 버그 수정

    • 내부 데이터 소스 명칭 일관성이 개선되었습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 2, 2025

Walkthrough

자동 로그인 기능을 위한 상태 관리와 흐름이 도입되었습니다. 새로운 AutoLoginState enum이 추가되었고, AuthRepository 및 DefaultAuthRepository에 autoLoginState 플로우가 구현되었습니다. SplashPresenter와 SplashUiState는 온보딩 및 자동 로그인 상태를 기반으로 동작하도록 변경되었습니다. 앱 이름 문자열 리소스도 변경되었습니다.

Changes

Cohort / File(s) Change Summary
앱 이름 문자열 리소스 변경
core/designsystem/src/main/res/values/strings.xml
앱 이름 문자열이 "Booket"에서 "Reed"로 변경됨
자동 로그인 상태 enum 추가
core/model/src/main/kotlin/com/ninecraft/booket/core/model/AutoLoginState.kt
AutoLoginState enum (IDLE, LOGGED_IN, NOT_LOGGED_IN) 신설
SplashPresenter 자동 로그인 상태 반영
feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt
SplashPresenter가 AuthRepository의 autoLoginState를 관찰하고, 온보딩 및 자동 로그인 상태에 따라 네비게이션 로직 분기
SplashUiState 구조 변경
feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashUiState.kt
isOnboardingCompleted(Boolean?) 대신 onboardingState, autoLoginState(enum) 속성으로 변경
AuthRepository autoLoginState 플로우 추가
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt
AuthRepository에 autoLoginState: Flow 추가
DefaultAuthRepository autoLoginState 구현 및 네이밍 수정
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt
autoLoginState 플로우 구현, tokenDatasource → tokenDataSource 네이밍 일관성 수정

Sequence Diagram(s)

sequenceDiagram
    participant SplashPresenter
    participant UserRepository
    participant AuthRepository
    participant Navigator

    SplashPresenter->>UserRepository: onboardingState 구독
    SplashPresenter->>AuthRepository: autoLoginState 구독
    Note right of SplashPresenter: 상태 변화 감지

    alt 온보딩 미완료
        SplashPresenter->>Navigator: 온보딩 화면 이동
    else 온보딩 완료 & 자동 로그인 LOGGED_IN
        SplashPresenter->>Navigator: 메인 화면 이동
    else 온보딩 완료 & 자동 로그인 NOT_LOGGED_IN
        SplashPresenter->>Navigator: 로그인 화면 이동
    else 상태 IDLE
        Note right of SplashPresenter: 대기
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
자동 로그인 구현 (#86)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
앱 이름 문자열 변경 (core/designsystem/src/main/res/values/strings.xml) 자동 로그인 구현(#86)과 직접적인 관련이 없는 앱 이름 변경 사항입니다.

Suggested reviewers

  • seoyoon513

Poem

🐰
자동 로그인 토큰 따라
로그인 화면, 온보딩 갈라
Reed라 불린 새 이름과
enum이 춤추는 데이터 바다
리뷰어님, 이 변화 속
토끼도 깡총, 기뻐하라!
🌱

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d4a031 and 554f9f3.

📒 Files selected for processing (4)
  • core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt (1 hunks)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt (2 hunks)
  • core/model/src/main/kotlin/com/ninecraft/booket/core/model/AutoLoginState.kt (1 hunks)
  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/model/src/main/kotlin/com/ninecraft/booket/core/model/AutoLoginState.kt
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#61
File: feature/webview/build.gradle.kts:17-21
Timestamp: 2025-07-20T12:34:23.786Z
Learning: Reed-Android 프로젝트에서는 `booket.android.feature` convention plugin을 사용하여 feature 모듈들의 공통 의존성을 관리한다. 이 plugin은 Circuit, Compose, 그리고 core 모듈들의 의존성을 자동으로 포함하므로, 각 feature 모듈의 build.gradle.kts에서는 특별한 의존성(예: libs.logger, libs.kakao.auth)만 별도로 선언하면 된다.
📚 Learning: kotlin에서 같은 패키지 내의 파일들은 패키지 레벨에 정의된 const val 상수를 import 없이 직접 접근할 수 있습니다. onboardingpresenter.kt와 o...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#77
File: feature/onboarding/src/main/kotlin/com/ninecraft/booket/feature/onboarding/OnboardingUi.kt:73-73
Timestamp: 2025-07-29T07:02:18.885Z
Learning: Kotlin에서 같은 패키지 내의 파일들은 패키지 레벨에 정의된 const val 상수를 import 없이 직접 접근할 수 있습니다. OnboardingPresenter.kt와 OnboardingUi.kt 모두 com.ninecraft.booket.feature.onboarding 패키지에 속해 있어서 ONBOARDING_STEPS_COUNT 상수를 공유할 수 있습니다.

Applied to files:

  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt
📚 Learning: in circuit architecture, presenters receive the screen object directly as a constructor parameter (e...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt:18-47
Timestamp: 2025-07-31T23:30:37.547Z
Learning: In Circuit architecture, presenters receive the Screen object directly as a constructor parameter (e.g., @Assisted private val screen: RecordDetailScreen), and screen parameters are accessed through this screen object (e.g., screen.recordId). Screen parameters should not be added as separate constructor parameters.

Applied to files:

  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt
📚 Learning: in the reed-android project using circuit architecture, delegatingnavigator was restored because nav...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#52
File: feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/screens/DelegatingNavigator.kt:0-0
Timestamp: 2025-07-16T15:54:19.322Z
Learning: In the Reed-Android project using Circuit architecture, DelegatingNavigator was restored because NavigableCircuitContent can only inject a single navigator, but the dual-navigator architecture (childNavigator for bottom navigation screens, rootNavigator for full-screen screens) requires a delegating component to work within Circuit's constraint.

Applied to files:

  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt
⏰ 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: ci-build
🔇 Additional comments (11)
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt (2)

3-4: 새로운 imports가 적절하게 추가되었습니다.

AutoLoginState와 Flow import가 새로운 기능에 필요한 타입들을 위해 정확히 추가되었습니다.


13-13: 자동 로그인 상태를 위한 reactive property가 잘 설계되었습니다.

Flow를 통해 인증 상태 변화를 reactive하게 관찰할 수 있도록 구현되었습니다. val로 선언하여 외부에서 변경할 수 없도록 보호하는 것도 좋은 설계입니다.

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt (4)

6-6: 필요한 imports가 정확하게 추가되었습니다.

AutoLoginState와 map extension을 위한 imports가 새로운 기능 구현에 적절하게 추가되었습니다.

Also applies to: 10-10


17-17: 네이밍 일관성이 개선되었습니다.

생성자 파라미터가 tokenDatasource에서 tokenDataSource로 변경되어 camelCase 네이밍 규칙을 올바르게 따르게 되었습니다.


40-40: private 메서드들이 수정된 프로퍼티 이름을 올바르게 사용합니다.

saveTokensclearTokens 메서드가 수정된 tokenDataSource 프로퍼티 이름을 정확하게 사용하도록 업데이트되었습니다.

Also applies to: 47-47


50-56: 자동 로그인 상태 구현이 효율적이고 정확합니다.

tokenDataSource.accessToken flow를 AutoLoginState로 매핑하는 구현이 깔끔합니다. 토큰이 비어있으면 NOT_LOGGED_IN, 그렇지 않으면 LOGGED_IN으로 매핑하는 로직이 명확하고 적절합니다. reactive programming 패턴을 잘 활용했습니다.

feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt (5)

5-7: 필요한 의존성과 타입 imports가 적절하게 추가되었습니다.

AuthRepository와 AutoLoginState import가 자동 로그인 기능 구현을 위해 정확하게 추가되었습니다.


26-26: AuthRepository 의존성 주입이 올바르게 구현되었습니다.

Circuit의 Assisted Injection 패턴을 따라 AuthRepository가 적절하게 주입되었습니다.


32-32: 자동 로그인 상태 관찰이 올바르게 구현되었습니다.

collectAsRetainedState를 사용하여 autoLoginState를 관찰하고, 초기값으로 AutoLoginState.IDLE을 설정한 것이 Circuit 아키텍처에 적합합니다.


34-60: 네비게이션 로직이 모든 상태 조합을 적절하게 처리합니다.

온보딩과 자동 로그인 상태를 조합한 네비게이션 로직이 잘 설계되었습니다:

  • 온보딩 미완료 → OnboardingScreen
  • 온보딩 완료 + 로그인됨 → BottomNavigationScreen
  • 온보딩 완료 + 로그인 안됨 → LoginScreen
  • IDLE 상태들은 적절히 대기하도록 처리

한국어 주석도 코드의 의도를 명확하게 설명합니다.


62-66: SplashUiState 생성이 새로운 상태 구조를 올바르게 반영합니다.

idle 속성이 두 상태 모두를 고려하여 계산되고, 각 상태가 개별적으로 전달되어 UI에서 필요에 따라 활용할 수 있도록 구성되었습니다.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-197-feature/#86

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions Bot requested a review from seoyoon513 August 2, 2025 01:21
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultUserRepository.kt (1)

7-8: 자동 로그인 상태 구현이 올바릅니다.

토큰의 존재 여부에 따른 로그인 상태 매핑이 적절하며, 반응형 Flow 변환을 올바르게 사용했습니다.

when 표현식을 더 간단한 if-else로 개선할 수 있습니다:

-    override val autoLoginState: Flow<AutoLoginState> = tokenDataSource.accessToken
-        .map { accessToken ->
-            when {
-                accessToken.isBlank() -> AutoLoginState.NOT_LOGGED_IN
-                else -> AutoLoginState.LOGGED_IN
-            }
-        }
+    override val autoLoginState: Flow<AutoLoginState> = tokenDataSource.accessToken
+        .map { accessToken ->
+            if (accessToken.isBlank()) {
+                AutoLoginState.NOT_LOGGED_IN
+            } else {
+                AutoLoginState.LOGGED_IN
+            }
+        }

Also applies to: 10-11, 17-17, 29-35

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between adb8e0b and 4d4a031.

📒 Files selected for processing (7)
  • core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/UserRepository.kt (2 hunks)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultUserRepository.kt (2 hunks)
  • core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/AutoLoginDataSource.kt (1 hunks)
  • core/designsystem/src/main/res/values/strings.xml (1 hunks)
  • core/model/src/main/kotlin/com/ninecraft/booket/core/model/AutoLoginState.kt (1 hunks)
  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt (2 hunks)
  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashUiState.kt (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#61
File: feature/webview/build.gradle.kts:17-21
Timestamp: 2025-07-20T12:34:23.786Z
Learning: Reed-Android 프로젝트에서는 `booket.android.feature` convention plugin을 사용하여 feature 모듈들의 공통 의존성을 관리한다. 이 plugin은 Circuit, Compose, 그리고 core 모듈들의 의존성을 자동으로 포함하므로, 각 feature 모듈의 build.gradle.kts에서는 특별한 의존성(예: libs.logger, libs.kakao.auth)만 별도로 선언하면 된다.
📚 Learning: reed-android 프로젝트는 현재 다국어 지원 계획이 없어서 모델에 한글 문자열을 직접 포함하는 것이 허용된다....
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: core/model/src/main/kotlin/com/ninecraft/booket/core/model/EmotionModel.kt:11-18
Timestamp: 2025-07-31T16:58:59.404Z
Learning: Reed-Android 프로젝트는 현재 다국어 지원 계획이 없어서 모델에 한글 문자열을 직접 포함하는 것이 허용된다.

Applied to files:

  • core/designsystem/src/main/res/values/strings.xml
📚 Learning: reed android 프로젝트에서 타이포그래피 사용 규칙: 톱 앱바(top app bar)에서는 `headline2semibold`를 사용하고, 바텀시트(bottom sheet)...
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#45
File: core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/appbar/ReedTopAppBar.kt:65-65
Timestamp: 2025-07-12T01:33:57.101Z
Learning: Reed Android 프로젝트에서 타이포그래피 사용 규칙: 톱 앱바(Top App Bar)에서는 `headline2SemiBold`를 사용하고, 바텀시트(Bottom Sheet)에서는 `heading2SemiBold`를 사용한다. 이는 의도적인 디자인 시스템 차별화이다.

Applied to files:

  • core/designsystem/src/main/res/values/strings.xml
📚 Learning: reed-android 프로젝트에서 core:model 모듈은 순수 kotlin 모듈이므로 android 리소스(r.string 등)에 접근할 수 없다....
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: core/model/src/main/kotlin/com/ninecraft/booket/core/model/EmotionModel.kt:11-18
Timestamp: 2025-07-31T16:58:59.404Z
Learning: Reed-Android 프로젝트에서 core:model 모듈은 순수 Kotlin 모듈이므로 Android 리소스(R.string 등)에 접근할 수 없다.

Applied to files:

  • core/designsystem/src/main/res/values/strings.xml
📚 Learning: in the reed-android project's termsagreementscreen.kt, the ontermdetailclick event is intentionally ...
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#35
File: feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/TermsAgreementScreen.kt:127-127
Timestamp: 2025-07-09T01:14:29.836Z
Learning: In the Reed-Android project's TermsAgreementScreen.kt, the OnTermDetailClick event is intentionally passed an empty string for the URL parameter because the actual URLs for terms detail pages haven't been decided yet. This is a temporary implementation that will be updated once the URLs are finalized.

Applied to files:

  • core/designsystem/src/main/res/values/strings.xml
📚 Learning: reed-android 프로젝트에서는 api가 준비되지 않은 상황에서 ui를 먼저 구현하고, api 연동 시점에 하드코딩된 데이터를 실제 데이터로 교체하는 개발 방식을 사용한다. ...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt:29-37
Timestamp: 2025-07-31T23:17:40.054Z
Learning: Reed-Android 프로젝트에서는 API가 준비되지 않은 상황에서 UI를 먼저 구현하고, API 연동 시점에 하드코딩된 데이터를 실제 데이터로 교체하는 개발 방식을 사용한다. RecordItem 컴포넌트의 emotionTags 매개변수도 API 연동 시점에 `text = emotionTags.joinToString(separator = "·") { "#$it" }`로 적용될 예정이다.

Applied to files:

  • core/designsystem/src/main/res/values/strings.xml
📚 Learning: reed-android 프로젝트에서는 `booket.android.feature` convention plugin을 사용하여 feature 모듈들의 공통 의존성을 관리한다. 이 p...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#61
File: feature/webview/build.gradle.kts:17-21
Timestamp: 2025-07-20T12:34:23.786Z
Learning: Reed-Android 프로젝트에서는 `booket.android.feature` convention plugin을 사용하여 feature 모듈들의 공통 의존성을 관리한다. 이 plugin은 Circuit, Compose, 그리고 core 모듈들의 의존성을 자동으로 포함하므로, 각 feature 모듈의 build.gradle.kts에서는 특별한 의존성(예: libs.logger, libs.kakao.auth)만 별도로 선언하면 된다.

Applied to files:

  • core/designsystem/src/main/res/values/strings.xml
📚 Learning: reed android 프로젝트에서는 다크모드/라이트모드 대응 계획이 없고 기본 테마 값만 사용할 예정이다....
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#32
File: core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Theme.kt:15-21
Timestamp: 2025-07-08T03:21:24.693Z
Learning: Reed Android 프로젝트에서는 다크모드/라이트모드 대응 계획이 없고 기본 테마 값만 사용할 예정이다.

Applied to files:

  • core/designsystem/src/main/res/values/strings.xml
📚 Learning: kotlin에서 같은 패키지 내의 파일들은 패키지 레벨에 정의된 const val 상수를 import 없이 직접 접근할 수 있습니다. onboardingpresenter.kt와 o...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#77
File: feature/onboarding/src/main/kotlin/com/ninecraft/booket/feature/onboarding/OnboardingUi.kt:73-73
Timestamp: 2025-07-29T07:02:18.885Z
Learning: Kotlin에서 같은 패키지 내의 파일들은 패키지 레벨에 정의된 const val 상수를 import 없이 직접 접근할 수 있습니다. OnboardingPresenter.kt와 OnboardingUi.kt 모두 com.ninecraft.booket.feature.onboarding 패키지에 속해 있어서 ONBOARDING_STEPS_COUNT 상수를 공유할 수 있습니다.

Applied to files:

  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashUiState.kt
  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt
⏰ 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: ci-build
🔇 Additional comments (11)
core/designsystem/src/main/res/values/strings.xml (1)

2-2: 앱 이름 변경 적용 확인 완료

app_name 문자열이 "Booket"에서 "Reed"로 정상적으로 변경되었습니다. 다른 리소스나 매니페스트의 android:label 값도 함께 업데이트되었는지 최종 점검만 해주세요. 기능상 문제는 없습니다.

core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/UserRepository.kt (1)

3-3: 인터페이스 확장이 적절합니다.

자동 로그인 상태를 위한 autoLoginState 프로퍼티 추가가 기존 onboardingState 패턴과 일관성 있게 구현되었습니다. Flow<AutoLoginState> 타입 사용으로 반응형 상태 관찰이 가능합니다.

Also applies to: 15-15

core/model/src/main/kotlin/com/ninecraft/booket/core/model/AutoLoginState.kt (1)

3-7: 자동 로그인 상태 enum 승인 및 IDLE 상태 사용 확인

AutoLoginState.IDLE가 다음 위치에서 정상적으로 사용되고 있음을 확인했습니다:

  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashUiState.kt
    • val autoLoginState: AutoLoginState = AutoLoginState.IDLE
    • idle = onboardingState == OnboardingState.IDLE || autoLoginState == AutoLoginState.IDLE
  • feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt
    • val autoLoginState by userRepository.autoLoginState.collectAsRetainedState(initial = AutoLoginState.IDLE)
    • when (autoLoginState) { AutoLoginState.IDLE -> { /* 자동 로그인 상태를 기다리는 중 */ } … }

추가 검토나 수정은 필요하지 않습니다.

core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/AutoLoginDataSource.kt (1)

6-8: 깔끔한 데이터소스 인터페이스 설계입니다.

단일 책임 원칙을 따르며, 반응형 Flow를 사용한 자동 로그인 상태 노출이 적절합니다. 기존 datasource 패턴과 일관성을 유지하고 있습니다.

feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashUiState.kt (1)

3-4: 상태 관리가 개선되었습니다.

단순한 boolean 플래그에서 표현력 있는 enum 상태로 리팩토링되어 타입 안전성과 명확성이 향상되었습니다. 두 상태 모두 IDLE로 기본값 설정이 적절합니다.

Also applies to: 9-10

feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/splash/SplashPresenter.kt (6)

6-6: 새로운 자동 로그인 상태 모델 import 추가 확인

자동 로그인 기능 구현을 위해 필요한 AutoLoginState 모델이 올바르게 import되었습니다.


8-8: 메인 화면 네비게이션을 위한 import 추가 확인

자동 로그인 성공 시 메인 화면으로 이동하기 위한 BottomNavigationScreen import가 적절하게 추가되었습니다.


30-30: 자동 로그인 상태 관찰 로직 구현 확인

collectAsRetainedState를 사용하여 자동 로그인 상태를 안전하게 관찰하고 있으며, 적절한 초기값(AutoLoginState.IDLE)이 설정되었습니다.


32-32: RememberedEffect 의존성 업데이트 확인

autoLoginState를 의존성에 추가하여 자동 로그인 상태 변경 시에도 네비게이션 로직이 적절히 재실행되도록 구현되었습니다.


39-54: 자동 로그인 기반 네비게이션 로직 구현 확인

온보딩 완료 후 자동 로그인 상태에 따른 네비게이션 로직이 올바르게 구현되었습니다.

로직 흐름:

  • 로그인됨: 메인 화면으로 이동
  • 로그인 안됨: 로그인 화면으로 이동
  • 대기 중: 상태 로딩 완료까지 대기

IDLE 상태에서의 대기 처리도 적절하게 구현되어 사용자 경험을 보장합니다.


59-61: UI 상태 반환 로직 개선 확인

SplashUiState가 두 상태를 모두 고려하도록 개선되었습니다:

  • idle 조건에 autoLoginState도 포함하여 완전한 로딩 상태 반영
  • 명시적인 상태 전달로 UI에서 더 정확한 상태 처리 가능

boolean 기반에서 enum 기반으로의 전환이 코드의 명확성과 유지보수성을 향상시켰습니다.

@seoyoon513
Copy link
Copy Markdown
Contributor

seoyoon513 commented Aug 2, 2025

오 잘 되네요! LGTM~

@easyhooon easyhooon merged commit 42923f5 into develop Aug 2, 2025
3 checks passed
@easyhooon easyhooon deleted the BOOK-197-feature/#86 branch August 2, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-197/feat] 자동 로그인 구현

2 participants