vipzhicheng / logseq-plugin-move-block

A Logseq plugin help you copy or cut blocks to anywhere you want.
https://www.vipzhicheng.com/logseq-plugin-move-block/
Other
47 stars 6 forks source link

Move block children #9

Closed kerim closed 1 month ago

kerim commented 1 year ago

I often want to move all the child block to another page. For instance, I might write this on my journal page:

But as I add more content, I decide that the child blocks should all be moved from the journal page to the page [[name of meeting]].

Do you think this feature could be added to the plugin in some form, so that I don't have to manually select the child blocks, but also don't move the parent?

vipzhicheng commented 1 year ago

I want to say that you need to manually select the child blocks, and then use 'cut content' action and select where you want to put. The good news is that the plugin support multi selection.

kerim commented 1 year ago

So I just tried this.

I created the following blocks:

I selected all three, and chose to cut and replace with an embed while moving to a target page.

The result was that it cut "child 2" and moved it to the target page, creating an embed. "Test block" and "child 2" were not affected.

The same result if I just chose "test block" - it still creates and embed for "child 2"

The next thing I did is to select "test block" and choose to create a ref instead of an embed. This time it made a ref for the top level element: "Inbox" instead of "test block." However, when selecting all items it works as intended.

To summarize:

"cut content and keep ref" works for child elements when parent and child are selected. If just selecting an individual block it chooses the parent block instead, which is not expected.

"cut content and keep embed" does not work in either case, always working with the last child block.

How I would like it to work:

"cut content and keep embed" should always work on the parent item, moving and embedding the children

"cut content and keep ref" should work on the selected block, with the children moved or not depending on whether they are selected. (Although I would prefer to have this as an option rather than manually selecting, since that can be difficult when there are many child blocks.)

vipzhicheng commented 1 year ago

Multi-selection hierarchical blocks are a complicated situation. That is not suggested or supported by this plugin. If this situation happens, I suggest just using native 'cmd+x' and cmd+v to do the trick.