This contains the default editor / view / sortingMode / etc. For now the
folder settings are shared among all Folders. But the idea is that we
should be able to set different settings per folder (real or virtual)
It doesn't make any difference as -
1. The sort order shown our SortedNotesFolder is different
2. Rebuilds of the tree affect everything. Even the elements which
should be in the correct place.
This really isn't a good way of doing this as now the folder
inserted/removed notifications will not be correct. But at least the
folders will be sorted.
We're accessing appState.notesFolder directly in the parent. Ideally it
would be nice if we passed it down via the Provider, but that doesn't
seem to be working for me. I've spent over 30 minutes. I now give up.
This also implements the ChangeNotifier, but additional provides more
fine grained notifications. We neeed this in order to animate the list
of notes / folders when they change.
This can sometimes lead to too many files being opened in parallel and
then failing because there aren't any file descriptors left. This patch
isn't perfect as given the directory structure we could still be loading
too many in one go, but it's a quick workaround for now.
The proper solution is to only load the Notes which need to be displayed
instead of loading all of them at startup.
For safety we're only allowing non-empty folders to be deleted. Ideally,
we should have some kind of undo button. Or some kind of history - since
we do have that with git.
Related to #18
We aren't using it, and if we implement a recursive option it should
somehow showcase which folder it is under. Evernote does it in an
interesting way.
Also make sure the _entities and _entityMap are always in sync.
The NotesFolder is complex enough that it could really use some proper
unit testing. Though since it is so tightly coupled to the FileSystem,
it would be quite an elaborate test to write.
Earlier whenever anything changed we would discard all the Notes +
NotesFolders in memory, and reconstruct the hierarchy. This would means
Notes which haven't changed at all, still need to parsed all over again.
Now we only reload what has actually changed.
This should result in a huge performance boost.
We still shouldn't be loading everything on boot, but that's a different
problem.
A NotesFolder doesn't only change when a note/folder is added or
removed. It is also changed when the contents of the Notes/Folders it
contains have changed.
This is a huge change which involves -
* Implementing Folder renames on the FS + Git level
* Implementing the concept of selecting an item in the FoldersListView,
this feature isn't provided by default, and even now I'm not sure if
the semantics which I've implemented are correct. I haven't
implemented multiple folder selection for now.
Related to issue #18
Also, we're now one step closer to allowing notes to be renamed (#23)
Folders for now can only be created under the root folder. I cannot seem
to figure out how to design a good interface for designing how to choose
the parent folder.