mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
One Return key press confirms "Send all funds": since #1052 alerts answer Return with their only Normal action, including irreversible ones #1139
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1139
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Since #1052, a single press of Return in the "Send all available funds?" confirmation sends the whole wallet. Before #1052 that alert ignored Return.
To reproduce, with a wallet holding one confirmed coin:
The alert closes, Send complete is shown, and the mempool holds one transaction spending the wallet's only coin. At
2bd5a61e8304, before #1052, the same key press does nothing and the alert stays open.When the alert opens, keyboard focus is on its content, not on a button. The content answers Return and Enter by triggering the alert's only action with the Normal role:
github.com/bitcoin-core/gui-qml@efc4a2c754/qml/controls/AlertPopup.qml (L159-L168)github.com/bitcoin-core/gui-qml@efc4a2c754/qml/controls/AlertPopup.qml (L116-L135)The comment on
returnActionsays this means "Return never confirms a destructive action". But "Send all funds" has no role, so it is Normal, while "Back to review" is Cancel:github.com/bitcoin-core/gui-qml@efc4a2c754/qml/pages/wallet/SendTransactionReview.qml (L375-L399)Other alerts whose only Normal action is hard to undo answer Return the same way:
In the #1052 review the rule was described as "In alerts, Return from a field runs the dialog's single primary action" (https://github.com/bitcoin-core/gui-qml/pull/1052#discussion_r4427774311). These alerts have no field. Marking these actions Destructive, or setting Cancel as their
returnAction, would stop Return from confirming them. For comparison, Bitcoin-Qt's send confirmation makes Cancel the default button and keeps Yes disabled for 3 seconds.macOS arm64 / Qt 6.9.0,
qt6atefc4a2c754eb, isolated regtest, native window. The send was done by hand with a real Return key, onefc4a2c754eband on2bd5a61e8304. For Update wallet and Close wallet I called the alert'saccept(), which is what the Return handler calls, through the test bridge (one run each). Create without encryption is from the source only.