Repository navigation
feat: 이전 운동 기록 API 연동 - #185
Conversation
dltldn1234
left a comment
There was a problem hiding this comment.
변경 범위와 API 호출 경로는 Issue #184의 요구 및 기존 API 서비스와 맞습니다. 다만 현재 CI Generate, lint, and test는 SwiftLint 오류 5건으로 실패했고, XCTest 단계도 실행되지 않았습니다. PR에는 새 동작 테스트가 없으며 Issue #184에서 요구한 성공·기록 없음·실패·재시도 흐름을 확인할 수 없습니다. 아래 코멘트의 lint 위반을 고치고 해당 상태 테스트를 추가한 뒤 CI를 다시 실행해 주세요. 현재는 승인할 수 없습니다.
| var sets: [WorkoutSessionSet] | ||
| var imageAssetOverride: String? | ||
| var usesSampleHistory = true | ||
| var previousRecord: WorkoutSessionPreviousRecord? = nil |
There was a problem hiding this comment.
[P1] = nil을 제거해 주세요. 이 줄에서 SwiftLint implicit_optional_initialization이 실패해 CI가 막힙니다. Optional 프로퍼티는 초기값을 생략해도 자동으로 nil로 초기화됩니다.
| WorkoutSessionRecordSummary(exercise: exercise, currentSetIndex: currentSetIndex) | ||
| .padding(.top, 9) | ||
| if let previousRecordError { | ||
| WorkoutSessionRecordRetryBanner( |
There was a problem hiding this comment.
[P1] 이 추가로 파일이 411줄이 되어 SwiftLint 400줄 제한을 넘었습니다. 재사용 가능한 오류 배너를 별도 구성으로 추출해 이 파일을 제한 안으로 줄여 주세요.
| loadingPreviousRecordExerciseIDs.contains(exerciseID) | ||
| } | ||
|
|
||
| func loadPreviousRecord(for exerciseID: String) async { |
There was a problem hiding this comment.
[P1] 이 로딩 흐름이 클래스 본문을 SwiftLint 제한인 250줄보다 3줄 초과시킵니다(253줄). 이전 기록 조회와 상태 처리를 별도 extension/helper로 옮겨 CI를 통과시켜 주세요.
| Task { await WorkoutRestActivityController.shared.end(sessionID: liveActivitySessionID) } | ||
| } | ||
| .task { showFirstExercisePromptIfNeeded() } | ||
| .task(id: "\(viewModel.hasStarted)-\(viewModel.currentExercise?.id ?? "")") { |
There was a problem hiding this comment.
[P1] 이 조회 task와 추가된 연결부 때문에 SwiftLint에서 파일 길이(412/400)와 본문 길이(256/250) 두 항목이 실패합니다. 이전 기록 조회/재시도 UI 연결을 별도 하위 뷰나 ViewModifier로 분리해 둘 제한을 모두 해결해 주세요.
| weightKilograms = response.weight | ||
| repetitions = response.reps | ||
| setIndex = response.setIndex | ||
| performedAtLabel = Self.dateLabel(from: response.performedAt) |
There was a problem hiding this comment.
[P1] 날짜·이전 기록 표시와 ViewModel의 성공/기록 없음/실패/재시도 동작을 검증하는 회귀 테스트를 추가해 주세요. Issue #184의 검증 조건인데 현재 PR에는 테스트가 없고, 이번 CI도 SwiftLint 실패 때문에 XCTest를 건너뛰었습니다.
Summary
GET /api/v1/exercises/{exerciseId}/previous-record를 연결했습니다.hasPreviousRecord: false응답은 디코딩 오류로 처리됩니다.Related issue
Closes #184
Verification
swiftc -frontend -parse),git diff --checkReview checklist