Activity: advanced filters, edited request labels, and used-address requests #817

Manually merged
epicleafies merged 17 commits from advanced-activity-filters into qt6 2026-09-11 08:14:17 +00:00 AGit
epicleafies commented 2026-08-01 18:41:34 +00:00 (Migrated from github.com)

This PR closes three related gaps in the Activity page. The list filters now reach parity with the Qt Widgets transaction view and payment request labels and used-address requests behave correctly. Fixes #707. Fixes #725. Fixes #726.

  • Added an Other transaction type, a minimum amount and a custom date range as Activity filter options
  • Added a Grid-based calendar component for the custom date range
  • Updated the activity page search and filter options layout and kept filter popups within the list area
  • Moved the Payment request type filter above Mined and Other
  • Made payment request labels stay in sync both ways. A request edit updates its Activity row and the address book, and an address book edit updates the matching requests and any views already open on them
  • Fixed used-address payment requests. They appear only under the Payment request filter and keep the request presentation (purple icon and creation date, since address use alone does not prove payment) and a payment marks every request for the paid address used so the live list matches a reload
  • Reset the Activity detail stack when opening a transaction from the send flow, so View Transaction shows the new transaction and Back returns to the list instead of a page left open earlier
  • Applied wallet transaction updates to the Activity model on the model's thread. Updating from the notification thread could transiently show an incoming payment twice and hide the matching request row
  • Aligned the Activity title and top padding with the Send and Receive pages

Added unit, QML and functional tests.

image image image
This PR closes three related gaps in the Activity page. The list filters now reach parity with the Qt Widgets transaction view and payment request labels and used-address requests behave correctly. Fixes #707. Fixes #725. Fixes #726. - Added an Other transaction type, a minimum amount and a custom date range as Activity filter options - Added a Grid-based calendar component for the custom date range - Updated the activity page search and filter options layout and kept filter popups within the list area - Moved the Payment request type filter above Mined and Other - Made payment request labels stay in sync both ways. A request edit updates its Activity row and the address book, and an address book edit updates the matching requests and any views already open on them - Fixed used-address payment requests. They appear only under the Payment request filter and keep the request presentation (purple icon and creation date, since address use alone does not prove payment) and a payment marks every request for the paid address used so the live list matches a reload - Reset the Activity detail stack when opening a transaction from the send flow, so View Transaction shows the new transaction and Back returns to the list instead of a page left open earlier - Applied wallet transaction updates to the Activity model on the model's thread. Updating from the notification thread could transiently show an incoming payment twice and hide the matching request row - Aligned the Activity title and top padding with the Send and Receive pages Added unit, QML and functional tests. <img width="800" height="665" alt="image" src="https://git.fish.foo/attachments/55d6d86b-d5a5-447a-afec-32f2d69fee8b" /> <img width="800" height="665" alt="image" src="https://git.fish.foo/attachments/475898ac-8687-4a28-99b1-4121ff3ff042" /> <img width="800" height="665" alt="image" src="https://git.fish.foo/attachments/6d2ffb50-3105-4bc1-b005-551a268e1dc2" />
johnny9 commented 2026-08-03 13:31:39 +00:00 (Migrated from github.com)

Can you go ahead and make the title and top padding align with Send/Receive?

Can you go ahead and make the title and top padding align with Send/Receive?
johnny9 (Migrated from github.com) reviewed 2026-08-03 16:03:51 +00:00
johnny9 (Migrated from github.com) commented 2026-08-03 16:03:51 +00:00

Could this mark every pending request for the address as used before removing it from m_pending_request_addresses?

Bitcoin Core explicitly supports multiple receive requests for one address. With two pending rows, findPendingRequestIndex() returns one, this function sets isUsedAddressRequest only on that row, and then removes the address from pending tracking. The other row therefore stays purple/pending and remains visible in the default Activity list for the rest of the session. After a reload, addPendingReceiveRequests() sees the real transaction and marks both rows as used, so the live and reloaded states disagree.

I reproduced this by extending paidPendingRequestBecomesUsedAddressRequestLive() with two requests for the same address; the second request failed the IsUsedAddressRequestRole assertion.

Suggested fix: capture the address, iterate m_transactions, set isUsedAddressRequest on every pending request with that address, emit dataChanged for each affected row (including IsUsedAddressRequestRole and DateTimeRole if roles are specified), then remove the address from m_pending_request_addresses once. Please add a two-request regression test that asserts both requests are used and hidden by the default proxy after the payment arrives. This also addresses the duplicate-request case raised in the original PR #708 review.

Could this mark every pending request for the address as used before removing it from `m_pending_request_addresses`? Bitcoin Core explicitly supports multiple receive requests for one address. With two pending rows, `findPendingRequestIndex()` returns one, this function sets `isUsedAddressRequest` only on that row, and then removes the address from pending tracking. The other row therefore stays purple/pending and remains visible in the default Activity list for the rest of the session. After a reload, `addPendingReceiveRequests()` sees the real transaction and marks both rows as used, so the live and reloaded states disagree. I reproduced this by extending `paidPendingRequestBecomesUsedAddressRequestLive()` with two requests for the same address; the second request failed the `IsUsedAddressRequestRole` assertion. Suggested fix: capture the address, iterate `m_transactions`, set `isUsedAddressRequest` on every pending request with that address, emit `dataChanged` for each affected row (including `IsUsedAddressRequestRole` and `DateTimeRole` if roles are specified), then remove the address from `m_pending_request_addresses` once. Please add a two-request regression test that asserts both requests are used and hidden by the default proxy after the payment arrives. This also addresses the duplicate-request case raised in the [original PR #708 review](https://github.com/bitcoin-core/gui-qml/pull/708#discussion_r3295457321).
pseudoramdom (Migrated from github.com) reviewed 2026-08-27 04:34:35 +00:00
pseudoramdom (Migrated from github.com) left a comment

Partial review till qml: add minimum amount and custom date range Activity filters 7daae41acce2093cbb22037acd894e6fdd48f290
Will complete the rest tomorrow.

Partial review till `qml: add minimum amount and custom date range Activity filters` 7daae41acce2093cbb22037acd894e6fdd48f290 Will complete the rest tomorrow.
pseudoramdom (Migrated from github.com) commented 2026-08-26 23:19:00 +00:00

In qml: add minimum amount and custom date range Activity filters

Codex notes that the range-chips & day cells use a different locale than what we use in Month & days heading.

In qml: add minimum amount and custom date range Activity filters Codex notes that the range-chips & day cells use a different locale than what we use in Month & days heading.
pseudoramdom (Migrated from github.com) commented 2026-08-27 04:29:29 +00:00

Each of the two calls will call

Q_EMIT rangeChanged();
Q_EMIT countChanged();

Could we do it one go? Should we also do some validations like

bool ActivityFilterProxyModel::applyCustomRange(
      const QString& start_iso,
      const QString& end_iso)
{
  const QDate start = QDate::fromString(start_iso, Qt::ISODate);
  const QDate end = QDate::fromString(end_iso, Qt::ISODate);

  if (!start.isValid() || !end.isValid() || start > end) {
    return false;
  }

  const bool range_changed = start != m_range_start || end != m_range_end;
  const bool filter_changed = m_date_filter != CustomRange;

  if (!range_changed && !filter_changed) return true;

//.. beginFilterChange
// set range
// endFilterChange
 

  if (range_changed) Q_EMIT rangeChanged();
  if (filter_changed) Q_EMIT dateFilterChanged();
      
  Q_EMIT countChanged();
  return true;
}
Each of the two calls will call ```qml Q_EMIT rangeChanged(); Q_EMIT countChanged(); ``` Could we do it one go? Should we also do some validations like ```qml bool ActivityFilterProxyModel::applyCustomRange( const QString& start_iso, const QString& end_iso) { const QDate start = QDate::fromString(start_iso, Qt::ISODate); const QDate end = QDate::fromString(end_iso, Qt::ISODate); if (!start.isValid() || !end.isValid() || start > end) { return false; } const bool range_changed = start != m_range_start || end != m_range_end; const bool filter_changed = m_date_filter != CustomRange; if (!range_changed && !filter_changed) return true; //.. beginFilterChange // set range // endFilterChange if (range_changed) Q_EMIT rangeChanged(); if (filter_changed) Q_EMIT dateFilterChanged(); Q_EMIT countChanged(); return true; } ```
pseudoramdom (Migrated from github.com) commented 2026-08-27 04:16:01 +00:00

These could be made read-only

These could be made read-only
pseudoramdom (Migrated from github.com) commented 2026-08-26 22:56:04 +00:00

In qml: add Other type and Last month filters to Activity -


I'm unsure if we really need Last month and not clear how it differs from This month when I see it in the menu.
IIUC, these are adjacent, non-overlapping ranges. So on August 26:

  • This month: August 1–31
  • Last month: July 1–31

Searching for something in July when you're in Aug doesn't deserve a top-level spot IMO. We can drop this since we have the custom range picker.

In `qml: add Other type and Last month filters to Activity` - --- I'm unsure if we really need `Last month` and not clear how it differs from `This month` when I see it in the menu. IIUC, these are adjacent, non-overlapping ranges. So on August 26: - This month: August 1–31 - Last month: July 1–31 Searching for something in July when you're in Aug doesn't deserve a top-level spot IMO. We can drop this since we have the custom range picker.
pseudoramdom (Migrated from github.com) commented 2026-08-26 22:56:54 +00:00

Also it's easier to read when all the options have the This prefix. Throwing a Last X in between is odd.

Also it's easier to read when all the options have the `This` prefix. Throwing a `Last X` in between is odd.
johnny9 (Migrated from github.com) approved these changes 2026-09-10 03:33:48 +00:00
johnny9 (Migrated from github.com) left a comment

ACK 5e89ae25c7dc8ac8a2f7f960d8816894530f0d3e

Some minor issues for follow up:

  • Label updates: Editing only a request’s amount or message should preserve the label. Update the label only when the request label changes.
  • Keyboard access: Make the Presets and calendar navigation buttons reachable with Tab and usable with Enter or Space. We'll need to do accessibility on all of our views at some point so can defer until then.
  • Date boundaries: Use startOfDay() so custom date filters work when daylight saving skips midnight on Qt 6.2.
ACK 5e89ae25c7dc8ac8a2f7f960d8816894530f0d3e Some minor issues for follow up: - Label updates: Editing only a request’s amount or message should preserve the label. Update the label only when the request label changes. - Keyboard access: Make the Presets and calendar navigation buttons reachable with Tab and usable with Enter or Space. We'll need to do accessibility on all of our views at some point so can defer until then. - Date boundaries: Use startOfDay() so custom date filters work when daylight saving skips midnight on Qt 6.2.
hebasto commented 2026-09-10 10:26:30 +00:00 (Migrated from github.com)

Please rebase.

Please rebase.
johnny9 (Migrated from github.com) approved these changes 2026-09-10 19:43:09 +00:00
johnny9 (Migrated from github.com) left a comment

ACK e473174ea8

Reviewed the rebase and both fixes. Keyboard accessibility can follow separately.

ACK e473174ea8a116740b1ce8a7b8be8897777c7837 Reviewed the rebase and both fixes. Keyboard accessibility can follow separately.
hebasto commented 2026-09-10 20:43:35 +00:00 (Migrated from github.com)

https://github.com/bitcoin-core/gui-qml/actions/runs/34518133156/job/103008632780?pr=817:

 FAIL!  : bitcoinqml_qmltests::SettingsNavigation::test_walletStackResetsWhenSelectedWalletChangesWhileHidden() Compared values are not the same
   Actual   (): false
   Expected (): true
   Loc: [qrc:/test/qml/tst_settingsnavigation.qml(378)]
https://github.com/bitcoin-core/gui-qml/actions/runs/34518133156/job/103008632780?pr=817: ``` FAIL! : bitcoinqml_qmltests::SettingsNavigation::test_walletStackResetsWhenSelectedWalletChangesWhileHidden() Compared values are not the same Actual (): false Expected (): true Loc: [qrc:/test/qml/tst_settingsnavigation.qml(378)] ```
pseudoramdom commented 2026-09-10 20:45:27 +00:00 (Migrated from github.com)

https://github.com/bitcoin-core/gui-qml/actions/runs/34518133156/job/103008632780?pr=817:

 FAIL!  : bitcoinqml_qmltests::SettingsNavigation::test_walletStackResetsWhenSelectedWalletChangesWhileHidden() Compared values are not the same
   Actual   (): false
   Expected (): true
   Loc: [qrc:/test/qml/tst_settingsnavigation.qml(378)]

I think #872 broke the qt6 branch. https://github.com/bitcoin-core/gui-qml/pull/876 has the fix for it (and it's ready to merge if ACK'ed).

> https://github.com/bitcoin-core/gui-qml/actions/runs/34518133156/job/103008632780?pr=817: > > ``` > FAIL! : bitcoinqml_qmltests::SettingsNavigation::test_walletStackResetsWhenSelectedWalletChangesWhileHidden() Compared values are not the same > Actual (): false > Expected (): true > Loc: [qrc:/test/qml/tst_settingsnavigation.qml(378)] > ``` I think #872 broke the `qt6` branch. https://github.com/bitcoin-core/gui-qml/pull/876 has the fix for it (and it's ready to merge if ACK'ed).
epicleafies commented 2026-09-10 23:48:29 +00:00 (Migrated from github.com)

Will rebase again once fix is in.

Will rebase again once fix is in.
Sign in to join this conversation.
No description provided.