From af0df98a15d7f198027e791dba80249cd941e7ad Mon Sep 17 00:00:00 2001 From: Olive Vaughn Date: Sat, 10 Oct 2026 20:38:41 -0400 Subject: [PATCH] N makes a symbol, shift-N a lane, alt for the top of the tab; alt-T traces N and shift-N make a symbol or a lane where the selection says, as the timeline's buttons do; with alt, at the top of the tab whatever is selected. A new symbol in a lane is a new drawing, so there N is shift-K: one meaning for a new empty thing in a lane. Alt-T switches tracing, beside alt-O for onion skin. Co-Authored-By: Claude Opus 5.5 --- frontend/src/arthur/events/ui.cljs | 28 ++++++++++++++++++++++----- frontend/src/arthur/ui/shortcuts.cljs | 8 ++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/frontend/src/arthur/events/ui.cljs b/frontend/src/arthur/events/ui.cljs index 551c2ad..5cf25d7 100644 --- a/frontend/src/arthur/events/ui.cljs +++ b/frontend/src/arthur/events/ui.cljs @@ -394,10 +394,11 @@ (rf/reg-event-fx ::drawing-here ;; K and ⇧K in a lane: see `span/drawing-at`. The new cel is selected and the - ;; playhead put on it, because it is there to be drawn in. - (fn [{:keys [db]} [_ copy?]] + ;; playhead put on it, because it is there to be drawn in. `lane` is + ;; `lane-here`'s answer unless the caller has already chosen one. + (fn [{:keys [db]} [_ copy? lane]] (let [clip (:clip (store/entry (:clip/current db))) - {:keys [sid frame path time]} (lane-here db) + {:keys [sid frame path time]} (or lane (lane-here db)) id (random-uuid) result (if sid (span/drawing-at clip sid frame id (clip/fresh-id clip) @@ -971,10 +972,27 @@ (rf/reg-event-db ::new-lane - (fn [db _] + (fn [db [_ where]] ;; A lane is an explicit persistent row across the effective target symbol. ;; The playhead validates that nested target; the row itself begins at zero. - (create-container db :inside true))) + (create-container db (or where :inside) true))) + +(rf/reg-event-fx + ::new + ;; N and its variants: a new symbol or lane where the selection says, or at + ;; the top of the tab (`:top`). + ;; + ;; A NEW SYMBOL IN A LANE IS A NEW DRAWING, so there it is ⇧K — one meaning + ;; for "a new empty thing in a lane", rather than two that differ in how + ;; much of the hold they take. A lane made in a lane is still a lane. + (fn [{:keys [db]} [_ where lane?]] + (let [{document :clip st :store} (store/entry (:clip/current db)) + into (creation/target document st (get-in db [:ui :open]) + (when-not (= :top where) (get-in db [:ui :selection])) + (editing-frame db document))] + (if (and (not lane?) (= :lane (:kind into))) + {:fx [[:dispatch [::drawing-here false into]]]} + {:db (create-container db where lane?)})))) ;; --------------------------------------------------------------------------- ;; a drop in flight diff --git a/frontend/src/arthur/ui/shortcuts.cljs b/frontend/src/arthur/ui/shortcuts.cljs index f6496ad..59d5c18 100644 --- a/frontend/src/arthur/ui/shortcuts.cljs +++ b/frontend/src/arthur/ui/shortcuts.cljs @@ -68,6 +68,8 @@ :note "playback loops between the marks"} {:label "Mark out" :keys ["o"] :run (constantly [::pb/mark :out])} {:label "Clear the marks" :keys ["alt+x"] :run (constantly [::pb/clear-marks])} + {:label "Tracing" :keys ["alt+t"] + :run #(vector ::ui/tracing-on (not (get-in % [:ui :tracing :on?])))} {:label "Onion skin" :keys ["alt+o"] :run #(let [on? (get-in % [:ui :onion (:clip/current %) (get-in % [:ui :open]) :on?])] [::layout/onion :on? (not on?)])}]] @@ -80,6 +82,12 @@ :run #(when-let [p (ui/span-path %)] [::ui/slide p 1 :out true])} {:label "One frame shorter" :keys ["-"] :run #(when-let [p (ui/span-path %)] [::ui/slide p -1 :out true])}]] + ["Make" + [{:label "New symbol" :keys ["n"] :run (constantly [::ui/new :inside false]) + :note "in the selected symbol; in a lane, a blank drawing"} + {:label "New lane" :keys ["shift+n"] :run (constantly [::ui/new :inside true])} + {:label "New symbol at the top of the tab" :keys ["alt+n"] :run (constantly [::ui/new :top false])} + {:label "New lane at the top of the tab" :keys ["alt+shift+n"] :run (constantly [::ui/new :top true])}]] ["Draw" [{:label "Select" :keys ["v"] :run (constantly [::ui/tool-key "v"])} {:label "Pen" :keys ["p"] :run (constantly [::ui/tool-key "p"])}