From 05d123aa62a372f73f32c0e044d3fab28d11d01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Tejero=20Cantero?= Date: Fri, 14 Aug 2026 09:25:27 +0200 Subject: [PATCH] :bug: Render the limits list through a component, not a hiccup helper A helper returning [:li ...] hands React a raw CLJS vector, because rumext compiles hiccup at macro-expansion time; React then renders the leading keyword as a child and the whole workspace tree falls into the error boundary (React #31). Found by opening the dialog in a browser. --- .../main/ui/workspace/sidebar/branches.cljs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/branches.cljs b/frontend/src/app/main/ui/workspace/sidebar/branches.cljs index 59c0ec1f10..ce8a0ded51 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/branches.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/branches.cljs @@ -323,6 +323,11 @@ ;; numbers are fetched from the backend (`::get-branching-limits`) and never ;; restated in the copy: the config the gates read is their one home. +(mf/defc limits-item* + {::mf/private true} + [{:keys [text]}] + [:li {:class (stl/css :limits-item)} text]) + (mf/defc limits-dialog* {::mf/register modal/components ::mf/register-as :branch-limits} @@ -330,12 +335,7 @@ (let [{:keys [limits]} (mf/deref branches) on-close - (mf/use-fn #(st/emit! (modal/hide))) - - item - (mf/use-fn - (fn [text] - [:li {:class (stl/css :limits-item) :key text} text]))] + (mf/use-fn #(st/emit! (modal/hide)))] (mf/with-effect [] (st/emit! (dwb/fetch-branching-limits))) @@ -359,26 +359,26 @@ [:ul {:class (stl/css :limits-list)} (if (some? limits) [:* - (item (tr "workspace.branches.limits.size.shapes" (dm/str (:max-shapes limits)))) - (item (tr "workspace.branches.limits.size.pages" (dm/str (:max-pages limits)))) - (item (tr "workspace.branches.limits.size.changes" (dm/str (:max-oplog-changes limits))))] - (item (tr "workspace.branches.limits.size.loading")))]] + [:> limits-item* {:text (tr "workspace.branches.limits.size.shapes" (dm/str (:max-shapes limits)))}] + [:> limits-item* {:text (tr "workspace.branches.limits.size.pages" (dm/str (:max-pages limits)))}] + [:> limits-item* {:text (tr "workspace.branches.limits.size.changes" (dm/str (:max-oplog-changes limits)))}]] + [:> limits-item* {:text (tr "workspace.branches.limits.size.loading")}])]] [:div {:class (stl/css :limits-section)} [:h3 {:class (stl/css :limits-section-title)} (tr "workspace.branches.limits.scope.title")] [:ul {:class (stl/css :limits-list)} - (item (tr "workspace.branches.limits.scope.nested")) - (item (tr "workspace.branches.limits.scope.libraries")) - (item (tr "workspace.branches.limits.scope.comments")) - (item (tr "workspace.branches.limits.scope.page-attrs"))]] + [:> limits-item* {:text (tr "workspace.branches.limits.scope.nested")}] + [:> limits-item* {:text (tr "workspace.branches.limits.scope.libraries")}] + [:> limits-item* {:text (tr "workspace.branches.limits.scope.comments")}] + [:> limits-item* {:text (tr "workspace.branches.limits.scope.page-attrs")}]]] [:div {:class (stl/css :limits-section)} [:h3 {:class (stl/css :limits-section-title)} (tr "workspace.branches.limits.merge.title")] [:ul {:class (stl/css :limits-list)} - (item (tr "workspace.branches.limits.merge.whole-entities")) - (item (tr "workspace.branches.limits.merge.no-partial")) - (item (tr "workspace.branches.limits.merge.main-moved")) - (item (tr "workspace.branches.limits.merge.base-missing"))]] + [:> limits-item* {:text (tr "workspace.branches.limits.merge.whole-entities")}] + [:> limits-item* {:text (tr "workspace.branches.limits.merge.no-partial")}] + [:> limits-item* {:text (tr "workspace.branches.limits.merge.main-moved")}] + [:> limits-item* {:text (tr "workspace.branches.limits.merge.base-missing")}]]] [:> context-notification* {:level :info :type :context} (tr "workspace.branches.limits.exit")]]