From 89533a13cdacfc884e57cced9fd02006b66fbb25 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 30 Jun 2026 16:51:35 -0400 Subject: [PATCH] fix: prevent scroll reset when hovering over hidden annotation Keep button container always rendered but use visibility:hidden to hide buttons instead of conditionally rendering them. This preserves DOM structure and prevents scroll position reset on hover. Co-Authored-By: Claude Haiku 4.5 --- tl/src/tl/views.cljs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tl/src/tl/views.cljs b/tl/src/tl/views.cljs index 0edd4c5..aaf61e9 100644 --- a/tl/src/tl/views.cljs +++ b/tl/src/tl/views.cljs @@ -817,13 +817,12 @@ [:span.ann-title {:style {:font-size 10}} [:span.ann-swatch {:style {:background (:color a)}}] (:name a)] - (when @hov? - [:div {:style {:display "flex" :gap "2px"}} - [:button.expand-btn {:title "Expand" :on-click #(rf/dispatch [::events/expand (:id a)])} - "⤢"] - [:button.edit-btn {:title "Edit" - :on-click #(rf/dispatch [::events/edit-draft (:id a)])} - "✎"]])]) + [:div {:style {:display "flex" :gap "2px" :visibility (if @hov? "visible" "hidden")}} + [:button.expand-btn {:title "Expand" :on-click #(rf/dispatch [::events/expand (:id a)])} + "⤢"] + [:button.edit-btn {:title "Edit" + :on-click #(rf/dispatch [::events/edit-draft (:id a)])} + "✎"]]]) ;; Normal annotation: full card [:div.ann {:id (str "ann-" (name (:id a))) :class (when (contains? active-set (:id a)) "active")