Drop the whole-form alpine-morph swap in favour of posting the whole form
but swapping back only what changed, never the input the user is editing --
so focus and caret survive a plain swap with no morph extension.
- Discrete changes (vendor, account, location, mode, add/remove row) swap the
#manual-coding-section fragment via hx-select, plus an OOB refresh of the
#wizard-snapshot hidden field so the round-tripped wizard state stays in sync
(the snapshot lives at #wizard-form level, outside the swapped fragment, and
the new/remove-account handlers read it).
- The amount field OOB-swaps only #total/#balance (hx-swap=none); memo posts
with hx-swap=none. Neither input is ever replaced.
- Give the BALANCE cell a unique id (#balance) so the OOB selector is unambiguous.
- Remove the alpine-morph ext + @alpinejs/morph plugin and all the key/x-data
re-init tricks they required. Rebuilding the fragment fresh makes vendor->account
population and repeat vendor changes work without any keying.
- Rename e2e/transaction-edit-morph.spec.ts -> -swap.spec.ts; assertions unchanged
(focus/caret preservation, vendor->account, repeat vendor changes all hold).
Full e2e suite: 27 passed / 2 failed (both pre-existing and unrelated -- the
legacy save-flow test and the date-range filter test).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>