chore: only fetch NFTs when section is focused and add skeletons - #33645
Conversation
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # app/components/Views/Homepage/Homepage.test.tsx # app/components/Views/Homepage/Homepage.tsx
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 708fab2. Configure here.
⚡ Performance Test Results
✅ All tests passed · 2 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ✅ Passed Tests (2)
Branch: |
🧪 Flaky unit test detectionRun history flaky detectionHistorical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow. Failures / runs sampled per window:
AI-detected flaky patterns
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No other tags are directly impacted — the changes are isolated to the NFT grid/section rendering within the homepage, with no impact on confirmations, swaps, accounts, networks, or other flows. Performance tests are not warranted — the skeleton loading is a UI enhancement that doesn't meaningfully change app performance characteristics. The NFT detection logic change (viewport-gated vs. always-on) could theoretically reduce unnecessary background work, but this is not a performance regression risk. Performance Test Selection: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #33645 +/- ##
==========================================
- Coverage 84.79% 84.79% -0.01%
==========================================
Files 6247 6248 +1
Lines 168342 168383 +41
Branches 41162 41171 +9
==========================================
+ Hits 142741 142774 +33
- Misses 15853 15860 +7
- Partials 9748 9749 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|




Description
Lazy-load NFT detection
detectNftsnow fires only when the NFTs section scrolls into view, instead of on every wallet unlockFix: account switch not triggering NFT detection
Skeleton loading states
New reusable
NftSkeletonCellcomponentreact-native-skeleton-placeholder, shared between the homepage section and the full grid viewChangelog
CHANGELOG entry: only fetch NFTs when section is focused and add skeletons
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3759
Manual testing steps
Screenshots/Recordings
Before
Screen.Recording.2026-07-22.at.13.33.28.mov
After
Screen.Recording.2026-07-22.at.13.25.06.mov
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes when and how NFT detection runs (viewport + throttle) and homepage section visibility/analytics counts; behavior is well-covered by tests but affects assets loading UX on scroll and account switch.
Overview
Moves NFT detection off the homepage root and into
NFTsSection, firingdetectNftsonly when the section is ≥30% visible, with a 5-minute throttle (re-evaluated onvisitId) and throttle reset on account switch so a new address can detect immediately.The homepage always mounts the NFTs section (analytics
sectionIndex/totalSectionsLoadedupdated accordingly). The section shows threeNftSkeletonCellplaceholders until detection runs, then unmounts if detection finishes with zero NFTs; the header is non-interactive until NFTs exist.Adds reusable
NftSkeletonCell(react-native-skeleton-placeholder, optionalanimated={false}for E2E).NftGridappends skeleton sentinel rows after real items whileisNftFetchingProgressis true (finish current 3-column row + six extra slots). Tests cover skeleton counts, viewport gating, throttle, and account-switch behavior.Reviewed by Cursor Bugbot for commit f5f9d48. Bugbot is set up for automated code reviews on this repo. Configure here.