0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

📎 Add two more debug options :display-touched and :show-ids

This commit is contained in:
Pablo Alba 2024-03-21 13:08:56 +01:00
parent 1d25115218
commit 0cd44f5540
3 changed files with 14 additions and 3 deletions

View file

@ -109,6 +109,8 @@
:style {"--depth" depth "--parent-size" parent-size}
:ref ref
:on-double-click start-edit}
(d/nilv shape-name "")]
(if (dbg/enabled? :show-ids)
(str (d/nilv shape-name "") " | " (str/slice (str shape-id) 24))
(d/nilv shape-name ""))]
(when (and (dbg/enabled? :show-touched) ^boolean shape-touched?)
[:span {:class (stl/css :element-name-touched)} "*"])])))

View file

@ -26,6 +26,7 @@
[app.main.ui.hooks :as h]
[app.main.ui.icons :as i]
[app.main.ui.workspace.sidebar.assets.common :as cmm]
[app.util.debug :as dbg]
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]]
[app.util.timers :as tm]
@ -639,4 +640,6 @@
[:& component-swap {:shapes copies}])
(when (and (not swap-opened?) (not multi) components-v2)
[:& component-annotation {:id id :shape shape :component component}])])])))
[:& component-annotation {:id id :shape shape :component component}])
(when (dbg/enabled? :display-touched)
[:div ":touched " (str (:touched shape))])])])))

View file

@ -73,6 +73,9 @@
;; Show an asterisk for touched copies
:show-touched
;; Show the id with the name
:show-ids
;;
:grid-layout
@ -80,7 +83,10 @@
:grid-cells
;; Show info about shapes
:shape-panel})
:shape-panel
;; Show what is touched in copies
:display-touched})
(defn enable!
[option]