Skip to content

[Fix] 캘린더 깜빡임, 복약 시간 텍스트 한글화, 통계 화면 드롭다운 수정 #8#9

Merged
librawish808 merged 14 commits intomainfrom
fix/ios-ui-ux-#8
Mar 12, 2026
Merged

[Fix] 캘린더 깜빡임, 복약 시간 텍스트 한글화, 통계 화면 드롭다운 수정 #8#9
librawish808 merged 14 commits intomainfrom
fix/ios-ui-ux-#8

Conversation

@librawish808
Copy link
Copy Markdown
Contributor

@librawish808 librawish808 commented Mar 10, 2026

🔗 관련 이슈

📙 작업 설명

  • 건강징후 상세화면에서 날짜 변경시 전체화면이 깜빡이던 현상 수정
  • 복약시간 한글변환 함수 추가 → 홈화면의 복약시간이 한글로 표시되도록 수정
  • 통계화면
    • 드롭다운시 어르신이름이 제대로 뜨도록 수정
    • 홈과 주간통계화면에서 어르신 변경시 화면전환시에도 선택상태가 정상반영되도록 수정

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

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

  • 안드로이드에서도 정상반영이 됐는지 확인 부탁드립니다

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 선택한 보호자(어르신) ID가 앱에 저장되어 유지됩니다.
  • 버그 수정

    • 건강 데이터 화면의 초기 로딩 표시가 개선되어 초기 로드 중 전체화면 로딩을 보여줍니다.
  • 개선 사항

    • 약 복용 시간이 한국어(아침약/점심약/저녁약)로 더 명확히 표시됩니다.
    • 보호자 선택 로직과 상태 복원/동기화, Home 화면의 뷰모델 연결이 정비되었습니다.

@ikseong00
Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d68e7386-a96a-4e30-abdb-af7e6b38bd8c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

복약 시간 토큰을 한글로 포맷하고, 선택된 어르신 ID를 저장소에 영속화하도록 저장소·구현·뷰모델·네비게이션을 연동하며, 건강징후 화면의 초기 로딩 처리를 추가해 캘린더 깜빡임을 완화합니다.

Changes

Cohort / File(s) Summary
로컬라이제이션 / 매퍼
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/mapper/HomeMapper.kt
복약 시간 토큰(MORNING/LUNCH/DINNER)을 한글(아침약/점심약/저녁약)으로 포맷하는 private 헬퍼 함수 추가 및 매핑에 적용.
어르신 ID 모델/저장소
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/model/ElderIds.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/ElderIdRepository.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/ElderIdRepositoryImpl.kt
ElderIdsselectedElderId: Long = -1L 추가. 저장소 인터페이스와 구현에 선택된 어르신 ID 저장/조회 메서드(updateSelectedElderId, getSelectedElderId) 추가 및 초기화 로직 업데이트.
네비게이션 / 뷰모델 연동
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/navigation/HomeNavigation.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/navigation/NavGraph.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/viewmodel/HomeViewModel.kt
HomeNavGraph에 backStack 기반 HomeViewModel 주입 파라미터 추가 및 전달. HomeViewModel에서 어르신 선택 시 저장소에 selectedElderId 갱신, SavedStateHandle 동기화 및 우선순위 기반 선택 복원 로직 조정.
UI 로딩 개선 / 통계 뷰모델
composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.kt, composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/statistics/viewmodel/StatisticsViewModel.kt
StateHealthDetailScreen에 초기 로딩 플래그(isInitialLoading) 추가해 초기 전체 로딩 상태 처리로 캘린더 깜빡임 완화. StatisticsViewModel에서 eldersMap 초기화 및 selectedElderId 검사 기준을 -1L로 변경.

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: 선택 상태 업데이트
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🌤️ 아침약, 점심약, 저녁약 속삭이며
선택은 기억되어 길에 새겨지고
캘린더의 깜빡임은 천천히 가라앉네
작은 저장이 큰 흐름을 잇고
앱은 한결 부드러워지네 ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 코드 변경 사항이 연결된 이슈 #8의 모든 요구사항을 충족하고 있습니다. 캘린더 깜빡임 해결, 복약 시간 한글화, 통계 화면 드롭다운 선택 상태 유지 등이 구현되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #8에 명시된 범위 내에 있습니다. 캘린더 깜빡임 수정, 약물 시간 한글화, 통계 화면 드롭다운 수정 관련 변경들만 포함되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ios-ui-ux-#8

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

📥 Commits

Reviewing files that changed from the base of the PR and between 83046f7 and 922ed2f.

📒 Files selected for processing (9)
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/mapper/HomeMapper.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/model/ElderIds.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repository/ElderIdRepository.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/data/repositoryimpl/ElderIdRepositoryImpl.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/navigation/HomeNavigation.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/viewmodel/HomeViewModel.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/statistics/viewmodel/StatisticsViewModel.kt
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/navigation/NavGraph.kt

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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 922ed2f and 4896ba6.

📒 Files selected for processing (1)
  • composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/homedetail/statehealth/screen/StateHealthDetailScreen.kt

Reopen [Fix] 회원가입 플로우 오류 수정 #6
Copy link
Copy Markdown
Contributor

@ProtossManse ProtossManse left a comment

Choose a reason for hiding this comment

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

리뷰 확인 부탁드려요!

이외의 다른 수정사항은 안드로이드에서도 잘 반영되었습니다!

Comment on lines +185 to +195
"MORNING" -> "아침"
"LUNCH" -> "점심"
"DINNER" -> "저녁"
"MORNING" -> "아침약"
"LUNCH" -> "점심약"
"DINNER" -> "저녁약"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

아침약, 점심약, 저녁약보다는 아침, 점심, 저녁으로 통일하는 게 나을 것 같습니다!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

피그마상 -약으로 표기되어있어서 피그마기준으로 맞춰두었습니다!

Copy link
Copy Markdown
Contributor Author

@librawish808 librawish808 Mar 12, 2026

Choose a reason for hiding this comment

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

아 혹시 enum은 아침/점심/저녁으로 두고 ui표시할때만 약을 붙이라는 의미인가요?

Copy link
Copy Markdown
Contributor

@ProtossManse ProtossManse Mar 12, 2026

Choose a reason for hiding this comment

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

피그마상 -약으로 표기되어있어서 피그마기준으로 맞춰두었습니다!

아 피그마에서 그렇게 돼있으면 아침약, 점심약, 저녁약으로 표기하는게 맞겠네요!
수정하신 코드대로 하면 될 것 같습니다~!

Copy link
Copy Markdown
Contributor

@alswlekk alswlekk left a comment

Choose a reason for hiding this comment

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

LGTM

@librawish808 librawish808 merged commit 4ea7d09 into main Mar 12, 2026
3 checks passed
@librawish808 librawish808 deleted the fix/ios-ui-ux-#8 branch March 14, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 캘린더 깜빡임, 복약 시간 텍스트 한글화, 통계 화면 드롭다운 수정

4 participants