From 32056bf3968a2652351960a2d09a696fa3532544 Mon Sep 17 00:00:00 2001 From: Bryce Date: Wed, 3 Jun 2026 06:15:13 -0700 Subject: [PATCH] refactor(ssr): delete dead transaction-account-row-no-cursor* twin (heuristic 1) transaction-account-row-no-cursor* and its only helper account-field-name were unreferenced anywhere in src/ or test/ -- the *-no-cursor* duplicate the plan targets for removal. The live row renderer is the top-rooted cursor form transaction-account-row* (driven by fc/cursor-map from the accounts cursor). Deleting the twin: no-cursor twins 1 -> 0, ~53 LOC removed. Swap spec stays 6/6. --- src/clj/auto_ap/ssr/transaction/edit.clj | 54 ------------------------ 1 file changed, 54 deletions(-) diff --git a/src/clj/auto_ap/ssr/transaction/edit.clj b/src/clj/auto_ap/ssr/transaction/edit.clj index 1d264bd0..a3986e37 100644 --- a/src/clj/auto_ap/ssr/transaction/edit.clj +++ b/src/clj/auto_ap/ssr/transaction/edit.clj @@ -339,60 +339,6 @@ :hx-include "closest form" :class "account-remove-action"} svg/x)))) -(defn- account-field-name [index field] - (str "step-params[transaction/accounts][" index "][" - (if (keyword? field) - (str (when (namespace field) - (str (namespace field) "/")) - (name field)) - field) - "]")) - -(defn transaction-account-row-no-cursor* [{:keys [account index client-id amount-mode total]}] - (com/data-grid-row - (-> {:class "account-row" - :x-data (hx/json {:show true - :accountId (:transaction-account/account account)}) - :data-key "show" - :x-ref "p"} - hx/alpine-mount-then-appear) - (com/hidden {:name (account-field-name index :db/id) - :value (or (:db/id account) "")}) - (com/data-grid-cell - {} - (com/validated-field - {} - (account-typeahead* {:value (:transaction-account/account account) - :client-id client-id - :name (account-field-name index :transaction-account/account) - :x-model "accountId"}))) - (com/data-grid-cell - {} - (com/validated-field - {} - (location-select* {:name (account-field-name index :transaction-account/location) - :account-location (:account/location (cond->> (:transaction-account/account account) - (nat-int? (:transaction-account/account account)) (dc/pull (dc/db conn) - '[:account/location]))) - :client-locations (pull-attr (dc/db conn) :client/locations client-id) - :value (:transaction-account/location account)}))) - (com/data-grid-cell - {} - (com/validated-field - {} - (if (= "%" amount-mode) - (com/text-input {:name (account-field-name index :transaction-account/amount) - :class "w-16 account-amount-field" - :value (:transaction-account/amount account) - :type "number" - :step "0.01"}) - (com/money-input {:name (account-field-name index :transaction-account/amount) - :class "w-16 account-amount-field" - :value (:transaction-account/amount account)})))) - (com/data-grid-cell {:class "align-top"} - (com/a-icon-button {"@click.prevent.stop" "show=false; setTimeout(() => $refs.p.remove(), 500)" - :class "account-remove-action"} svg/x)))) - (defn location-select [{{:keys [name account-id client-id value] :as qp} :query-params}] (html-response (location-select* {:name name :value value