Skip to content

fix: add loading feedback in country list for smooth ux#1267

Merged
kushagrasarathe merged 3 commits intopeanut-wallet-devfrom
fix/country-click-delay
Oct 2, 2025
Merged

fix: add loading feedback in country list for smooth ux#1267
kushagrasarathe merged 3 commits intopeanut-wallet-devfrom
fix/country-click-delay

Conversation

@kushagrasarathe
Copy link
Contributor

  • fixes TASK-14968 : added loading feedback and using transition hook from react now to make navigation feel smoother
  • also added caching to useGeoLocation hook

@vercel
Copy link

vercel bot commented Oct 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Ready Ready Preview Comment Oct 2, 2025 9:06am

@notion-workspace
Copy link

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Updates navigation to use React transitions in Add/Withdraw routes, refines country list UI with deferred search and per-item loading states, removes an on-mount user refetch in countries list, and adds 24-hour caching to geo-location via in-memory and sessionStorage with consistent loading state handling.

Changes

Cohort / File(s) Summary
Add/Withdraw navigation
src/components/AddWithdraw/AddWithdrawRouterView.tsx
Wraps route changes in startTransition for smoother navigation; introduces cryptoPath; updates handlers to use transitions for country and crypto paths; no public API changes.
Country list UI behavior
src/components/Common/CountryList.tsx
Uses useDeferredValue for non-blocking filtering; adds per-item loading via clickedCountryId; disables interaction during loading/unsupported; conditionally renders rightContent/loading/status; prioritizes first 10 flag images.
Add/Withdraw countries list mount behavior
src/components/AddWithdraw/AddWithdrawCountriesList.tsx
Removes effect that called fetchUser() on mount; no other logic changes.
Geo location caching
src/hooks/useGeoLocation.ts
Adds in-memory and sessionStorage caching with 24h TTL; fast-path returns cached country code; falls back to fetch on cache miss; consistently sets loading state in finally; no API changes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • Zishan-7
  • jjramirezn
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/country-click-delay

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 676d5c8 and 6a00bb9.

📒 Files selected for processing (4)
  • src/components/AddWithdraw/AddWithdrawCountriesList.tsx (0 hunks)
  • src/components/AddWithdraw/AddWithdrawRouterView.tsx (3 hunks)
  • src/components/Common/CountryList.tsx (5 hunks)
  • src/hooks/useGeoLocation.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kushagrasarathe kushagrasarathe merged commit 38e396d into peanut-wallet-dev Oct 2, 2025
3 of 5 checks passed
@coderabbitai coderabbitai bot added the enhancement New feature or request label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants