Skip to content

Conversation

@Sjors
Copy link
Member

@Sjors Sjors commented Feb 13, 2018

Before this change QT just remained on the Send tab, which I found confusing. Now it switches to the Transactions tab. This makes it more clear to the user that the send actually succeeded, and here they can monitor progress.

Ideally I would like to highlight the transaction, e.g. by refactoring TransactionView::focusTransaction(const QModelIndex &idx) to accept a transaction hash, but I'm not sure how to do that.

@laanwj laanwj added the GUI label Feb 13, 2018
@laanwj
Copy link
Member

laanwj commented Feb 13, 2018

Concept ACK

@maflcko
Copy link
Member

maflcko commented Feb 13, 2018

utACK ddbc5aaee1bdb69583eb711ad3145fa5f8b67933

@promag
Copy link
Contributor

promag commented Feb 13, 2018

just remained on the Send tab, which I found confusing

IMHO this is more confusing, having such sudden UI change. What if he wants to do multiple sends?

How about adding a checkbox like [x] View transaction after sending and remembering the checkbox state in settings?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the idea is to highlight the transaction, adding the txid or like can help.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can extract the tx id and pass it along as a string. The part I couldn't figure out is how to convert that to whatever focusTransaction(const QModelIndex &idx) needs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Sjors
Copy link
Member Author

Sjors commented Feb 14, 2018

@promag I don't think I've ever seen an online banking application that doesn't take the user to the transaction overview page after sending money.

In most financial applications Send is a modal experience, where the Send screen is pushed on top of the transaction screen and popped when the user is done. In a desktop browser that's usually a modal window, on an iPhone it's a window that animates in from the right, with an arrow on the top left to dismiss it. Doing another send is then simply a matter of clicking on Send again.

Making the experience modal might be too much of a change, but e.g. we could get rid of all tabs: merge the Overview and Transactions tab, Send and Receive open a new window.

I do think highlighting the new transaction would give a better visual clue to the user as to why they moved to this other tab.

@jonasschnelli
Copy link
Contributor

utACK ddbc5aaee1bdb69583eb711ad3145fa5f8b67933

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sjors like you say the current layout is very different from those you mention. Anyway, ACK with the row focus.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment? It's only relevant below when connecting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, add

    ui->checkBoxCoinControlChange->setChecked(false);
    ui->lineEditCoinControlChange->clear();

like #12432?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coin control fields, custom change address and selected inputs, are already cleared after you send.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify custom change address checkbox and line edit because here they are not cleared.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Turns out #12432 fixes that, because SendCoinsDialog::accept() is called when the transaction is sent, which in turn calls clear().

@practicalswift
Copy link
Contributor

Concept ACK

@randolf
Copy link
Contributor

randolf commented Feb 15, 2018

Concept ACK.

@Sjors Sjors force-pushed the 2018/02/qt-goto-transactions-after-send branch 3 times, most recently from 26fd965 to 44c7768 Compare February 15, 2018 17:56
@Sjors
Copy link
Member Author

Sjors commented Feb 15, 2018

It now highlights the transaction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (results.isEmpty()) return;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after if, one line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const QString& txid so that it's clear what the argument is?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@promag promag Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC this performs linear search. Probably something worth to optimise in case of bigger wallets in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are transactions in reverse chronological order? In that case it should be pretty quick, unless some race condition causes the new transaction to be missing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transactions are displayed in whatever order the user chooses. I'm not sure what order is internally used, however...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a fresh wallet and then called generate 10000. I didn't notice any delay when sending transactions, although my machine is relatively fast. I also tried reversing transaction order in the view.

@Sjors Sjors force-pushed the 2018/02/qt-goto-transactions-after-send branch from 44c7768 to ea04610 Compare February 16, 2018 15:47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh on using strings for internal uint256 transport.
Why not uint256? Could also register the type if not yet supported.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried passing the uint256 directly and got a bloodbath of compiler errors. How do I go about registering the type?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Q_DECLARE_METATYPE, see

// Declare meta types used for QMetaObject::invokeMethod
Q_DECLARE_METATYPE(bool*)
Q_DECLARE_METATYPE(CAmount)

@Sjors Sjors force-pushed the 2018/02/qt-goto-transactions-after-send branch from ea04610 to fdea382 Compare February 19, 2018 15:27
@Sjors
Copy link
Member Author

Sjors commented Feb 19, 2018

Now passing the transaction hash as uint256.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK fdea382.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use reference? const uint256& txid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use reference? const uint256& txid.

@Sjors Sjors force-pushed the 2018/02/qt-goto-transactions-after-send branch from fdea382 to b7ebe39 Compare February 20, 2018 12:21
@promag
Copy link
Contributor

promag commented Feb 20, 2018

reACK b7ebe39, only changes are the suggested above.

@luke-jr
Copy link
Member

luke-jr commented Feb 27, 2018

What if he wants to do multiple sends?

@promag Then he should do them all at once...


if (results.isEmpty()) return;

focusTransaction(results[0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We support selecting multiple transactions, so this ought to select all of them...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider more than 1 result an error, given that we're passing a single tx id. I could replace the isEmpty() with a check that length is 1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely not an error. The transaction list shows logical transactions, not blockchain transactions. There is 1 txid per blockchain transaction, but that could be many logical transactions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see what you mean. E.g. sending to two destinations in one transaction results in two rows in the transactions tab.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luke-jr 👍

@promag
Copy link
Contributor

promag commented Feb 27, 2018

@luke-jr agree, came to the same conclusion little after.

@Sjors
Copy link
Member Author

Sjors commented Feb 27, 2018

I'd like to select both entries on the transaction screen when a user sends to two addresses. Unfortunately:

  • this->model->getTransactionTableModel()->match(... only returns one entry.
  • transactionView->selectRow(...) deselects whichever row was previously selected (even though the user can manually select multiple transactions)

@luke-jr
Copy link
Member

luke-jr commented Feb 27, 2018

https://doc.qt.io/qt-5/qtableview.html#setSelection with QItemSelectionModel::Rows (and probably QItemSelectionModel::ClearAndSelect).

Why would match only return one entry??

@Sjors
Copy link
Member Author

Sjors commented Feb 28, 2018

Why would match only return one entry??

I don't know. Here's a WIP commit. The fprintf(stderr, "row: line is only called once.

I'm confused about the relation between this->model->getTransactionTableModel(), transactionView and transactionProxyModel. E.g. what does QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx); do? My intuitive grasp is that there's somehow multiple representations of the same data. Maybe @laanwj can explain the big picture here?

@Sjors
Copy link
Member Author

Sjors commented Feb 28, 2018

I added @promag's commit to enable multi row selection. Note that if the user scrolls down, it won't scroll up. And if the user orders transactions by ascending date and scrolls down, it won't scroll further down to reveal the new transaction.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK after squash and comments addressed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could ensure first row is visible:

for (...) {
    if (index == results[0]) transactionView->scrollTo(index);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That worked (using transactionProxyModel->mapFromSource) when transactions are ordered by date. Unfortunately when they're ordered in reverse it doesn't scroll all the way to the bottom. Maybe we need to wait a little bit for transactionView to become aware of its new size?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, add space after if.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid copy here:

const uint256& txid = ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or roll it into the Q_EMIT, as txid is not used after this. YMMV. For performance I'd be surprised it makes any difference.

Q_EMIT coinsSent(currentTransaction.getTransaction()->GetHash());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rolled into Q_EMIT.

@laanwj
Copy link
Member

laanwj commented Feb 28, 2018

@promag I don't think I've ever seen an online banking application that doesn't take the user to the transaction overview page after sending money.
@promag Then he should do them all at once...

+1

Copy link
Member

@laanwj laanwj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or roll it into the Q_EMIT, as txid is not used after this. YMMV. For performance I'd be surprised it makes any difference.

Q_EMIT coinsSent(currentTransaction.getTransaction()->GetHash());

@Sjors Sjors force-pushed the 2018/02/qt-goto-transactions-after-send branch 2 times, most recently from f22196f to 48ef8d8 Compare February 28, 2018 14:47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my system calling transactionView->scrollTo(targetIndex) for every model index fixes it (not sure why). It also works in the default order because scroll hint is QAbstractItemView::EnsureVisible, so focusing the 2nd row will not remove the 1st from the viewport (the 2nd row is already visible).

But it's also possible to order by other column (for instance address), and in that case it can be impossible to show the whole selection in the table viewport.

I see 3 possible solutions for that:

  • do nothing :trollface:;
  • automatically sort by date descending (new rows will be the first);
  • automatically fill the filter field with the new txid.

Copy link
Member Author

@Sjors Sjors Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I call scrollTo for every model index and transactions are sort by ascending date, things get weird: if I send to two destinations it scrolls correctly, but if I send to one destination it won't scroll far enough.

Calling scollTo() twice "fixes" it. Seems suspiciously similar to this I'll poke around a bit.

I prefer your first solution for the case where transactions are not ordered by date. At least one of them will be in view.

The transaction will be selected. When sending to multiple
destinations, all will be selected (thanks @promag).
@Sjors Sjors force-pushed the 2018/02/qt-goto-transactions-after-send branch from 48ef8d8 to e7d9fc5 Compare March 1, 2018 09:40
@laanwj laanwj merged commit e7d9fc5 into bitcoin:master Mar 1, 2018
laanwj added a commit that referenced this pull request Mar 1, 2018
e7d9fc5 [qt] navigate to  transaction history page after send (Sjors Provoost)

Pull request description:

  Before this change QT just remained on the Send tab, which I found confusing. Now it switches to the Transactions tab. This makes it more clear to the user that the send actually succeeded, and here they can monitor progress.

  Ideally I would like to highlight the transaction, e.g. by refactoring `TransactionView::focusTransaction(const QModelIndex &idx)` to accept a transaction hash, but I'm not sure how to do that.

Tree-SHA512: 8aa93e03874de8434e18951f8aec47377814c0bcaf7eda4766fc41d5a4e32806346e12e4139e4d45468dfdf0b786f5a7faa393a31b8cd6c65ccac21fb3782c33
@Sjors Sjors deleted the 2018/02/qt-goto-transactions-after-send branch March 1, 2018 14:09
maflcko pushed a commit that referenced this pull request Aug 20, 2018
…e bump

d795c61 [qt] TransactionView: highlight replacement tx after fee bump (Sjors Provoost)

Pull request description:

  Consistent with #12421 which highlights the transaction after send.

  <img width="747" alt="1" src="https://user-images.githubusercontent.com/10217/38036280-a7358ea4-32a6-11e8-8f92-417e9e1e3e8b.png">

  <img width="685" alt="2" src="https://user-images.githubusercontent.com/10217/38036289-aac87040-32a6-11e8-9f94-81745ff6c592.png">

  ~I'm not too proud of the `QTimer::singleShot(10` bit; any suggestions on how to properly wait for the transactions table to become aware of the new transaction?~

  Although I could have called `focusTransaction()` directly from `TransactionView::bumpFee()` I'm using the same signal as the send screen. This should make it easier to move fee bump / transaction replacement functionality around later.

Tree-SHA512: 242055b7c3d32c7b2cf871f5ceda2581221902fd53fa29e0b092713fc16d3191adbe8cbb28417d522dda9febec8cc05e07afe3489cd7caaecd33460c1dde6fbc
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 14, 2020
…send

e7d9fc5 [qt] navigate to  transaction history page after send (Sjors Provoost)

Pull request description:

  Before this change QT just remained on the Send tab, which I found confusing. Now it switches to the Transactions tab. This makes it more clear to the user that the send actually succeeded, and here they can monitor progress.

  Ideally I would like to highlight the transaction, e.g. by refactoring `TransactionView::focusTransaction(const QModelIndex &idx)` to accept a transaction hash, but I'm not sure how to do that.

Tree-SHA512: 8aa93e03874de8434e18951f8aec47377814c0bcaf7eda4766fc41d5a4e32806346e12e4139e4d45468dfdf0b786f5a7faa393a31b8cd6c65ccac21fb3782c33
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants