77 Commits

Author SHA1 Message Date
3dce1cb122 Upgrade sdk version
This way we can use the new Dart 3 features.
2023-12-22 21:23:45 +01:00
657721adc6 Update dart-git and stop using the Result class
Instead we're going to move back to standard exceptions.

Using a custom Result class has created far far more problems
- The Stacktraces aren't always right
- Sometimes one forgets to check the Result error
- All other exception throwing code needing to be converted to Results
- Non idiomatic Dart code

I think it's better to just go back to exceptions. They have their
problems, but overall, I think it's a better approach.
2023-11-24 14:03:30 +01:00
a192ae04df Fix Sorting string
Fixes #903

This broke while migrating from easy_translate to the standardized
Flutter translation mechanism.
2023-02-21 15:09:07 +01:00
9400c701bc Fixed bug where commit message for move had the source path for the destination path 2023-02-16 13:26:12 +01:00
d164562b54 Make sure the rootFolder says "Root Folder"
Instead of some empty text
2023-01-20 12:52:06 +01:00
756465c76f Handle a few more cases of easy_localization
We are almost done
2022-11-27 19:02:32 +01:00
9425f11685 Map a lot of the settings translation strings to enums
This is a lot of boilerplate, but overall its less than what was there
previously. And if I didn't care about preserving the settings, I could
simplify it a lot more.
2022-11-27 18:55:39 +01:00
6f2ce4a6b5 Port more uses of LocaleKeys to new translation system 2022-11-27 17:42:26 +01:00
9a14048bf6 License change some files
Any files with external contributions need to be Apache2 licensed, since
I don't have any CLA, and need to release this on the ios store where
*GPL apps are a problem.
2022-09-01 16:34:47 +02:00
63e05c3212 Add Unix timestamp magnitude option
This allows switching the precision of Unix timestamps in YAML
frontmatter between second (the current beahaviour) and millisecond
(compatible with Dendron) precision.
2022-07-21 13:51:55 +02:00
dbb86cba99 Add created and modified date format options
Two values:

- Unix Timestamp is a numeric timestamp value, currently always
  expressed in seconds.
- ISO 8601 follows the ISO 8601 format.
2022-07-21 13:51:55 +02:00
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
ea221941e0 Fix renaming a note test 2022-02-28 14:02:59 +01:00
ae09b1ba12 Add unawaited or explicitly wait
There are still many cases (over 60) to fix.
2022-02-23 15:15:49 +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
dd88bf2cb7 Repo.createFolder: Allow it to fail 2022-01-26 12:01:47 +01:00
6eaae014da NotesFolderFS: Simplify
Avoid passing the FileStorage since the parent already has it
2022-01-26 12:01:47 +01:00
c9a031dd29 moveNote: Add test + fix
Fixes #590
2022-01-26 12:01:47 +01:00
4b9b40045c Allow the 'editor type' yaml key to be configured
The keyword 'type' intefers with Foam.

Fixes #567
2022-01-22 10:40:10 +01:00
901e4b5cb9 Avoid importing dart_git's Result class
It's easier to see where all dart_git is used this way, and this result
class should be refactored into its own package anyway.
2022-01-22 10:11:45 +01:00
f5ef08fd09 Repository.rename: Fail if the destination exists 2022-01-21 21:29:11 +01:00
abbfbba961 Add a high level test for renaming a Note
Now that GitJournal is following a redux style, writing tests for the
domain logic is much easier.
2022-01-21 16:27:48 +01:00
83d122d06f Note.oid: The oid is now only empty when the file hasn't yet been saved 2022-01-20 17:51:32 +01:00
b38c97454b Compute the file hash on saving a note
It's not ideal as the hash is now calculated twice, but it simplifies
such a large porition of the code as I can put proper asserts to make
sure all Files in the NotesFolderFS always have a valid GitHash.
2022-01-20 15:43:22 +01:00
7bdf52165c Ensure the Note's file is reloaded on reloading the Note
Also add more asserts.
2022-01-20 14:34:48 +01:00
802b177d3e Remove invalid assert
This will happen when a note is modified or a new note is added.
2022-01-20 14:05:47 +01:00
61e5304991 Ensure the File oid is never empty
This shouldn't be happening
2022-01-20 13:39:30 +01:00
812860aa78 FlattenedNotesFolders: Update the note internally when modified
This wasn't needed before as notes were passed by reference. Whereas
they are now immutable.
2022-01-20 12:26:58 +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
a6eb613b5a Fix note renaming 2022-01-14 17:09:41 +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
e2b6d94eda analyzer: Fix unnecessry includes 2022-01-13 19:03:16 +01:00
f4e8437c91 FolderTree: Subfolders shouldn't show the full path 2022-01-13 18:27:10 +01:00
0441bc51e2 Enable assert 2022-01-07 16:08:35 +01:00
0997844e4e FlattenedNotesFolder: Optimize
Using a list causes quite a big slowdown when inserting notes as one has
to check if the note has already been inserted.
2022-01-05 15:51:32 +01:00
4d337c3d6f Find index numbers in the FlattenedNotesFolder
I'm an idiot
2022-01-05 15:27:25 +01:00
787fd783b7 Reload the FileStorage cache if it is missing items
I'm not sure if this is a good idea as it results in the same Repo being
rebuilt again and again and again.
2021-12-29 11:20:28 +01:00
fce67766db Fix renaming a new note
Don't propogate the signals as that note isn't attached to a folder so
far. This method of renaming is too hacky.
2021-12-22 21:35:15 +01:00
812a7b5263 FlattenedNotesFolder: Fix note index 2021-12-22 21:30:39 +01:00
8867e13c16 FilteredNotesFolder: Implement it properly
I wasn't taking folders which have finished loading into account.
2021-12-20 15:02:38 +01:00
073de700e5 Avoid double flattening 2021-12-20 09:28:00 +01:00
7830737a17 cleanup 2021-12-20 09:28:00 +01:00
ff1f944761 Extra assert 2021-12-20 09:28:00 +01:00
2fecc1ab1d NotesFolderFS: Do not replace the original folder on load
Otherwise the notifiers are lost.
2021-12-20 09:28:00 +01:00
f4fc349e99 NotesFolderNotifier: More asserts 2021-12-20 09:28:00 +01:00
4c95e739ed Always update the entityMap 2021-12-20 09:28:00 +01:00
391ad685a8 NotesFolderFS: Update the entity map as well
urgh.
2021-12-20 09:28:00 +01:00
60b2922176 NotesFolder: Only notify if modified if really modified
Reloading the note doesn't count as a modification
2021-12-20 09:28:00 +01:00
559b0495d2 Make the sorting stable 2021-12-20 09:28:00 +01:00