Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ struct EggSceneView: View {
if progress > 0 {
scene.setCrackProgress(progress, animated: false)
}
// Resume full hatch if restored at step 7 (Alive)
if state.currentStep == 7 {
// Resume full hatch if restored at step 5 (Alive)
if state.currentStep == 5 {
scene.triggerFullHatch()
}
}
.onChange(of: state.crackProgress) { _, newValue in
scene.setCrackProgress(newValue, animated: true)
}
.onChange(of: state.currentStep) { old, new in
if (4...6).contains(new) && new > old {
if (3...4).contains(new) && new > old {
scene.triggerDramaticCrack(for: new)
} else if new == 7 {
} else if new == 5 {
scene.triggerFullHatch()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ struct OnboardingStageImage: View {
@State private var displayedStage: Int = 1
@State private var isTransitioning = false

/// Maps onboarding step (0-7) to stage image number (1-5).
/// Maps onboarding step (0-5) to stage image number (1-5).
private var stageNumber: Int {
switch currentStep {
case 0, 1, 2: return 1
case 3: return 2
case 4, 5: return 3
case 6: return 4
default: return 5
case 0, 1: return 1
case 2: return 2
case 3: return 3
case 4: return 4
default: return 5
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ struct OnboardingFlowView: View {
.opacity(0.25)
.allowsHitTesting(false)

if state.currentStep <= 7 {
// Vertical card layout (steps 0-7)
if state.currentStep <= 5 {
// Vertical card layout (steps 0-5)
VStack(spacing: 0) {
// TOP: Meadow background + stage image
ZStack {
Expand All @@ -50,12 +50,8 @@ struct OnboardingFlowView: View {
case 3:
FnKeyStepView(state: state)
case 4:
SpeechPermissionStepView(state: state)
case 5:
AccessibilityPermissionStepView(state: state)
case 6:
ScreenPermissionStepView(state: state)
case 7:
case 5:
AliveStepView(
state: state,
onComplete: onComplete,
Expand Down Expand Up @@ -98,7 +94,7 @@ struct OnboardingFlowView: View {
.shadow(color: .black.opacity(0.4), radius: 24, y: 12)
.position(x: geometry.size.width / 2, y: geometry.size.height / 2)
} else {
// Step 8: Interview — manages its own layout
// Step 6: Interview — manages its own layout
InterviewStepView(
state: state,
daemonClient: daemonClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SwiftUI

/// Five cumulative progress dots for the onboarding flow.
///
/// By default maps 8 steps (0-7) to 5 dots. Pass a custom `totalSteps`
/// By default maps 6 steps (0-5) to 5 dots. Pass a custom `totalSteps`
/// for flows with a different number of steps (e.g. `totalSteps: 5` for
/// the first-meeting flow).
struct OnboardingProgressDots: View {
Expand All @@ -12,7 +12,7 @@ struct OnboardingProgressDots: View {

private let totalDots = 5

init(currentStep: Int, totalSteps: Int = 8) {
init(currentStep: Int, totalSteps: Int = 6) {
self.currentStep = currentStep
self.totalSteps = totalSteps
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ final class OnboardingState {
var observationDurationMinutes: Int = 5
var observationInsights: [String] = []

/// Only checks permissions that are requested during onboarding.
/// Microphone and screen recording are deferred to dashboard tasks.
var anyPermissionDenied: Bool {
!speechGranted || !accessibilityGranted || !screenGranted
!accessibilityGranted
}

/// Continuous crack progress (0.0–1.0) derived from step and permission state.
Expand All @@ -55,12 +57,10 @@ final class OnboardingState {
switch currentStep {
case 0: return hasHatched ? 0.15 : 0.0
case 1: return 0.20
case 2: return 0.30
case 3: return 0.40
case 4: return speechGranted ? 0.55 : 0.45
case 5: return accessibilityGranted ? 0.75 : 0.60
case 6: return screenGranted ? 0.95 : 0.80
case 7: return 1.0
case 2: return 0.40
case 3: return 0.55
case 4: return accessibilityGranted ? 0.80 : 0.65
case 5: return 1.0
default: return 1.0
}
}
Expand All @@ -86,9 +86,9 @@ final class OnboardingState {
firstMeetingCrackProgress = CGFloat(UserDefaults.standard.double(forKey: "onboarding.firstMeetingCrackProgress"))

// Clamp restored step to the variant's maximum to prevent out-of-range
// rendering (e.g. a step saved from the 8-step default flow would be
// invalid for the 5-step first-meeting flow).
let maxStep = onboardingVariant == .firstMeeting ? 4 : 7
// rendering (e.g. a step saved from a previous flow version would be
// invalid for the current flow).
let maxStep = onboardingVariant == .firstMeeting ? 4 : 5
if currentStep > maxStep {
currentStep = maxStep
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ struct DynamicPageSurfaceView: NSViewRepresentable {
}

func makeCoordinator() -> Coordinator {
<<<<<<< HEAD
Coordinator(onAction: onAction, onDataRequest: onDataRequest, onPageChanged: onPageChanged, onSnapshotCaptured: onSnapshotCaptured, currentHTML: data.html, sandboxMode: sandboxMode)
=======
Coordinator(onAction: onAction, onDataRequest: onDataRequest, onPageChanged: onPageChanged, onSnapshotCaptured: onSnapshotCaptured, onLinkOpen: onLinkOpen, currentHTML: data.html, sandboxMode: sandboxMode)
>>>>>>> 96cab3e0 (feat: add vellum.openLink JS bridge and coordinator handler)
}

func makeNSView(context: Context) -> WKWebView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ struct SurfaceContainerView: View {
appId: viewModel.appId,
onDataRequest: viewModel.onDataRequest,
onCoordinatorReady: viewModel.onCoordinatorReady,
sandboxMode: viewModel.sandboxMode,
onLinkOpen: viewModel.onLinkOpen
onLinkOpen: viewModel.onLinkOpen,
sandboxMode: viewModel.sandboxMode
)
.frame(maxWidth: .infinity, maxHeight: .infinity)
case .fileUpload(let data):
Expand Down