tomboy-notes / tomboy-ng

Next generation of Tomboy
MIT License
389 stars 38 forks source link

[Feature Request] Pinned notes #286

Open uwemock opened 1 year ago

uwemock commented 1 year ago

I'd like to be able to pin notes, i.e. prevent them from moving down in the menu and in the list in the search window.

davidbannon commented 1 year ago

Hmm, interesting idea, I will look into it. Thanks Davo

davidbannon commented 1 year ago

OK, thinking out loud. Mark a Pinned note with a tag, eg in the section, put system:pinned. Will be ignored by older versions of -ng and its cousin applications.

When the notes menu is redrawn, it relies on the fact that we keep the in memory notes sorted by most recently used. So, for the first sweep we look for pinned notes. Then, space permitting, unpinned. That way, we see the Pinned notes in the correct order and then the unpinned, also in correct order. This will be a bit time consuming, bypassing some of the optimizations I have done. So, maybe keep a record in memory as to how many pinned notes the user has, that way, pinned notes, probably more used, will be found first and when they are all found, stop that sweep ? If the user has one pinned note that has not been touched for years, then a full sweep will be necessary. OK if notes in memory but possibly slow for users who choose not to do that.

Another problem will be how to handle that for Sync users. When doing GitHub sync, we will always defer to an existing note's pinned status ? The Index page is generated locally so thats easy. For file sync the xml will tell us all we need. However, if the user is using Github to sync two different machines then the Pinned status will NOT be passed to other machine. Hmm....

A dodgy hidden markdown tag ? Sigh ....

Anyway, does sound like it can be made useful for most users.