feat(ui): show a loading state while transaction history loads - #926
Conversation
On launch the home feed rendered "There are no transactions to display" until the first reload finished. `txItems` is empty both while loading and when the wallet genuinely has no history, and the view treated the two as the same thing — so every launch briefly asserted the wallet was empty before that was known. Adds `HomeViewModel.hasLoadedInitialTxItems`, published on the main thread and set when the first full reload publishes its results. The feed shows a spinner until then, and the empty-state copy only once an empty result is actually established. Kept separate from the existing private `hasCompletedInitialLoad`, which guards reload/incremental-update sequencing on the worker queue and is neither published nor main-thread-confined. The flag resets on a network switch, where the feed is cleared and the new network's history reloads from scratch — the same "loading, not empty" situation as a cold launch. Subsequent incremental refreshes never clear it, so the spinner does not flash on ordinary updates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 16 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Comment |
Problem
On launch the home feed rendered "There are no transactions to display" until the first reload finished.
HomeViewkeyed that copy onviewModel.txItems.isEmptyalone — buttxItemsis empty in two very different situations: while the initial load is still running on the worker queue, and when the wallet genuinely has no history. Treating them the same meant every cold launch briefly asserted the wallet was empty before that was known, which reads as data loss on a wallet that actually has transactions.Fix
HomeViewModelgainshasLoadedInitialTxItems, published on the main thread and set when the first full reload publishes its results. The feed shows a spinner + "Loading transactions" until then, and falls back to the empty-state copy only once an empty result is actually established.Deliberately kept separate from the existing private
hasCompletedInitialLoad: that one guards reload/incremental-update sequencing on the worker queue, is not published, and is not main-thread-confined, so it can't drive a view. Its behaviour is untouched.Behaviour details
Verification
dashpayscheme builds clean (arm64 simulator).Note this branch is cut from
develop, which is currently red — see #925, which fixes an unrelated #923/#924 merge collision. Building this branch locally needs that fix (or merge #925 first); the change here is independent of it.Not visually confirmed on-device: the simulator is PIN-gated, and the state is transient by nature — it appears between launch and the first reload completing.