Damus
Frederik Handberg · 5w
I have a decision to make about how I will store the note documents in my app. The native Swift app stores the blocks in a flat JSON structure. This worked fine in the native macOS app, but now that ...
Frederik Handberg profile picture
Been working on heading folding/collapsing. Basically just being able to collapse a heading like H1, and then all the blocks below would hide. It’s a very common feature in writing apps.

I have implemented the collapse functionality in Lexical, but having some annoying issues with caret navigation when using left or right arrow. Obviously the caret should skip over the blocks that were hidden because of the heading being collapsed. Sometimes it works, but mostly not. It’s really confusing…

Interestingly, arrow up or down works all the time.

Usually when using arrow left or right the cursor gets stuck or is completely removed (in this case the whole editor unfocuses).
1
Frederik Handberg · 5w
I also need to make sure that the collapsed state is working correctly when opening a note document. For example, a collapsed heading shows the chevron icon in correct state, but the blocks are visible.