70 Commits

Author SHA1 Message Date
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
464b7512e9 Move Note and NoteFolder class into a core folder 2019-12-04 14:18:11 +01:00
56ccf00260 FolderListing: Show the actual folders
Also don't load hidden folders
2019-12-04 00:35:29 +01:00
7ba8faa57f Remove the entire concept of a subFolder
When configuring the Git Repo server, we could optionally track one folder
in the root git repo, instead of just the root folder. This was
specifically to address my use case where I have my journals in a
sub-directory. The setup screen was super ugly, though.

Since now I'm in the process of adding folder support because of #18, I
can remove this hack. It simplifies the code a lot.
2019-12-01 12:04:45 +01:00
5d69dd9de2 AppState: Remove isLoadingFromDisk
It isn't actually used anywhere. I want to simplify this as much as
possible, as I want the note loading to be as lazy as possible.
2019-10-20 00:54:34 +01:00
69003cf0ac Rename package from journal -> gitjournal
It's about time.
2019-10-07 19:30:50 +02:00
c144f14816 Avoid saving hasJournalEntries
It can be a simple getter
2019-10-04 04:37:41 +02:00
3d8aa2ad70 AppState: Move loading/saving to where the data lies 2019-10-04 04:35:02 +02:00
890fd059d4 Remove unused base class 2019-09-26 17:27:29 +02:00
186f6b0af3 Refactor: Remove FileStorage
With this, the application compiles again. And note editing is working
again. This is was the first of some small refactors in order to
implement both async note loading and a support for directories.
2019-09-26 17:22:52 +02:00
11a9023e99 Allow the Note FileName to be configured
This is super ugly, but it solves a real use case, and hopefully I'll
eventually get around to improving the UI of the Settings page.
2019-09-25 15:41:19 +02:00
74d7bdd763 Use a proper logger - Fimber
It's time to start using a proper logger so we can control the number of
log messages, also - it helps to have a central configuration point for
the logs, specially since I would like to hook them up to Crashlytics in
the future.
2019-06-19 09:45:15 +02:00
89f7c10ba9 Analytics: Send events when the notes are loaded
I want to know why they failed to load.
2019-06-14 17:26:51 +02:00
2bfd6ea199 setState may not be async 2019-06-02 15:58:57 +02:00
8ff5d02033 DartLinter: Add unnecessary_this 2019-02-23 01:33:34 +01:00
29c8da11fb Enable OnBoarding 2019-02-16 13:24:48 +01:00
475315785c Delete Note: Do not sync untill the snackbar has gone
Otherwise we would have already pushed that change to the server, and
undo-ing it will be impossible.
2019-02-15 20:12:13 +01:00
a32f01b2c4 Implement undo delete properly
This way the git History is not modified.
2019-02-15 19:58:58 +01:00
428c0bb611 Note Edit: Immediately update that note in the list
Otherwise, it's only after syncing and reloading the entire list of
notes do we see the update. This process is usually quite fast, but
not always.
2019-02-14 23:45:50 +01:00
ac7d7f7445 Disable onBoarding screen for now
I want to make a new release, and the onboarding is clearly not ready.
2019-02-14 14:35:04 +01:00
03e46ce8cd Allow notes to be stored inside a sub-folder in a git repo 2019-02-14 12:59:43 +01:00
8345f1424e Note: Rename 'fileName' to 'filePath'
A note can reside in a subfolder, so lets just use the path as an
identifier instead of using just the fileName.
2019-02-14 12:07:23 +01:00
c819f49afe Add a very basic onBoardingScreen 2019-02-14 01:44:57 +01:00
6fea27e0ca Show +1 notification badge after user has made a journal entry 2019-02-14 01:11:35 +01:00
acede95536 Dart: Add analysis_options
For now I've mostly tried to follow the same style guide as the flutter
repository, with many options disabled. Eventually, maybe it would make
sense to be far stricter.
2019-02-13 13:08:15 +01:00
285a900e76 Rename OnBoarding to GitHostSetup
It was either GitHost or GitRemote.
2019-01-25 12:05:32 +01:00
170983024c Fix Clone screen not disappearing
and other misc changes
2019-01-23 12:48:37 +01:00
2b1ac6cad7 Hookup onBoarding screen to app
* I should probably stop calling in an onboarding screen, since it's now
just a way to setup sync.

* It overall feels quite ugly, and unpolished.
2019-01-23 12:13:02 +01:00
a29a102667 Move git api to apis folder 2019-01-23 11:54:02 +01:00
519de8fcff Remove onboarding screen
For now just create a local git repo and commit all the changes over
there, we're going to allow the user to first see the app and use it
however they want, and later connect it to a remote git repo.

This commit breaks the app, as the on-boarding screen is no longer
connected so you cannot push to a remote app.
2019-01-21 13:43:33 +01:00
c99fe854a1 Note: Replace 'id' with 'fileName'
It all just makes far more since when each Note has a fileName.

Though we don't save the fileName in the YAML header. It seems quite
redundant to do that.

Another advantage of this is that if we can read any file ending with a
'.md' in a git repo. It doesn't need to be named exactly how we want it,
and we will still save the details correctly.
2019-01-18 16:12:03 +01:00