100 Commits

Author SHA1 Message Date
51ececd150 Immediately save the note when changing
Earlier we would wait till we got the 'mutex' to make a change, however
with the way libgit2 works, during a git push/pull other git operations
such as add/rm/commit block.

So performing a save, while the push/pull is occuring - might have
resulted in a note being lost

Related to #124
2020-06-10 13:03:28 +02:00
267ecb7499 Implement a very basic file system view
This will show all the files and not just the "notes". This way the user
can easily figure out why a file isn't included in the list of notes.

It's currently disabled by default as it clearly needs a lot more work.
2020-06-10 00:54:15 +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
ee1009b087 Avoid hardcoding the git repo folder's name everywhere
This way, in the future we can support multiple repos, and more
importantly it will be easier to reconfigure the git host.
2020-05-26 23:49:57 +02:00
c6ec94dab6 Log when lock obtained
Notes don't always seem to get deleted, and I'm not sure why that's
happening.
2020-05-18 00:35:48 +02:00
188740974f Firebase Analytics: Set onboarded property
This makes it easier to calculate the actual retention rate as some
40-50% of the users never land up setting up a git sync.
.
2020-05-13 11:56:36 +02:00
8636021952 SyncButton: Show number of unpushed changes
Related to #123
2020-05-01 11:09:40 +02:00
152a95d4e9 Record when an action is performed on a Note/Folder
This way I'll have statistics about how the app is used and more
importantly, figuring out crash reports will be easier as there will be
a rough trail of actions.
2020-04-22 01:31:48 +02:00
77e67fca11 Rename Folders properly
1. Actually rename the folder instead of calling rename with the oldPath
2. Inform the parentFolder that a sub-folder has been renamed so it can
accordingly update its mapping.

Fixes #108
2020-04-20 02:11:42 +02:00
5784399ac6 Remove NotesFolderFS::insert
The position of the note in the folder doesn't matter as Virtual folders
on top of this sort it according to how to how the user wants them to be
sorted.
2020-04-20 01:56:32 +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
bbaf5b4452 Wait for previous completion of loadNotes
Fixes APP-R
2020-04-16 09:35:18 +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
fe08b53539 Add a .gitjournal.yaml file in a folder
This file will be added to save the settings of how we want that folder
to behave. For example - default Editor, view, sorting mode, etc.

This feature is currently disabled as it will only be a part of the pro
mode.
2020-03-31 14:02:38 +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
577b73ff3c SyncButton: Seperate pulling and pushing
This way we also refresh the view after the pulling, as we don't need to
wait for a push for that.
2020-03-30 13:00:28 +02:00
a99eca9131 Simplify code by using pathSpec 2020-03-21 00:52:54 +01:00
eb7d7dc2e7 Add a lock between all git operations
This way in between a git add + git commit, no other git operation will
run. This rarely occurs but it was a posibility depending on the speed
of the users actions.
2020-03-21 00:44:14 +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
31262e5f7d Add some debug messages 2020-03-01 14:53:11 +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
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
3a3ec76529 StateContainer: Use Provider
This way we can avoid listening for changes in many places.
2020-02-11 19:10:34 +01:00
e0f03d703e Allow remote sync frequency to be controller
For now the only 2 options are - automaitic and manual.

I rather name it "Automatic" instead of "After each change" as that way
I can choose to do it more frequently, if desired.

Fixes #8
2020-02-09 22:23:39 +01:00
49192026a7 NotesFolder: Do not allow changes in the folderPath
Otherwise the NotesFolder can reach an inconsistent state.
2020-02-09 17:08:31 +01:00
0c0fd17543 syncNotes: Catch the exception outside the StateContainer
The StateContainer doesn't have access to the snackbar.
2020-02-09 16:32:35 +01:00
56fa627de7 moveNote: Do nothing if dest is the current folder 2020-01-29 17:05:21 +01:00
43281bd2bb Add support for moving a Note to another folder
The Folder selection dialog needs a lot of work, but it's a start.
2020-01-29 16:51:57 +01:00
3f40a2992a Add the concept of Editors
* We no longer have a separate editing and browsing view - This does
mean we loose the ability to quick flip between notes by swiping.
However, this is more how a note editor would behave. I do later want to
add that capability back.

* We have 2 editors for now - Markdown and Raw. By default we use the
Markdown editor which can be toggled between Preview / Edit mode.

I later want to add a rich text editor and a todo editor as well.
2020-01-29 00:04:24 +01:00
8c5720c34b Note Rename: Do not let it be renamed to a non markdown file
Otherwise it disappears from the listing as we only show files which end
with a '.md'.
2020-01-27 23:11:42 +01:00
f8e7773f16 NoteBrowser: Add a button to rename notes
Fixes #23
2020-01-27 23:09:11 +01:00
a759ad4a23 Combine showSnackbar code
It's annoying to always have to remember to call it. We had forgotten in
one place and that resulted in a lot of noise.
2020-01-27 19:02:44 +01:00
b6b49e84e4 Simplify the code
Now the Note's modified/created can never have a date with a year = 10
meaning a special thing.
2020-01-07 23:56:58 +01:00
8a6b6023d6 Sync: Combine crashlytics code 2019-12-27 00:37:20 +01:00
6af3b03210 Add a sync button to the AppBar
This somewhat shows what's going on with the network. It isn't ideal, as
is a bit ugly. But it's a start to show the network status, and what's
going on in the background.
2019-12-26 20:43:12 +01:00
70877438eb Git: Take the folderPath instead of folderName
The Git Api was strange and took a foldeName and it would only allow you
to access git operations in a particular path. This has now been fixed,
and now it can operate in any path.

This was the first step to moving the git api into its own library.
2019-12-20 20:40:00 +01:00
591ba30762 Fix flutter analyze 2019-12-11 21:48:46 +01:00
abb6029798 Allow Folders to be deleted
For safety we're only allowing non-empty folders to be deleted. Ideally,
we should have some kind of undo button. Or some kind of history - since
we do have that with git.

Related to #18
2019-12-11 21:43:08 +01:00
b0b7da5291 Move storage classes into core
The Git functionality is fairly core!
2019-12-09 01:19:44 +01:00
cd24d2688f Never let the Note be in an invalid state
It's a bit confusing that the created date has to be set when creating a
new note, and the path had to be constructured properly, without which
the note shouldn't be saved. Ideally, an object shouldn't be able exist
in such an inconsistent state.
2019-12-09 01:14:45 +01:00
76f70f0d18 Note: Store when last modified
Also sort the notes based on when last modified. Now that we're moving
towards being a more note-taking app, it makes sense that a recently
modified note goes on top.

Of course, the sorting should be controllable by the user, but the
default probably should be by when modified.
2019-12-09 00:02:40 +01:00
8a49d948f0 StateContainer: Do not call setState when the notesFolder changes
The NotesFolder is now a listenable and is always accessed via Provider,
and therefore doesn't need setState to be called when it is modified.
2019-12-08 02:58:56 +01:00
62207eb6c7 StateContainer: Mark a field final
With this we're one step closer to making the StateContainer a stateless
widget.
2019-12-08 01:27:40 +01:00
7dafdaa617 StateContainer: noteRepo doesn't need to be public
Also lets call it gitRepo instead
2019-12-08 01:10:50 +01:00
8c6a33456a Allow folders to be renamed
This is a huge change which involves -
* Implementing Folder renames on the FS + Git level
* Implementing the concept of selecting an item in the FoldersListView,
  this feature isn't provided by default, and even now I'm not sure if
  the semantics which I've implemented are correct. I haven't
  implemented multiple folder selection for now.

Related to issue #18

Also, we're now one step closer to allowing notes to be renamed (#23)
2019-12-06 21:32:41 +01:00
975b235df3 Add Folder creation
Folders for now can only be created under the root folder. I cannot seem
to figure out how to design a good interface for designing how to choose
the parent folder.
2019-12-05 17:08:02 +01:00
5b8fc6342a Connect the AppState to the Folders
Now when adding/editing/removing a note, it gets modified from the
directory it was present in. There is no longer a just a plain list of
all notes, but always a tree of notes, which are inside Folders.
2019-12-04 15:33:30 +01:00
10d65cd6fb Rename NoteFolder -> NotesFolder 2019-12-04 15:33:27 +01:00