Skip to content

Conversation

@wotjs020708
Copy link
Contributor

🔗 연결된 이슈

📄 작업 내용

  • QA 반영 완료

@wotjs020708 wotjs020708 requested a review from a team January 22, 2026 13:43
@wotjs020708 wotjs020708 self-assigned this Jan 22, 2026
@wotjs020708 wotjs020708 requested review from soseoyo12, sum130 and y-eonee and removed request for a team January 22, 2026 13:43
@wotjs020708 wotjs020708 added 재선🐻 Fix 버그 수정 labels Jan 22, 2026
@wotjs020708 wotjs020708 linked an issue Jan 22, 2026 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

SelectTreatment과 Treatment 관련 뷰들의 레이아웃 조정(텍스트 프레임 높이, 스페이서/스크롤뷰 높이 계산)과 함께 NoTreatment/Treatment 뷰모델의 날짜 유효성 검사(isDateTextFieldNotEmpty) 로직이 오늘(today) 및 scheduledDate 비교를 명확히 하도록 수정되었습니다. 동작 흐름 변경은 경계 검사 위주입니다.

Changes

Cohort / File(s) 변경 사항 요약
SelectTreatmentView 높이 조정
Cherrish-iOS/.../Calendar/SelectTreatment/SelectTreatmentView.swift
titleView의 두 TypographyText 프레임 높이를 27.adjustedH에서 30.adjustedH로 증가; 빈 줄 제거 (레이아웃 변경).
TreatmentFilterView 레이아웃 및 로드
Cherrish-iOS/.../Calendar/Treatment/View/Treatment/TreatmentFilterView.swift
itemHeight, spacing, maxVisibleCount, scrollViewHeight 계산 추가로 ScrollView 높이 동적 결정; 검색 필드 하단 패딩을 고정 스페이서로 교체; 헤더 설명 텍스트 및 추가 스페이서 삽입; 뷰 onAppear용 .task로 치료목록 fetch 추가(기존 onTap fetch 유지). 주의: 동적 높이 및 초기 fetch 동작.
NoTreatmentFilterView 동적 높이/레이아웃
Cherrish-iOS/.../Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift
동일한 레이아웃 상수(itemHeight, spacing, maxVisibleCount) 및 scrollViewHeight 계산 추가; 고정 스페이서(198.adjustedH)를 동적 Spacer 프레임으로 교체; TreatmentRowView 액션 클로저 포맷 변경(동작 동일).
NoTreatmentViewModel 날짜 검증 강화
Cherrish-iOS/.../Calendar/Treatment/ViewModel/NoTreatment/NoTreatmentViewModel.swift
isDateTextFieldNotEmpty()scheduledDate 가드 추가; today 기준 및 scheduledDate 비교를 도입해 과거/시술전(beforeProcedureDate) 경계 처리 세분화; scheduledDate 누락 시 조기 실패 반환 추가.
TreatmentViewModel 날짜 검증 강화
Cherrish-iOS/.../Calendar/Treatment/ViewModel/Treatment/TreatmentViewModel.swift
isDateTextFieldNotEmpty()scheduledDate 가드 추가 및 today 비교 도입; 날짜가 오늘 이전/이후 케이스와 scheduledDate 대비 로직 재구성해 pastDate vs beforeProcedureDate 분기 명확화.

Sequence Diagram(s)

(생략)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • soseoyo12
  • sum130
  • y-eonee
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed PR 제목은 #164 QA 수정 완료라는 연결된 이슈와 관련이 있으며, 변경 사항의 주요 목표인 QA 수정 반영을 나타내고 있습니다.
Description check ✅ Passed PR 설명은 변경 사항과 관련이 있으며, 연결된 이슈 #164를 명시하고 QA 반영 완료라는 작업 내용을 포함하고 있습니다.
Linked Issues check ✅ Passed 코드 변경 사항들이 QA 수정 요구사항을 반영하고 있습니다. SelectTreatmentView의 높이 조정, TreatmentFilterView와 NoTreatmentFilterView의 동적 레이아웃 개선, 그리고 두 ViewModel의 날짜 검증 로직 정제가 UI/UX 및 기능 개선을 구성합니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항들이 QA 수정 및 개선과 관련된 범위 내에 있으며, 레이아웃 조정, 동적 크기 계산, 날짜 검증 로직 개선 등으로 구성되어 있습니다.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#164-treatmentqa2

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
Contributor

@y-eonee y-eonee left a comment

Choose a reason for hiding this comment

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

ㅇㅍㄹㅂㅇㅍㄹㅂㅇㅍㄹㅂㅇㅍㄹㅂ수고하셧습니당

Copy link

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentFilterView.swift (1)

85-88: .task 내부 중첩 Task 제거

.task 안에서 새로운 Task {}를 생성하면 해당 Task는 구조화되지 않은 최상위 Task가 되어 .task의 취소 신호를 받지 않습니다. 뷰가 사라질 때 외부 .task는 취소되지만 내부 Task는 계속 실행되어 불필요한 호출이 남을 수 있습니다. .task 블록에서 직접 await를 호출하여 구조화된 동시성을 유지해주세요.

🔧 제안 수정안
-        .task {
-            Task {
-                try await viewModel.fetchTreatments()
-            }
-        }
+        .task {
+            try? await viewModel.fetchTreatments()
+        }
🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift`:
- Around line 14-22: The computed property scrollViewHeight currently sums
values where itemHeight and spacing already use adjustedH, but elsewhere the
value is being re-scaled again (scrollViewHeight.adjustedH); fix by ensuring
adjustedH is applied exactly once: keep adjustedH on the base constants
(itemHeight, spacing, any fixed paddings like 24 and 40) and remove any extra
.adjustedH call where scrollViewHeight is used (or alternatively remove
adjustedH from the constants and apply it once to scrollViewHeight) so
scrollViewHeight calculation in NoTreatmentFilterView and its usage uses a
single scaling application; locate symbols itemHeight, spacing, scrollViewHeight
and any usages of scrollViewHeight.adjustedH to update consistently.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentFilterView.swift`:
- Around line 13-21: The computed property scrollViewHeight already uses values
with .adjustedH applied (itemHeight, spacing and the added paddings), so remove
the extra scaling where scrollViewHeight is consumed (do not call
scrollViewHeight.adjustedH); update usages (e.g., where scrollViewHeight is
referenced in layout code around the previous Line 78–81) to use
scrollViewHeight directly, or alternatively compute itemHeight/spacing without
.adjustedH and apply .adjustedH only once—ensure scrollViewHeight remains
consistently scaled exactly once.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/ViewModel/NoTreatment/NoTreatmentViewModel.swift`:
- Around line 141-156: The inner check for `date < today` inside the `else`
branch is unreachable because the `else` guarantees `date >= today`; simplify
the branching in NoTreatmentViewModel by removing that impossible condition and
collapsing logic to: if `date < today` -> call `updateWarning(state: .pastDate)`
and return false; else if `date < scheduledDate` -> call `updateWarning(state:
.beforeProcedureDate)` and return false; keep references to `date`, `today`,
`scheduledDate`, and `updateWarning(state:)` intact so behavior remains the same
but with the unreachable branch removed.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/ViewModel/Treatment/TreatmentViewModel.swift`:
- Around line 132-147: The else branch contains an unreachable check (date <
today) and should be simplified: in the else (where date >= today) remove the
nested "if date < today" and, when date < scheduledDate, call
updateWarning(state: .beforeProcedureDate) and return false; keep the earlier
branch that sets updateWarning(state: .pastDate) when date < today && date <
scheduledDate so .pastDate logic remains intact. Reference: variables date,
today, scheduledDate and the updateWarning(state:
.pastDate)/updateWarning(state: .beforeProcedureDate) calls in
TreatmentViewModel.

Comment on lines +14 to +22
private let itemHeight: CGFloat = 34.adjustedH
private let spacing: CGFloat = 8.adjustedH
private let maxVisibleCount = 3

private var scrollViewHeight: CGFloat {
let count = min(viewModel.selectedTreatments.count, maxVisibleCount)
let contentHeight = CGFloat(count) * itemHeight + CGFloat(max(count - 1, 0)) * spacing
return contentHeight + 24.adjustedH + 40.adjustedH
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

scrollViewHeight 이중 스케일링 가능성

Line 19-21에서 adjustedH가 이미 적용된 값을 계산하고 있는데, Line 53에서 scrollViewHeight.adjustedH를 다시 적용하고 있습니다. adjustedH가 스케일링이라면 높이가 과대 계산될 수 있으니 한 번만 적용해주세요.

🔧 제안 수정안
-                        24.adjustedH : scrollViewHeight.adjustedH + 24.adjustedH
+                        24.adjustedH : scrollViewHeight + 24.adjustedH

Also applies to: 51-54

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift`
around lines 14 - 22, The computed property scrollViewHeight currently sums
values where itemHeight and spacing already use adjustedH, but elsewhere the
value is being re-scaled again (scrollViewHeight.adjustedH); fix by ensuring
adjustedH is applied exactly once: keep adjustedH on the base constants
(itemHeight, spacing, any fixed paddings like 24 and 40) and remove any extra
.adjustedH call where scrollViewHeight is used (or alternatively remove
adjustedH from the constants and apply it once to scrollViewHeight) so
scrollViewHeight calculation in NoTreatmentFilterView and its usage uses a
single scaling application; locate symbols itemHeight, spacing, scrollViewHeight
and any usages of scrollViewHeight.adjustedH to update consistently.

Comment on lines +13 to +21
private let itemHeight: CGFloat = 34.adjustedH
private let spacing: CGFloat = 8.adjustedH
private let maxVisibleCount = 3

private var scrollViewHeight: CGFloat {
let count = min(viewModel.selectedTreatments.count, maxVisibleCount)
let contentHeight = CGFloat(count) * itemHeight + CGFloat(max(count - 1, 0)) * spacing
return contentHeight + 24.adjustedH + 40.adjustedH
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

scrollViewHeight 재스케일링으로 높이 과대 가능

Line 18-21에서 이미 adjustedH가 적용된 값을 만들고 있는데, Line 80에서 scrollViewHeight.adjustedH를 다시 적용하고 있습니다. 스케일링 중복을 제거해 주세요.

🔧 제안 수정안
-                        24.adjustedH : scrollViewHeight.adjustedH + 24.adjustedH
+                        24.adjustedH : scrollViewHeight + 24.adjustedH

Also applies to: 78-81

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentFilterView.swift`
around lines 13 - 21, The computed property scrollViewHeight already uses values
with .adjustedH applied (itemHeight, spacing and the added paddings), so remove
the extra scaling where scrollViewHeight is consumed (do not call
scrollViewHeight.adjustedH); update usages (e.g., where scrollViewHeight is
referenced in layout code around the previous Line 78–81) to use
scrollViewHeight directly, or alternatively compute itemHeight/spacing without
.adjustedH and apply .adjustedH only once—ensure scrollViewHeight remains
consistently scaled exactly once.

Comment on lines 141 to +156
let today = Calendar.current.startOfDay(for: Date())

if date < today {
updateWarning(state: .pastDate)
return false
if date < scheduledDate {
updateWarning(state: .pastDate)
return false
}

} else {
if date < scheduledDate {
if date < today {
updateWarning(state: .pastDate)
}
updateWarning(state: .beforeProcedureDate)
return false
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

도달 불가능한 분기 제거로 경고 로직 단순화

Line 149의 else는 date >= today를 보장하므로 Line 151의 date < today는 항상 false입니다. 현재 구조는 경고 업데이트 의도를 흐릴 수 있어 분기 정리를 권장합니다.

🔧 제안 수정안
-        if date < today {
-            if date < scheduledDate {
-                updateWarning(state: .pastDate)
-                return false
-            }
-            
-        } else {
-            if date < scheduledDate {
-                if date < today {
-                    updateWarning(state: .pastDate)
-                }
-                updateWarning(state: .beforeProcedureDate)
-                 return false
-            }
-        }
+        if date < today {
+            if date < scheduledDate {
+                updateWarning(state: .pastDate)
+                return false
+            }
+        } else if date < scheduledDate {
+            updateWarning(state: .beforeProcedureDate)
+            return false
+        }
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/ViewModel/NoTreatment/NoTreatmentViewModel.swift`
around lines 141 - 156, The inner check for `date < today` inside the `else`
branch is unreachable because the `else` guarantees `date >= today`; simplify
the branching in NoTreatmentViewModel by removing that impossible condition and
collapsing logic to: if `date < today` -> call `updateWarning(state: .pastDate)`
and return false; else if `date < scheduledDate` -> call `updateWarning(state:
.beforeProcedureDate)` and return false; keep references to `date`, `today`,
`scheduledDate`, and `updateWarning(state:)` intact so behavior remains the same
but with the unreachable branch removed.

Comment on lines 132 to +147
let today = Calendar.current.startOfDay(for: Date())

if date < today {
updateWarning(state: .pastDate)
return false
if date < scheduledDate {
updateWarning(state: .pastDate)
return false
}

} else {
if date < scheduledDate {
if date < today {
updateWarning(state: .pastDate)
}
updateWarning(state: .beforeProcedureDate)
return false
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

도달 불가능한 분기 제거로 경고 로직 단순화

Line 140의 else는 date >= today 조건이므로 Line 142의 date < today는 항상 false입니다. 분기를 단순화하면 의도가 명확해집니다.

🔧 제안 수정안
-        if date < today {
-            if date < scheduledDate {
-                updateWarning(state: .pastDate)
-                return false
-            }
-            
-        } else {
-            if date < scheduledDate {
-                if date < today {
-                    updateWarning(state: .pastDate)
-                }
-                updateWarning(state: .beforeProcedureDate)
-                 return false
-            }
-        }
+        if date < today {
+            if date < scheduledDate {
+                updateWarning(state: .pastDate)
+                return false
+            }
+        } else if date < scheduledDate {
+            updateWarning(state: .beforeProcedureDate)
+            return false
+        }
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/ViewModel/Treatment/TreatmentViewModel.swift`
around lines 132 - 147, The else branch contains an unreachable check (date <
today) and should be simplified: in the else (where date >= today) remove the
nested "if date < today" and, when date < scheduledDate, call
updateWarning(state: .beforeProcedureDate) and return false; keep the earlier
branch that sets updateWarning(state: .pastDate) when date < today && date <
scheduledDate so .pastDate logic remains intact. Reference: variables date,
today, scheduledDate and the updateWarning(state:
.pastDate)/updateWarning(state: .beforeProcedureDate) calls in
TreatmentViewModel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix 버그 수정 재선🐻

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 2차 QA 수정

3 participants