From 551d57234763725bfb6f48ed0bf2b6bccfe3ed23 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 3 Oct 2026 04:48:03 -0400 Subject: [PATCH] idk man something hopefully helpful --- frontend/src/arthur/subs/ui.cljs | 12 +++++++++++- frontend/test/arthur/events/lane_test.cljs | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/arthur/subs/ui.cljs b/frontend/src/arthur/subs/ui.cljs index 763b876..8fe9623 100644 --- a/frontend/src/arthur/subs/ui.cljs +++ b/frontend/src/arthur/subs/ui.cljs @@ -5,7 +5,9 @@ Cheap by construction, like `subs/playback`: each reads a path and returns a value, so clicking a swatch notifies the swatches and nothing else." (:require [arthur.domain.creation :as creation] + [arthur.domain.clip :as clip] [arthur.domain.nest :as nest] + [arthur.domain.node :as node] [arthur.domain.pick :as pick] [arthur.footage.store :as store] [arthur.subs.playback :as playback] @@ -93,7 +95,15 @@ (when-let [{:keys [sid id frame] :as pl} (nest/placement clip st open path f)] (let [n (get-in clip [:symbols sid :nodes id])] (assoc pl :node n - :bounds ((pick/bounds-of clip st sid n) frame)))))))) + ;; An explicitly created symbol can be empty. It is still a + ;; valid creation destination, so give its occurrence a + ;; visible target box using the source symbol's stage until + ;; content supplies tighter bounds. Drawing-created symbols + ;; already take the normal content-bounds branch. + :bounds (or ((pick/bounds-of clip st sid n) frame) + (when-let [source (node/source n)] + (let [[w h] (clip/stage clip source)] + [0 0 w h])))))))))) (rf/reg-sub ::selected-placement diff --git a/frontend/test/arthur/events/lane_test.cljs b/frontend/test/arthur/events/lane_test.cljs index c523827..bac02cc 100644 --- a/frontend/test/arthur/events/lane_test.cljs +++ b/frontend/test/arthur/events/lane_test.cljs @@ -64,6 +64,9 @@ (is (= :main sid)) (is (= [5 6] (node/placed-span instance))) (is (= 1 (clip/frames saved source))) + (is (= source (:sid (creation/target saved {} :main + (get-in db [:ui :selection]) 5))) + "an explicitly created cel is immediately its own creation target") (is (every? (fn [other] (or (= instance-id (:id other)) (let [[a b] (node/placed-span other)]