refactor(ssr): revert hiccup→Selmer migration; render forms in Hiccup again

Abandons the Selmer-templating step of the SSR re-authoring and moves the four
migrated form/wizard modals back to Hiccup (com/* components), keeping the
whole-form HTMX swap doctrine, top-rooted render functions, and the
session-backed wizard engine unchanged.

- transaction/edit, transaction/bulk_code, invoices (bulk-edit group), and
  pos/sales_summaries render via com/* again; every hx-* swap (whole-form +
  targeted location-cell / totals-tbody / inline account-cell swaps) is
  preserved exactly.
- add com/single-modal-card to centralize the md:w-[950px] md:h-[650px] modal
  chrome that previously lived only in the Selmer modal-card templates.
- delete auto-ap.ssr.selmer, auto-ap.ssr.components.selmer, selmer_test, the
  whole resources/templates tree (55 files), the selmer dependency, and the
  tailwind resources/templates content glob.
- strip Selmer guidance from the ssr-form-migration skill + modernization plan.

Verified: all four namespaces compile and render with no stringified-hiccup
leaks; output.css rebuilds byte-identically (no Tailwind class loss); 60 e2e
specs pass — the four reverted modals (incl. whole-form-swap focus/caret tests)
plus the untouched wizard/pay/new/rule modals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 00:37:21 -07:00
parent e1a2f7b638
commit 8b43017d6e
71 changed files with 746 additions and 1793 deletions

View File

@@ -1,6 +1,6 @@
---
name: ssr-form-migration
description: Migrate an SSR form or wizard modal to the whole-form HTMX swap doctrine, top-rooted render functions, the data-driven session-backed wizard engine, and (where it helps) Selmer templates. Use when simplifying a server-rendered form/wizard modal in this codebase, removing EDN-snapshot round-trips, deleting *-no-cursor* duplicate render fns, collapsing per-interaction routes, or replacing the multi-step wizard protocol machinery.
description: Migrate an SSR form or wizard modal to the whole-form HTMX swap doctrine, top-rooted render functions, and the data-driven session-backed wizard engine. Use when simplifying a server-rendered form/wizard modal in this codebase, removing EDN-snapshot round-trips, deleting *-no-cursor* duplicate render fns, collapsing per-interaction routes, or replacing the multi-step wizard protocol machinery. Rendering stays in Hiccup (`com/*` components) — the earlier Selmer-templating step was abandoned.
---
# SSR Form & Wizard Migration
@@ -12,7 +12,7 @@ approach with **zero out-of-band swaps**. Every migration *reads this skill firs
*extends it last* (the Growth contract below). If migration N+1 is not easier than N,
the skill-update step was skipped — treat that as a bug.
The four patterns every migration moves code toward live in `reference/`:
The three patterns every migration moves code toward live in `reference/`:
- `reference/swap-doctrine.md` — the four-rule HTMX swap priority order + the focus
invariant + Alpine-survives-swap hardening + target-selector strategy.
@@ -20,8 +20,11 @@ The four patterns every migration moves code toward live in `reference/`:
**or a top-rooted cursor**; no faked cursor positions, no `*-no-cursor*` twins.
- `reference/form-vs-wizard.md` — single-step → plain form; multi-step → data-driven
engine with **per-step state in the Ring session** (the Django `formtools` model).
- `reference/selmer-conventions.md` — plain-HTML attributes via Selmer, the
Hiccup↔Selmer interop bridge, include/block patterns.
> **Rendering stays in Hiccup.** An earlier iteration of this skill added a fourth
> pattern — templating interactive components in Selmer — which was later **abandoned**.
> All modals render through the shared Hiccup components (`com/*`); there is no Selmer
> layer. Ignore any residual Selmer references in the cookbooks below.
Growing cookbooks (append every migration):
`component-cookbook.md`, `gotchas.md`, `test-recipes.md`, `scorecard.md`.
@@ -65,9 +68,9 @@ Run this loop for each modal. The phase notes in the migration plan list only wh
and any `with-cursor`/`MapCursor` rebind that fakes a deep starting position
(heuristics 1, 2). Using a cursor is fine; faking where it *starts* is not.
6. **Templatize in Selmer** (`reference/selmer-conventions.md`) where the component is
interactive/attribute-heavy. Reuse cookbook bits; add new ones back (heuristics 5, 8).
Static markup may stay Hiccup — Selmer scope is hybrid (Open decision 2).
6. **Render in Hiccup** with the shared `com/*` components. Reuse cookbook bits; add new
ones back (heuristic 5). (An earlier version of this step templated interactive
components in Selmer; that was abandoned — everything renders through Hiccup.)
7. **Wire HTMX per the swap doctrine** (`reference/swap-doctrine.md`). Keep the focus
invariant intact. No OOB except a genuinely disjoint region, documented (heuristic 7).