mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:12:38 +00:00
Improve Send and Send Review pages #860
No reviewers
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!860
Loading…
Reference in a new issue
No description provided.
Delete branch "send-improvements"
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?
This is an omnibus PR that fixes a several issues related to Send and Send review pages.
Review note: The changes are organized into focused commits, so this PR is best reviewed commit by commit.
Everything looks good in this PR. Just want to check if we should go ahead and handle full bitcoin uri's with this PR or not.
Should we go ahead and add Uri parsing for all input fields?
The uri can contain data for the amount and label as well. Would probably need to be handled at the form level instead of just the input fields so that the rest of the fields could be modified when pasting. We'd also probably need to confirm overwrite if there is already information in the unfocused fields.
This is a good suggestion. The commit
qml: Parse payment URIs pasted into send fields(8cf4f065d7f8e9a6917b3bc42087fa73d5290250) does this now.I think this might be making too big of an assumption about how pasting form the clipboard is configured. I don't know that we can assume ctrl+V is always the paste combo
I removed the shortcut-specific paste interception. Bitcoin URIs are now detected when the field content changes and handled at the Send form level, so this works with platform-specific keyboard shortcuts, context-menu paste, and other paste mechanisms.
Paste handling still breaks older supported Qt versions and mixes user paste with model updates.
Would it be simpler to keep the previous explicit paste handler and use
event.matches(StandardKey.Paste)instead of checking Ctrl/Meta+V? Qt would handle the platform shortcut mappings, the handler would run before validation, and model updates would not be treated as pastes. A context-menu Paste action could call the same shared handler. This may remove the need for the new text synchronization code.TextAreahas notextEditedsignal in supported Qt 6.4 and 6.8. CI fails here and the Send page cannot load.onTextChangedalready callshandlePaymentUriInput(), so this line can be removed.This only works when the URI replaces the whole field. The amount field starts with
0.00000000, so a normal paste at the cursor is rejected by the validator. The test hides this by callingselectAll()first.Please compare the old and new text to find what was inserted, verify it matches the clipboard, and parse that value.
StandardKey.Pastecan handle platform keyboard shortcuts, with the same handler used by the context menu. This should also reduce the need forsyncFromAddress().onTextChangedalso runs for model updates. If a label contains a valid Bitcoin URI, it gets parsed again and can set an amount that was not in the original request. I reproduced an encoded label setting the amount to 1 BTC. Please only check user edits or add a sync guard.Fixed. I removed TextArea.onTextEdited. Now handle native context-menu paste through the guarded onTextChanged path, which should be compatible with the Qt versions
Fixed in Native context-menu paste now compares the previous and current text, verifies that the inserted substring matches the clipboard.
I also removed the
selectAll()calls from the functional test so it now covers pasting directly at the cursorThis is crazy and a great catch. Should be fixed now.
Took the suggestion. Keyboard paste now uses
event.matches(StandardKey.Paste), allowing Qt to handle the platform shortcut mapping. Keyboard and native context-menu URI pastes are both routed through the shared Send form handlerRebase and make the changes to the testcases to match the current pattern
this should be less flakey
this is to use the window that qt quick test already provides
These need to be updated now to remove gTest
ACK
f121078eff