cone icon indicating copy to clipboard operation
cone copied to clipboard

Copy existing transaction to data entry form

Open bradyt opened this issue 4 years ago • 2 comments

I think this is ready, implemented and working, but filing the issue for visibility, and as a point of reference, as I haven't deployed it yet. Commit is on master branch, at https://github.com/bradyt/cone/commit/d91cf74b03432fc3c6a6521f5327d7a2aebb34e1.

In the version of cone after current, v0.2.20+28, there will be a new feature where if you tap on a transaction, the add button becomes a copy button. Pressing it will open the data entry form, pre-populated with the contents of the selected transaction.

          child: (store.state.transactionIndex == -1)
              ? const Icon(Icons.add)
              : const Icon(Icons.content_copy),

The pre-populated values actually appear as hintText, so that you can start typing a new value without needing to delete the current one, but maybe that is a strange idiom, and really we just need to add a clear button for text fields.

The idea was inspired in discussion on IRC, with hledger author, where I was trying to brainstorm on how to implement a way to add entries faster, such as described in the recently filed template issue. At one point, they mentioned a lot of their faster transaction adding is just copying previous transactions in their editor. And so that inspired this copy feature.

The great thing about a copy feature, is it starts to approximate templates, editing, deleting, without adding any state to the app. The UI is just a function of your ledger file.

bradyt avatar Mar 13 '20 08:03 bradyt