← Back to PRs

#7762: feat: add 'go back' navigation to onboarding wizard

by SalimBinYousuf1 open 2026-02-03 05:41 View on GitHub →
stale
This PR implements a robust 'go back' feature for the onboarding process. ### Key Improvements: - **State-Machine Navigation**: Refactored the linear onboarding flow into a step-based loop, allowing for seamless backward and forward movement. - **User Guidance**: Added a 'Go Back' option to selection menus and a ':back' command for text inputs, making it easy for users to correct mistakes (e.g., if they accidentally skip the API key step). - **Robustness**: The implementation ensures that state is correctly managed when moving between steps, preventing configuration corruption. This addresses the user feedback regarding the lack of navigation options during the installation/onboarding process. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a “go back” capability to the onboarding wizard by introducing a `WIZARD_BACK` sentinel, plumbs `allowBack` through prompt parameter types, and updates the clack prompter to expose “Go Back” in selects and a `:back` escape hatch in text inputs. The onboarding flow itself was refactored into a step-based loop/state-machine to support backwards navigation across early steps. Main concerns are around type-safety and completeness of the navigation behavior: `WizardProgress.stop` was narrowed to require a message (likely breaking existing callers), the new flow relies on several `any`/`as any` casts that can mask real bugs around handling `WIZARD_BACK`, and back navigation is only supported through some steps (later steps always advance). <h3>Confidence Score: 2/5</h3> - This PR is not safe to merge as-is due to a likely breaking type change and several type-safety regressions around the new back-navigation sentinel. - The onboarding refactor is substantial, and `WizardProgress.stop` was narrowed to require a message, which is likely to break existing call sites. Additionally, several `any`/`as any` casts reduce confidence that all `WIZARD_BACK` paths are handled correctly, and back navigation is inconsistent across steps. - src/wizard/prompts.ts (progress type change), src/wizard/onboarding.ts (state machine + any casts), src/wizard/clack-prompter.ts (typed back option injection) <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs