Conversation
- 세부루틴 옆 i 버튼 삭제 - 수정하기에서 세부 루틴 수정 안되는 문제 해결
Walkthrough루틴 생성 화면의 UI 요소를 수정하고, 서브루틴 관리 로직을 강화했습니다. 서브루틴 정보 이미지 표시 비활성화, 최대 개수 제한(3개), 기간 정보 우선 전송, 빈 항목 필터링 기능을 추가했습니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
Projects/Presentation/Sources/RoutineCreation/ViewModel/RoutineCreationViewModel.swift (2)
186-197:⚠️ Potential issue | 🟠 Major
fetchRecommendedRoutine에서 서버 응답subRoutines필터링 필요서버 응답에서
subRoutines이 3개를 초과할 경우, 4번째 이상 요소들도 모두subRoutinesSubject에 저장됩니다.configureSubroutine은 인덱스 3 이상의 수정을 차단하지만, 이미 저장된 4번째+ 요소는 그대로 유지되며 루틴 등록 시 서버로 전송됩니다.UI는 3개까지만 표시하므로(RoutineNameContentView.swift), 내부 상태와 UI 간 불일치 발생합니다.
권장 수정
// fetchRecommendedRoutine의 173번 줄 부분 let subRoutines = routine.subRoutines.prefix(maxSubRoutineCount).map { $0.title }또는 fetchRecommendedRoutine 함수 내에서 응답을 명시적으로 필터링하여
maxSubRoutineCount이하로 제한해야 합니다.
254-295:⚠️ Potential issue | 🟠 Major
registerRoutine의 빈catch블록과 비동기 처리 — 저장 실패가 사용자에게 숨겨짐Lines 254-295의
registerRoutine메서드가Task내에서 비동기로 실행되는데, ViewController(Line 147)는 이 작업의 완료를 기다리지 않고 즉시 화면을pop합니다. 동시에 Lines 292-294의 빈catch블록으로 인해saveRoutine실패가 완전히 무시됩니다. 결과적으로 저장이 실패해도 화면이 닫히고 사용자는 성공으로 인식하게 됩니다.필요한 개선:
- 저장 성공/실패 상태를 ViewController에 알릴 수 있는 메커니즘 추가 (예: Publisher, Delegate, 또는 completion handler)
- ViewController에서 저장 완료를 기다린 후에만 화면 전환
- 저장 실패 시 사용자에게 에러 알림 표시
🧹 Nitpick comments (1)
Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift (1)
144-162:registerRoutine호출 후 완료 대기 없이 즉시 화면 전환
viewModel.action(input: .registerRoutine)은 내부적으로Task를 통해 비동기saveRoutine을 호출하지만, ViewController에서는 완료 콜백이나 결과를 기다리지 않고 즉시popViewController/popToRootViewController를 수행합니다. 네트워크 저장이 실패하더라도 사용자는 성공한 것처럼 이전 화면으로 돌아가게 됩니다.이상적으로는 저장 성공/실패에 따라 화면 전환을 제어해야 하지만, 이번 QA 수정 범위 밖일 수 있으므로 후속 개선 사항으로 기록해두시면 좋겠습니다.
🌁 Background
👩💻 Contents
📝 Review Note
Summary by CodeRabbit
릴리스 노트