refine: hidden annotations show edit + expand buttons on hover

Remove the unhide button. Instead show Edit (✎) and Expand (⤢) buttons
on hover so users can edit for any reason or expand to zoom in.

Make title text smaller (10px) and reduce card height to 24px.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Your Name 2026-06-30 16:49:37 -04:00
parent 4ffd831551
commit 06b28e2a9c

View file

@ -799,7 +799,7 @@
(let [grp (get-in scene [:groups (:id a)])] (let [grp (get-in scene [:groups (:id a)])]
^{:key (:id a)} ^{:key (:id a)}
(if (:hidden a) (if (:hidden a)
;; Hidden annotation: small collapsed card ;; Hidden annotation: small collapsed card with edit/expand on hover
(r/with-let [hov? (r/atom false)] (r/with-let [hov? (r/atom false)]
[:div.ann {:id (str "ann-" (name (:id a))) [:div.ann {:id (str "ann-" (name (:id a)))
:class (when (contains? active-set (:id a)) "active") :class (when (contains? active-set (:id a)) "active")
@ -807,21 +807,23 @@
{:opacity 0.4 {:opacity 0.4
:background "var(--desktop)" :background "var(--desktop)"
:background-size "2px 2px" :background-size "2px 2px"
:min-height "28px" :min-height "24px"
:display "flex" :display "flex"
:align-items "center" :align-items "center"
:justify-content "space-between" :justify-content "space-between"
:padding "2px 8px"}) :padding "2px 6px"})
:on-mouse-enter #(reset! hov? true) :on-mouse-enter #(reset! hov? true)
:on-mouse-leave #(reset! hov? false)} :on-mouse-leave #(reset! hov? false)}
[:span.ann-title {:style {:font-size 12}} [:span.ann-title {:style {:font-size 10}}
[:span.ann-swatch {:style {:background (:color a)}}] [:span.ann-swatch {:style {:background (:color a)}}]
(:name a)] (:name a)]
(when @hov? (when @hov?
[:button.edit-btn {:title "Unhide" [:div {:style {:display "flex" :gap "2px"}}
:on-click #(rf/dispatch [::events/put-group (:id a) [:button.expand-btn {:title "Expand" :on-click #(rf/dispatch [::events/expand (:id a)])}
(update grp :meta dissoc :hidden)])} "⤢"]
"Unhide"])]) [:button.edit-btn {:title "Edit"
:on-click #(rf/dispatch [::events/edit-draft (:id a)])}
"✎"]])])
;; Normal annotation: full card ;; Normal annotation: full card
[:div.ann {:id (str "ann-" (name (:id a))) [:div.ann {:id (str "ann-" (name (:id a)))
:class (when (contains? active-set (:id a)) "active") :class (when (contains? active-set (:id a)) "active")