From cd02eb04774b06eef16e08712b51d0e98ed8082b Mon Sep 17 00:00:00 2001 From: Olive Vaughn Date: Sat, 10 Oct 2026 18:29:42 -0400 Subject: [PATCH] Add symbols and uploads from the foot of the media pool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A "+ symbol" and an "upload…" button pinned to the bottom of the pool, where a list's own "add one" goes. A new symbol goes into the library only, one empty frame placed nowhere, as Flash's New Symbol, and its name opens for editing. The pane head loses its "+". Converting footage reads "make roto". Co-Authored-By: Claude Opus 5.5 --- frontend/src/arthur/events/project.cljs | 11 +++++++++ frontend/src/arthur/ui/convert.cljs | 2 +- frontend/src/arthur/ui/pool.cljs | 32 ++++++++++++++++++------- static/arthur/app.css | 16 +++++++++++++ 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/frontend/src/arthur/events/project.cljs b/frontend/src/arthur/events/project.cljs index 4b4b962..2e2f4a7 100644 --- a/frontend/src/arthur/events/project.cljs +++ b/frontend/src/arthur/events/project.cljs @@ -697,6 +697,17 @@ (assoc-in % [:symbols sid :name] value) (update-in % [:symbols sid] dissoc :name))))))) +(rf/reg-event-db + ::add-symbol + (fn [db [_ sid]] + ;; Into the library and nowhere else, as Flash's New Symbol: one empty + ;; frame, placed in nothing until it is dragged somewhere. `sid` comes from + ;; the caller so the pool can open the new row's name for editing. + (if (clip/symbol (:clip (store/entry (:clip/current db))) sid) + db + (edit/transaction db #(assoc-in % [:symbols sid] + {:id sid :name (name sid) :frames 1 :nodes {}}))))) + (rf/reg-event-db ::symbol-setting (fn [db [_ sid key value]] diff --git a/frontend/src/arthur/ui/convert.cljs b/frontend/src/arthur/ui/convert.cljs index 6cc6f2a..6394dc8 100644 --- a/frontend/src/arthur/ui/convert.cljs +++ b/frontend/src/arthur/ui/convert.cljs @@ -91,4 +91,4 @@ "tracing layer"] [:button.on {:disabled (or loading? (< n 1) (empty? name)) :on-click #(rf/dispatch [::footage/convert])} - (if loading? "working…" "make symbol")]]]])))) + (if loading? "working…" "make roto")]]]])))) diff --git a/frontend/src/arthur/ui/pool.cljs b/frontend/src/arthur/ui/pool.cljs index d182cb5..7080cc6 100644 --- a/frontend/src/arthur/ui/pool.cljs +++ b/frontend/src/arthur/ui/pool.cljs @@ -38,6 +38,10 @@ `events.footage/relabel`. A symbol of ANOTHER project is renameable where it lives and not from here. + ADDING IS AT THE FOOT: a new empty symbol, which goes into the library and is + placed nowhere until it is dragged, and an upload, which is the same as a file + dropped on the pane. + THE WHOLE PANE IS THE DROP TARGET for a file. A video dropped anywhere in it uploads and lands in THIS PROJECT's media, and goes no further: which frames of it become a symbol, and what that symbol is called, is asked when it is dropped @@ -610,13 +614,7 @@ (reset! depth 0) (when-let [file (aget (.. e -dataTransfer -files) 0)] (rf/dispatch [::footage/upload file])))} - [:div.pane-head - "media pool" - [:span.spacer] - [:button {:title "add a video, a sound or an image" - :disabled loading? - :on-click #(.click (js/document.getElementById "pool-file"))} - "+"]] + [:div.pane-head "media pool"] [:input {:id "pool-file" :type "file" :accept "video/*,audio/*,image/*" :style {:display "none"} :on-change (fn [^js event] @@ -646,4 +644,22 @@ [:span.count (get tallies k)])]))] [:div.pane-body (if (= :project @scope) [this-project ctx] [all-assets ctx]) - (when status [:div.dim status])]]))) + (when status [:div.dim status])] + ;; At the foot, where a list's own "add one" goes, and pinned there so it + ;; does not scroll away under a long one. + [:div.pool-foot + [:button {:title "a new empty symbol in this project's library" + :on-click (fn [_] + (let [sid (clip/fresh-id document)] + (rf/dispatch [::project/add-symbol sid]) + (rf/dispatch [::ui/select [:symbol sid]]) + ;; Show its row and open its name, so what it + ;; is called is the next thing you type. + (reset! scope :project) + (reset! query "") + (reset! editing [:symbol sid])))} + "+ symbol"] + [:button {:title "add a video, a sound or an image — or drop one on this pane" + :disabled loading? + :on-click #(.click (js/document.getElementById "pool-file"))} + "upload…"]]]))) diff --git a/static/arthur/app.css b/static/arthur/app.css index 6fe786e..7985c5b 100644 --- a/static/arthur/app.css +++ b/static/arthur/app.css @@ -525,6 +525,22 @@ button.share-button:hover, button.share-button.on { filter: brightness(1.1); } } .pool-clear:hover { background: var(--hair); color: var(--fg); } +/* The pool's add buttons. Pushed to the bottom by the auto margin and sticky + there, so they sit at the foot of a short list and stay in view under a long + one. */ +.pool-foot { + position: sticky; + bottom: 0; + z-index: 2; + margin-top: auto; + display: flex; + gap: 4px; + padding: 3px 5px; + background: var(--chrome); + border-top: 1px solid var(--line); +} +.pool-foot > button { flex: 1; } + /* The scope tabs, in the vocabulary `ui/tabs` already established for symbols — the same object, so two rows of tabs on one screen read as one idea. */ .pool > .tabs { top: 45px; position: sticky; z-index: 2; }