115 Commits

Author SHA1 Message Date
e1d19fc8c2 Optimize building of the NotesCache 2020-03-05 01:36:58 +01:00
cdd214c102 Let the notesCache be toggleable
It might be the cause of a massive slowdown for one particular user. I'm
still leaving it enabled for now, but I want to be able to easily
disable it.
2020-03-05 01:02:16 +01:00
c65ec96da2 Fix bug when you have less than 10 notes
Fixes #73
2020-03-02 17:37:47 +01:00
de2553c31f Mark new notes as Loaded 2020-03-01 17:14:01 +01:00
51b95bb7e0 SortedNotesFolder: Ignore sorting order for unloaded notes 2020-03-01 14:52:27 +01:00
c90189e55b Note: Do not try to generate the summary if not loaded 2020-03-01 14:28:10 +01:00
b5f7a24b1f Use filename comparison when both Notes don't have modified/created 2020-03-01 14:19:26 +01:00
b199e4ef74 Simplify the sorting the presentation
Now we don't try to be smart and guess the sorting.

The problem was what to do when we don't have the modified/created
value. In those cases we were trying to use the fileLastModifed, but
that could get quite tricky and it wasn't obvious to the user what was
going on.

From now on - if it doesn't have a modified field, it just goes to the
end.
2020-03-01 14:17:06 +01:00
ec11f09b2e More thorough checking for if a Note has been modified 2020-03-01 14:08:04 +01:00
3ed246310e Centralize sorting code 2020-03-01 13:50:39 +01:00
7bdcd5dd82 Moving SortingMode into its own file 2020-03-01 13:42:09 +01:00
d50f772468 Only have one SortingMode class
It doesn't make sense to duplicate it.
2020-03-01 13:40:16 +01:00
78d7e6cef0 Integrate the NotesCache
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.
2020-02-28 14:55:52 +01:00
2de1d17ee1 SortedNotesFolder: if created/modified not present it goes in the end 2020-02-28 14:55:11 +01:00
215dfc2cec NotesCache: Add a simple way to build the cache 2020-02-28 14:29:07 +01:00
cbacfa31e3 First attempt of creating a NotesCache
This is just for optimizing the loading of the Notes in the correct
order. I want to avoid the notes appearing and disappearing in a strange
order when loading. It gives a bad first impression.

This cache isn't integrated, it's only half done.
2020-02-28 14:17:37 +01:00
020c65e132 Minor cleanup 2020-02-28 14:16:05 +01:00
d137fb83cf Add experimental support for not saving the yaml header
Fixes #19

This is experimental as it changes the whole concept of a Note - We have
till now always assumed that a Note can have attached metadata. With
this, there is no longer any metadata. So other parts of the application
need to start reacting accordingly. For example the Mardkown Editor
should not allow you to modify the title.

This also makes it easier to implement '.txt' file support.
2020-02-18 22:29:16 +01:00
4f5c44812f checklists: Do not add unnecessary \n 2020-02-17 01:05:35 +01:00
e5a6236cfc Checklists: Ensure there is one item at the start 2020-02-16 22:57:58 +01:00
5569c3fca1 Checklist: last may not exist 2020-02-16 22:11:11 +01:00
8cabb07483 checklist: verify insertItem works 2020-02-15 02:30:00 +01:00
7221befcc1 Checklist: Make sure \n exists before adding a new checklist item 2020-02-15 02:28:49 +01:00
b9c7fed6dc Add emjoi support
Only supported for the body and title of notes.

Fixes #62
2020-02-15 02:06:48 +01:00
ffc7c8f483 Fix flutter analyze 2020-02-14 11:34:33 +01:00
a98df20c77 Revert "NotesFolder: Add a notification for when a note changes"
This reverts commit f583d181c6c21f2e332a2468b19de47bca72b848.

This causes way too many rebuilds.
2020-02-14 08:26:51 +01:00
46a38cdedf Rename NoteData -> MdYamlDoc
It more clearly defines what exactly it is.

This is important as its less confusing for when we add support for
other file types.
2020-02-14 08:12:41 +01:00
39cc1bc0ce NotesFolder: sort the sub-folders
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.
2020-02-14 07:56:53 +01:00
f583d181c6 NotesFolder: Add a notification for when a note changes
This way we can re-order the list when one of the notes changes a
specific property.
2020-02-14 07:41:49 +01:00
7df3e9dce0 ChecklistEditor: Allow adding an item by pressing enter 2020-02-13 17:19:12 +01:00
660874f6af Simplify sorting logic 2020-02-11 22:01:34 +01:00
12122be7fe AppState.notesFolder: Avoid changing the object
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.
2020-02-11 19:57:57 +01:00
d5f5b4975a Note Summary: Avoid reparsing the markdown on each build
Save it after it is done once. This should result in a significant
performance boost - over 22% while showing the list view. Also, now with
the addition of a few more animations, this is even more important.
2020-02-11 19:08:33 +01:00
6627f9c38a ChecklistEditor: Try to give focus on the next item on removing
This doesn't seem to work reliably - it only kind-of gives the focus. I
see the 'x' on the right, but the keyboard has not been shown. Maybe
this is just an ios emulator issue.
2020-02-11 18:08:34 +01:00
c7981606bf Checklist: Do not add extra \n while parsing
Now the checklist editor is finally somewhat usable.
2020-02-11 17:21:32 +01:00
4c23c28671 checklist: Improve test 2020-02-10 17:27:14 +01:00
1cd0b967de Checklist: Let items be re-ordered 2020-02-10 17:10:54 +01:00
dbbe8589c6 Checklists: Allow items to be removed 2020-02-10 17:02:45 +01:00
8bebe91bc0 Checklist: Allow adding new items
It's not perfect as we don't maintain focus, but it's a great start.
2020-02-10 16:45:20 +01:00
fd791a6597 Hookup the checklist editor properly
It's not perfect as one cannot remove items or add new ones. But it's a
start.
2020-02-10 16:16:11 +01:00
9373988054 Checklist: Implement serialization back into Note 2020-02-10 16:03:48 +01:00
b98a42543e Add a Checklist class 2020-02-10 15:44:08 +01:00
1d0cf3ab6d Save the selected sorting mode 2020-02-09 22:41:16 +01:00
9c02f1d8ac Allow the sorting mode to be toggled 2020-02-09 19:37:10 +01:00
7fd2546334 Add as NotesFolderReadOnly interface
This simplifies the implementation of VirtualNotesFolder and
NotesFolder.
2020-02-09 19:11:01 +01:00
2bc1c0aea8 Fix SortedNotes folder and enable it again 2020-02-09 18:53:56 +01:00
57a309a63e SortedNotesFolder: ensure reverse sort 2020-02-09 18:17:14 +01:00
a97bdd8f92 Add a VirtualNotesFolder
Also disable the SortedNotesFolder - it's buggy.

This simplifies using a JournalList as one doesn't need to pick between
a list of notes / notesfolder.
2020-02-09 18:08:57 +01:00
be23f944b7 JournalList: Show the notes sorted
We're using a new SortesNotesFolder class. This way we don't continously
re-sort the notes.

And in the future we will be able to toggle the notes sorting method.
2020-02-09 17:38:51 +01:00
20f8d7f7fe NoteEditor: Improve modified check
If the only modification is the addition of a 'modified' tag, then we
shouldn't count it as modified.

I'm not too fond of this logic.
2020-02-09 17:34:12 +01:00