[Fix] 캘린더 깜빡임, 복약 시간 텍스트 한글화, 통계 화면 드롭다운 수정 #8#9
Conversation
- ElderIdRepository에 선택 어르신 ID 저장 및 조회 로직 추가
[Fix] 설정 > 어르신 건강정보 설정 화면 데이터 로딩 실패 수정
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Walkthrough복약 시간 토큰을 한글로 포맷하고, 선택된 어르신 ID를 저장소에 영속화하도록 저장소·구현·뷰모델·네비게이션을 연동하며, 건강징후 화면의 초기 로딩 처리를 추가해 캘린더 깜빡임을 완화합니다. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as "HomeScreen / Dropdown"
participant VM as "HomeViewModel"
participant Repo as "ElderIdRepository"
participant Store as "DataStore/Storage"
UI->>VM: 사용자 어르신 선택(id)
VM->>Repo: updateSelectedElderId(id)
Repo->>Store: write selectedElderId
Store-->>Repo: write ack
Repo-->>VM: ack
VM-->>UI: 선택 상태 업데이트
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/viewmodel/HomeViewModel.kt (1)
124-135:⚠️ Potential issue | 🟠 Major사라진 어르신 ID가 남아도 선택을 초기화하지 않아요.
지금 분기들은 “유효한 ID를 찾았을 때”만
_selectedElderId를 바꿉니다. 그래서 현재/공유/복원 ID가 전부 새 목록에 없으면 이전 ID가 그대로 남고, 이후 홈 조회가 stale ID로 다시 나갈 수 있어요. 목록이 비면-1L로 비우고, 목록은 남아 있는데 선택만 무효하면 첫 항목으로 fallback 하는 분기가 필요합니다.🔧 수정 예시
if (currentSelectedId != -1L && _elderInfoList.value.any { it.elderId == currentSelectedId }) { _selectedElderId.value = currentSelectedId } else if (sharedSelectedId != -1L && _elderInfoList.value.any { it.elderId == sharedSelectedId }) { _selectedElderId.value = sharedSelectedId } else if (restoredId != -1L && _elderInfoList.value.any { it.elderId == restoredId }) { _selectedElderId.value = restoredId - } else if (_selectedElderId.value == -1L && _elderInfoList.value.isNotEmpty()) { + } else if (_elderInfoList.value.isEmpty()) { + _selectedElderId.value = -1L + } else { _selectedElderId.value = _elderInfoList.value.first().elderId }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/viewmodel/HomeViewModel.kt` around lines 124 - 135, The selection logic in HomeViewModel leaves a stale _selectedElderId when current/shared/restored IDs are not present in the new _elderInfoList; update the branching after checking currentSelectedId/sharedSelectedId/restoredId so that if none matched you explicitly clear selection to -1L when _elderInfoList is empty, and when the list is non-empty but the previous selection is invalid set _selectedElderId.value = _elderInfoList.value.first().elderId; reference the symbols _selectedElderId, _elderInfoList, elderIdRepository.getSelectedElderId(), and savedStateHandle.get<Long>(KEY_SELECTED_ELDER_ID) when making this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/mapper/HomeMapper.kt`:
- Around line 40-50: The mapping for dose names is inconsistent:
formatNextDoseTimeToKorean(nextTime) converts MORNING/LUNCH/DINNER to
"아침약/점심약/저녁약" while getDefaultNextDose() returns "아침/점심/저녁"; choose one
canonical copy and make both functions use it—either update
formatNextDoseTimeToKorean to return "아침/점심/저녁" for MORNING/LUNCH/DINNER, or
change getDefaultNextDose() to include the "약" suffix—ensure both
formatNextDoseTimeToKorean and getDefaultNextDose use the exact same Korean
strings so successful API responses and fallback text match.
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.kt`:
- Line 46: Reset the initial-loading state when the viewed elder changes: change
the declaration of isInitialLoading so it is remembered with elderId as a key
(e.g., use remember(elderId) { mutableStateOf(true) } or otherwise reinitialize
it inside a block keyed to elderId) so that when elderId changes the loader
returns to true for that elder; apply the same pattern to the other
isInitialLoading instances referenced in the 61-86 range of
StateHealthDetailScreen.
---
Outside diff comments:
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/viewmodel/HomeViewModel.kt`:
- Around line 124-135: The selection logic in HomeViewModel leaves a stale
_selectedElderId when current/shared/restored IDs are not present in the new
_elderInfoList; update the branching after checking
currentSelectedId/sharedSelectedId/restoredId so that if none matched you
explicitly clear selection to -1L when _elderInfoList is empty, and when the
list is non-empty but the previous selection is invalid set
_selectedElderId.value = _elderInfoList.value.first().elderId; reference the
symbols _selectedElderId, _elderInfoList,
elderIdRepository.getSelectedElderId(), and
savedStateHandle.get<Long>(KEY_SELECTED_ELDER_ID) when making this change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c0e315d4-15a0-4da4-b4fd-b67ba215c5b1
📒 Files selected for processing (9)
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/mapper/HomeMapper.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/model/ElderIds.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/ElderIdRepository.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/ElderIdRepositoryImpl.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/navigation/HomeNavigation.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/viewmodel/HomeViewModel.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/statistics/viewmodel/StatisticsViewModel.ktcomposeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/navigation/NavGraph.kt
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.kt (1)
61-76:⚠️ Potential issue | 🟠 Major어르신 변경 직후 이전 데이터가 잠깐 보일 수 있어요.
Line 57-58의 로드는
LaunchedEffect뒤에 시작되고,HealthViewModel.loadHealthDataForDate()도 별도 coroutine으로isLoading을 올립니다. 그래서elderId가 바뀐 첫 리컴포지션에서는isInitialLoading == true여도isLoading == false라서 이 분기가 레이아웃을 먼저 그리게 되고, 직전 어르신의 건강 데이터가 한 프레임 노출될 수 있습니다. 초기 전환에서는isInitialLoading만으로 가리는 쪽이 더 안전해요.가능한 수정 예시
- if (isLoading && isInitialLoading) { + if (isInitialLoading) { Box( Modifier .fillMaxSize() .background(color = MediCareCallTheme.colors.white), ) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.kt` around lines 61 - 76, 현재 UI가 로드 표시를 렌더링할 때 조건이 "isLoading && isInitialLoading"이라 elderId 변경 직후 isInitialLoading이 true인데 isLoading이 아직 false이면 이전 어르신 데이터가 노출될 수 있습니다; 수정 방법은 초기 전환 시에는 isInitialLoading만으로 가리는 것이 안전하니 StateHealthDetailScreen의 해당 분기 조건을 "isInitialLoading" (또는 필요시 "isInitialLoading || isLoading")으로 변경하여 LaunchedEffect/HealthViewModel.loadHealthDataForDate()의 비동기 시작 타이밍과 상관없이 elderId 변경 직후 레이아웃이 초기 로딩 UI를 보여주도록 하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.kt`:
- Around line 61-76: 현재 UI가 로드 표시를 렌더링할 때 조건이 "isLoading && isInitialLoading"이라
elderId 변경 직후 isInitialLoading이 true인데 isLoading이 아직 false이면 이전 어르신 데이터가 노출될 수
있습니다; 수정 방법은 초기 전환 시에는 isInitialLoading만으로 가리는 것이 안전하니 StateHealthDetailScreen의
해당 분기 조건을 "isInitialLoading" (또는 필요시 "isInitialLoading || isLoading")으로 변경하여
LaunchedEffect/HealthViewModel.loadHealthDataForDate()의 비동기 시작 타이밍과 상관없이 elderId
변경 직후 레이아웃이 초기 로딩 UI를 보여주도록 하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 29ad2a38-33e2-4dba-8fbb-e16b2a244e29
📒 Files selected for processing (1)
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.kt
Reopen [Fix] 회원가입 플로우 오류 수정 #6
| "MORNING" -> "아침" | ||
| "LUNCH" -> "점심" | ||
| "DINNER" -> "저녁" | ||
| "MORNING" -> "아침약" | ||
| "LUNCH" -> "점심약" | ||
| "DINNER" -> "저녁약" |
There was a problem hiding this comment.
아침약, 점심약, 저녁약보다는 아침, 점심, 저녁으로 통일하는 게 나을 것 같습니다!
There was a problem hiding this comment.
피그마상 -약으로 표기되어있어서 피그마기준으로 맞춰두었습니다!
There was a problem hiding this comment.
아 혹시 enum은 아침/점심/저녁으로 두고 ui표시할때만 약을 붙이라는 의미인가요?
There was a problem hiding this comment.
피그마상 -약으로 표기되어있어서 피그마기준으로 맞춰두었습니다!
아 피그마에서 그렇게 돼있으면 아침약, 점심약, 저녁약으로 표기하는게 맞겠네요!
수정하신 코드대로 하면 될 것 같습니다~!
🔗 관련 이슈
📙 작업 설명
📸 스크린샷 또는 시연 영상 (선택)
💬 추가 설명 or 리뷰 포인트 (선택)
Summary by CodeRabbit
릴리스 노트
새로운 기능
버그 수정
개선 사항