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:
parent
4ffd831551
commit
06b28e2a9c
1 changed files with 10 additions and 8 deletions
|
|
@ -799,7 +799,7 @@
|
|||
(let [grp (get-in scene [:groups (:id a)])]
|
||||
^{:key (:id 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)]
|
||||
[:div.ann {:id (str "ann-" (name (:id a)))
|
||||
:class (when (contains? active-set (:id a)) "active")
|
||||
|
|
@ -807,21 +807,23 @@
|
|||
{:opacity 0.4
|
||||
:background "var(--desktop)"
|
||||
:background-size "2px 2px"
|
||||
:min-height "28px"
|
||||
:min-height "24px"
|
||||
:display "flex"
|
||||
:align-items "center"
|
||||
:justify-content "space-between"
|
||||
:padding "2px 8px"})
|
||||
:padding "2px 6px"})
|
||||
:on-mouse-enter #(reset! hov? true)
|
||||
: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)}}]
|
||||
(:name a)]
|
||||
(when @hov?
|
||||
[:button.edit-btn {:title "Unhide"
|
||||
:on-click #(rf/dispatch [::events/put-group (:id a)
|
||||
(update grp :meta dissoc :hidden)])}
|
||||
"Unhide"])])
|
||||
[: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)])}
|
||||
"✎"]])])
|
||||
;; Normal annotation: full card
|
||||
[:div.ann {:id (str "ann-" (name (:id a)))
|
||||
:class (when (contains? active-set (:id a)) "active")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue