From bec21e69e64e014900faccac84b2d1f5867ac133 Mon Sep 17 00:00:00 2001 From: Jeff <158072326+jeffrey701@users.noreply.github.com> Date: Fri, 29 May 2026 02:31:59 -0700 Subject: [PATCH] :bug: Preserve explicit hide-in-viewer when adding prototype interactions (#9695) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 --- common/src/app/common/logic/shapes.cljc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/logic/shapes.cljc b/common/src/app/common/logic/shapes.cljc index 70c9b63fde..c49a445b2d 100644 --- a/common/src/app/common/logic/shapes.cljc +++ b/common/src/app/common/logic/shapes.cljc @@ -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)))