Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,22 @@ extension SelectTreatmentView {

@ViewBuilder
private var titleView: some View {
HStack {
VStack(alignment: .leading){
TypographyText("시술 일정을 추가해볼게요.", style: .title1_sb_18, color: .gray1000)

TypographyText("이미 생각해둔 시술이 있나요?", style: .title1_sb_18, color: .gray1000)
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()
}
}
Comment on lines +72 to 90
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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import SwiftUI

enum TreatmentSelectionState: CaseIterable {
case notSelected
case available
case notSelected

var title: String {
switch self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct DownTimeSettingView: View {
let today: (year: Int, month: Int, day: Int)

var body: some View {
VStack {
VStack(spacing: 0) {
Spacer()
.frame(height: 30.adjustedH)

Expand All @@ -30,9 +30,10 @@ struct DownTimeSettingView: View {
}
.padding(.horizontal, 25.adjustedW)
ScrollView(.vertical, showsIndicators: false) {
VStack {
Spacer()
.frame(height: 24.adjustedH)
Spacer()
.frame(height: 24.adjustedH)
VStack(spacing: 10) {

ForEach(treatments, id: \.self) { treatment in
TreatmentRowView(
displayMode: .completeBoxView,
Expand All @@ -48,42 +49,43 @@ struct DownTimeSettingView: View {
selectedTreatment = treatment
})
}
}
.padding(.horizontal, 25.adjustedW)
Spacer()
.frame(height: 14.adjustedH)

HStack(alignment: .top, spacing: 0) {
TypographyText(
"◎",
style: .body3_r_12,
color: .gray600
)

Spacer()
.frame(height: 14.adjustedH)

HStack(alignment: .top, spacing: 0) {
VStack(alignment: .leading, spacing: 0) {
TypographyText(
"",
"본 정보는 의료 상담이나 진단을 대체하지 않으며,",
style: .body3_r_12,
color: .gray600
)

VStack(alignment: .leading, spacing: 0) {
TypographyText(
"본 정보는 의료 상담이나 진단을 대체하지 않으며,",
style: .body3_r_12,
color: .gray600
)

TypographyText(
"실제 다운타임 및 회복 과정은 개인에 따라 다를 수 있습니다.",
style: .body3_r_12,
color: .gray600
)

TypographyText(
"정확한 내용은 의료진 상담을 통해 확인하세요.",
style: .body3_r_12,
color: .gray600
)

}
TypographyText(
"실제 다운타임 및 회복 과정은 개인에 따라 다를 수 있습니다.",
style: .body3_r_12,
color: .gray600
)

TypographyText(
"정확한 내용은 의료진 상담을 통해 확인하세요.",
style: .body3_r_12,
color: .gray600
)

Spacer()
}

Spacer()
}
.padding(.horizontal, 25.adjustedW)

}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,31 @@ struct NoTreatmentFilterView: View {
VStack(spacing: 0) {
TitleHeaderView(title: viewModel.selectedCategory?.title ?? "")

Spacer()
.frame(height: 10.adjustedH)

ScrollView(.vertical, showsIndicators: false){
Spacer()
.frame(height: 10.adjustedH)
.frame(height: 18.adjustedH)

ForEach(viewModel.treatments, id: \.id) { treatment in
TreatmentRowView(
displayMode: .checkBoxView,
treatmentEntity: treatment,
isSelected: .constant(viewModel.isSelected(treatment)),
action: { viewModel.addTreatment(treatment) }
action: {
if viewModel.isSelected(treatment) {
viewModel.removeTreatment(treatment)
} else {
viewModel.addTreatment(treatment)

}
}
Comment on lines +26 to +33
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.

)
.padding(.horizontal, 34.adjustedW)
.padding(.horizontal, 25.adjustedW)

}
Spacer()
.frame(height: 198.adjustedH)
Comment on lines +38 to +39
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.

}

}
.task {
await viewModel.fetchNoTreatments()
Expand All @@ -44,16 +51,16 @@ private struct TitleHeaderView: View {

var body: some View {
VStack(spacing: 4.adjustedH) {
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 6.adjustedW) {
TypographyText(title, style: .title1_sb_18, color: .gray1000)

.frame(height: 27.adjustedH)
TypographyText("관련 시술 리스트", style: .title1_sb_18, color: .gray1000)

.frame(height: 27.adjustedH)
Spacer()

}
.frame(height: 27.adjustedH)


HStack(spacing: 4.adjustedW) {
VStack {
Expand All @@ -62,20 +69,17 @@ private struct TitleHeaderView: View {
Spacer()

}
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 0) {
TypographyText("본 정보는 인터넷 빅테이터 검색 및 분석을 통해 수집된 정보이며, ", style: .body3_r_12, color: .gray600)

TypographyText("관련 시술 리스트", style: .body3_r_12, color: .gray600)

.frame(height: 17.adjustedH)
TypographyText("공식적인 의료 정보가 아닙니다.", style: .body3_r_12, color: .gray600)
.frame(height: 17.adjustedH)
}
.frame(height: 34.adjustedH)
}
}
.padding(.horizontal, 25.adjustedW)
.padding(.vertical, 20.adjustedH)

Spacer()

}
.background(Color.gray100)
.overlay(alignment: .top) {
Expand All @@ -88,7 +92,7 @@ private struct TitleHeaderView: View {
.frame(height: 1.adjustedH)
.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.


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ struct NoTreatmentView: View {

case .treatmentFilter:
NoTreatmentFilterView(viewModel: viewModel)
.overlay(alignment: .bottom) {
if viewModel.state == .treatmentFilter, !viewModel.selectedTreatments.isEmpty {
SelectedTreatmentSheetView(
selectedTreatments: viewModel.selectedTreatments,
removeTreatment: viewModel.removeTreatment(_:)
)

}
}
Comment on lines +82 to +90
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.


case .downTimeSetting:
DownTimeSettingView(
Expand All @@ -101,13 +110,6 @@ struct NoTreatmentView: View {
@ViewBuilder
private func bottomView() -> some View {
VStack(spacing: 0) {
if viewModel.state == .treatmentFilter, !viewModel.selectedTreatments.isEmpty {
SelectedTreatmentSheetView(
selectedTreatments: viewModel.selectedTreatments,
removeTreatment: viewModel.removeTreatment(_:)
)
}

CherrishButton(
title: "다음",
type: .large,
Expand Down Expand Up @@ -157,28 +159,33 @@ private struct TreatmentSelectedCategory: View {
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_m_14,
color: .gray700
)
.frame(height: 20.adjustedH)

}
.frame(height: 78.adjustedH)

Spacer()
}
.padding(.horizontal, 34.adjustedW)
Spacer()
.frame(height: 40.adjustedH)

ScrollView(.vertical, showsIndicators:false) {
Spacer()
.frame(height: 40.adjustedH)
LazyVGrid(columns: columns, spacing: 12.adjustedH) {
ForEach(viewModel.categories, id: \.id) { category in
SelectionChip(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,45 @@ struct SelectedTreatmentSheetView: View {
y: -5
)
ZStack {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: spacing) {
if selectedTreatments.count > 3 {
scrollViewTopMarkerView
.allowsHitTesting(false)
}
ForEach(selectedTreatments, id: \.id) { treatment in
TreatmentRowView(
displayMode: .summary,
treatmentEntity: treatment,
isSelected: .constant(true),
action: { removeTreatment(treatment) }
)
.frame(height: itemHeight)
ScrollViewReader { proxy in
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: spacing) {
if selectedTreatments.count > 3 {
scrollViewTopMarkerView
.allowsHitTesting(false)
}
ForEach(selectedTreatments, id: \.id) { treatment in
TreatmentRowView(
displayMode: .summary,
treatmentEntity: treatment,
isSelected: .constant(true),
action: { removeTreatment(treatment) }
)
.id(treatment.id)
.frame(height: itemHeight)
}
.padding(.horizontal, 24.5.adjustedW)
Comment on lines +70 to +71
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.


if selectedTreatments.count > 3 {
scrollViewBottomMarkerView
.allowsHitTesting(false)
}

Color.clear
.frame(height: 1)
.id("scrollBottom")
}
if selectedTreatments.count > 3 {
scrollViewBottomMarkerView
.allowsHitTesting(false)
.padding(.vertical, 14.adjustedH)
}
.onChange(of: selectedTreatments.count) { oldCount, newCount in
if newCount > oldCount {
withAnimation {
proxy.scrollTo("scrollBottom", anchor: .bottom)
}
}
}
.padding(.vertical, 14.adjustedH)
}

if selectedTreatments.count > 3 {
GradientBox(isTop: true)
.frame(height: 42.adjustedH)
Expand All @@ -86,12 +103,10 @@ struct SelectedTreatmentSheetView: View {
.opacity(shouldShowGradientBottom ? 1 : 0)
.frame(maxHeight: .infinity, alignment: .bottom)
}



}
.background(.gray0)
.frame(height: scrollViewHeight)
.padding(.horizontal, 24.5.adjustedW)

.coordinateSpace(name: "SelectedTreatmentScroll")
.onPreferenceChange(ScrollTopPreferenceKey.self) { minY in
if initialTopGlobalY == nil { initialTopGlobalY = minY }
Expand All @@ -100,7 +115,9 @@ struct SelectedTreatmentSheetView: View {
.onPreferenceChange(ScrollBottomPreferenceKey.self) { height in
bottomOffsetY = height
}

}

}
}

Expand Down
Loading