Skip to content

fix(onboarding): auto-save every section as a draft, not just completed ones (43)#91

Merged
bmarshall511 merged 1 commit into
mainfrom
fix/onboarding-autosave-all-sections
Jun 26, 2026
Merged

fix(onboarding): auto-save every section as a draft, not just completed ones (43)#91
bmarshall511 merged 1 commit into
mainfrom
fix/onboarding-autosave-all-sections

Conversation

@bmarshall511

Copy link
Copy Markdown
Contributor

The v0.11.1 fix didn't actually work — you were right. Onboarding answers and the private/sharing status still didn't save on select while filling out onboarding.

Why v0.11.1 missed it (my failure)

I "verified" with an E2E I wrote to pass — and it tested an already-completed section. The real bug is on first-time onboarding. This time I reproduced against the running app first: a new decrypt-level E2E that drives a first-time section fails on v0.11.1 (the answer stays null after fill + sharing change with no Continue), proving the bug before any fix.

Root cause

The auto-save effect was gated if (!complete || locked) return — it only fired on already-completed sections. But onboarding is spent in notStarted/inProgress sections, so nothing auto-saved while you filled them out.

The fix

  • submitSectionForm gains a markComplete param (default true); autoSaveForm sends complete: false — a draft that persists answers + answerSharing but only nudges notStarted → inProgress, never completing the section (so no premature portrait). The explicit Continue/Done is still the only thing that completes.
  • Auto-save now fires for every (unlocked) section, with a flush-on-unmount (a quick Back/section-switch never drops the last edit) and cancel-on-explicit-submit (a debounced draft can't race in after the completing submit and revert it).

Verification (reproduce-first, decrypt-level)

  • New E2E: fill a first-time section + change sharing with no Continue → both the answer and the scope persist to the encrypted vault, and the section is not completed. Fails on v0.11.1, passes here.
  • Existing edit-a-completed-section E2E still green; intimacy-conditionals E2E green.
  • typecheck (all) + lint clean; 939 core + 855 desktop unit (inverted the stale "first-time doesn't auto-save" RTL to assert it does as complete:false; + a core submitSectionForm draft test).
  • Re-amended spec 43.

🤖 Generated with Claude Code

…ed ones (43)

The v0.11.1 fix scoped auto-save to already-completed sections, so first-time onboarding
still didn't save answers or sharing on select — the real reported bug. Reproduced with a
decrypt-level E2E that fails on v0.11.1 (a first-time section's answer stays null after
fill + sharing change with no Continue), then fixed.

- submitSectionForm gains markComplete (default true); autoSaveForm sends complete:false
  so a DRAFT persists answers + answerSharing without completing the section (only nudges
  notStarted -> inProgress). The explicit Continue/Done still completes.
- The auto-save effect fires for every (unlocked) section, not just complete ones, with a
  flush-on-unmount (no lost edit on a quick Back) and cancel-on-explicit-submit (no draft
  racing in after the completing submit).

939 core + 855 desktop unit (inverted the stale first-time RTL; +a core draft test) + the
new first-time decrypt E2E (answer + scope persist with no Continue; not completed). Re-amended spec 43.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bmarshall511 bmarshall511 merged commit 061d30a into main Jun 26, 2026
1 check passed
@bmarshall511 bmarshall511 deleted the fix/onboarding-autosave-all-sections branch June 26, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant