[NDGL-102] 앱 설정 기능 구현#33
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
Walkthrough설정(Settings) 기능을 새로 추가하여 홈 및 여행 모듈에서 접근 가능하게 하였습니다. 설정 화면에서 URL 메뉴, 앱 버전, 식별 코드 복사 기능을 제공하며, AuthRepository에 식별 코드 조회 메서드를 노출했습니다. Changes
Sequence DiagramsequenceDiagram
participant User as 사용자
participant HomeUI as Home/Travel UI
participant ViewModel as SettingsViewModel
participant AuthRepo as AuthRepository
participant AppProvider as AppVersionProvider
participant System as 시스템<br/>(ClipboardManager/<br/>Browser)
User->>HomeUI: 설정 아이콘 클릭
HomeUI->>ViewModel: ClickSettings Intent 발행
alt URL 메뉴 클릭
User->>ViewModel: ClickUrlMenu(menu) Intent
ViewModel->>ViewModel: postOpenUrl(menu)
ViewModel->>System: OpenUrl SideEffect 발행
System->>System: 브라우저에서 URL 열기
else 식별 코드 복사 클릭
User->>ViewModel: ClickCopyIdentifierCodeMenu Intent
ViewModel->>ViewModel: postCopyIdentifierCode()
ViewModel->>AuthRepo: getIdentifierCode() 호출
AuthRepo-->>ViewModel: identifier code 반환
ViewModel->>System: CopyIdentifierCode SideEffect 발행
System->>System: 클립보드에 코드 복사
end
ViewModel->>HomeUI: SideEffect 수신 처리
HomeUI->>User: UI 업데이트
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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: 3
🧹 Nitpick comments (1)
feature/home/src/main/java/com/yapp/ndgl/feature/home/settings/SettingsContract.kt (1)
39-59: URL 하드코딩에 대한 향후 고려사항.현재 URL이 enum에 하드코딩되어 있어 URL 변경 시 앱 업데이트가 필요합니다. 현 단계에서는 괜찮지만, 향후 Remote Config 등을 통해 서버에서 URL을 관리하는 방안을 고려해 보시면 좋겠습니다.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@feature/home/src/main/java/com/yapp/ndgl/feature/home/settings/SettingsContract.kt` around lines 39 - 59, The UrlMenu enum currently hardcodes URL strings (see UrlMenu enum and its url property), which forces app updates for URL changes; replace hardcoded URLs by reading them from a configurable source (e.g., Remote Config, BuildConfig, or string resources) at runtime: keep UrlMenu entries for labelRes and a key/identifier for the URL, change the enum to expose a urlKey or resource id instead of a literal, and update callers to resolve the actual URL via the chosen config provider (RemoteConfigProvider.getUrl(key) or context.getString(resId)) so URL values can be changed without rebuilding the app.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@feature/home/src/main/java/com/yapp/ndgl/feature/home/settings/SettingsScreen.kt`:
- Around line 62-66: Handle potential null from context.getSystemService and
replace the hardcoded clipboard label with a string resource: in the
SettingsSideEffect.CopyIdentifierCode branch, obtain the ClipboardManager via
context.getSystemService(ClipboardManager::class.java) and guard with a
null-check before calling setPrimaryClip; if null, log or return gracefully.
Also replace the literal "NDGL Identifier Code" passed to ClipData.newPlainText
with a string resource (e.g., context.getString(R.string.ndgl_identifier_code))
so the label is not hardcoded and is localized/managed via resources.
In
`@feature/home/src/main/java/com/yapp/ndgl/feature/home/settings/SettingsViewModel.kt`:
- Around line 40-45: postCopyIdentifierCode currently calls
authRepository.getIdentifierCode() inside viewModelScope.launch without error
handling, so exceptions silently fail; wrap the suspend call in a try/catch or
use suspendRunCatching/runCatching around authRepository.getIdentifierCode()
inside postCopyIdentifierCode (the coroutine launched by viewModelScope.launch)
and on success call postSideEffect(SettingsSideEffect.CopyIdentifierCode(uuid))
while on failure post an error side effect (e.g.,
SettingsSideEffect.ShowCopyError or similar) and optionally log the exception so
the UI gets feedback when getIdentifierCode() fails.
In
`@feature/home/src/main/java/com/yapp/ndgl/feature/home/util/AppVersionProvider.kt`:
- Around line 10-14: getAppVersion uses the deprecated getPackageInfo(String,
Int) signature on API 33+, causing lint warnings; update getAppVersion to branch
on Build.VERSION.SDK_INT: for API >= Build.VERSION_CODES.TIRAMISU call
context.packageManager.getPackageInfo(context.packageName,
PackageManager.PackageInfoFlags.of(0)) and for older APIs keep the existing
getPackageInfo(context.packageName, 0) path, preserving the existing
runCatching/getOrDefault behavior and returning the same versionName fallback.
---
Nitpick comments:
In
`@feature/home/src/main/java/com/yapp/ndgl/feature/home/settings/SettingsContract.kt`:
- Around line 39-59: The UrlMenu enum currently hardcodes URL strings (see
UrlMenu enum and its url property), which forces app updates for URL changes;
replace hardcoded URLs by reading them from a configurable source (e.g., Remote
Config, BuildConfig, or string resources) at runtime: keep UrlMenu entries for
labelRes and a key/identifier for the URL, change the enum to expose a urlKey or
resource id instead of a literal, and update callers to resolve the actual URL
via the chosen config provider (RemoteConfigProvider.getUrl(key) or
context.getString(resId)) so URL values can be changed without rebuilding the
app.
49df0c6 to
ec2c5ae
Compare
ec2c5ae to
312d7f0
Compare
앱 설정 기능 구현
연관 문서
디자인
스크린샷 (Optional)
변경사항
테스트 체크 리스트
Summary by CodeRabbit
릴리스 노트
새로운 기능
리팩토링