40 Commits

Author SHA1 Message Date
92e73c414d Move core Note classes into a separate file
I'm trying to get ride of this huge 'Note' class, and have it be quite
dumb. The idea is that we'll have separate Note subclasses - TxtNote,
MdNote, etc
2022-04-24 13:09:14 +02:00
6237161a28 Enable logging in tests
It makes it easier to diagnose issues on the CI
2022-02-20 01:24:07 +05:30
5d48229736 use IMap instead of ListMap 2022-02-02 01:51:02 +04:00
0a085e78e7 MdYamlDoc: Make it immutable 2022-01-27 15:17:56 +01:00
afd7690611 Use fast_immutable_collections instead of Kt
It's much more intuitive to use, and is way more performant.
2022-01-27 12:13:34 +01:00
3841cdcab9 Note.tags: Use an compile time immutable set 2022-01-27 11:52:43 +01:00
7fce95c187 Make Note class immutable
This greatly simplifies the entire data flow. Though, it comes at the
risk of introducing bugs, but I think it's worth it.

Plus, it makes everything far far more testable.
2022-01-18 21:42:56 +01:00
3195dd7afc JournalEditorHeader: Simplify
It doesn't need the full note.
2022-01-14 18:32:36 +01:00
e6a24f8897 Fix note renaming to change editor type 2022-01-14 17:34:19 +01:00
0488714e89 Refactor note file naming logic
I want to make the note class immutable, and the file path naming logic
is the toughest part.
2022-01-14 12:55:27 +01:00
567835b9c5 make fmt 2021-12-14 16:28:08 +01:00
4b658e3580 Move markdown handling to its own folder 2021-12-14 14:12:12 +01:00
e1ea7a4953 Fetch the modified + created time from git
Fixes #78

This is probably the largest commit that I have ever made. From now on -
every File always has an mtime and ctime which is fetched from git.
Notes can optionally override that time by providing yaml metadata.

Additionally the 'filePath' and 'folderPath' is now relative to the
repoPath instead of being the full path.

This will slow down GitJournal like crazy as all the mtimes and ctime
still need to be cached. For my test repo it takes about 23 seconds for
GitJournal to become responsive.
2021-10-26 17:49:08 +02:00
7a56d0f423 Remove Note's default constructor
Instead there is a new type called 'UnopenedFile'. This was part of my
effort to not have everything inside the 'Note' class and to make it a
bit more immutable.

But, wow, this took a very long time. The 'Note' class seems to be very
deeply integrated everywhere.
2021-10-18 13:03:22 +02:00
5f07543db2 Remove Note's doc setter
This makes us one step closer to making the Note class immutable which
will help GitJournal's overall architecture a lot. Plus it makes me one
step closer to having proper web support.
2021-10-17 22:22:33 +02:00
6a915864f2 Move NotesFolder's code to their own folder
The 'core' folder is becoming way too huge.
2021-10-15 12:31:35 +02:00
510b277398 Add Note.apply
Avoid calling each setter as each results in the entire tree being
rebuilt.
2021-09-16 20:07:33 +02:00
fb2ebcdd6c Reuse: Add licenseing to the tests 2021-09-15 13:11:50 +02:00
86a88966df Make emojification controllable
Also disable it by default

Fixes #260
2021-09-07 09:18:46 +02:00
c53b7ebbd1 Note: fileLastModified should never be null
This simplifies so much of the code.
2021-09-07 00:00:42 +02:00
c6665fa63e Simplify Settings/Config classes 2021-07-29 12:45:33 +02:00
c66eaf1052 NotesFolderConfig: Read directly from the SharedPref
It's super annoying that we have this class which reading from the
settings, so adding any new value involves updating some 12 new things.
2021-07-27 16:33:16 +02:00
d6e2f09a72 Move all settings code to its own folder
Jumping around between the widgets / screens and outside is bit
confusing. Also this way, I can add the stories right here.
2021-06-05 12:23:28 +02:00
96c2809d3e Migrate most of the tests to null safety 2021-05-19 12:09:45 +02:00
d008f0d982 First version of dart migrate
Most of the files haven't been migrated. Lets work on this bit by bit
2021-04-10 22:18:35 +02:00
b7e274c937 Add FileName option in Note title settings
This doesn't do anything right now. It just shows the option.
2021-02-12 15:32:10 +01:00
5280917e7a Minor refactor 2021-02-09 12:00:52 +01:00
f75e119995 Make Settings take the folderName as a parameter 2020-10-23 02:29:48 +02:00
9499cea164 Remove Settings global
Stop it being a singleton. This means it needs to be passed around a
lot. This sucks, but it's how it should be. I shouldn't be using a
global variable to get around this.

This is needed as Settings will soon become repo specific when we
support multiple repos.

This breaks saving the settings in a file, that feature was toggled off
anyway. It needs to be thought over again.
2020-10-09 00:59:19 +02:00
2668d14510 Replace test with simpler test
Also lets not auto convert old notes title format.
2020-08-19 11:40:50 +02:00
8f2bb557da YAML tags: Let it be a string seperated by spaces and have a #
In general we try to follow the same format as specified in the input
note.
2020-08-19 10:41:52 +02:00
9380f3cc06 Allow YAML tags to be a string 2020-08-19 10:12:07 +02:00
9859aa6106 Allow custom metadata to be specifiec for any note
This way we can add 'draft: true' to all new notes.

Fixes #168
2020-08-18 10:47:26 +02:00
cd9ae57a71 Fix tests 2020-08-10 09:59:20 +02:00
9c01b8a931 NoteSerializer: Avoid using Settings.instance 2020-08-09 01:50:52 +02:00
4a97d03bd8 Title Codec: Support empty starting lines in the body 2020-07-29 15:25:17 +02:00
417f0414f2 Setting: Note metadata change subtitle 2020-07-29 15:13:37 +02:00
41447027f2 Allow 'title' saving to be configured
We now allow it be to either saved as the H1 or in the YAML metadata.
I'm not sure what the default should be. Still deciding.

Fixes #112
2020-07-28 17:26:42 +02:00
9d00fdac06 Use import_sorter
flutter pub run import_sorter:main --no-comments

The code feels much cleaner
2020-07-24 12:43:28 +02:00
b9c7fed6dc Add emjoi support
Only supported for the body and title of notes.

Fixes #62
2020-02-15 02:06:48 +01:00