diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index 36618f2617..4cdeb36053 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -1353,24 +1353,20 @@ [ids search replacement] (ptk/reify ::replace-text-in-shapes ptk/WatchEvent - (watch [_ state _] - (let [undo-group (uuid/next) - update-event - (dwsh/update-shapes - ids - (fn [shape] - (if (and (= :text (:type shape)) (some? (:content shape))) - (let [new-content (txt/replace-text-in-content (:content shape) search replacement) - new-name (txt/generate-shape-name (txt/content->text new-content))] - (-> shape (assoc :content new-content) (assoc :name new-name))) - shape)) - {:attrs #{:content :name} :undo-group undo-group})] - (rx/concat - (rx/of update-event) - (if (features/active-feature? state "render-wasm/v1") - (->> (rx/from ids) - (rx/map #(dwwt/resize-wasm-text-debounce %))) - (rx/empty))))))) + (watch [_ _ _] + ;; No explicit WASM resize: the :content change committed below is + ;; picked up by the commit-level text re-measure in `initialize-workspace`. + (let [undo-group (uuid/next)] + (rx/of + (dwsh/update-shapes + ids + (fn [shape] + (if (and (= :text (:type shape)) (some? (:content shape))) + (let [new-content (txt/replace-text-in-content (:content shape) search replacement) + new-name (txt/generate-shape-name (txt/content->text new-content))] + (-> shape (assoc :content new-content) (assoc :name new-name))) + shape)) + {:attrs #{:content :name} :undo-group undo-group})))))) ;; -- Text Editor v3 diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs index 60b0c15c02..cf107f5e0c 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs @@ -18,7 +18,6 @@ [app.main.data.workspace.texts-v3 :as dwt-v3] [app.main.data.workspace.tokens.application :as dwta] [app.main.data.workspace.undo :as dwu] - [app.main.data.workspace.wasm-text :as dwwt] [app.main.features :as features] [app.main.refs :as refs] [app.main.store :as st] @@ -180,11 +179,13 @@ (when (some? content) (st/emit! (dwt/v2-update-text-shape-content (first ids) content :finalize? true))))) + ;; The :grow-type change is committed by `update-shapes`; the + ;; commit-level text re-measure in `initialize-workspace` picks it + ;; up and resizes, so no explicit WASM resize is dispatched here. (st/emit! (dwsh/update-shapes ids #(assoc % :grow-type grow-type))) (when (features/active-feature? @st/state "render-wasm/v1") - (st/emit! (dwwt/resize-wasm-text-all ids) - (ptk/data-event :layout/update {:ids ids}))) + (st/emit! (ptk/data-event :layout/update {:ids ids}))) ;; We asynchronously commit so every sychronous event is resolved first and inside the transaction (ts/schedule #(st/emit! (dwu/commit-undo-transaction uid)))) (when (some? on-blur) (on-blur))))]