🤖 The AI Prompt That Checks a Multi-Step Wizard Form for State That Silently Gets Lost the Moment a User Navigates Back a Step
A multi-step wizard form usually keeps each step’s data in memory inside whichever component currently renders that step, which works perfectly as long as the user only ever moves forward, since each step mounts fresh, collects its own input, and hands the combined result off to whatever submits at the end. The moment a user clicks Back to review or change an earlier step, that step’s component has to either still exist with its previous values intact or be rebuilt from a value that was actually saved somewhere outside the component itself, and a wizard built without that second part quietly re-mounts the earlier step as blank, discarding whatever the user typed there even though the step after it, and the wizard’s own progress indicator, both still believe that step was completed.
🔎 The Prompt
You are reviewing a multi-step wizard form for state that gets lost when a user navigates backward through the steps. For the wizard implementation described below, check: 1. Where each step's field values actually live -- inside that step's own component state, in a shared parent or store that persists across steps, or nowhere at all beyond whatever the DOM currently holds. 2. What happens to a step's component, and its values, specifically when the user clicks Back: whether it stays mounted, gets rebuilt from a previously saved value, or gets rebuilt from nothing and silently resets to its defaults. 3. Whether the wizard's own completion indicator for a step gets reset to match that step's actual current values after going back and forward again, or keeps showing a step as complete even after its values were silently wiped out. 4. Any step whose fields depend on an earlier step's answer (a region dropdown that depends on a previously chosen country, for example), and whether going back to change that earlier answer correctly invalidates or refreshes the dependent step instead of leaving it showing options for an answer that no longer applies. --- WIZARD COMPONENT STRUCTURE AND STATE MANAGEMENT CODE --- <paste the wizard's step components and however state is passed or stored between them></paste>
✅ What This Prompt Catches
- A step component that initializes its input fields from empty defaults every time it mounts, with no check for a previously entered value, so clicking Back and then Next again silently shows that step as blank even though the user already filled it in once.
- A wizard that stores each step’s value only in that step’s own local component state with nothing lifted to a shared parent, so the framework fully discards the state the instant the step unmounts on navigation, with no error or warning that anything was lost.
- A progress indicator that marks a step as complete the first time its values pass validation and never re-checks that status afterward, so it keeps showing a checkmark for a step whose actual values were silently reset to blank several clicks ago.
🚨 Why This Is Dangerous
- This prompt can only point out where a wizard’s architecture makes silent state loss possible, it can’t run the exact click sequence a real user will take, so treat every flagged step as a reason to test that specific back-and-forward path by hand, not as proof the bug has already been confirmed to happen.
A wizard form that only ever tests moving forward is testing the one path through it that was never actually at risk, since every real user eventually clicks Back to fix something, and that’s exactly the path nobody built the state to survive.

