mirror of
https://github.com/penpot/penpot.git
synced 2026-06-09 17:02:05 +00:00
🐛 Preserve explicit hide-in-viewer when adding prototype interactions (#9695)
`cls/show-in-viewer` unconditionally dissoc'ed `:hide-in-viewer` on the interaction destination, so every `add-interaction`, `add-new-interaction`, and `update-interaction` call silently re-enabled the destination's view-mode visibility — even when the user had just deliberately hidden that frame. Reporter (#9049) hid a board, dragged a prototype arrow at it, and watched the board reappear in View Mode. Make `show-in-viewer` a no-op when the destination already has `:hide-in-viewer true`. The auto-unhide still fires on destinations with no explicit hide flag (the original ergonomic — new prototype targets default to visible), but explicit user intent is now preserved across interaction-add / interaction-update. Behaviour change: dropping the auto-unhide on explicitly-hidden destinations matches the reporter's expectation ("nothing would show up in View Mode unless explicitly marked as such") and the surrounding `:hide-in-viewer`-aware UI in `measures.cljs`, which already lets users toggle the same property directly. Closes #9049. Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
c51a137ca9
commit
bec21e69e6
@ -539,5 +539,12 @@
|
||||
(update shape :interactions ctsi/add-interaction interaction))
|
||||
|
||||
(defn show-in-viewer
|
||||
"Auto-unhide the shape in viewer when it becomes an interaction
|
||||
destination, but only when the user has not explicitly hidden it.
|
||||
Preserves explicit `:hide-in-viewer true` so that adding or updating
|
||||
an interaction whose destination has been deliberately hidden does not
|
||||
silently flip the viewer-visibility flag the user set. See #9049."
|
||||
[shape]
|
||||
(dissoc shape :hide-in-viewer))
|
||||
(if (true? (:hide-in-viewer shape))
|
||||
shape
|
||||
(dissoc shape :hide-in-viewer)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user