The wizard serialized the whole accumulating form state into a `snapshot` hidden field (pr-str EDN + custom readers), decoded it every request, and merged step-params back in. For this single-step modal the snapshot is pure redundancy: every value is either in the entity or the live posted form. Remove it: - render: EditWizard.render-wizard renders a plain form -- no snapshot / edit-path / current-step hidden fields; a single `db/id` hidden rides in the form instead. - middleware: wrap-derive-state rebuilds :multi-form-state per request from the entity (loaded by the db/id hidden) overlaid with the live step-params, replacing wrap-init-multi-form-state + wrap-entity. The ~34 :snapshot reads are unchanged -- :snapshot is now a derived map, not a round-tripped blob. - editable fields (accounts, vendor, memo, approval, action, mode, amount-mode) come ONLY from the posted form (absent = cleared) so removing all account rows doesn't resurrect the entity's persisted accounts; only entity-only fields (db/id, client, amount, ...) come from the entity. - delete the dead initial-edit-wizard-state and render-account-grid-body. - e2e: make removeAllAccounts re-query each iteration (whole-form swaps stale a captured row index) and restore the percentage test to type-then-add ordering. Scorecard: snapshot EDN round-trip + custom readers + merge-multi-form-state -> gone (snapshot-field renders 0). Verified on a fresh server: full suite 38 pass / 1 unrelated fail, swap 6/6, transaction-edit 8/8 -- same green as before, snapshot removed.
20 KiB
20 KiB