135 Commits

Author SHA1 Message Date
99c36f32f5 Make Repository a consumer of RepoManager
I feel like I really don't understand Provider properly and this is
going to blow up in my face.
2021-02-05 09:42:51 +01:00
e3e513ef65 Log device info
This way it's easier to debug user's issues
2021-02-04 10:51:29 +01:00
05aca7a013 Logs: Output the version number
This ways it's easier to understand logs sent by users
2021-02-04 10:36:38 +01:00
96ce50bc68 Basic Implementation of RepoManager
This is for multiple-repo setup.
2021-02-04 10:27:29 +01:00
e873f1f4e2 Fix sharing to the app
It's super hacky, but since I broke it, I just want to first fix it, and
later I'll try to make it nicer.
2020-11-10 18:24:43 +01:00
466e6f0569 Reset _sharedText and _sharedImages values after use 2020-11-09 13:15:32 +01:00
9fd24169c8 Fix sharing to GitJournal
Fixes #293
2020-11-09 12:56:20 +01:00
0d22fa76c4 isolate firebase analytics code to one file
This way it'll be easier to remove in the future
2020-11-09 11:16:21 +01:00
199db78c58 Fill out experimental analytics device id 2020-11-07 17:08:02 +01:00
c37b47302d Add some clear logs about when the app was launched
It makes it easier to read the logs
2020-11-07 14:25:58 +01:00
56adb27f01 App: Use a provider consumer
I'm hoping with this if any value in the repo changes it will result in
a rubuild of the entire subtree, so this way I can change the entire
NotesFolderFS easily.
2020-10-23 16:34:38 +02:00
07d0bdb7d8 Migrate setting to be repo specific
Each attribute of the settings is prefixed with the "id" of the repo.
2020-10-23 15:25:12 +02:00
a9abf5d9b3 Make Setting Migrations independent of the Settings class
That class is going to lose many of its members, and I don't want to
keep the old ones just for compatibility sake.

Also give each setting the concept on an id - will be used later.
2020-10-23 14:38:16 +02:00
f75e119995 Make Settings take the folderName as a parameter 2020-10-23 02:29:48 +02:00
b2aa96cbe1 Give a Repository a name 2020-10-23 02:10:42 +02:00
43206219da Merge AppState into Repository
The 'AppState' was more of a Repository state, and it's easier if it
lives inside the Repository class.
2020-10-23 02:01:45 +02:00
770394a8f9 Rename StateContainer to Respository 2020-10-23 01:38:47 +02:00
f1ccae1db0 Split App into AppRouter
There is way too much code in this file, and it makes it difficult to
test and reason about. Lets start simplifying this huge class.
2020-10-22 23:22:40 +02:00
efc6e651ac Remove unused import 2020-10-20 14:09:20 +02:00
9f53115616 ios: Add iCloud capability
I cannot see the GitJournal app's data in my iCloud, but I believe maybe
my app needs to go through the app review process.
2020-10-19 20:01:36 +02:00
6b1a9caf86 Remove unnecessary logging
This was added to figure out the cause of a bug. Now that it's clear,
and fixed, I can remove these logs.
2020-10-18 09:46:43 +02:00
4f0d065bf7 Simplify the code 2020-10-17 12:38:21 +02:00
5441700f28 Move building the repo's path logic to one place
Instead of having it duplicated
2020-10-17 12:33:19 +02:00
81bd1322a6 Settings: Rename internalRepoFolderName to folderName 2020-10-17 12:28:14 +02:00
c02af7f156 Avoid unnecessary log
Left over from an experiment. Logs only stay on the device, so this
wasn't a problem, but it stays constant on Android across installs. It
would be nice to use this ID instead the random ID that we generate, but
that could be counted as personally identifyable info. I'm not too sure.
2020-10-17 11:38:30 +02:00
fd74a86abf Remove the whole local/remoteConfigured settings
We now infer this by checking if the directory exists, and by reading
the git config. It's a bit slower, but it's a far better method. I can
add a cache later, if it turns out to be too slow.
2020-10-16 15:13:34 +02:00
f44c1ce17d Collect proMode and proExpirationDate as user properties
It'll make it easier to know how many % of the users are on pro.
2020-10-16 12:52:31 +02:00
530c8ea55a Release a bug fix version
Some % of the users are badly affected by a bug, which I cannot seem to
reproduce, maybe this debug message will help.

Also, I accidentally shipped it with the bottom bar disabled.
2020-10-16 02:38:41 +02:00
5c2e336343 Save Notes Cache in the cache directory
It shouldn't be saved in the Documents folder. Now that this folder is
exposed on ios, I should remove all non-user related files from here.
2020-10-16 01:10:18 +02:00
540078c413 Improve repo migrations
Earlier we had one folder 'journal_local', when the remote would be
setup a new folder called 'journal' would be created, and each all the
files would be copied over. This meant the local history was being
destroyed.

Now, we only have 1 folder 'journal', and on 'cloning', we add the url
as a remote, and do a git fetch + merge.

This simplifies everything drastically, and opens the door for multiple
remotes.
2020-10-15 12:18:47 +02:00
2c0470a3c1 Log the gitBaseDir to try and debug what is going on 2020-10-15 10:07: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
27cad98937 Send app_update in analytics
I'm calling this event gj_app_update as firebase automatically sends an
app_update event. This is being done so that I can easily remove
firebase analytics in the future.
2020-09-30 11:27:27 +02:00
4b3f1669f5 Stop caching the gitBaseDir
It makes the entire code base far more complicated and the round trip to
get the directory really isn't that much. This is a massive
micro-optimization for very little benefit.
2020-09-26 18:52:28 +02:00
fe08834259 Split Settings into AppSettings and Settings
This way I can eventually change Settings into RepoSettings without
breaking anything.
2020-09-25 00:33:54 +02:00
f30c52f595 Move all persistent state from AppState to Settings
This way all the persistant state of the app is managed from the same
place. It makes everything much easier. Also, it's required for when
GitJournal supports multiple repositories.
2020-09-24 23:45:37 +02:00
f7adeafe7d First iteration of the Graph View
I'm testing this with the Foam documentation. This has revealed a number
of bugs in our link resolver - most of which have now been fixed.

The graph layouting is not being done as this is so incredibly slow.

This has been added as an experimental feature.
2020-09-14 17:47:26 +02:00
01a436d182 Replace FirebaseAnalyticsObserver with our own
This way we have the screen names in the debug log and diagnosing issues
becomes easier. Also, this brings me closer to being able to drop
Firebase Analytics.
2020-09-04 08:41:38 +02:00
6ba0f3974a NoteEditor: Pass it the parentFolder
A note has a parent which is the physical folder it is inside, and a
parent folder which it is being displayed inside. It's useful to have
the latter as that can be used to display the next note - in the case of
the Journal Editor, and open the graph view as well.
2020-08-20 10:42:39 +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
7936cc70b8 Analytics: Make all events into enums
No more random strings
2020-08-17 15:29:38 +02:00
d94a1e1630 Remove another use of Settings.instance
I really want to remove this global variable, and only access it through
the Provider.
2020-08-16 15:51:53 +02:00
4bcbf8226a Move onBoardingCompleted from AppState to Settings
I want to get rid of the AppState entirely. It serves exactly the same
purpose as Settings.
2020-08-16 15:29:49 +02:00
2bc9e8deaf More removals of Settings.instance 2020-08-09 01:59:07 +02:00
9d55b449d3 Settings: Access it through the Provider
Make it a ChageNotifier and try to access it through the Provider
instead of like a global variable. This way, the state is better
managed and it'll be easier to split out Settings into smaller classes.
2020-08-09 01:29:22 +02:00
98e0bead90 Revert "Make sure local git repo always exists"
This reverts commit 42d755be1d3333a374b53274236eb75718c8d265.
2020-07-30 12:05:04 +02:00
db93d5ab27 Revert "Fix the case when the repo folder disappears"
This reverts commit 2ee25e0b8ff7d0715ce419e044649980ab6c6e31.
2020-07-30 12:04:00 +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
2ee25e0b8f Fix the case when the repo folder disappears
In that case we should treat it as though the app is being freshly
launched.

Fixes APP-43
2020-07-23 17:31:58 +02:00
42d755be1d Make sure local git repo always exists
There are some cases when upgrading from a really old version that the
journal_local no longer exists.
2020-07-21 11:19:27 +02:00