Skip to content

Refactor: v1.3.0 QA 수정사항 반영 - #174

Merged
dogmania merged 8 commits into
developfrom
refactor/#171-v1.3.0-qa-feedback
Apr 12, 2026
Merged

Refactor: v1.3.0 QA 수정사항 반영#174
dogmania merged 8 commits into
developfrom
refactor/#171-v1.3.0-qa-feedback

Conversation

@dogmania

@dogmania dogmania commented Apr 12, 2026

Copy link
Copy Markdown
Member

작업내용

  • 캘린더 바텀시트에서 일정 삭제 추가
  • 중요한 알약 바텀시트 컴포넌트 제거
  • 코드 주석 추가

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 삭제 API 반환형 추가(직접적인 결과형 기반 삭제 지원)
    • 삭제 처리에 과거/미래 구분을 전달하도록 인텐트 및 콜백 확장
  • 개선 사항

    • 일정 삭제 시 낙관적 업데이트, 알람 취소 및 오류 복구 흐름 추가 및 성공 토스트 표시
    • 일정 저장 시 기존 알람 전부 취소하도록 동작 변경
    • 캘린더 일정 칩 표시 수 2→3으로 증가
  • 제거

    • 체크 화면의 의약품 선택 UI 삭제
  • 문서화

    • 날짜/시간 변환 함수 설명 추가
  • 테스트

    • 삭제 API 관련 테스트용 페이크 저장소 인터페이스 확장

@dogmania dogmania self-assigned this Apr 12, 2026
@dogmania dogmania added the REFACTOR 코드 개선 label Apr 12, 2026
@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@dogmania has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 44 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 44 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d29adcfb-ae77-48fd-8dab-a8e857f78478

📥 Commits

Reviewing files that changed from the base of the PR and between 699fba0 and 0a0062b.

📒 Files selected for processing (2)
  • core/util/src/commonMain/kotlin/com/ondot/util/DateTimeFormatter.kt
  • feature/calendar/src/commonMain/kotlin/com/ondot/calendar/contract/CalendarViewModel.kt

Walkthrough

캘린더 삭제 흐름이 확장되어 항목이 과거인지 여부를 전달받아 과거/미래를 분기 처리하고, AppResult 기반의 새로운 삭제 API(deleteScheduleAppResult)를 추가했습니다. UI 콜백 시그니처와 일부 화면/뷰모델, 알람 취소 및 체크박스 관련 UI가 변경되었습니다.

Changes

Cohort / File(s) Summary
리포지토리 변경
domain/src/commonMain/kotlin/com/ondot/domain/repository/ScheduleRepository.kt, data/src/commonMain/kotlin/com/ondot/data/repository/ScheduleRepositoryImpl.kt
suspend fun deleteScheduleAppResult(scheduleId: Long): AppResult<Unit> 메서드 추가 및 구현(원격 DELETE 호출, safeApiCall 래핑).
Calendar Intent & ViewModel
feature/calendar/src/commonMain/kotlin/com/ondot/calendar/contract/CalendarIntent.kt, feature/calendar/src/commonMain/kotlin/com/ondot/calendar/contract/CalendarViewModel.kt
DeleteHistoryisPast: Boolean 인자 추가. ViewModel에 비과거 삭제를 위한 새로운 deleteSchedule() 낙관적 업데이트/롤백 및 알람 취소/복원 로직 추가.
Calendar UI 변경
feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/CalendarScreen.kt, feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/component/CalendarBottomSheet.kt
onDelete 시그니처가 (Long) -> Unit(Long, Boolean) -> Unit 으로 변경되어 isPast 전파. BottomSheet/Route/Screen에서 호출점 수정.
Calendar 표시 변경
feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/component/CalendarDay.kt
일정 칩 렌더 개수 증가: 최대 2개 → 3개(cell.markers.take(3)).
EditViewModel 알람 처리
feature/edit/src/commonMain/kotlin/com/ondot/edit/EditScheduleViewModel.kt
saveSchedule()에서 기존 조건부 알람 취소를 항상 모든 알람 취소로 변경(cancelAlarms() 호출로 통일).
General UI
feature/general/src/commonMain/kotlin/com/ondot/general/check/CheckScheduleScreen.kt
하단 시트의 의약품 선택 체크박스 UI 제거(관련 import/Row 및 토글 제거).
테스트 더미
domain/testing/src/commonMain/kotlin/com/ondot/testing/fake/FakeScheduleRepository.kt
deleteScheduleAppResult 오버라이드 추가(현재 TODO 스텁).
유틸 문서화
core/util/src/commonMain/kotlin/com/ondot/util/DateTimeFormatter.kt
formatIsoDateTime(date,time)에 KDoc 주석 추가(기능 변경 없음).

Sequence Diagram

sequenceDiagram
    participant UI as CalendarScreen
    participant VM as CalendarViewModel
    participant Repo as ScheduleRepository
    participant API as Network

    UI->>VM: dispatch(DeleteHistory(id, isPast))
    activate VM
    alt isPast == true
        VM->>VM: deleteHistory(scheduleId) (기존 흐름)
    else isPast == false
        VM->>VM: deleteSchedule(scheduleId)
        VM->>VM: 낙관적 업데이트 (selectedDateSchedules, schedulesByDate 수정)
        VM->>VM: 예정 알람 취소
        VM->>Repo: deleteScheduleAppResult(scheduleId)
        activate Repo
        Repo->>API: DELETE /schedules/{id}
        API-->>Repo: 응답(성공/실패)
        deactivate Repo
        alt 성공
            VM->>VM: SUCCESS_DELETE_SCHEDULE 토스트 발생
        else 실패
            VM->>VM: schedulesByDate 복원 및 알람 재적용, 에러 로깅
        end
    end
    deactivate VM
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive PR 제목이 한국어로 작성되었으며, 전반적인 변경사항을 요약하지만 구체적인 주요 변경점을 명확히 나타내지 못함. 제목을 더 구체적으로 수정하여 주요 변경사항(일정 삭제 기능, 약 선택 UI 제거 등)을 명확히 표현하는 것을 권장함.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#171-v1.3.0-qa-feedback

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (1)
feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/component/CalendarDay.kt (1)

109-109: 매직 넘버를 상수로 분리해 의도를 명확히 해주세요.

Line 109의 take(3) 자체는 문제 없지만, 같은 컴포넌트에서 dot는 take(2)를 사용하고 있어 이후 QA 변경 시 누락 위험이 있습니다. 제한 개수를 상수로 분리하면 유지보수가 쉬워집니다.

🔧 제안 코드
+private const val MAX_LABEL_MARKERS = 3
+private const val MAX_DOT_MARKERS = 2
...
-                        cell.markers.take(3).forEach { marker ->
+                        cell.markers.take(MAX_LABEL_MARKERS).forEach { marker ->
...
-                        cell.markers.take(2).forEach { _ ->
+                        cell.markers.take(MAX_DOT_MARKERS).forEach { _ ->
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/component/CalendarDay.kt`
at line 109, Replace the magic literal in CalendarDay.kt (the
cell.markers.take(3) call) with a named constant to clarify intent and prevent
future mismatches with the dot logic; define a constant (e.g.,
MARKER_DISPLAY_LIMIT) in the same scope as the CalendarDay composable or its
companion object and use it in place of 3, and likewise replace the dot take(2)
with a DOT_DISPLAY_LIMIT constant (or unify under a single constant if they
should match) so both marker and dot display limits are explicit and easy to
maintain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@core/util/src/commonMain/kotlin/com/ondot/util/DateTimeFormatter.kt`:
- Around line 328-332: Update the KDoc in DateTimeFormatter.kt to use standard
Kotlin syntax: replace lines like "@param: date 선택된 날짜" and "@param: time 선택된
시간" with "@param date 선택된 날짜" and "@param time 선택된 시간", and change "@return:
LocalDate, LocalTime을 조합한 ISO8601 문자열" to "@return LocalDate와 LocalTime을 조합한
ISO8601 문자열" so the `@param` and `@return` tags do not include colons and follow
Kotlin KDoc conventions.

In
`@feature/calendar/src/commonMain/kotlin/com/ondot/calendar/contract/CalendarViewModel.kt`:
- Around line 389-390: The code stores previousSchedulesByDate =
currentState.schedulesByDate and on error replaces the whole schedulesByDate
map, which can overwrite concurrent updates; instead capture only the prior
value for the specific date key(s) you are modifying (e.g., val previousForDate
= currentState.schedulesByDate[dateKey]) before applying changes, and on failure
restore only that entry (create a new map from currentState.schedulesByDate with
.toMutableMap(), set map[dateKey] = previousForDate or remove if it was null,
and assign it back) rather than reassigning previousSchedulesByDate; update the
rollback logic wherever currentState.schedulesByDate is fully replaced (also at
the other occurrence around lines 434-437) to use this targeted restore.

In `@feature/edit/src/commonMain/kotlin/com/ondot/edit/EditScheduleViewModel.kt`:
- Around line 86-87: The current flow calls cancelAlarms() before the network
save completes, risking alarm loss on failure; move the cancelAlarms() call to
the success branch of the save (after the API confirms the schedule update) or
implement a rollback in onFailSaveSchedule that restores previous alarms
(recreate them from the pre-save state). Locate the cancelAlarms() invocation in
EditScheduleViewModel (the save/update method) and either shift it into the
success callback where you handle the API response, or capture the existing
alarms before cancelling and use that snapshot in onFailSaveSchedule to
re-create the alarms if the API call fails.

---

Nitpick comments:
In
`@feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/component/CalendarDay.kt`:
- Line 109: Replace the magic literal in CalendarDay.kt (the
cell.markers.take(3) call) with a named constant to clarify intent and prevent
future mismatches with the dot logic; define a constant (e.g.,
MARKER_DISPLAY_LIMIT) in the same scope as the CalendarDay composable or its
companion object and use it in place of 3, and likewise replace the dot take(2)
with a DOT_DISPLAY_LIMIT constant (or unify under a single constant if they
should match) so both marker and dot display limits are explicit and easy to
maintain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 712cd39a-571e-4fe7-8b5a-ae42d124d703

📥 Commits

Reviewing files that changed from the base of the PR and between 1b51981 and b8d8178.

📒 Files selected for processing (10)
  • core/util/src/commonMain/kotlin/com/ondot/util/DateTimeFormatter.kt
  • data/src/commonMain/kotlin/com/ondot/data/repository/ScheduleRepositoryImpl.kt
  • domain/src/commonMain/kotlin/com/ondot/domain/repository/ScheduleRepository.kt
  • feature/calendar/src/commonMain/kotlin/com/ondot/calendar/contract/CalendarIntent.kt
  • feature/calendar/src/commonMain/kotlin/com/ondot/calendar/contract/CalendarViewModel.kt
  • feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/CalendarScreen.kt
  • feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/component/CalendarBottomSheet.kt
  • feature/calendar/src/commonMain/kotlin/com/ondot/calendar/ui/component/CalendarDay.kt
  • feature/edit/src/commonMain/kotlin/com/ondot/edit/EditScheduleViewModel.kt
  • feature/general/src/commonMain/kotlin/com/ondot/general/check/CheckScheduleScreen.kt
💤 Files with no reviewable changes (1)
  • feature/general/src/commonMain/kotlin/com/ondot/general/check/CheckScheduleScreen.kt

Comment thread core/util/src/commonMain/kotlin/com/ondot/util/DateTimeFormatter.kt

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@domain/testing/src/commonMain/kotlin/com/ondot/testing/fake/FakeScheduleRepository.kt`:
- Around line 162-164: The TODO stub in
FakeScheduleRepository.deleteScheduleAppResult is invoked from production path
(CalendarViewModel -> deleteSchedule call) so replace the TODO with a minimal
fake implementation that mirrors the existing tested deleteSchedule(Flow)
behavior: perform any in-memory removal of the schedule by scheduleId and return
AppResult.Success(Unit) (or the appropriate AppResult failure when id not found)
so CalendarViewModel can exercise that path; alternatively, add a unit test in
CalendarViewModel that covers the deleteSchedule flow to justify keeping the
TODO, but preferred fix is to implement deleteScheduleAppResult in
FakeScheduleRepository to update the fake store and return a success/failure
AppResult.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7f0ba56d-56f5-468a-a7e7-3c91a1d5a28a

📥 Commits

Reviewing files that changed from the base of the PR and between b8d8178 and 699fba0.

📒 Files selected for processing (1)
  • domain/testing/src/commonMain/kotlin/com/ondot/testing/fake/FakeScheduleRepository.kt

@dogmania
dogmania merged commit df6f746 into develop Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

REFACTOR 코드 개선

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant