Sub topic 12
Tracking progress, skipping, and resuming
Earlier chapters covered which onboarding pattern to choose and how to write for it. This chapter covers the data underneath: what the app remembers about each user's onboarding, and how that memory lets people skip steps, leave, and come back.
This chapter assumes you can read basic TypeScript and know what a product analytics event is. It also assumes you have used a checklist or multi-step flow in an app.
Why onboarding needs state
A flow with no memory restarts every time. Imagine a user who finishes the welcome screen, gets interrupted by a phone call, and reopens the app an hour later. If they see the welcome screen again, they will probably leave.
Onboarding state is the record of what a user has done in the flow. It lets you do four things:
- Resume at the right step after the app closes, crashes, or is reinstalled.
- Let users skip a step without being nagged about it on every launch.
- Show honest progress, such as "2 of 3 steps handled".
- Feed the funnel measurements covered in the next chapter.
Completed, skipped, and pending are different
A common first design is one boolean per step: done: true or done: false. This breaks down quickly, because "the user finished the step" and "the user chose not to do it" mean different things for the product and for analytics.
| Status | Meaning | What the UI should do |
|---|---|---|
| Pending | The user has not reached or decided on this step | Offer it when it is next in order |
| Completed | The user finished the step | Mark it done and never ask again |
| Skipped | The user deliberately declined for now | Do not block the flow, but keep it reachable, for example in a checklist |
Skipped steps matter because many are valuable later. A user who skips "connect your calendar" may want it after a week of use. If skipping were stored as completed, you could never offer it again, and your funnel would overstate how many people connected.
A minimal state model
Store two lists, completed and skipped. A step is pending if it appears in neither list. The next step is the first one in the fixed order that has been handled in neither way.
type StepId = "welcome" | "profile" | "connect" | "done";
const steps: StepId[] = ["welcome", "profile", "connect", "done"];
interface OnboardingState {
completed: StepId[];
skipped: StepId[];
}
function nextStep(state: OnboardingState): StepId {
const handled = new Set<StepId>([...state.completed, ...state.skipped]);
return steps.find((s) => !handled.has(s)) ?? "done";
}
// A user who skipped "profile" resumes at "connect" after "welcome".
console.log(nextStep({ completed: ["welcome"], skipped: ["profile"] })); // "connect"The state does not store the "current step". It stores facts about what happened, and the current step is computed from them. This has two benefits. First, there is no second value that can drift out of sync with the lists. Second, if you reorder or insert steps in a later release, existing users land in a sensible place automatically.
Making transitions safe
Write the transitions as small pure functions. Two rules prevent most bugs:
- A step is never in both lists. Completing a step removes it from
skipped. - Skipping a step that is already completed does nothing. A late or repeated tap should not undo real progress.
type StepId = "welcome" | "profile" | "connect" | "done";
const steps: StepId[] = ["welcome", "profile", "connect", "done"];
const realSteps = steps.filter((s) => s !== "done");
interface OnboardingState {
completed: StepId[];
skipped: StepId[];
}
function without(list: StepId[], id: StepId): StepId[] {
return list.filter((s) => s !== id);
}
function completeStep(state: OnboardingState, id: StepId): OnboardingState {
return {
completed: [...without(state.completed, id), id],
skipped: without(state.skipped, id),
};
}
function skipStep(state: OnboardingState, id: StepId): OnboardingState {
if (state.completed.includes(id)) return state;
return {
completed: state.completed,
skipped: [...without(state.skipped, id), id],
};
}
function progress(state: OnboardingState): number {
const handled = realSteps.filter(
(s) => state.completed.includes(s) || state.skipped.includes(s)
).length;
return handled / realSteps.length;
}
let state: OnboardingState = { completed: [], skipped: [] };
state = completeStep(state, "welcome");
state = skipStep(state, "profile");
state = skipStep(state, "welcome"); // ignored: already completed
console.log(state); // { completed: ["welcome"], skipped: ["profile"] }
console.log(progress(state)); // 0.6666666666666666The done step is a terminal marker, not a task, so it is excluded from the progress calculation. Without that exclusion, a user who finished everything would see 3 of 4 and never reach 100%.
What "progress" should show
A progress bar that counts skipped steps as progress can feel like a lie. Two options work well:
- Count completed and skipped together as "handled" when the bar describes the linear flow. The user has moved past those screens.
- Count only completed steps when the bar describes a checklist the user can return to. Skipped items stay unchecked and stay visible.
Pick one meaning per surface and label it accordingly. For example, "2 of 3 set up" is clearer than a bare percentage.
Persisting and resuming
State that lives only in memory disappears when the app closes. Where you store it decides how well resuming works.
- Device storage (local storage on web, preferences on mobile) is simple and works before the user has an account. It is lost on reinstall or on a new device.
- Account storage on your server survives reinstalls and follows the user across devices. It requires a signed-in user, so pre-sign-up steps still need device storage.
Many apps use both. They keep device state until sign-up, then merge it into the account.
When you load saved state, treat it as untrusted input. It can be corrupted, edited, or written by an older app version that had different step names.
type StepId = "welcome" | "profile" | "connect" | "done";
const steps: StepId[] = ["welcome", "profile", "connect", "done"];
interface OnboardingState {
completed: StepId[];
skipped: StepId[];
}
const KEY = "onboarding.v1";
function known(list: unknown): StepId[] {
if (!Array.isArray(list)) return [];
return list.filter((s): s is StepId => steps.includes(s as StepId));
}
function load(storage: Pick<Storage, "getItem">): OnboardingState {
const empty: OnboardingState = { completed: [], skipped: [] };
const raw = storage.getItem(KEY);
if (!raw) return empty;
try {
const data = JSON.parse(raw);
return { completed: known(data.completed), skipped: known(data.skipped) };
} catch {
return empty;
}
}
function save(storage: Pick<Storage, "setItem">, state: OnboardingState): void {
storage.setItem(KEY, JSON.stringify(state));
}
// In-memory stand-in for localStorage so the example runs anywhere.
const memory = new Map<string, string>();
const fakeStorage = {
getItem: (k: string) => memory.get(k) ?? null,
setItem: (k: string, v: string) => {
memory.set(k, v);
},
};
save(fakeStorage, { completed: ["welcome"], skipped: ["profile"] });
console.log(load(fakeStorage)); // { completed: ["welcome"], skipped: ["profile"] }
memory.set(KEY, '{"completed":["welcome","retired_step"],"skipped":"oops"}');
console.log(load(fakeStorage)); // { completed: ["welcome"], skipped: [] }The versioned key (onboarding.v1) gives you a clean way to change the format later. The known filter drops step names that no longer exist, so a removed step cannot break the flow.
Edge cases to plan for
- Steps added after a user finished. If version 2 adds a step, users who already reached
donewould be pushed back into onboarding. Decide on purpose: either record a finished flag that overrides the step lists, or show new steps as optional hints instead of a forced flow. - State that disagrees with reality. A user may have filled in their profile through settings, not onboarding. Where you can, derive completion from the real data ("profile has a name") instead of trusting only the saved list. Otherwise you will ask for something the app already has.
- Two devices. If both devices write state, the last write can erase the other's progress. Merge instead of overwriting: take the union of
completed, and letcompletedwin overskippedfor the same step. - Back navigation. Going back to a completed step should show its saved answers. It should not reset the step or remove it from
completed. - Interrupted steps. Mark a step completed only when its action succeeds, not when the screen opens. If a network request fails, the step stays pending and the user can retry.
- Resuming after a long gap. A user returning after weeks may not remember the context. Resume at the next step, but show a short recap, and give a way to restart from the beginning.
Making skipping feel safe
Skipping works only if the user trusts that it is not a trap. Three practices help:
- Put the skip control where users expect it, with a plain label such as "Not now". Avoid labels that shame the choice.
- Tell users where the skipped step will live afterward, for example "You can connect this later in Settings".
- Do not re-ask on every launch. Re-surface a skipped step only at a moment when it becomes relevant, as discussed in the progressive disclosure chapter.
Remember that skipping must stay compatible with accessibility needs. The skip control must be reachable by keyboard and screen reader, and resuming should place focus on the next step's heading.
Recording events alongside state
State tells you where a user is now. Events tell you how they got there. Send one analytics event when a step is completed and another when it is skipped, such as onboarding_step_completed and onboarding_step_skipped, each with the step ID. The funnel in the next chapter is built from these events, and skip counts show which steps users find unnecessary or confusing.
Exercise
A user has completed "welcome" and skipped "profile". They later open Settings and fill in their profile. Using the transition functions from this chapter, what should the state be afterward, and why does the order of the two lists matter for avoiding a bug?
Show answer
The state should be completed: ["welcome", "profile"] and skipped: []. completeStep adds "profile" to completed and removes it from skipped, so the step is never in both lists. If it stayed in skipped too, the checklist might still show it as unfinished and the funnel would count the user as both skipping and completing it.
Exercise
Your team adds a new step "invite" to the end of the flow in a release. Users who already finished onboarding have a saved state of completed: ["welcome", "profile", "connect"]. What happens with nextStep, and what is one way to avoid forcing those users back into onboarding?
Show answer
nextStep returns "invite", because it is the first step in the order that is in neither list, so finished users would be sent back into the flow. One fix is to store a separate finished flag that takes priority over the step lists. Another is to present "invite" as an optional hint in the app instead of a required step.