mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
Activity: what should the list do when a pending transaction confirms? It currently jumps away from the newest rows #1120
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#1120
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?
When a block confirms a pending transaction, the Activity list moves by itself. I'd like to settle what it should do at that moment, because the current position looks accidental.
What happens now
The list jumps to the row that was first when the wallet's list was loaded, and that row lands near the bottom of the visible area. Most of what arrived since then is above the visible area, including most of the transactions that just confirmed: with 20 new rows at the default window size, 3 stay visible and 17 do not. The page header, search bar and filters do not scroll, so nothing shows that the list has left the top.
How far it moves depends on how many rows have arrived since the list was loaded, counted over the whole session. At the default 800x665 window:
This happened on every confirming block with three or more new rows: 33 of 33 offscreen and 13 of 13 in a native window, with identical positions at the same window size. It was the same with 5, 50 and 500 existing transactions, with Day grouping, with a search or a type filter set, at other window sizes, with the page hidden behind another tab or wallet, and for payments sent from the app.
What does not move the list:
If the user has scrolled down to read older history, that position is kept while payments arrive and lost at the confirming block, which moves the view to the same row. Scrolling back up works until the next confirming block. Switching tabs or wallets does not bring the list back.
The question
A confirming row leaves the Pending group and joins the dated groups, so some rows have to move. What should the view do?
I lean towards the first. Bitcoin-Qt, by its source, leaves its transaction table where the user left it on a confirmation (transactiontablemodel.cpp#L283-L291), and scrolls only to a transaction the user has just acted on, such as one just sent (walletview.cpp#L84-L85). A comment in the model here states the same aim: "Reconcile stable IDs without resetting the view on each confirmation" (transactionactivitymodel.cpp#L549-L550).
Why it lands where it does
On a confirmation the filter proxy calls
invalidate()(activityfilterproxymodel.cpp#L125-L135), which the list view treats as a reset. The list view keeps Qt's default current item (ActivityListPage.qml#L337-L345): it starts as the first row and is pushed down by every row inserted above it. On a reset Qt positions the view on that item. Nothing on the page uses the current item.A stand-alone Qt 6.9 program with those two ingredients gives the same positions, and stays put without the
invalidate()or with the current item cleared. I did not rebuild the app to test either change.Reproduced on merged
qt6ateed1f426fcb6, macOS / Qt 6.9, isolated regtest, offscreen and native. Payments and blocks came over RPC, as they would from the network; no input in the app triggers it. Scrolling in the tests was set through properties, not a wheel or scroll bar. Payments were seconds apart and confirmed by one block. The 500-row, Day grouping, filter, window-size, hidden-page and in-app-send cases ran offscreen only.