fix(settings): save earlier pending personalisation edits past an invalid Other box

↗ view on GitHub · Amal · 2026-08-21 · 2a0168d0

WHY THIS MATTERS
An independent audit of the previous personalisation-autosave commit
found a residual hole in the same class as the bug it fixed: change
Title (save armed, inside the 400 ms debounce), then tick an empty
"Other" practice area. The effect re-ran, the guard keyed on the LAST
edited field's group (now invalid) returned early, and the still
unsaved Title change was silently dropped - never re-armed.

HOW THE FIX WORKS
The per-field group guard is removed entirely; it was redundant. The
payload substitution already replaces invalid groups with their last
persisted values, so when only the invalid group changed, the payload
equals the persisted snapshot and no save fires - exactly what the
guard achieved. When OTHER fields also changed, the snapshot differs
and the save now fires, carrying the earlier edits with the invalid
group held at its persisted value. One comparison does both jobs, and
the FIELD_GROUP map is deleted. A deterministic test pins the exact
sequence (Title edit -> empty Other tick -> flush) and asserts the
Title change survives with the stored practice areas untouched.

KNOWN LIMIT (deliberate)
A valid area ticked while the Other box is empty stays visible in the
UI but is excluded from payloads until the Other text is filled - the
inline "Enter your other practice area" message shows why saving is
partially held. Saving half-finished groups would be worse.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RuPCULDYgVsiCanRgbEy6W
Repository open-legal-products/mike
Author Amal <mamalanand3@gmail.com>
Authored
Parents 8b5f3aef
Stats 2 files changed , +32 , -15
Part of Add Google sign-in and personalised onboarding

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-2a0168d0.md from inside the repo you want the change in.

⬇ Download capture-commit-2a0168d0.md