14 Commits

Author SHA1 Message Date
b35d5f4337 Use YAML serializer package
This code might be useful to someone else
2019-12-29 12:03:42 +01:00
53839c9101 Surround the title by quotes before saving it to yaml
Otherwise people can put # or : or something else in the title and that
will result in invalid YAML.

Also escape any existing '. YAML is weird that the method of escaping a
' is by specifying it twice. It's sad that there is no dart YAML
serializer, and I'm surely missing some other edge cases. The YAML
specification is quite long.
2019-12-28 01:12:18 +01:00
2b09708793 JournalListing: Show the title
It's no longer a simple JournalListing and instead we also show the
title. The main problem is with what to do when the title is not there.
Just leaving it blank seems to feel weird, specially when the note is
too small.

Maybe it's time to change it such that each row size is not the same.
We're effectively wasting whitespace right now for very small notes.
2019-12-27 11:34:15 +01:00
895d2f4f1b Give each Note a title
We're moving away from being a Journal Editor to being a Note Editor. I
don't want to discard the Journaling parts, as Journaling is really a
subset of Note Taking - so in the future it would be nice if this could
be somehow toggled.

Maybe each Folder can have different display settings. Probably in the
"pro" version.
2019-12-27 11:05:32 +01:00
6790bfe9f5 Fix Note sorting function 2019-12-14 12:06:07 +01:00
bc6f7c1b8f Note: Load the modified tag properly 2019-12-14 12:05:52 +01:00
880f290d82 New note: fix 'created' not being serialized 2019-12-09 01:36:55 +01:00
b0b7da5291 Move storage classes into core
The Git functionality is fairly core!
2019-12-09 01:19:44 +01:00
cd24d2688f Never let the Note be in an invalid state
It's a bit confusing that the created date has to be set when creating a
new note, and the path had to be constructured properly, without which
the note shouldn't be saved. Ideally, an object shouldn't be able exist
in such an inconsistent state.
2019-12-09 01:14:45 +01:00
6c10fa8a0f Improve Note sorting
* First by modified
* Then by created
* Then by file Path

I feel like there must be a simpler way of writing this compareTo
function.
2019-12-09 00:14:00 +01:00
76f70f0d18 Note: Store when last modified
Also sort the notes based on when last modified. Now that we're moving
towards being a more note-taking app, it makes sense that a recently
modified note goes on top.

Of course, the sorting should be controllable by the user, but the
default probably should be by when modified.
2019-12-09 00:02:40 +01:00
a51f8f170f Make Note and NotesFolder ChangeNotifiers
This will allow us for finer grained notifications of when things change
so we don't have to rebuild everything, like we do currently.
2019-12-06 01:22:57 +01:00
5b8fc6342a Connect the AppState to the Folders
Now when adding/editing/removing a note, it gets modified from the
directory it was present in. There is no longer a just a plain list of
all notes, but always a tree of notes, which are inside Folders.
2019-12-04 15:33:30 +01:00
464b7512e9 Move Note and NoteFolder class into a core folder 2019-12-04 14:18:11 +01:00