📎 Add some notes to assets ns in sidebar

This commit is contained in:
Andrey Antukh 2022-07-06 11:27:20 +02:00
parent c405e9a7a3
commit ade41f77f3

View file

@ -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)