aardappel / treesheets

TreeSheets : Free Form Data Organizer (see strlen.com/treesheets)
zlib License
2.49k stars 184 forks source link

Add feature: bookmark #635

Closed tobiolo closed 2 months ago

tobiolo commented 2 months ago

With this feature, users can bookmark cells, delete these bookmarks and go to bookmarks. Bookmarks are persistent.

tobiolo commented 2 months ago

Still wonder what would be better: expand Cell with bookmarked member variable or store Cells as set centrally?

Central pro: good for a bookmark menubar Central con: extra handling for cell deletion and wrapping

Decentral per cell pro: no extra handling for cell manipulation like deletion (?) Decentral per cell con: just go to next and previous bookmark, but no menubar with bookmark items

aardappel commented 2 months ago

I feel the Central approach is very fragile. If you forget one spot in the code where a cell may get deleted, you now introduce bad bugs/crashes. Also searching in the set is not cheap.

The Decentral approach is certainly more elegant, especially if the cost of finding the bookmarks only applies when you go to a bookmark.

A third approach is to store paths. We already have the feature of paths (for e.g. undo and other things) whose exact purpose was to be resilient against deletions etc, since I did not want to store a Cell * external to the tree.

Then there is the question if we want this feature at all.. what is it useful for? I don't think I would use it, since a file is either small and then you don't need bookmarks, or it is huge and then you'd need a lot of bookmarks to get any kind of organization, which become then hard to organize themselves. To me, the file itself is the structure I use to find stuff.

tobiolo commented 2 months ago

Hello Wouter, Thanks for your reply. Thanks for outlining possible ways to implement it and especially for challenging the PR. I see your point and having a second thought about it, I see that it is sufficient to organise by the structure in itself and not having a parallel organization by means of bookmarks. There is also the link feature so this is also sufficient and an alternative way to have an equivalent way of maintaining a sort of bookmark. So I withdraw my PR. Best regards, Tobias