From ade41f77f3fe7d0d202d27fcd3072f646a630351 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 6 Jul 2022 11:27:20 +0200 Subject: [PATCH] :paperclip: Add some notes to assets ns in sidebar --- .../app/main/ui/workspace/sidebar/assets.cljs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs index 71c5fb260..1352747f0 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/assets.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/assets.cljs @@ -47,14 +47,10 @@ [potok.core :as ptk] [rumext.alpha :as mf])) -;; TODO: refactor to remove duplicate code and less parameter passing. -;; - Move all state to [:workspace-local :assets-bar file-id :open-boxes {} -;; :open-groups {} -;; :reverse-sort? -;; :listing-thumbs? -;; :selected-assets {}] -;; - Move selection code to independent functions that receive the state as a parameter. -;; +;; NOTE: TODO: for avoid too many arguments, I think we can use react +;; context variables for pass to the down tree all the common +;; variables that are defined on the MAIN container/box component. + ;; TODO: change update operations to admit multiple ids, thus avoiding the need of ;; emitting many events and opening an undo transaction. Also move the logic ;; of grouping, deleting, etc. to events in the data module, since now the @@ -205,8 +201,6 @@ create-typed-assets-group (partial create-typed-assets-group components-to-group)] (modal/show! :name-group-dialog {:accept create-typed-assets-group})))))) - - (defn- on-drag-enter-asset [event asset dragging? selected-assets selected-assets-paths] (when (and @@ -275,8 +269,6 @@ (:id target-asset) (cph/merge-path-item prefix (:name target-asset)))))))) - - ;; ---- Common blocks ---- (def auto-pos-menu-state {:open? false @@ -1090,6 +1082,7 @@ :else (:value color)) ;; TODO: looks like the first argument is not necessary + ;; TODO: this code should be out of this UI component apply-color (fn [_ event] (let [objects (wsh/lookup-page-objects @st/state)