Skip to content

Conversation

@easyhooon
Copy link
Contributor

@easyhooon easyhooon commented Dec 26, 2025

🔗 관련 이슈

📙 작업 설명

  • LoginTooltipBox 컴포넌트 구성
  • 툴팁 노출 여부를 관리하기 위한 dataStore 환경 구축
  • 카카오 로그인 위에 배치
  • Login 화면 중첩 컴포넌트 배치 개선(Column { Box { Column } } -> Box { Column })

🧪 테스트 내역 (선택)

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

📸 스크린샷 또는 시연 영상 (선택)

default.mp4

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

  • 구글 로그인 버튼 위에 추가되는거는 구글 로그인 쪽 PR 작업에서 이어 작업하겠습니다.

Summary by CodeRabbit

릴리스 노트

  • 새 기능

    • 최근 로그인 방법 기록 및 추적 기능 추가
    • 로그인 화면에서 최근 로그인 방법을 안내하는 툴팁 표시
  • 리팩토링

    • 툴팁 컴포넌트 구조 개선

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

개요

사용자의 마지막 로그인 계정(카카오 또는 구글) 정보를 저장하고 추적하는 기능을 추가했습니다. DataStore를 통해 로그인 방법을 지속적으로 관리하며, 로그인 화면에 최근 로그인 방법을 알려주는 툴팁을 표시합니다.

변경사항

코호트 / 파일 변경 요약
LoginMethod 모델
core/model/src/main/kotlin/com/ninecraft/booket/core/model/LoginMethod.kt
새로운 공개 열거형 LoginMethod 추가 (NONE, KAKAO, GOOGLE)
DataStore 계층
core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/LoginMethodDataSource.kt
core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLoginMethodDataSource.kt
core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreGraph.kt
core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreQualifier.kt
LoginMethod DataSource 인터페이스 및 구현 추가, DataStore 프로비저닝 및 의존성 주입 설정 구성
Repository 계층
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt
recentLoginMethod, setRecentLoginMethod(), clearRecentLoginMethod() API 추가, 로그아웃 시 최근 로그인 방법 초기화
Login 기능 - 상태 및 이벤트
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUiState.kt
showLoginTooltip, recentLoginMethod 상태 속성 및 OnDismissLoginTooltip 이벤트 추가
Login 기능 - 프레젠터
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginPresenter.kt
최근 로그인 방법 수집 및 추적, 로그인 성공 시 방법 저장, 툴팁 가시성 관리 로직 구현
Login 기능 - UI 컴포넌트
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUi.kt
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/component/LoginTooltipBox.kt
새로운 LoginTooltipBox 컴포넌트 추가, 레이아웃 재구성으로 전역 클릭 처리 및 조건부 툴팁 표시 구현
Login 기능 - 문자열 리소스
feature/login/src/main/res/values/strings.xml
"최근 로그인" 문자열 리소스 추가
Record 기능 - 컴포넌트 리팩토링
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/component/RecordTooltipBox.kt
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/ImpressionStep.kt
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt
CustomTooltipBoxRecordTooltipBox로 이름 변경 및 참조 업데이트
Onboarding 안정성
feature/onboarding/stability/onboarding.stability
안정성 파일에서 세 개의 Composable 선언 제거

예상 코드 리뷰 난이도

🎯 3 (중간) | ⏱️ ~25분

🐰 마지막 로그인을 기억해,
카카오든 구글이든 반겨,
툴팁이 깜찍하게 손잡고,
DataStore 깊숙이 저장되어,
사용자 경험이 쏙쏙 물든다! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 최근 로그인 계정 정보 안내 기능 구현이라는 주요 변경사항을 명확하게 요약하고 있습니다.
Linked Issues check ✅ Passed PR의 모든 코드 변경사항이 이슈 #233의 요구사항을 충족합니다. LoginTooltipBox 컴포넌트, DataStore 환경, 최근 로그인 방식 관리 기능이 모두 구현되었습니다.
Out of Scope Changes check ✅ Passed RecordTooltipBox 네이밍 변경은 코드 일관성을 위한 적절한 리팩토링이며, 온보딩 스테빌리티 파일 변경은 Compose 컴파일러 관련 기술적 변경입니다. 모든 변경사항이 이슈 범위와 관련이 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-475-feature/#233

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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: 3

🧹 Nitpick comments (6)
core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/LoginMethodDataSource.kt (1)

6-10: 공개 API에 KDoc 문서화 권장

새로운 공개 인터페이스에 KDoc 주석을 추가하면 API 사용성과 유지보수성이 향상됩니다. 각 메서드의 목적과 동작을 간략히 설명하는 것이 좋습니다.

🔎 제안하는 문서화 예시
+/**
+ * 최근 로그인 방식을 관리하는 데이터 소스.
+ */
 interface LoginMethodDataSource {
+    /**
+     * 최근 로그인 방식을 Flow로 제공합니다.
+     */
     val recentLoginMethod: Flow<LoginMethod>
+    
+    /**
+     * 최근 로그인 방식을 저장합니다.
+     */
     suspend fun setRecentLoginMethod(loginMethod: LoginMethod)
+    
+    /**
+     * 저장된 최근 로그인 방식을 초기화합니다.
+     */
     suspend fun clearRecentLoginMethod()
 }
core/model/src/main/kotlin/com/ninecraft/booket/core/model/LoginMethod.kt (1)

3-7: Enum 정의 확인 완료 및 문서화 권장

로그인 방식을 나타내는 enum이 명확하게 정의되었습니다. PR 설명에 따르면 구글 로그인 툴팁은 별도 PR에서 작업 예정이므로 GOOGLE 상수가 미리 정의된 것은 적절합니다.

간단한 KDoc 주석을 추가하면 코드 가독성이 향상됩니다.

🔎 제안하는 문서화 예시
+/**
+ * 사용자의 로그인 방식을 나타냅니다.
+ */
 enum class LoginMethod {
+    /** 로그인 방식이 설정되지 않음 */
     NONE,
+    /** 카카오 로그인 */
     KAKAO,
+    /** 구글 로그인 */
     GOOGLE,
 }
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt (1)

21-25: 공개 API에 KDoc 문서화 권장

새로운 공개 API에 KDoc 주석을 추가하면 의도와 사용 방법이 명확해집니다. 특히 clearRecentLoginMethod()가 어떤 상황에서 호출되어야 하는지(로그아웃/탈퇴 시) 명시하면 좋습니다.

🔎 제안하는 문서화 예시
+    /**
+     * 최근 로그인 방식을 나타내는 Flow입니다.
+     */
     val recentLoginMethod: Flow<LoginMethod>
 
+    /**
+     * 최근 로그인 방식을 저장합니다.
+     * @param loginMethod 저장할 로그인 방식
+     */
     suspend fun setRecentLoginMethod(loginMethod: LoginMethod)
 
+    /**
+     * 저장된 최근 로그인 방식을 초기화합니다.
+     * 로그아웃 또는 회원 탈퇴 시 호출됩니다.
+     */
     suspend fun clearRecentLoginMethod()
core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLoginMethodDataSource.kt (1)

22-31: 문자열 비교 대신 LoginMethod.name을 사용하는 것이 더 안전합니다.

현재 하드코딩된 문자열("KAKAO", "GOOGLE")로 비교하고 있는데, LoginMethod enum의 name을 사용하면 enum 이름 변경 시에도 일관성을 유지할 수 있습니다.

🔎 제안하는 수정
     override val recentLoginMethod: Flow<LoginMethod> = dataStore.data
         .handleIOException()
         .map { prefs ->
             val method = prefs[RECENT_LOGIN_METHOD]
             when (method) {
-                "KAKAO" -> LoginMethod.KAKAO
-                "GOOGLE" -> LoginMethod.GOOGLE
+                LoginMethod.KAKAO.name -> LoginMethod.KAKAO
+                LoginMethod.GOOGLE.name -> LoginMethod.GOOGLE
                 else -> LoginMethod.NONE
             }
         }
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/component/LoginTooltipBox.kt (1)

77-82: 삼각형 포인터의 오프셋 값에 하드코딩된 14.dp가 사용되고 있습니다.

다른 곳에서는 ReedTheme.spacing을 사용하는데, 여기서는 14.dp가 하드코딩되어 있습니다. 일관성을 위해 테마 값을 사용하거나 상수로 추출하는 것을 고려해 주세요.

feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUi.kt (1)

128-135: 툴팁 위치 지정에 하드코딩된 오프셋 값이 사용되고 있습니다.

(-28).dp(-32).dp 값이 하드코딩되어 있습니다. 다양한 화면 크기나 폰트 스케일링에서 일관된 위치를 보장하려면 테마 기반 값을 사용하거나, 최소한 상수로 추출하는 것이 좋습니다.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25c1f6b and 50ebe6e.

📒 Files selected for processing (16)
  • core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt
  • core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/LoginMethodDataSource.kt
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLoginMethodDataSource.kt
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreGraph.kt
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreQualifier.kt
  • core/model/src/main/kotlin/com/ninecraft/booket/core/model/LoginMethod.kt
  • feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginPresenter.kt
  • feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUi.kt
  • feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUiState.kt
  • feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/component/LoginTooltipBox.kt
  • feature/login/src/main/res/values/strings.xml
  • feature/onboarding/stability/onboarding.stability
  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/component/RecordTooltipBox.kt
  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/ImpressionStep.kt
  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt
💤 Files with no reviewable changes (1)
  • feature/onboarding/stability/onboarding.stability
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-08-28T12:25:54.058Z
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 174
File: feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt:128-133
Timestamp: 2025-08-28T12:25:54.058Z
Learning: In BookSearchPresenter.kt, when a guest user tries to register a book and is redirected to login, the bottom sheet (isBookRegisterBottomSheetVisible) and selection state (selectedBookIsbn, selectedBookStatus) are intentionally kept open/preserved so that when the user returns from login, they can continue from where they left off without losing context.

Applied to files:

  • feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUiState.kt
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreGraph.kt
  • core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt
  • feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginPresenter.kt
  • feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUi.kt
📚 Learning: 2025-07-31T23:30:37.547Z
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 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/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUiState.kt
📚 Learning: 2025-08-28T12:26:12.482Z
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 174
File: core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt:16-19
Timestamp: 2025-08-28T12:26:12.482Z
Learning: In AuthRepository, autoLoginState and userState serve different purposes and should not be conflated:
- autoLoginState: tracks whether automatic login is enabled (user preference/setting)
- userState: tracks current authentication state (Guest vs LoggedIn)
These are orthogonal concepts that need to be maintained separately.

Applied to files:

  • core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt
📚 Learning: 2025-07-20T12:34:23.786Z
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 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:

  • feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUi.kt
🧬 Code graph analysis (6)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/ImpressionStep.kt (1)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/component/RecordTooltipBox.kt (1)
  • RecordTooltipBox (25-64)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt (1)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/component/RecordTooltipBox.kt (1)
  • RecordTooltipBox (25-64)
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUi.kt (5)
core/ui/src/main/kotlin/com/ninecraft/booket/core/ui/component/ReedTopAppBar.kt (1)
  • ReedCloseTopAppBar (105-120)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/button/ReedButton.kt (1)
  • ReedButton (34-114)
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/component/LoginTooltipBox.kt (1)
  • LoginTooltipBox (51-91)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/button/ReedTextButton.kt (1)
  • ReedTextButton (25-74)
core/ui/src/main/kotlin/com/ninecraft/booket/core/ui/component/ReedLoadingIndicator.kt (1)
  • ReedLoadingIndicator (16-36)
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/component/LoginTooltipBox.kt (1)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Theme.kt (1)
  • ReedTheme (14-21)
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt (3)
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt (1)
  • clearRecentLoginMethod (25-25)
core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/LoginMethodDataSource.kt (1)
  • clearRecentLoginMethod (9-9)
core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLoginMethodDataSource.kt (1)
  • clearRecentLoginMethod (39-43)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/component/RecordTooltipBox.kt (1)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Theme.kt (1)
  • ReedTheme (14-21)
⏰ 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). (2)
  • GitHub Check: Compose Stability Check
  • GitHub Check: ci-build
🔇 Additional comments (16)
feature/login/src/main/res/values/strings.xml (1)

9-9: 문자열 리소스 추가 확인 완료

최근 로그인 기능을 위한 문자열 리소스가 적절하게 추가되었습니다.

feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt (1)

48-48: 컴포넌트 리네임 확인 완료

CustomTooltipBox에서 RecordTooltipBox로의 리네임이 일관되게 적용되었습니다.

Also applies to: 148-148

feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/ImpressionStep.kt (1)

54-54: 컴포넌트 리네임 확인 완료

CustomTooltipBox에서 RecordTooltipBox로의 리네임이 일관되게 적용되었습니다.

Also applies to: 159-161

feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/component/RecordTooltipBox.kt (1)

26-26: 컴포넌트 리네임 확인 완료

CustomTooltipBox에서 RecordTooltipBox로의 리네임이 선언부, 프리뷰 함수, 사용처 모두에서 일관되게 적용되었습니다. 더 명확한 네이밍으로 개선되었습니다.

Also applies to: 68-70

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreQualifier.kt (1)

25-27: DI Qualifier 추가 확인 완료

기존 패턴을 따라 LoginMethodDataStore qualifier가 적절하게 추가되었습니다.

feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUiState.kt (2)

14-15: LGTM! 상태 속성 추가가 적절합니다.

showLoginTooltiprecentLoginMethod의 기본값이 적절하며, 기존 LoginUiState 패턴을 잘 따르고 있습니다.


34-34: 이벤트 추가가 적절합니다.

OnDismissLoginTooltip 이벤트가 기존 이벤트 네이밍 컨벤션과 일관성 있게 추가되었습니다.

feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginPresenter.kt (1)

105-126: 로그인 성공 시 최근 로그인 방식 저장 로직이 적절합니다.

Kakao 로그인 성공 후 setRecentLoginMethod(LoginMethod.KAKAO)를 호출하여 다음 로그인 시 툴팁에 표시될 수 있도록 저장하는 로직이 올바르게 구현되었습니다.

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreGraph.kt (2)

30-37: DataStore 설정이 기존 패턴과 일관성 있게 추가되었습니다.

LOGIN_METHOD_DATASTORE_NAME 상수와 Context.loginMethodDataStore 확장 속성이 기존의 다른 DataStore 설정과 동일한 패턴으로 구현되었습니다.


72-76: DI 바인딩이 올바르게 구성되었습니다.

Provider와 Binds 설정이 기존 DataSource들과 동일한 패턴을 따르고 있어 일관성이 유지됩니다.

Also applies to: 92-94

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLoginMethodDataSource.kt (1)

17-21: SingleIn 스코프와 의존성 주입이 올바르게 설정되었습니다.

@SingleIn(DataScope::class)@LoginMethodDataStore 한정자를 사용한 DI 설정이 프로젝트의 다른 DataSource 구현체들과 일관성 있게 구성되었습니다.

feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/component/LoginTooltipBox.kt (1)

31-49: TriangleShape 구현이 깔끔합니다.

커스텀 Shape 구현이 명확하고 주석도 잘 되어 있어 코드 이해가 쉽습니다.

feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginUi.kt (2)

124-136: recentLoginMethod 상태가 UI에서 사용되지 않고 있습니다.

현재 state.recentLoginMethodLoginUiState에 포함되어 있지만, 툴팁 메시지에서 사용되지 않고 있습니다. 항상 R.string.recent_login만 표시되는데, 이것이 의도된 동작인지 확인해 주세요.

만약 "카카오로 최근 로그인" 또는 "구글로 최근 로그인"처럼 로그인 방식에 따라 다른 메시지를 표시해야 한다면, recentLoginMethod를 활용하여 동적으로 메시지를 선택해야 합니다.


59-72: 툴팁 해제를 위한 클릭 핸들러 구현이 적절합니다.

showLoginTooltip 상태에 따라 조건부로 noRippleClickable을 적용하여 툴팁 외부 클릭 시 해제되도록 구현한 부분이 좋습니다.

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

41-45: 회원 탈퇴 시 최근 로그인 방식 초기화가 적절하게 구현되었습니다.

withdraw() 호출 시 clearRecentLoginMethod()를 호출하여 계정 삭제 후 로그인 방식 정보가 남지 않도록 처리한 부분이 올바릅니다.


76-81: recentLoginMethod 속성과 setter 메서드가 올바르게 구현되었습니다.

loginMethodDataSource에 위임하는 방식으로 깔끔하게 구현되었으며, 기존 repository 패턴과 일관성을 유지하고 있습니다.

Comment on lines +21 to +25
val recentLoginMethod: Flow<LoginMethod>

suspend fun setRecentLoginMethod(loginMethod: LoginMethod)

suspend fun clearRecentLoginMethod()
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find and examine the logout implementation in DefaultAuthRepository
rg -A 10 "override suspend fun logout" --type kotlin

Repository: YAPP-Github/Reed-Android

Length of output: 1459


logout() 메서드에서 clearRecentLoginMethod() 호출 누락

logout() 메서드에서 clearRecentLoginMethod()를 호출하지 않고 있습니다. withdraw() 메서드에서는 호출되고 있으나, logout()에서는 누락되어 있습니다. 사용자가 로그아웃 후 다시 로그인 화면에 접근할 때 이전 로그인 방식이 표시되는 불일치한 동작이 발생합니다. logout() 메서드에도 clearRecentLoginMethod()를 추가하여 withdraw()와 일관성 있게 수정해주세요.

🤖 Prompt for AI Agents
In
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt
around lines 21 to 25, the recentLoginMethod flow and clearRecentLoginMethod()
are defined but the logout() implementation does not call
clearRecentLoginMethod(), causing the previous login method to remain visible
after logout; update the logout() method to invoke suspend fun
clearRecentLoginMethod() (same as withdraw()) so the stored recent login method
is cleared on logout, and ensure any call is awaited and errors are handled
consistently with withdraw().

Comment on lines +93 to +99
@ComponentPreview
@Composable
private fun RecordTooltipBoxPreview() {
ReedTheme {
LoginTooltipBox(messageResId = R.string.recent_login)
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Preview 함수명이 컴포넌트명과 일치하지 않습니다.

RecordTooltipBoxPreview가 아닌 LoginTooltipBoxPreview가 되어야 컴포넌트명과 일관성이 유지됩니다. (아마도 이전 네이밍에서 변경 시 누락된 것으로 보입니다)

🔎 제안하는 수정
 @ComponentPreview
 @Composable
-private fun RecordTooltipBoxPreview() {
+private fun LoginTooltipBoxPreview() {
     ReedTheme {
         LoginTooltipBox(messageResId = R.string.recent_login)
     }
 }
📝 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.

Suggested change
@ComponentPreview
@Composable
private fun RecordTooltipBoxPreview() {
ReedTheme {
LoginTooltipBox(messageResId = R.string.recent_login)
}
}
@ComponentPreview
@Composable
private fun LoginTooltipBoxPreview() {
ReedTheme {
LoginTooltipBox(messageResId = R.string.recent_login)
}
}
🤖 Prompt for AI Agents
In
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/component/LoginTooltipBox.kt
around lines 93 to 99, the Preview function is misnamed RecordTooltipBoxPreview;
rename it to LoginTooltipBoxPreview so the preview function matches the
component name, update any usages or references accordingly, and keep the
annotations (@ComponentPreview, @Composable) and body unchanged.

Comment on lines +58 to +63
LaunchedEffect(Unit) {
authRepository.recentLoginMethod.collect { method ->
recentLoginMethod = method
showLoginTooltip = method != LoginMethod.NONE
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

툴팁 해제 후 다시 표시되는 잠재적 문제가 있습니다.

LaunchedEffect에서 collect를 사용하여 recentLoginMethod를 수신하고 있는데, 사용자가 툴팁을 해제(showLoginTooltip = false)한 후에도 Flow에서 동일한 값이 다시 emit되면 툴팁이 다시 표시될 수 있습니다.

해제 상태를 별도로 추적하거나, collectLatest와 함께 해제 플래그를 관리하는 방식을 고려해 주세요.

🔎 제안하는 수정 방안
+        var hasUserDismissedTooltip by rememberRetained { mutableStateOf(false) }
+
         LaunchedEffect(Unit) {
             authRepository.recentLoginMethod.collect { method ->
                 recentLoginMethod = method
-                showLoginTooltip = method != LoginMethod.NONE
+                showLoginTooltip = method != LoginMethod.NONE && !hasUserDismissedTooltip
             }
         }

그리고 OnDismissLoginTooltip 핸들러에서:

                 is LoginUiEvent.OnDismissLoginTooltip -> {
                     showLoginTooltip = false
+                    hasUserDismissedTooltip = true
                 }
📝 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.

Suggested change
LaunchedEffect(Unit) {
authRepository.recentLoginMethod.collect { method ->
recentLoginMethod = method
showLoginTooltip = method != LoginMethod.NONE
}
}
var hasUserDismissedTooltip by rememberRetained { mutableStateOf(false) }
LaunchedEffect(Unit) {
authRepository.recentLoginMethod.collect { method ->
recentLoginMethod = method
showLoginTooltip = method != LoginMethod.NONE && !hasUserDismissedTooltip
}
}
🤖 Prompt for AI Agents
In
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginPresenter.kt
around lines 58 to 63, the LaunchedEffect collects recentLoginMethod and
unconditionally sets showLoginTooltip when a value is emitted, which allows the
tooltip to reappear if the Flow re-emits the same/non-NONE method after the user
dismissed it; fix by adding a dismissed flag (e.g., loginTooltipDismissed) that
the OnDismissLoginTooltip handler sets to true, and in the collector only set
showLoginTooltip = true when method != LoginMethod.NONE AND
loginTooltipDismissed is false (or use collectLatest and check the dismissed
flag before showing), ensuring the dismiss action prevents future emissions from
re-showing the tooltip.

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-475/feat] 마지막 로그인 계정 정보 안내 기능 구현

2 participants