Files
integreat/resources
Bryce 599b849e6f refactor(ssr): Phase 4 — full Selmer migration of POS Sales Summary; remove the wizard; fix add-item + totals
Migrates the POS Sales Summary edit modal off the wizard to a plain Selmer form,
building on the parity gate committed earlier. Largest migration so far and the
first with no prior test coverage.

What changed
- Wizard removed: deleted MainStep/EditWizard records, MultiStepFormState, the
  step-params[...] prefix, the EDN snapshot round-trip, and all mm/* middleware.
  Replaced with a plain handler + flat wrap-decode/wrap-derive-state. The 51 fc/
  cursor refs are de-cursored into explicit data + Selmer templates.
- db/id-keyed item merge: wrap-derive-state overlays posted items onto the
  persisted items by :db/id, so read-only fields the form doesn't post
  (ledger-side, amount) survive a re-render and the debit/credit split + totals
  stay correct. New manual rows (temp db/id) ride through as-is.
- Inline click-to-edit account cell preserved as three small targeted
  .account-cell-swap routes (edit/save/cancel-item-account), ported to Selmer
  with the new field-name scheme.
- 100% Selmer modal render path (the remaining Hiccup / hx-swap-oob / "hx-"
  strings are all grid-page code — grid render lambdas, the filters form, and the
  submit response-header map — not the modal).
- Routes: dropped edit-wizard-navigate + new-summary-item; added form-changed.

Fixes (two pre-existing bugs, per request)
- "New Summary Item" add button (was throwing `newRowIndex is not defined` and
  targeting a non-existent `.new-row`) is now a whole-form-swap op=new-item that
  adds an editable manual row (category + account typeahead + debit/credit money
  inputs + remove).
- The dead totals/balance display (malformed Hiccup that discarded its labels) is
  replaced by a proper #summary-totals block showing running Total +
  Balanced/Unbalanced, refreshed via a Rule-4 targeted swap on manual amount edits.

Scorecard delta (pos/sales_summaries.clj): LOC 790->732, mm coupling 20->0,
wizard records 4->0, fc/ cursor 51->0, step-params 27->0 (2 comments), modal
routes 8->6. (hx-swap-oob 1 and mixed-hx live in the grid page, not the modal.)

Verification: sales-summary spec 7/7 (incl. the two fixes); full Playwright suite
46/46; cljfmt clean. Skill fed: scorecard row + narrative; gotchas (parity-gate-
first, characterize-then-fix, keyup-trigger tests); cookbook (inline click-to-edit
cell, db/id-keyed item merge).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 22:13:19 -07:00
..
2020-07-03 17:50:37 -07:00
2023-09-28 20:41:00 -07:00
2023-04-18 11:32:58 -07:00
2019-01-16 21:30:39 -08:00
2018-09-20 18:12:40 -07:00
2018-09-20 18:12:40 -07:00
2018-07-14 21:13:22 -07:00
2019-04-12 10:42:18 -07:00
2026-05-27 08:42:42 -07:00
2019-05-19 08:06:21 -07:00
2018-09-20 18:12:40 -07:00
2024-10-16 15:37:22 -07:00
2026-05-26 21:56:58 -07:00
2020-08-01 17:07:17 -07:00
2020-08-01 17:07:17 -07:00
2020-08-01 17:07:17 -07:00
2018-09-20 18:12:40 -07:00
2018-08-16 21:04:55 -07:00
2020-05-16 16:08:17 -07:00
2020-05-16 16:08:17 -07:00
2020-08-22 17:14:30 -07:00
2022-10-15 10:58:08 -07:00
2025-02-03 21:06:28 -08:00
2026-05-16 00:36:16 -07:00
2020-08-22 17:14:30 -07:00
2020-05-30 10:31:46 -07:00
2020-11-16 18:40:52 -08:00