48 Commits

Author SHA1 Message Date
e5eb8c1576 lint: avoid-ignoring-return-values++ 2021-11-17 18:10:59 +01:00
e4eecc58d9 NotesCache: Better optimize loading of notes 2021-11-07 18:25:11 +01:00
d786edd920 NotesCache: Move directory creation code to NotesFolderFS 2021-11-07 18:11:04 +01:00
f8926d9eda NotesCache: Add pinned files
This way the view doesn't change later.
2021-11-04 15:10:24 +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
f87793acbf NotesCache: Save it as a 'File'
This way it'll also be sorted correctly later.
2021-10-20 22:31:12 +02:00
ffcbda3afb History: Show a progress indicator 2021-10-18 14:23:34 +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
7e0a77ace3 Fix many cases of 'avoid-ignoring-return-values'
Now that dart-code-metrics has been updated, this lint can finally be
used. So far all of these are false positives, in the sense that I don't
care about their return values.

I wish there was an easy way of marking functions whose return value
shouldn't ever be ignored.
2021-09-27 18:39:18 +02:00
c4ef1f569b Use flutter_lint
Instead of picking lint values. This way I don't need to routinely
looking at extra lints to enable.
2021-09-21 15:42:13 +02:00
33a731a3d7 Add reuse licensing to files in lib 2021-09-15 13:06:43 +02:00
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
c53b7ebbd1 Note: fileLastModified should never be null
This simplifies so much of the code.
2021-09-07 00:00:42 +02:00
3a71cca202 Move logging code to its own folder 2021-07-30 14:39:13 +02:00
2505d00dfb Replace dart:io with universal_io
Platform from dart:io cannot be used on the web for reasons. And this
way we get a fake File/Directory class which we can use for atleast
running the web version, even if it won't work.
2021-07-30 11:39:26 +02:00
009ec48a8c One less use of dart:io
dart:io cannot be used in the web
2021-07-30 11:03:36 +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
54195a16da null safety++ 2021-05-18 11:09:42 +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
f2cf9dbfff Handle cache crash
Not sure how this can happen.

Fixes APP-YN
2021-03-05 14:50:07 +01:00
ae70ab8b8f NotesCache: Save file atomically
Fixes APP-QV
2021-03-02 10:19:12 +01:00
2016793b97 NotesCache: Print logs of how many items are saved / loaded 2020-12-27 10:34:16 +01: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
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
97812e1501 Convert more prints to logs
This way they will show up in the LogViewer
2020-06-10 13:25:22 +02:00
b9b53f28c4 Log some exceptions are warnings
These aren't really a problem, but it's still interesting to know if
they are happening.
2020-05-31 02:00:00 +02:00
d665981182 Allow Git remote host to be reset
This is quick and dirty way of fixing the problem. It doesn't migrate
the notes from the previous repo and just discards them, so you cannot
move your notes from one repo to another using GitJournal (for now), but
at least its better than having to re-install the app.

Related to #36
2020-05-26 23:53:14 +02:00
87393ac588 NoteCache: Avoid duplicates
This should ideally never happen, but it seems to be occasionally happening
for some reason.
2020-05-14 16:59:03 +02:00
ff2ac647c5 Remove unused imports 2020-04-17 10:33:31 +02:00
6c47016c8b logException: Also log to Sentry 2020-04-17 09:42:19 +02:00
bb0e574495 Abstract out the logging
This way moving away from Fimber will be much easier.
2020-04-04 11:50:57 +02:00
4c73840d43 NotesCache: Increase its size to 20
With the cards view, we see way more notes.
2020-04-04 10:36:08 +02:00
965639e6f2 Add the concept of Folder Settings
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)
2020-03-31 11:16:04 +02:00
5db269c826 NotesCache: Allow for json decoding errors
The file may have gotten corrupted.
2020-03-19 23:44:50 +01:00
b252f037b3 Rename NotesFolder -> NotesFolderFS
And NotesFolderReadOnly to NotesFolder. It just makes more sense this
way as we're now getting more and more different "types" of
NotesFolders.
2020-03-15 02:01:07 +01:00
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
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
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