bradyt / cone

A ledger.
https://cone.tangential.info
20 stars 5 forks source link

Templates or default balancing transaction #60

Open thinlines opened 4 years ago

thinlines commented 4 years ago

Installed from FDroid: v0.2.18

Howdy, love the app so far. Great work! Here's a use-case I was considering:

I take the subway every day in Beijing, and I want to make an entry in my ledger when I pay my fare. Current steps to make an entry:

  1. Type subway into payee box (or select autocomplete)
  2. Select account expenses:transportation
  3. Enter amount
  4. Select balancing account
  5. Hit save

I was thinking it would be nice if it went more like this:

  1. Type subway into payee box
  2. Enter amount for pre-populated first account (expenses:transportation)
  3. Tap Save

The accounts (and potentially amounts, too) would be taken from the most recent transaction with the same payee and autofilled into the form. They could be grey or something to let the user know that they are default values. This autofill behavior already works for balancing amounts entered. If the user wants to change them, the user can start typing in the field and have it work just as if the field were empty. If the user wants to delete one, the user can just swipe it away, as is currently supported.

Alternatively, there could be some sort of template based on account. For example, expenses:food might usually balance with assets:cash. I think the former idea is more robust and easier to implement, though.

bradyt commented 4 years ago

I think the first improvement towards this would be to sort the account suggestions by frequency. That could probably be done just in modifying the following function and its corresponding tests.

https://github.com/bradyt/cone/blob/629445b7c3098fb91874b559ebab99408adaf1f9/cone_lib/lib/src/parse.dart#L84-L106

So instead of a Set, maybe add to List, then construct the frequency Map, and generate a new sorted List based on that.

I'm looking at a few other aspects of the project at the moment, and my schedule is busy, but hopefully we can get this small improvement in soon.

bradyt commented 4 years ago

Small improvement at https://github.com/bradyt/cone/commit/ecb261ec257dce7a807095ec64bd862cbcb1611e, sorts accounts by frequency, then by recency. Should be on Google Play in less than a day, F-Droid in less than a week.

Maybe we can have a different sort order per posting line. EDIT: Your idea is interesting, that for example the completion of the second account should be a function of what was entered for the first account. We could on the one hand, have a list of second accounts for each first account. But I wonder if we can make this more general, more symmetric in the accounts, and allowing for an arbitrary number of postings.

I realize these aren't the original issue, but I'd like to motivate the right next difficult problem by finding the low hanging fruit that speeds up your workflow.

bradyt commented 4 years ago

Another approximation towards this feature is at https://github.com/bradyt/cone/issues/64. Not released yet. Rather than the app trying to figure out what the user needs, the user explicitly selects a transaction from the home page, to copy to the form's hintText with.