feat: shift-drop links an annotation, plain drop moves

Matches Blender's M / shift-M (move to collection / link to collection).
Alt was the modifier before; nothing else referenced it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Your Name 2026-09-17 15:35:27 -04:00
parent 79a87403b5
commit 839f4c51f1

View file

@ -1205,13 +1205,13 @@
(when (has-type? e "text/ann") (when (has-type? e "text/ann")
(.stopPropagation e) (.preventDefault e) (reset! over? true))) (.stopPropagation e) (.preventDefault e) (reset! over? true)))
:on-drag-leave (fn [_] (reset! over? false)) :on-drag-leave (fn [_] (reset! over? false))
;; plain drop MOVES the edge you grabbed onto this card; ⌜⌥/Alt⌟-drop ADDS ;; plain drop MOVES the edge you grabbed onto this card; SHIFT-drop LINKS
;; (links, keeping the source edge). ;; (adds this edge, keeping the source one) — Blender's M / ⇧M.
:on-drop (fn [e] :on-drop (fn [e]
(let [src (.. e -dataTransfer (getData "text/ann"))] (let [src (.. e -dataTransfer (getData "text/ann"))]
(when (seq src) (when (seq src)
(.stopPropagation e) (.preventDefault e) (reset! over? false) (.stopPropagation e) (.preventDefault e) (reset! over? false)
(rf/dispatch [::events/reparent (keyword src) (:id a) (.-altKey e)]))))})) (rf/dispatch [::events/reparent (keyword src) (:id a) (.-shiftKey e)]))))}))
(defn- annotation-card [a scene ctx segs nmap authed? open by-parent revealed source-parent seen] (defn- annotation-card [a scene ctx segs nmap authed? open by-parent revealed source-parent seen]
(r/with-let [over? (r/atom false) hov? (r/atom false)] (r/with-let [over? (r/atom false) hov? (r/atom false)]