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,21 +14,28 @@ struct NoTreatmentFilterView: View {
VStack(spacing: 0) {
TitleHeaderView(title: viewModel.selectedCategory?.title ?? "")

Spacer()
.frame(height: 10.adjustedH)
// 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.

주석 지워줍시다!


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)

}
}
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 @@ -157,28 +157,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 @@ -24,6 +24,7 @@ struct SelectedTreatmentSheetView: View {
@State private var topGlobalY: CGFloat = .zero
@State private var initialTopGlobalY: CGFloat? = nil
@State private var bottomOffsetY: CGFloat = .zero
@State private var scrollTargetID: UUID?

var body: some View {
VStack(spacing: 0) {
Expand Down Expand Up @@ -51,28 +52,44 @@ struct SelectedTreatmentSheetView: View {
y: -5
)
ZStack {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: spacing) {
if selectedTreatments.count > 3 {
scrollViewTopMarkerView
.allowsHitTesting(false)
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)
}
if selectedTreatments.count > 3 {
scrollViewBottomMarkerView
.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.

주석! 화긴해주세용~~

Color.clear
.frame(height: 1)
.id("scrollBottom")
}
ForEach(selectedTreatments, id: \.id) { treatment in
TreatmentRowView(
displayMode: .summary,
treatmentEntity: treatment,
isSelected: .constant(true),
action: { removeTreatment(treatment) }
)
.frame(height: itemHeight)
}
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,9 +103,6 @@ struct SelectedTreatmentSheetView: View {
.opacity(shouldShowGradientBottom ? 1 : 0)
.frame(maxHeight: .infinity, alignment: .bottom)
}



}
.frame(height: scrollViewHeight)
.padding(.horizontal, 24.5.adjustedW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import SwiftUI

enum DdayState: CaseIterable {
case yes
case no
case yes
var id: Self { self }

var title: String {
Expand Down Expand Up @@ -38,17 +38,14 @@ struct TargetDdaySettingView: 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: 54.adjustedH)

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

HStack(spacing: 12.adjustedW) {
ForEach(DdayState.allCases, id: \.self) { state in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
struct TreatmentFilterView: View {
@ObservedObject var viewModel: TreatmentViewModel
var body: some View {
VStack {
VStack(spacing: 0) {
TreatmentSearchBarTextField(
text: $viewModel.searchText,
onTap: {
Expand Down Expand Up @@ -51,7 +51,12 @@ struct TreatmentFilterView: View {
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)

} }
)
}
.padding(.horizontal, 24.adjustedW)
Expand Down
Loading