425 Commits

Author SHA1 Message Date
fdc79828c7 Move note.load to NoteStorage
Now the note class is almost ready to become immutable
2021-09-09 10:01:36 +02:00
c57e95f620 Better debug statements 2021-09-08 16:25:02 +02:00
92515f9924 Allow multiple inline tags in the same line
Fixes #268
2021-09-08 15:43:55 +02:00
82504c8c2b Sanitize inline tags
I'm not doing this for manually added tags. Over there the user has full
control of the keyboard.
2021-09-08 10:51:14 +02:00
941f5f17c5 Use RegExp.escape instead of doing it manually
I didn't know this existed!
2021-09-07 16:28:43 +02:00
10bce9a35a LocaleKeys++ 2021-09-07 14:46:37 +02:00
86a88966df Make emojification controllable
Also disable it by default

Fixes #260
2021-09-07 09:18:46 +02:00
fdfd6a7e3d FlattenedNotesFolder: Adding missing notify
Urgh.
2021-09-07 00:00:45 +02:00
c53b7ebbd1 Note: fileLastModified should never be null
This simplifies so much of the code.
2021-09-07 00:00:42 +02:00
d3fab6fb7c Fix LinksView
Stupid box / dart limitation
2021-09-06 17:33:43 +02:00
23221a0c4c MaterializedView: Delete old invalid items 2021-09-06 16:57:34 +02:00
665d1dce2b Add a Materialized View for the Links
Calculating the links is very expensive, this way we finally don't need
to do it each time!
2021-09-06 16:57:30 +02:00
d3fae40173 Rename views to providers
The providers give a View
2021-09-06 14:32:25 +02:00
d209ed4d30 MaterializedViewProvider: Make the fetch function async
Also make the contructor sync, this makes everything much easier.
2021-09-06 14:15:38 +02:00
df9e594a4a Split FlattenedNotesFolder
Move to filtered version to its own class. Now that the filter is an
async function it makes everything more complicated. It's easier to just
have 2 separate classes even though most of the implementation is the
same.
2021-09-06 14:03:26 +02:00
a9d183a1e0 FlattenedNotesFolder: Make the filter function async 2021-09-05 18:02:12 +02:00
a270a58cf8 MaterializedView: Pass the template argument properly 2021-09-05 11:50:01 +02:00
db80229209 Stop Note from being a ChangeNotifier
The only one listening was the parent folder. This simplifies the note
class a lot. Also it gets us one step closer from making the note more
dumb.
2021-09-05 11:23:51 +02:00
7abfc505e3 Note: move rename function to the parent
I want the note class to have a simple object with no internal state
mutation.
2021-09-05 11:15:24 +02:00
0231cbd3bc Note: Move 'move' function out of note
It doesn't need access to any of the note internals. For now I've placed
it in notes_folder_fs, though it really doesn't need to be there as
well.
2021-09-05 11:09:17 +02:00
985fe5c3dc InlineTagsView: Save it as a List
Hive doesn't seem to be able to serialize sets.
2021-09-03 16:01:52 +02:00
17afc9deb9 Views: Use Nested to simplify code
It makes it easier to read by avoiding the deep nesting.
2021-09-01 09:16:50 +02:00
abc9a31290 Add InlineTags Materialized View
This way we avoid parsing the tags from the body again and again, also
I can make the tags processing more complex without worrying too much
about the computational overhead.
2021-08-31 22:59:41 +02:00
130eb852b2 Note: Move summary to a MaterializedView
This way it doesn't need to be computed each time the app loads.
2021-08-31 21:48:27 +02:00
5b9106eb2c MaterializedView: Make the key shorter
Just use the path spec, but calculate it in a faster way.
2021-08-31 20:57:03 +02:00
0384bba656 Note: Remove unused member 'images' 2021-08-31 17:12:50 +02:00
096d3a8278 Rename NoteView -> NoteMaterializedView
It is stored in the disk
2021-08-31 17:12:42 +02:00
4163f75189 NoteView: A 'view' (like in sql) on top of the notes
This way we can compute expensive operations (like finding the links in
a note) only once and store the results. Currently it is computed each
time the app is loaded.
2021-08-31 13:38:42 +02:00
5ea80fb617 Note: Move Image code to its own class
The Note class is way way too huge and has too many responsabilities. I
would like the Note class to be very small and immutable.
2021-08-31 12:30:47 +02:00
455844e9b0 LocaleKeys++ 2021-08-26 13:54:39 +02:00
b4f3c96889 Experimenting with different latex syntaxes
I'm still not sure which ones are used.
2021-08-26 08:33:20 +02:00
38f0877e7d flutter analyze fix 2021-08-26 07:35:49 +02:00
3c9994fca7 Remove title based sorting
Now that we support multiple file types, sorting by title gets confusing
since a lot of notes don't have a title. Also, this simplifies a lot of
the code base.
2021-08-26 07:34:55 +02:00
7ff61d2f41 Disable dart-code-metrics for now
Even though I'm not using v4.2, the return-value rule is still being
applied with `flutter analyze` though not consistently.

For now, lets disable this, as there are 300+ warnings to fix.
2021-08-25 11:17:21 +02:00
01934bc504 Desktop: Enable fetch/push on linux 2021-08-24 17:25:13 +02:00
2863a26543 Try to fix concurrent modification error 2021-08-17 14:09:36 +02:00
cb389a44af Remove unused feature flag 2021-08-10 14:16:13 +02:00
e90233d45c Update modified/created as unix timestamp if already in that format
Related to #349
2021-08-10 10:57:31 +02:00
ae8016caec experiment: Custom file class
Just trying to figure out a rough API
2021-08-09 11:38:05 +02:00
fc4eb60c6f Add a WorkerQueue class
This is meant to reduce the code duplication between the LinksLoader and
the MdYamlDocLoader class. So far, it just highlights how fragile
the message passing is between Isolates.
2021-08-09 11:38:05 +02:00
879e238428 Sort by filename if file last modified is the same
Related to #172
2021-08-09 10:47:35 +02:00
f24740ea3a SortedNotesFolder: Fix binary search
I can't remember why I implemented this myself instead of using a
standard implementation and avoiding idiotic bugs like this.

Fixes #172
2021-08-09 10:43:46 +02:00
4d1dff32fa OrgMode: Add images with the correct markup
It was using the markdown syntax.

Related to #145
2021-08-04 08:40:15 +02:00
ef1536223d Remove Note.addImageSync
We can just always use the async version.
2021-08-04 08:28:10 +02:00
a0a97aa8cb Cleanup code 2021-08-04 08:17:49 +02:00
d53154aa8e Remove note.remove
Only being used in a test
2021-08-04 08:13:48 +02:00
39096c270c Note.save: Move to NoteStorage
I'm trying to move all FS related operations out of the Note class, and
ideally make it super small. This class will need to be serialized over
the wire for the web version, and that needs it to be small.
2021-08-04 08:03:48 +02:00
b0edb257c6 Analytics: Cleanup
I don't see any way of getting the app install source.

Run the formatter on the rest
2021-08-03 16:25:15 +02:00
b7af4604df LinksLoader: Use LineSplitter
Far more efficient
2021-07-31 17:20:01 +02:00
a181cd9e20 Add a markdown TextVisitor class
This is going to be used to parse the tags from a markdown document
while ignoring the text inside a code block
2021-07-31 17:18:46 +02:00