Conversation
Walkthrough홈 화면에서 캘린더로의 네비게이션을 연결하고 캘린더 경로에 날짜 파라미터를 도입했습니다. 동시에 더 이상 사용되지 않는 Dummy 데이터 계층(DTO/서비스/데이터소스/레포지토리/모델)을 제거했습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant HomeUI as HomeScreen(UI)
participant HomeVM as HomeViewModel(Logics)
participant MainState as MainAppState(NavState)
participant Nav as NavController(System)
participant Calendar as CalendarScreen(UI)
User->>HomeUI: 예정된 계획 클릭 / 추가 버튼 클릭
HomeUI->>HomeVM: onUpcomingPlanClick(date) / onAddPlanClick()
HomeVM->>HomeVM: emit NavigateToCalendar(date)
HomeUI->>MainState: navigateToCalendarSelected(date)
MainState->>Nav: navigateToCalendar(date)
Nav->>Calendar: open route Calendar(date)
Calendar->>Calendar: read date from SavedStateHandle
Calendar-->>User: render calendar with selected date
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related PRs
Suggested reviewers
🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@app/src/main/java/com/cherrish/android/presentation/calendar/navigation/CalendarNavigator.kt`:
- Around line 20-24: The navigateToCalendar helper allows a nullable date which
ends up routing the literal "null" string and can crash LocalDate.parse in
CalendarViewModel; change the function signature
NavController.navigateToCalendar to accept a non-null LocalDate with a default
of LocalDate.now() (i.e., remove the nullable type) and continue passing
Calendar(date = date.toString()), so callers always route a valid date string
and parsing in CalendarViewModel no longer receives "null".
🧹 Nitpick comments (3)
app/src/main/java/com/cherrish/android/presentation/calendar/CalendarViewModel.kt (1)
38-55: 라우트 날짜 파싱 방어 로직 제안현재
LocalDate.parse(...)가 실패하면 즉시 크래시가 납니다. 딥링크/복원 시 잘못된 문자열이 들어올 가능성에 대비해 기본값으로 폴백하는 방어 로직을 권장합니다.♻️ 제안 수정
- private val dateArg: LocalDate = - LocalDate.parse(savedStateHandle.toRoute<Calendar>().date) + private val dateArg: LocalDate = + runCatching { + LocalDate.parse(savedStateHandle.toRoute<Calendar>().date) + }.getOrElse { LocalDate.now() }app/src/main/java/com/cherrish/android/presentation/calendar/CalendarScreen.kt (1)
42-45: 로딩 화면에도paddingValues적용 필요현재 로딩 상태는 Scaffold 인셋을 무시해 바 하단/상단과 겹칠 수 있습니다.
paddingValues를 루트에 먼저 적용하도록 감싸 주세요. Based on learnings, 이 패턴을 유지하는 것이 일관된 인셋 처리를 보장합니다.🛠️ 제안 수정
+import androidx.compose.foundation.layout.Box @@ - is UiState.Loading -> { - LoadingScreen() - } + is UiState.Loading -> { + Box( + modifier = Modifier + .fillMaxSize() + .padding(paddingValues) + ) { + LoadingScreen() + } + }app/src/main/java/com/cherrish/android/presentation/main/MainTab.kt (1)
22-25: 캘린더 탭 날짜 생성 시점 검토(옵션)enum 초기화 시점의
LocalDate.now()가 고정되므로, 앱이 장시간 살아있을 때도 “오늘”을 기대한다면 네비게이션 시점에 날짜를 생성하는 방식도 고려해 주세요.
| fun NavController.navigateToCalendar( | ||
| date: LocalDate? = LocalDate.now(), | ||
| navOptions: NavOptions? = null | ||
| ) = | ||
| navigate(Calendar(date = date.toString()), navOptions) |
There was a problem hiding this comment.
date nullable 허용으로 인한 파싱 크래시 가능성
date가 null이면 "null" 문자열로 라우팅되고, CalendarViewModel에서 LocalDate.parse(...)가 실패할 수 있습니다(Line 38). API 레벨에서 null을 제거하는 쪽이 안전합니다.
🛠️ 제안 수정
-fun NavController.navigateToCalendar(
- date: LocalDate? = LocalDate.now(),
- navOptions: NavOptions? = null
-) =
- navigate(Calendar(date = date.toString()), navOptions)
+fun NavController.navigateToCalendar(
+ date: LocalDate = LocalDate.now(),
+ navOptions: NavOptions? = null
+) =
+ navigate(Calendar(date = date.toString()), navOptions)📝 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.
| fun NavController.navigateToCalendar( | |
| date: LocalDate? = LocalDate.now(), | |
| navOptions: NavOptions? = null | |
| ) = | |
| navigate(Calendar(date = date.toString()), navOptions) | |
| fun NavController.navigateToCalendar( | |
| date: LocalDate = LocalDate.now(), | |
| navOptions: NavOptions? = null | |
| ) = | |
| navigate(Calendar(date = date.toString()), navOptions) |
🤖 Prompt for AI Agents
In
`@app/src/main/java/com/cherrish/android/presentation/calendar/navigation/CalendarNavigator.kt`
around lines 20 - 24, The navigateToCalendar helper allows a nullable date which
ends up routing the literal "null" string and can crash LocalDate.parse in
CalendarViewModel; change the function signature
NavController.navigateToCalendar to accept a non-null LocalDate with a default
of LocalDate.now() (i.e., remove the nullable type) and continue passing
Calendar(date = date.toString()), so callers always route a valid date string
and parsing in CalendarViewModel no longer receives "null".
nhyeonii
left a comment
There was a problem hiding this comment.
LGTM ~~ 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀
Related issue 🛠
Work Description ✏️
Screenshot 📸
Uncompleted Tasks 😅
To Reviewers 📢
Summary by CodeRabbit
새로운 기능
버그 수정
리팩터링
✏️ Tip: You can customize this high-level summary in your review settings.