mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 17:06:23 +00:00
refactor: replace :block/left with :block/order
Finally no need to worry about parent-left conflicts and broken chain. With :block/order, we only need to re-compute new orders for siblings with same order (it can happens if there're bugs in our code, or updates from rtc), but it doesn't break UI. Another huge potential benefit after discussing with Zhiyuan is: Ee might be able to simplify both RTC and undo/redo, currently, we need to handle each new op for both of them, with recently refactorings like properties being db attributes, :block/order is a string instead of a ref, we can handle most property value conflicts using last-write-wins, and others (e.g. :block/parent, property with :default type) specifically. I haven't fixed the issues of using :block/left in RTC and undo/redo, because we might change both soon.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
(mldoc/->edn text format)
|
||||
text format
|
||||
{:page-name (:block/name (db/entity page-id))})
|
||||
blocks' (gp-block/with-parent-and-left page-id blocks)]
|
||||
blocks' (gp-block/with-parent-and-order page-id blocks)]
|
||||
(editor-handler/paste-blocks blocks' {:keep-uuid? true}))))
|
||||
|
||||
(defn- paste-segmented-text
|
||||
|
||||
Reference in New Issue
Block a user