feat(history): show "Loading older history (N%)" during the initial bulk load
History streams in over many refresh cycles (the incremental shielded scan walks every z-address), so the first batch appears long before the list is complete — with no indication more is still coming. The existing loading banner deliberately goes quiet once any rows are on screen. Track whether the first full shielded scan has finished (initial_history_scan_complete_) and, until it has, surface a progress percentage (fraction of z-addresses scanned) in transactionRefreshProgressText() — which the History tab already renders as its pulsing loading indicator. Goes quiet once the first scan completes; routine per-block re-scans don't re-trigger it. Reset on a full history invalidation (rescan / session reset) so it shows again on reload. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
14
src/app.cpp
14
src/app.cpp
@@ -3704,6 +3704,20 @@ std::string App::transactionRefreshProgressText() const
|
||||
return buf;
|
||||
}
|
||||
|
||||
// Initial bulk history load: the incremental shielded scan streams older transactions in over
|
||||
// many refresh cycles, so the first batch can appear long before the history is complete. Keep
|
||||
// the user informed (with a %) even after rows are on screen, so they know it's still loading.
|
||||
// Progress = fraction of z-addresses scanned at least once (monotonic). Goes quiet for good once
|
||||
// the first full scan completes; routine per-block re-scans don't re-trigger it.
|
||||
if (!initial_history_scan_complete_ && !state_.z_addresses.empty()) {
|
||||
std::size_t total = state_.z_addresses.size();
|
||||
std::size_t scanned = std::min(shielded_history_scan_heights_.size(), total);
|
||||
int pct = total > 0 ? static_cast<int>((scanned * 100) / total) : 0;
|
||||
if (pct > 99) pct = 99; // 100% is the "complete" state, which suppresses the banner
|
||||
snprintf(buf, sizeof(buf), TR("tx_loading_history_progress"), pct);
|
||||
return buf;
|
||||
}
|
||||
|
||||
// Once history is on screen, stay quiet for routine background refreshes. The incremental
|
||||
// shielded-receive scan re-dirties transactions_dirty_ on EVERY new block (each block moves the
|
||||
// "scanned at tip" bar, invalidating prior per-address scans), so for a wallet with more
|
||||
|
||||
Reference in New Issue
Block a user