-
Notifications
You must be signed in to change notification settings - Fork 0
fix/ #164 QA 수정 완료 #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/ #164 QA 수정 완료 #165
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,19 +9,31 @@ import SwiftUI | |
|
|
||
| struct TreatmentFilterView: View { | ||
| @ObservedObject var viewModel: TreatmentViewModel | ||
|
|
||
| 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 | ||
| } | ||
|
Comment on lines
+13
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 18-21에서 이미 🔧 제안 수정안- 24.adjustedH : scrollViewHeight.adjustedH + 24.adjustedH
+ 24.adjustedH : scrollViewHeight + 24.adjustedHAlso applies to: 78-81 🤖 Prompt for AI Agents |
||
|
|
||
| var body: some View { | ||
| VStack(spacing: 0) { | ||
| TreatmentSearchBarTextField( | ||
| text: $viewModel.searchText, | ||
| onTap: { | ||
| Task { | ||
| try await viewModel.fetchTreatments() | ||
| try await viewModel.fetchTreatments() | ||
| } | ||
| }, | ||
| isDisabled: false | ||
| ) | ||
| .padding(.horizontal, 25.adjustedW) | ||
| .padding(.bottom, 8.adjustedH) | ||
| Spacer() | ||
| .frame(height: 8.adjustedH) | ||
| ScrollView(.vertical, showsIndicators: false) { | ||
| HStack(alignment: .top,spacing: 4) { | ||
| TypographyText("◎", style: .body3_r_12, color: .gray600) | ||
|
|
@@ -33,14 +45,15 @@ struct TreatmentFilterView: View { | |
| color: .gray600 | ||
| ) | ||
| .lineLimit(2) | ||
|
|
||
| } | ||
|
|
||
| Spacer() | ||
|
|
||
| } | ||
| .frame(height: 34.adjustedH) | ||
| .padding(.horizontal, 25.adjustedW) | ||
|
|
||
| Spacer() | ||
| .frame(height: 20.adjustedH) | ||
|
|
||
| if viewModel.treatments.isEmpty { | ||
| Spacer() | ||
| .frame(height: 148.adjustedH) | ||
|
|
@@ -62,7 +75,10 @@ struct TreatmentFilterView: View { | |
| .padding(.horizontal, 24.adjustedW) | ||
| } | ||
| Spacer() | ||
| .frame(height: 198.adjustedH) | ||
| .frame( | ||
| height: viewModel.selectedTreatments.isEmpty ? | ||
| 24.adjustedH : scrollViewHeight.adjustedH + 24.adjustedH | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
@@ -71,7 +87,7 @@ struct TreatmentFilterView: View { | |
| try await viewModel.fetchTreatments() | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,6 +113,10 @@ final class NoTreatmentViewModel: ObservableObject{ | |
| } | ||
|
|
||
| func isDateTextFieldNotEmpty() -> Bool { | ||
| guard let scheduledDate = calendarTreatmentFlowState.selectedDate else { | ||
| return false | ||
| } | ||
|
|
||
| guard !year.isEmpty, !month.isEmpty, !day.isEmpty else { | ||
| Task { @MainActor in | ||
| updateWarning(state: .none) | ||
|
|
@@ -133,14 +137,28 @@ final class NoTreatmentViewModel: ObservableObject{ | |
| return false | ||
| } | ||
|
|
||
|
|
||
| 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 | ||
| } | ||
|
Comment on lines
141
to
+156
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 도달 불가능한 분기 제거로 경고 로직 단순화 Line 149의 else는 🔧 제안 수정안- 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 |
||
| } | ||
|
|
||
| updateWarning(state: .none) | ||
| return true | ||
|
|
||
| } | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,10 @@ final class TreatmentViewModel: ObservableObject{ | |
| } | ||
|
|
||
| func isDateTextFieldNotEmpty() -> Bool { | ||
| guard let scheduledDate = calendarTreatmentFlowState.selectedDate else { | ||
| return false | ||
| } | ||
|
|
||
| guard !year.isEmpty, !month.isEmpty, !day.isEmpty else { | ||
| Task { @MainActor in | ||
| updateWarning(state: .none) | ||
|
|
@@ -124,14 +128,28 @@ final class TreatmentViewModel: ObservableObject{ | |
| return false | ||
| } | ||
|
|
||
|
|
||
| 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 | ||
| } | ||
|
Comment on lines
132
to
+147
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 도달 불가능한 분기 제거로 경고 로직 단순화 Line 140의 else는 🔧 제안 수정안- 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 |
||
| } | ||
|
|
||
| updateWarning(state: .none) | ||
| return true | ||
|
|
||
| } | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scrollViewHeight이중 스케일링 가능성Line 19-21에서
adjustedH가 이미 적용된 값을 계산하고 있는데, Line 53에서scrollViewHeight.adjustedH를 다시 적용하고 있습니다.adjustedH가 스케일링이라면 높이가 과대 계산될 수 있으니 한 번만 적용해주세요.🔧 제안 수정안
Also applies to: 51-54
🤖 Prompt for AI Agents