Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(desktop-app): rewind the onboarding wizard once an environment exists

Andy Pavia525ea275dfcc
diff --git a/desktop-app/ui/src/hooks/domain/__tests__/useOnboardingController.test.tsx b/desktop-app/ui/src/hooks/domain/__tests__/useOnboardingController.test.tsx
index 093152f7f..717c7f3d9 100644
--- a/desktop-app/ui/src/hooks/domain/__tests__/useOnboardingController.test.tsx
+++ b/desktop-app/ui/src/hooks/domain/__tests__/useOnboardingController.test.tsx
@@ -36,8 +36,6 @@ describe('useOnboardingController', () => {
it('sends "just getting started" to Q2, where hosting is offered', () => {
const { result } = renderHook(() => useOnboardingController())
- expect(result.current.hostedAvailable).toBe(true)
-
act(() => result.current.answerOrigin('gettingStarted'))
expect(result.current.step).toBe('runStyle')
diff --git a/desktop-app/ui/src/hooks/domain/useOnboardingController.ts b/desktop-app/ui/src/hooks/domain/useOnboardingController.ts
index 87c624215..3606d9432 100644
--- a/desktop-app/ui/src/hooks/domain/useOnboardingController.ts
+++ b/desktop-app/ui/src/hooks/domain/useOnboardingController.ts
@@ -76,7 +76,6 @@ export function useOnboardingController(): OnboardingViewModel {
() => ({
step: state.step,
canGoBack: state.history.length > 0,
- hostedAvailable: HOSTED_SIGNUP_AVAILABLE,
answerOrigin,
answerRunStyle,
goToManual,
diff --git a/desktop-app/ui/src/hooks/useAppController.ts b/desktop-app/ui/src/hooks/useAppController.ts
index 7a9172827..74a0bb5f4 100644
--- a/desktop-app/ui/src/hooks/useAppController.ts
+++ b/desktop-app/ui/src/hooks/useAppController.ts
@@ -180,6 +180,14 @@ export function useAppController() {
runtimeConfigMissing: auth.runtimeConfigMissing,
isAuthenticated: auth.isAuthenticated,
})
+ // The controller is app-level, so wizard state outlives the wizard itself.
+ // Once an environment exists the run is finished: rewind to Q1, so deleting
+ // that environment later reopens onboarding at the first question instead of
+ // the step of a path the user already left.
+ const resetOnboarding = onboarding.reset
+ useEffect(() => {
+ if (!auth.runtimeConfigMissing) resetOnboarding()
+ }, [auth.runtimeConfigMissing, resetOnboarding])
// ─── First-screen data contexts ───
const agentsData = useAgentsDataController()
diff --git a/desktop-app/ui/src/pages/OnboardingPage/types.ts b/desktop-app/ui/src/pages/OnboardingPage/types.ts
index dee61d977..0edd86070 100644
--- a/desktop-app/ui/src/pages/OnboardingPage/types.ts
+++ b/desktop-app/ui/src/pages/OnboardingPage/types.ts
@@ -30,8 +30,6 @@ export interface OnboardingViewModel {
step: OnboardingStep
/** False on the first step, which uses Q1's "I have a server address" as its skip. */
canGoBack: boolean
- /** Whether Q2 is part of the flow. False until the hosted project exists. */
- hostedAvailable: boolean
answerOrigin: (answer: OnboardingOriginAnswer) => void
answerRunStyle: (answer: OnboardingRunStyleAnswer) => void
goToManual: () => void