Re-render the entire #wizard-form on each field edit and swap with hx-swap="morph" so the focused input keeps focus/caret/value while typing. - Field-level routes return the full form and target #wizard-form - Key state-owning wrappers (account rows, simple-mode wrapper, vendor typeahead) so server-driven value changes re-init across the morph - Guard tippy/$refs access in typeahead against stale post-morph state - Round-trip simple/advanced mode via step-params[mode] - Add e2e/transaction-edit-morph.spec.ts covering focus/caret preservation, vendor->account population, and repeated vendor changes - Seed a second vendor/account for test isolation Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
44 lines
2.1 KiB
Clojure
44 lines
2.1 KiB
Clojure
(ns auto-ap.routes.transactions)
|
|
|
|
(def routes {"" {:get ::page
|
|
:put ::edit-wizard-navigate
|
|
"/unapproved" ::unapproved-page
|
|
"/requires-feedback" ::requires-feedback-page
|
|
"/approved" ::approved-page
|
|
"/bulk-delete" ::bulk-delete
|
|
"/bulk-suppress" ::bulk-suppress
|
|
"/bulk-code" {:get ::bulk-code
|
|
:put ::bulk-code-submit
|
|
"/new-account" ::bulk-code-new-account
|
|
"/vendor-changed" ::bulk-code-vendor-changed}}
|
|
"/new" {:get ::new
|
|
:post ::new-submit
|
|
"/location-select" ::location-select
|
|
"/account-typeahead" ::account-typeahead
|
|
"/line-item" {:get ::new-line-item}}
|
|
|
|
"/external-new" ::external-page
|
|
"/external-import-new" {"" ::external-import-page
|
|
"/parse" ::external-import-parse
|
|
"/import" ::external-import-import}
|
|
|
|
"/table" ::table
|
|
"/csv" ::csv
|
|
"/bank-account-filter" ::bank-account-filter
|
|
|
|
["/" [#"\d+" :db/id]] {"/edit" {:get ::edit-wizard}}
|
|
"/edit-submit" ::edit-submit
|
|
"/edit-vendor-changed" ::edit-vendor-changed
|
|
"/location-select" ::location-select
|
|
"/account-total" ::account-total
|
|
"/account-balance" ::account-balance
|
|
"/toggle-amount-mode" ::toggle-amount-mode
|
|
"/edit-form-changed" ::edit-form-changed
|
|
"/edit-wizard-new-account" ::edit-wizard-new-account
|
|
"/edit-wizard-remove-account" ::edit-wizard-remove-account
|
|
"/edit-wizard-toggle-mode" ::edit-wizard-toggle-mode
|
|
"/match-payment" ::link-payment
|
|
"/match-autopay-invoices" ::link-autopay-invoices
|
|
"/match-unpaid-invoices" ::link-unpaid-invoices
|
|
"/apply-rule" ::apply-rule
|
|
"/unlink-payment" ::unlink-payment}) |