Thread

I just implemented a very essential feature in the notes app I'm building 😁 It's now possible to rearrange blocks by moving them up and down. Added two options to the context menu that appears when right-clicking a block: "Move Up" and "Move Down". This is currently implemented for image blocks, normal text blocks, and headings - so I still got a few more blocks to work on... Next task will be getting it to work in list blocks. #dev #macOS #AppKit #Swift #SwiftUI image

Replies (2)

I need to make it possible to simply drag the blocks to rearrange. Also need to find a place to show an icon that indicates the block can be grabbed to drag. I think positioning the icon on the left side of each block seems most logical, but headings and list items already have a chevron icon on the left side… For now, I suppose the two buttons in the context menu will be fine. A shortcut would also be nice - perhaps `Cmd+Arrow-up` and `Cmd+Arrow-down`. This is also the same shortcut used in VSCode to move lines up and down.