docs(skill): feed ssr-form-migration with Phase 10 (Client) learnings

- form-vs-wizard.md: the sub-editor pattern — modeling a parameterized sub-step
  (list ⇄ per-item editor with accept/discard/sort) on the linear engine as
  whole-form swaps driven by routes that mutate session step-data, with a
  pass-through step :decode that re-reads the list via a non-stripped `wiz` hidden.
- scorecard.md: Phase 10 row (defrecord 9→0, multimethods→case, grid+schemas+
  power-query preserved verbatim, blank-address recurrence, 71/71 green).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 00:50:56 -07:00
parent 7b0e8bfd65
commit ddffbf58f9
2 changed files with 68 additions and 0 deletions

View File

@@ -293,3 +293,38 @@ blank-nested-entity upsert error (see `gotchas.md`).
create across all 5 steps persists; edit opens prefilled and a rename persists; a too-short
name blocks advancing). Create + edit semantics also confirmed at the REPL (incl. the
cookie-session EDN round-trip). `maybe-spread-locations`-style domain helpers untouched.
---
## Phase 10 — New/Edit Client (the largest modal: 7 steps + a bank-account sub-editor)
**Coupling outcome:** `defrecord` **9 → 0** (InfoModal / MatchesModal / ContactModal /
BankAccountsModal / IntegrationsModal / BankAccountModal / CashFlowModal /
OtherSettingsModal + ClientWizard all gone), `mm/` **0**, `fc/` cursor refs **0**,
`step-params[…]` **0**, `bank-account-card`/`bank-account-form` multimethods (dispatched on
`(comp deref :bank-account/type)`) collapsed to plain `case` on a data map. Routes: the
broken `navigate` + `discard` are deleted; four bank-account sub-editor routes added
(new/edit/accept/discard) + sort kept. The grid, both form schemas, and ~200 lines of
sales power-query export are preserved **verbatim** (stitched around the rewritten wizard
region rather than retyped).
**The new pattern — a parameterized sub-step on a linear engine.** The old
`[:bank-account which]` mm sub-step (open one account, Accept/discard/sort, back to the
list) doesn't map onto wizard2's flat step list. Modeled instead as a *sub-editor of the
bank-accounts step*: see `form-vs-wizard.md` ("Sub-editor"). Key moves: list + editor are
both whole-form swaps of `#wizard-form`; dedicated routes mutate `:bank-accounts`
step-data in the session via `ws/put-step` and re-render through `wizard2/render-wizard`;
the step's own `:decode` is a **pass-through** that re-reads the session list (via a `wiz`
hidden the engine doesn't strip) so Next never wipes the out-of-band list.
**Fixes carried/!surfaced:** new-vs-edit keyed off `:db/id` presence (engine always POSTs,
so the old PUT/POST split is gone); client + bank-account dates → `#inst` for EDN-safe
session; the **blank-address** trap recurs (empty Contact address posts blank fields →
all-nil db/id-less map → "tempid used only as value") — same `blank-address?` drop as
Phase 9. A long detour confirmed the REPL is direct-link-poisoned: validate migrations
against a fresh `TEST_SERVER_PORT=… lein run -m auto-ap.test-server` JVM, not the REPL.
**Verification:** full e2e suite **71/71** (65 prior + 6 client-wizard: new dialog +
timeline; edit prefill w/ disabled code; bank-accounts card + add affordance; editor
open/discard; accept-merge; edit→save round-trip). Engine flow + accept + pass-through +
edit init also confirmed at the REPL.