From d28c0ea066cd071275c910b6d59ddab743af7b70 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 21 Apr 2026 21:17:33 +0000 Subject: [PATCH] :zap: Memoize label computation in text-menu* component Wrap the (case type (tr ...) ...) expression in mf/with-memo [type] so the translation is resolved only when the type prop changes instead of on every render. Signed-off-by: Andrey Antukh --- .../main/ui/workspace/sidebar/options/menus/text.cljs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 63138c6fb9..bb5c2aa3f6 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 @@ -323,10 +323,12 @@ :attributes #{:typography} :token token :on-update-shape dwta/update-typography}))))) - label (case type - :multiple (tr "workspace.options.text-options.title-selection") - :group (tr "workspace.options.text-options.title-group") - (tr "workspace.options.text-options.title")) + label + (mf/with-memo [type] + (case type + :multiple (tr "workspace.options.text-options.title-selection") + :group (tr "workspace.options.text-options.title-group") + (tr "workspace.options.text-options.title"))) set-option-ref (mf/use-fn (fn [node]