Skip to content

Conversation

@wotjs020708
Copy link
Contributor

🔗 연결된 이슈

📄 작업 내용

  • QA 반영

@wotjs020708 wotjs020708 requested a review from a team January 22, 2026 06:58
@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 06:58
@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

캘린더 관련 치료 선택/필터 UI의 레이아웃 및 프레임 높이 조정, 치료 선택 토글 로직 추가, SelectedTreatmentSheetView의 ScrollViewReader 기반 자동 스크롤과 시트 표시 위치 변경, DdayState에 새 케이스 추가 등 프레젠테이션 중심의 변경입니다.

Changes

Cohort / File(s) 변경 요약
SelectTreatment 뷰·뷰모델
Cherrish-iOS/Presentation/Feature/Calendar/SelectTreatment/SelectTreatmentView.swift, Cherrish-iOS/Presentation/Feature/Calendar/SelectTreatment/SelectTreatmentViewModel.swift
TitleView 레이아웃을 수평+명시적 높이(frames)로 재구성하고 VStack 간격 0 적용. TreatmentSelectionState 케이스 순서 변경(available, notSelected).
SelectedTreatment 시트·표시 위치 변경
.../Treatment/View/SelectedTreatmentSheetView.swift, .../Treatment/TreatmentView.swift, .../NoTreatment/NoTreatmentView.swift
SelectedTreatmentSheetViewScrollViewReader로 래핑해 id 부여 및 onChange로 항목 추가 시 하단으로 애니메이션 스크롤 구현. 시트 표시를 bottomView에서 overlay로 이동(선택된 치료가 있을 때 조건부).
Treatment 리스트·행 관련
.../Treatment/TreatmentFilterView.swift, .../Treatment/TreatmentRowView.swift, .../Treatment/View/NoTreatment/NoTreatmentFilterView.swift
TreatmentRow 액션을 토글(add/remove)로 변경. TreatmentRow 내 Text→TypographyText 통일, 다운타임 0-0 케이스 명시 처리, 패딩/프레임 조정. ScrollView 하단 고정 Spacer(198) 추가.
DownTime / TargetDday 뷰
.../Treatment/View/DownTimeSettingView.swift, .../Treatment/View/TargetDdaySettingView.swift
여러 VStack의 spacing을 0으로 조정하고 내부 구조 평탄화. DdayStateyes 케이스 추가 및 헤더 TypographyText 높이/프레임 조정.
글로벌 텍스트 박스
Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift, Presentation/Global/Components/CherrishTextBox/DateTextBox.swift
헤더 TypographyText에 .frame(height: 20.adjustedH) 추가로 레이아웃 고정.

Sequence Diagram(s)

sequenceDiagram
    participant User as 사용자
    participant FilterView as TreatmentFilterView
    participant SheetView as SelectedTreatmentSheetView
    participant ViewModel as ViewModel

    User->>FilterView: 치료 항목 선택(탭)
    FilterView->>ViewModel: addTreatment(treatment) or removeTreatment(treatment) (토글)
    ViewModel-->>SheetView: selectedTreatments 업데이트
    Note right of SheetView: ScrollViewReader 감지(onChange)
    SheetView->>SheetView: proxy.scrollTo("scrollBottom", animated)
    SheetView-->>User: 스크롤 애니메이션(새 항목 표시)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • sum130
  • soseoyo12
  • 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 제목 'Fix/#151 QA 반영'은 변경 사항의 주요 의도(QA 반영)를 명확히 나타내며, 링크된 이슈와 일치합니다.
Description check ✅ Passed PR 설명은 연결된 이슈 #151을 명시하고 'QA 반영'이라는 작업 내용을 포함하므로 변경 사항과 관련이 있습니다.
Linked Issues check ✅ Passed PR은 이슈 #151의 QA 반영 요구사항을 충족하는 UI 레이아웃 및 상호작용 개선(스페이싱, 프레임 높이, 토글 로직 등)을 포함합니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항은 UI 레이아웃, 스페이싱, 프레임 조정 및 토글 로직 개선으로 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/#151-treatmentqa

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

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

Caution

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

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

10-24: 버튼 순서가 PR 목표와 일치하지 않을 수 있습니다.

PR 목표에 "버튼 순서("네, 있어요" / "아직 없어요") 교정"이라고 명시되어 있습니다. 현재 DdayState enum에서 no가 먼저 선언되어 있어 ForEach(DdayState.allCases, ...)가 "아직 없어요"를 먼저 표시합니다.

의도된 순서가 "네, 있어요" → "아직 없어요"라면 enum case 순서를 변경해야 합니다:

🔧 수정 제안
 enum DdayState: CaseIterable {
-    case no
     case yes
+    case no
     var id: Self { self }
Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentFilterView.swift (1)

67-71: 중첩된 Task 제거 및 에러 처리 개선 필요.

.task 수정자는 이미 async 컨텍스트를 제공하므로 내부 Task는 불필요합니다. 또한 try로 던져진 에러가 처리되지 않고 무시됩니다.

🐛 수정 제안
         .task {
-            Task {
-                try await viewModel.fetchTreatments()
-            }
+            do {
+                try await viewModel.fetchTreatments()
+            } catch {
+                CherrishLogger.error(error)
+            }
         }
🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/SelectTreatment/SelectTreatmentView.swift`:
- Around line 72-90: The diff shows unnecessary blank lines inside the
SelectTreatmentView SwiftUI layout (inside the HStack/VStack block) which reduce
readability; remove the extra empty lines between the VStack children (around
the TypographyText and Spacer entries) so the VStack contents are compact and
consistently formatted, leaving the existing frames, alignment, and spacers
(references: HStack, VStack, TypographyText calls and Spacer) untouched.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift`:
- Line 95: Remove the unnecessary extra whitespace inside the frame modifier
call in NoTreatmentFilterView (the line using .frame(height: 105.adjustedH   
)), i.e., fix the .frame(height: ...) invocation so there are no trailing spaces
between the value and the closing parenthesis; update the .frame call in
NoTreatmentFilterView.swift accordingly.
- Around line 17-18: Remove the unused commented Spacer lines in
NoTreatmentFilterView.swift (the two lines "//            Spacer()" and "//     
.frame(height: 18.adjustedH)") to clean up dead/commented-out code; simply
delete these commented lines from the NoTreatmentFilterView Swift view (e.g.,
around where Spacer() was commented) so the file contains only active, relevant
UI code.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/SelectedTreatmentSheetView.swift`:
- Line 27: The `@State` variable scrollTargetID in SelectedTreatmentSheetView is
declared but never used; either remove the declaration or implement the intended
scrolling behavior: if unused, delete the line declaring scrollTargetID to avoid
dead state, otherwise wire it into your ScrollViewReader (or SwiftUI scrolling
logic) by giving list items identifiable IDs, update scrollTargetID when
selecting an item, and call proxy.scrollTo(scrollTargetID) (e.g., inside
onChange(of: scrollTargetID) or when presenting the sheet) so the view actually
scrolls to the targeted UUID; reference the scrollTargetID symbol and the
SelectedTreatmentSheetView body/ScrollViewReader when making the change.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/Treatment/TreatmentRowView.swift`:
- Around line 74-76: Duplicate downtime formatting exists in
TreatmentSummaryView and DownTimeLabel; extract it into a computed property on
TreatmentEntity named downtimeDisplayText. Add an extension or property on
TreatmentEntity that returns "다운타임* 0일" when downtimeMin == 0 && downtimeMax ==
0, otherwise "다운타임*  \(downtimeMin)-\(downtimeMax)일", then replace the inline
logic in TreatmentSummaryView and DownTimeLabel to use
treatmentEntity.downtimeDisplayText.

Comment on lines +72 to 90
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 0){

TypographyText("시술 일정을 추가해볼게요.", style: .title1_sb_18, color: .gray1000)
.frame(height: 27.adjustedH)
TypographyText("이미 생각해둔 시술이 있나요?", style: .title1_sb_18, color: .gray1000)
.frame(height: 27.adjustedH)



Spacer()
.frame(height: 4.adjustedH)
TypographyText("시술을 선택하셨는지 확인할게요.", style: .body1_r_14, color: .gray700)

.frame(height: 20.adjustedH)
}
.frame(height: 78.adjustedH)
Spacer()
}
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

레이아웃 구조가 명확합니다

명시적인 높이 프레임을 사용하여 일관된 레이아웃을 구현했습니다. 코드 내 불필요한 빈 줄(74, 79-80행)을 정리하면 가독성이 향상됩니다.

♻️ 코드 정리 제안
     private var titleView: some View {
         HStack(spacing: 0) {
             VStack(alignment: .leading, spacing: 0){
-
                     TypographyText("시술 일정을 추가해볼게요.", style: .title1_sb_18, color: .gray1000)
                         .frame(height: 27.adjustedH)
                     TypographyText("이미 생각해둔 시술이 있나요?", style: .title1_sb_18, color: .gray1000)
                         .frame(height: 27.adjustedH)
-            
-               
-                
                 Spacer()
                     .frame(height: 4.adjustedH)
                 TypographyText("시술을 선택하셨는지 확인할게요.", style: .body1_r_14, color: .gray700)
                     .frame(height: 20.adjustedH)
             }
             .frame(height: 78.adjustedH)
             Spacer()
         }
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 0){
TypographyText("시술 일정을 추가해볼게요.", style: .title1_sb_18, color: .gray1000)
.frame(height: 27.adjustedH)
TypographyText("이미 생각해둔 시술이 있나요?", style: .title1_sb_18, color: .gray1000)
.frame(height: 27.adjustedH)
Spacer()
.frame(height: 4.adjustedH)
TypographyText("시술을 선택하셨는지 확인할게요.", style: .body1_r_14, color: .gray700)
.frame(height: 20.adjustedH)
}
.frame(height: 78.adjustedH)
Spacer()
}
}
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 0){
TypographyText("시술 일정을 추가해볼게요.", style: .title1_sb_18, color: .gray1000)
.frame(height: 27.adjustedH)
TypographyText("이미 생각해둔 시술이 있나요?", style: .title1_sb_18, color: .gray1000)
.frame(height: 27.adjustedH)
Spacer()
.frame(height: 4.adjustedH)
TypographyText("시술을 선택하셨는지 확인할게요.", style: .body1_r_14, color: .gray700)
.frame(height: 20.adjustedH)
}
.frame(height: 78.adjustedH)
Spacer()
}
}
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/SelectTreatment/SelectTreatmentView.swift`
around lines 72 - 90, The diff shows unnecessary blank lines inside the
SelectTreatmentView SwiftUI layout (inside the HStack/VStack block) which reduce
readability; remove the extra empty lines between the VStack children (around
the TypographyText and Spacer entries) so the VStack contents are compact and
consistently formatted, leaving the existing frames, alignment, and spacers
(references: HStack, VStack, TypographyText calls and Spacer) untouched.

.gray500()
}
.frame(height: 105)
.frame(height: 105.adjustedH )
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

불필요한 공백 제거

frame 수정자 내에 불필요한 공백이 있습니다.

♻️ 제안된 수정
-        .frame(height: 105.adjustedH    )
+        .frame(height: 105.adjustedH)
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift`
at line 95, Remove the unnecessary extra whitespace inside the frame modifier
call in NoTreatmentFilterView (the line using .frame(height: 105.adjustedH   
)), i.e., fix the .frame(height: ...) invocation so there are no trailing spaces
between the value and the closing parenthesis; update the .frame call in
NoTreatmentFilterView.swift accordingly.

Comment on lines +74 to +76
treatmentEntity.downtimeMin == 0 && treatmentEntity.downtimeMax == 0 ?
"다운타임* 0일" :
"다운타임* \(treatmentEntity.downtimeMin)-\(treatmentEntity.downtimeMax)",
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

다운타임 표시 로직 중복 — 헬퍼 함수 추출 권장.

동일한 다운타임 문자열 포맷팅 로직이 TreatmentSummaryView(라인 74-76)와 DownTimeLabel(라인 188-190)에 중복되어 있습니다. TreatmentEntity의 computed property로 추출하면 유지보수성이 향상됩니다.

♻️ TreatmentEntity extension 추가 제안
// TreatmentEntity+Extension.swift 또는 해당 모델 파일에 추가
extension TreatmentEntity {
    var downtimeDisplayText: String {
        if downtimeMin == 0 && downtimeMax == 0 {
            return "다운타임* 0일"
        }
        return "다운타임*  \(downtimeMin)-\(downtimeMax)"
    }
}

사용 예시:

 TypographyText(
-    treatmentEntity.downtimeMin == 0 && treatmentEntity.downtimeMax == 0 ?
-    "다운타임* 0일" :
-    "다운타임*  \(treatmentEntity.downtimeMin)-\(treatmentEntity.downtimeMax)일",
+    treatmentEntity.downtimeDisplayText,
     style: .body1_r_14,
     color: .gray700
 )
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/Treatment/TreatmentRowView.swift`
around lines 74 - 76, Duplicate downtime formatting exists in
TreatmentSummaryView and DownTimeLabel; extract it into a computed property on
TreatmentEntity named downtimeDisplayText. Add an extension or property on
TreatmentEntity that returns "다운타임* 0일" when downtimeMin == 0 && downtimeMax ==
0, otherwise "다운타임*  \(downtimeMin)-\(downtimeMax)일", then replace the inline
logic in TreatmentSummaryView and DownTimeLabel to use
treatmentEntity.downtimeDisplayText.

Copy link
Contributor

@soseoyo12 soseoyo12 left a comment

Choose a reason for hiding this comment

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

수고하셨숨니당

@y-eonee y-eonee changed the title Fix/#151 treatmentqa Fix/#151 QA 반영 Jan 22, 2026
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.

수고하셨슴당
IMG_6276

@y-eonee y-eonee added 재선🐻 Fix 버그 수정 labels Jan 22, 2026
Copy link
Contributor

@sum130 sum130 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 17 to 18
// Spacer()
// .frame(height: 18.adjustedH)
Copy link
Contributor

Choose a reason for hiding this comment

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

주석 지워줍시다!

.allowsHitTesting(false)
}

// 스크롤 앵커용 더미 뷰
Copy link
Contributor

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

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)

69-73: .task 내부의 중복 Task 래퍼 제거 권장

.task 수정자는 이미 비동기 컨텍스트를 제공하므로 내부에 Task { } 래퍼가 불필요합니다. 또한 에러가 발생해도 처리되지 않습니다.

♻️ 제안된 수정
         .task {
-            Task {
-                try await viewModel.fetchTreatments()
-            }
+            do {
+                try await viewModel.fetchTreatments()
+            } catch {
+                // 에러 처리 로직 추가 필요
+            }
         }
🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift`:
- Around line 38-39: Replace the magic number 198.adjustedH used in the Spacer
frame with a named constant (e.g., bottomSheetSpacing or keyboardInset) declared
near the top of NoTreatmentFilterView or in a dedicated ViewConstants struct and
add a one-line comment explaining the intent (e.g., "spacing to account for
bottom sheet/keyboard inset"); update the Spacer to use that constant (preserve
.adjustedH application if needed) so the purpose is clear and maintainable.
- Around line 26-33: The action closure contains an unnecessary blank line after
viewModel.addTreatment(treatment); remove that extra empty line so the toggle
logic using viewModel.isSelected(treatment),
viewModel.removeTreatment(treatment), and viewModel.addTreatment(treatment) is
compact and consistent; update the closure in NoTreatmentFilterView's action
block to eliminate the stray blank line.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentView.swift`:
- Around line 82-90: Remove the redundant state check inside NoTreatmentView's
overlay: since this block is already in the .treatmentFilter case, drop the
`viewModel.state == .treatmentFilter` condition and only check
`!viewModel.selectedTreatments.isEmpty` before showing
SelectedTreatmentSheetView; locate the overlay code in NoTreatmentView.swift
where SelectedTreatmentSheetView is created (references: viewModel.state,
.treatmentFilter, SelectedTreatmentSheetView, selectedTreatments,
removeTreatment) and simplify the conditional accordingly.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/SelectedTreatmentSheetView.swift`:
- Around line 70-71: Move the horizontal padding from the ForEach container to
each row: remove the .padding(.horizontal, 24.5.adjustedW) applied after the
ForEach in SelectedTreatmentSheetView and instead apply .padding(.horizontal,
24.5.adjustedW) directly to each TreatmentRowView instance inside the ForEach
(same pattern as NoTreatmentFilterView); update the ForEach content where
TreatmentRowView is created so each row receives the padding individually and
ensure no leftover container padding remains.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentFilterView.swift`:
- Around line 64-65: 해당 매직 넘버는 TreatmentFilterView의 Spacer 높이(198.adjustedH)로
SelectedTreatmentSheetView 오버레이 공간을 예약하는 용도이므로 198.adjustedH를 하드코딩된 리터럴로 두지 말고
상수로 추출하거나 SelectedTreatmentSheetView의 시트 높이와 연동하세요; 예를 들어 TreatmentFilterView 내에
private enum Layout { static let selectedSheetHeight = ... } 또는
SelectedTreatmentSheetView에서 public static let sheetHeight을 제공한 뒤
Spacer().frame(height: SelectedTreatmentSheetView.sheetHeight.adjustedH)처럼 참조하도록
변경해 유지보수성을 개선하세요.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentView.swift`:
- Around line 77-85: 현재 TreatmentView contains an overlay that checks
viewModel.state == .treatmentFilter even though this view is already inside the
.treatmentFilter case, causing a redundant condition and duplicating the same
overlay pattern found in NoTreatmentView; remove the redundant state check and
extract the overlay into a shared component (e.g., a ViewModifier or a small
reusable view) that wraps SelectedTreatmentSheetView (use
viewModel.selectedTreatments and viewModel.removeTreatment(_:) as the public
API) so both TreatmentView and NoTreatmentView can reuse the same overlay logic.
♻️ Duplicate comments (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift (1)

95-95: 불필요한 공백 제거 필요

frame 수정자 내에 불필요한 공백이 여전히 존재합니다. 이전 리뷰에서 지적된 사항입니다.

♻️ 제안된 수정
-        .frame(height: 105.adjustedH    )
+        .frame(height: 105.adjustedH)

Comment on lines +26 to +33
action: {
if viewModel.isSelected(treatment) {
viewModel.removeTreatment(treatment)
} else {
viewModel.addTreatment(treatment)

}
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

토글 로직 구현이 적절합니다.

ViewModel의 isSelected, addTreatment, removeTreatment 메서드를 활용한 선택/해제 토글 로직이 올바르게 구현되어 있습니다.

다만, 31번 줄에 불필요한 빈 줄이 있어 정리하면 좋겠습니다.

♻️ 제안된 수정
                         action: {
                             if viewModel.isSelected(treatment) {
                                 viewModel.removeTreatment(treatment)
                             } else {
                                 viewModel.addTreatment(treatment)
-                                
                             }   
                         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
action: {
if viewModel.isSelected(treatment) {
viewModel.removeTreatment(treatment)
} else {
viewModel.addTreatment(treatment)
}
}
action: {
if viewModel.isSelected(treatment) {
viewModel.removeTreatment(treatment)
} else {
viewModel.addTreatment(treatment)
}
}
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift`
around lines 26 - 33, The action closure contains an unnecessary blank line
after viewModel.addTreatment(treatment); remove that extra empty line so the
toggle logic using viewModel.isSelected(treatment),
viewModel.removeTreatment(treatment), and viewModel.addTreatment(treatment) is
compact and consistent; update the closure in NoTreatmentFilterView's action
block to eliminate the stray blank line.

Comment on lines +38 to +39
Spacer()
.frame(height: 198.adjustedH)
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

매직 넘버에 대한 설명 추가 권장

198.adjustedH 값의 의도가 명확하지 않습니다. 이 값이 특정 UI 요소(예: 하단 시트, 키보드 등)와의 간격을 위한 것이라면 상수로 추출하거나 주석을 추가하여 의도를 명확히 하면 유지보수에 도움이 됩니다.

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift`
around lines 38 - 39, Replace the magic number 198.adjustedH used in the Spacer
frame with a named constant (e.g., bottomSheetSpacing or keyboardInset) declared
near the top of NoTreatmentFilterView or in a dedicated ViewConstants struct and
add a one-line comment explaining the intent (e.g., "spacing to account for
bottom sheet/keyboard inset"); update the Spacer to use that constant (preserve
.adjustedH application if needed) so the purpose is clear and maintainable.

Comment on lines +82 to +90
.overlay(alignment: .bottom) {
if viewModel.state == .treatmentFilter, !viewModel.selectedTreatments.isEmpty {
SelectedTreatmentSheetView(
selectedTreatments: viewModel.selectedTreatments,
removeTreatment: viewModel.removeTreatment(_:)
)

}
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

중복 상태 체크 제거 권장

case .treatmentFilter: 내에서 viewModel.state == .treatmentFilter 조건은 항상 true이므로 불필요합니다.

♻️ 제안된 수정
             NoTreatmentFilterView(viewModel: viewModel)
                 .overlay(alignment: .bottom) {
-                    if viewModel.state == .treatmentFilter, !viewModel.selectedTreatments.isEmpty {
+                    if !viewModel.selectedTreatments.isEmpty {
                         SelectedTreatmentSheetView(
                             selectedTreatments: viewModel.selectedTreatments,
                             removeTreatment: viewModel.removeTreatment(_:)
                         )
-                    
                     }
                 }
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentView.swift`
around lines 82 - 90, Remove the redundant state check inside NoTreatmentView's
overlay: since this block is already in the .treatmentFilter case, drop the
`viewModel.state == .treatmentFilter` condition and only check
`!viewModel.selectedTreatments.isEmpty` before showing
SelectedTreatmentSheetView; locate the overlay code in NoTreatmentView.swift
where SelectedTreatmentSheetView is created (references: viewModel.state,
.treatmentFilter, SelectedTreatmentSheetView, selectedTreatments,
removeTreatment) and simplify the conditional accordingly.

Comment on lines +70 to +71
}
.padding(.horizontal, 24.5.adjustedW)
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

find . -name "SelectedTreatmentSheetView.swift" -type f

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 175


🏁 Script executed:

# Check the context around lines 70-71 in the file
sed -n '60,80p' Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/SelectedTreatmentSheetView.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1132


🏁 Script executed:

# Run the verification script to check padding patterns with TreatmentRowView
rg -n "TreatmentRowView" --type swift -A 5 -B 5

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 8805


🏁 Script executed:

# Check padding application in DownTimeSettingView
sed -n '30,50p' Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/DownTimeSettingView.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1016


🏁 Script executed:

# Check padding application in TreatmentFilterView
sed -n '45,65p' Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentFilterView.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1036


🏁 Script executed:

# Check padding application in NoTreatmentFilterView
sed -n '15,35p' Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/NoTreatment/NoTreatmentFilterView.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1042


TreatmentRowView에 개별 패딩 적용 권장

.padding(.horizontal, 24.5.adjustedW)ForEach 전체에 적용하는 대신, NoTreatmentFilterView에서 사용하는 패턴처럼 각 TreatmentRowView에 직접 적용하는 것이 더 명확합니다. 이렇게 하면 각 행이 독립적으로 패딩을 받으며 코드의 의도가 더 분명해집니다.

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/SelectedTreatmentSheetView.swift`
around lines 70 - 71, Move the horizontal padding from the ForEach container to
each row: remove the .padding(.horizontal, 24.5.adjustedW) applied after the
ForEach in SelectedTreatmentSheetView and instead apply .padding(.horizontal,
24.5.adjustedW) directly to each TreatmentRowView instance inside the ForEach
(same pattern as NoTreatmentFilterView); update the ForEach content where
TreatmentRowView is created so each row receives the padding individually and
ensure no leftover container padding remains.

Comment on lines +64 to +65
Spacer()
.frame(height: 198.adjustedH)
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

매직 넘버 상수화 권장

198.adjustedHSelectedTreatmentSheetView 오버레이 공간을 위한 것으로 보입니다. 이 값을 상수로 추출하거나 시트 높이와 연동하면 유지보수성이 향상됩니다.

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentFilterView.swift`
around lines 64 - 65, 해당 매직 넘버는 TreatmentFilterView의 Spacer 높이(198.adjustedH)로
SelectedTreatmentSheetView 오버레이 공간을 예약하는 용도이므로 198.adjustedH를 하드코딩된 리터럴로 두지 말고
상수로 추출하거나 SelectedTreatmentSheetView의 시트 높이와 연동하세요; 예를 들어 TreatmentFilterView 내에
private enum Layout { static let selectedSheetHeight = ... } 또는
SelectedTreatmentSheetView에서 public static let sheetHeight을 제공한 뒤
Spacer().frame(height: SelectedTreatmentSheetView.sheetHeight.adjustedH)처럼 참조하도록
변경해 유지보수성을 개선하세요.

Comment on lines +77 to +85
.overlay(alignment: .bottom) {
if viewModel.state == .treatmentFilter, !viewModel.selectedTreatments.isEmpty {
SelectedTreatmentSheetView(
selectedTreatments: viewModel.selectedTreatments,
removeTreatment: viewModel.removeTreatment(_:)
)

}
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

중복 상태 체크 및 코드 중복 개선 권장

  1. case .treatmentFilter: 내에서 viewModel.state == .treatmentFilter 조건이 중복됩니다.
  2. NoTreatmentView.swift의 Lines 82-90과 동일한 오버레이 패턴이 반복됩니다.
♻️ 중복 조건 제거
             TreatmentFilterView(viewModel: viewModel)
                 .overlay(alignment: .bottom) {
-                    if viewModel.state == .treatmentFilter, !viewModel.selectedTreatments.isEmpty {
+                    if !viewModel.selectedTreatments.isEmpty {
                         SelectedTreatmentSheetView(
                             selectedTreatments: viewModel.selectedTreatments,
                             removeTreatment: viewModel.removeTreatment(_:)
                         )
-                    
                     }
                 }

향후 오버레이 로직을 ViewModifier 또는 공통 컴포넌트로 추출하면 TreatmentViewNoTreatmentView 간 중복을 줄일 수 있습니다.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.overlay(alignment: .bottom) {
if viewModel.state == .treatmentFilter, !viewModel.selectedTreatments.isEmpty {
SelectedTreatmentSheetView(
selectedTreatments: viewModel.selectedTreatments,
removeTreatment: viewModel.removeTreatment(_:)
)
}
}
.overlay(alignment: .bottom) {
if !viewModel.selectedTreatments.isEmpty {
SelectedTreatmentSheetView(
selectedTreatments: viewModel.selectedTreatments,
removeTreatment: viewModel.removeTreatment(_:)
)
}
}
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/View/Treatment/TreatmentView.swift`
around lines 77 - 85, 현재 TreatmentView contains an overlay that checks
viewModel.state == .treatmentFilter even though this view is already inside the
.treatmentFilter case, causing a redundant condition and duplicating the same
overlay pattern found in NoTreatmentView; remove the redundant state check and
extract the overlay into a shared component (e.g., a ViewModifier or a small
reusable view) that wraps SelectedTreatmentSheetView (use
viewModel.selectedTreatments and viewModel.removeTreatment(_:) as the public
API) so both TreatmentView and NoTreatmentView can reuse the same overlay logic.

@y-eonee y-eonee merged commit c2cedcf into develop Jan 22, 2026
7 checks passed
@y-eonee y-eonee deleted the fix/#151-treatmentqa branch January 22, 2026 08:32
@coderabbitai coderabbitai bot mentioned this pull request Jan 22, 2026
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] QA 반영

5 participants