refactor(wizard): show all steps at once with validation gating
- Replace progressive reveal with single fade-in of all steps - Add canPlanTrip validation requiring all fields before planning - Disable Plan Trip button until all selections are made - Simplify ViewModel by removing step-by-step visibility logic - Update tests for new validation-based approach Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ struct ReviewStep: View {
|
||||
let allowRepeatCities: Bool
|
||||
let mustStopLocations: [LocationInput]
|
||||
let isPlanning: Bool
|
||||
let canPlanTrip: Bool
|
||||
let onPlan: () -> Void
|
||||
|
||||
var body: some View {
|
||||
@@ -55,11 +56,11 @@ struct ReviewStep: View {
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(Theme.Spacing.md)
|
||||
.background(Theme.warmOrange)
|
||||
.background(canPlanTrip ? Theme.warmOrange : Theme.textMuted(colorScheme))
|
||||
.foregroundStyle(.white)
|
||||
.clipShape(RoundedRectangle(cornerRadius: Theme.CornerRadius.large))
|
||||
}
|
||||
.disabled(isPlanning)
|
||||
.disabled(!canPlanTrip || isPlanning)
|
||||
}
|
||||
.padding(Theme.Spacing.lg)
|
||||
.background(Theme.cardBackground(colorScheme))
|
||||
@@ -113,6 +114,7 @@ private struct ReviewRow: View {
|
||||
allowRepeatCities: false,
|
||||
mustStopLocations: [],
|
||||
isPlanning: false,
|
||||
canPlanTrip: true,
|
||||
onPlan: {}
|
||||
)
|
||||
.padding()
|
||||
|
||||
Reference in New Issue
Block a user