[Feature Request] - Pinned notes and marking notes visible to sub-directory
I manage course work etc. with QOwnNotes and I often like to create subfolders to keep everything sorted. So I might have directory structure like
notes_root_dir/TODO.mdcourse_root_dir/Description.mdSchedule.mdCourse Progress.mdweek_1/Assignment 1.mdAssignment 2.md
week_2/Assignment 3.mdAssignment 4.md
another_course_root_dir/
I often find myself needing to make edits to TODO.md and Course Progress.md while mainly working on e.g. assignment 2.md.
It would be really helpful if I could right-click a note in the list and select something like pin this note that then displays the note at the top of any note list of any directory.
Also I'd love if I could right-click the note and select something like make note visible in sub-directories that does just that: e.g. setting it for Course Progress.md would show it e.g. when week_1/ is selected but not when another_course_root_dir/ is selected.
As for the note listing, here's a mockup I made

I used the bookmark symbol (🔖) to denote a pinned note, those should IMO be on top.
The notes that are located in a higher level directory and marked visible to subdirectories I denoted with the ↑ symbol and I'll refer to them as ↑-notes below. IMO those should be listed below pinned notes, but above notes of the sub directory.
As for the ordering of notes amidst the two groups
-
Pinned notes can be located anywhere, so they can only be sorted in alphabetical order or by time last edited. It's most likely enough if they obey the global setting for note sorting.
-
As for the
↑-notes, there could be additional settinggroup ↑-notes by directory level, that displays the notes so that↑-notesof the parent directory are sorted just above the sub-directory notes, the↑-notesof grand parent directory are sorted among themselves above the parent directory↑-notesetc.
In addition to the unpin and don't display note in sub-directories buttons, general toggle settings Hide pinned notes and Hide notes marked to be visible in subdirectories would be helpful as one doesn't have to edit a dozen notes if they want to hide them when they want to focus on a task.
Thank you for your suggestion.
Similar to #351 or #774. As nice it would be to have something like that the unlikely it is that we will. That would mean a larger rewrite of how QOwnNotes operates. There is no notes database (for portability). Notes are only read from their folders every time.
I created the script https://github.com/pbek/QOwnNotes/blob/develop/doc/scripting/favorite-note.qml back then.
That's unfortunate. However, I almost managed to hack around this issue by writing a Python script that takes a file I want to create an ↑-note for, and creates symlinks recursively to any directories and subdirectories in the directory where the note is: When QOwnnotes opens the symlink it edits the original file in the top-most directory. The problem here is this requires the notes to be reloaded every time they are opened via another symlink or the original file.
I added a QML script that reloads the note. The last problem I'm facing is the API only seems to have two options
-
noteDoubleClickedHookworks, but if I edit the note in two places and forget to open the note every time with double click, it will cause loss of data from all edits except the last. -
noteOpenedHookseemed to work for a second but it caused a busy loop and crashed the application.
The script I wrote looks like this:
import QtQml 2.0
import QOwnNotesTypes 1.0
Script {
function noteDoubleClickedHook(note) {
mainWindow.buildNotesIndexAndLoadNoteDirectoryList(true, true);
script.setCurrentNote(note);
}
}
So would it be possible to add noteSingleClickedHook to the API? (Also, should I make a separate issue for that?)
So would it be possible to add noteSingleClickedHook to the API? (Also, should I make a separate issue for that?)
I don't fancy hooks on things that will be triggered a lot, because every time they trigger every script needs to be searched for that hook.
Also clicking on a note is not the only way to trigger a change of the current note.
Would tags help you to mark "often used" notes?
You're probably right. However, wouldn't this be mainly the problem of the user if they choose to run lots of scripts including ones that slow the application down (the API documentation could warn about the adverse effects)?
(Also I didn't notice slow-downs when I double-clicked notes with the script above. A hook for single click on a note shouldn't be any different in nature than hook for double click. I only have three scripts at the moment and I don't see myself adding many more. Also I'd assume C++ runs fast enough on modern laptop with NVMe storage for this not to be a problem.
But! I'll look into the tags as soon as I have a moment of spare time and see if I can get desired functionality from those!
Thank you for your suggestion.
Similar to #351 or #774. As nice it would be to have something like that the unlikely it is that we will. That would mean a larger rewrite of how QOwnNotes operates. There is no notes database (for portability). Notes are only read from their folders every time.
I created the script https://github.com/pbek/QOwnNotes/blob/develop/doc/scripting/favorite-note.qml back then.
how is this script used? I already have it activated but I didn't see any new options in the menus
New link: https://github.com/pbek/QOwnNotes/blob/develop/docs/content/scripting/examples/favorite-note.qml
Scripting menu, Custom actions
I'd really like to see this feature however as an interim measure I've just added an underscore to the name of my notes I use most frequently and set the notes to sort by Name.
When notes are sorted by last edit, the underscore solution does not work :s
Having pinned notes would be a nice feature indeed @pbek The link to the script that you provided is no more reachable https://github.com/pbek/QOwnNotes/blob/develop/docs/content/scripting/examples/favorite-note.qml Can you please share the right location?
Best just use the one from the script repository now. https://github.com/qownnotes/scripts/tree/master/favorite-note