Skip to content

feat: portfolio loading UX & cache persistence#217

Merged
premiumjibles merged 3 commits intomainfrom
feat/portfolio-loading-ux-cache
Mar 19, 2026
Merged

feat: portfolio loading UX & cache persistence#217
premiumjibles merged 3 commits intomainfrom
feat/portfolio-loading-ux-cache

Conversation

@premiumjibles
Copy link
Contributor

@premiumjibles premiumjibles commented Mar 18, 2026

Summary

  • Loading indicators: Spinner + status text during initial portfolio load; subtle rotating refresh icon during background refetches (both asset list and header)
  • Cache persistence: Extend gcTime from 5min to 30min and staleTime from 10s to 30s so cached data survives drawer close/reopen and tab switches
  • Flash prevention: Use keepPreviousData to prevent empty-state flash when query keys change (e.g. Dynamic SDK re-init)

Test plan

  • Open portfolio drawer → confirm spinner + "Loading portfolio..." visible during initial load
  • Close drawer, wait <30min, reopen → cached data shows immediately (no skeleton)
  • With data loaded, wait for background refetch → small refresh icon appears briefly next to balance
  • Switch browser tab and return → no full reload flash

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed portfolio panel displaying stale balances when wallet is connected
    • Improved error messaging for wallet and portfolio tools with clearer, actionable guidance
    • Fixed $ character being stripped from swap request inputs
    • Enhanced address lookup to support ENS names
    • Resolved USDC→ETH swap reversion on Arbitrum
  • Improvements

    • Added visual loading indicators when fetching portfolio balances
    • Improved empty-state messaging to distinguish between connected wallets with no assets and disconnected wallets
    • Optimized portfolio data refresh intervals for better responsiveness

Add spinner + status text during initial load and a subtle refresh icon
during background refetches. Extend gcTime to 30min and staleTime to 30s
so cached data survives drawer close/reopen and tab switches. Use
keepPreviousData to prevent flash-to-empty on query key changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 18, 2026

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

Project Deployment Actions Updated (UTC)
shapeshift-agentic Ready Ready Preview, Comment Mar 19, 2026 9:51am

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d3aee207-182a-42b3-9464-70c51a77be7c

📥 Commits

Reviewing files that changed from the base of the PR and between d9ab866 and 2051f96.

📒 Files selected for processing (9)
  • .tickets/tic-32f9.md
  • .tickets/tic-616a.md
  • .tickets/tic-78e5.md
  • .tickets/tic-93f0.md
  • .tickets/tic-fc5f.md
  • apps/agentic-chat/src/components/Portfolio/PortfolioAssetList.tsx
  • apps/agentic-chat/src/components/Portfolio/PortfolioHeader.tsx
  • apps/agentic-chat/src/hooks/usePortfolioQuery.ts
  • apps/agentic-chat/src/hooks/useVaultBalances.ts

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

This PR adds five new ticket documents describing bugs, feature requests, and chores (USDC swap reversion, dollar-sign stripping, ENS name support, generic error messages, and stale portfolio display), alongside improvements to portfolio components' loading UI states and React Query caching configuration.

Changes

Cohort / File(s) Summary
Ticket Documentation
.tickets/tic-32f9.md, .tickets/tic-616a.md, .tickets/tic-78e5.md, .tickets/tic-93f0.md, .tickets/tic-fc5f.md
Five new bug reports, feature requests, and chores documenting USDC→ETH swap failure, dollar-sign character stripping in chat, missing ENS name resolution, generic backend error messages, and stale portfolio display after wallet connection.
Portfolio Loading UI
apps/agentic-chat/src/components/Portfolio/PortfolioAssetList.tsx, apps/agentic-chat/src/components/Portfolio/PortfolioHeader.tsx
Integrated Dynamic Labs wallet context to differentiate empty-state messaging; expanded query state handling to distinguish loading from fetching; added "Loading portfolio..." and "Fetching balances..." indicators with spinner icons.
React Query Optimization
apps/agentic-chat/src/hooks/usePortfolioQuery.ts, apps/agentic-chat/src/hooks/useVaultBalances.ts
Increased staleTime and gcTime cache durations; added placeholderData: keepPreviousData to retain cached data during refetches instead of showing blank/loading states.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 Five tickets hop along the way,
New loading spinners dance and sway,
The portfolio now shows its care,
With wallet context everywhere!
Cache stays snappy, smooth as clover. 🌱

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/portfolio-loading-ux-cache
📝 Coding Plan
  • Generate coding plan for human review comments

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.

- Empty state: distinguish "no wallet" vs "wallet with no assets"
- Header skeleton: match balance height to prevent layout shift
- Delta skeleton: match text-xs dimensions for smoother transition

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ting

Created tickets from comprehensive e2e browser testing of all agent tools:
- tic-32f9 [P1] USDC swap reverts after approval on Arbitrum
- tic-616a [P2] Dollar sign stripped from chat input messages
- tic-78e5 [P3] External address lookup does not support ENS names
- tic-fc5f [P3] Portfolio side panel shows stale 'No assets found' state
- tic-93f0 [P4] Generic error messages for backend failures lack detail

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@premiumjibles premiumjibles marked this pull request as ready for review March 19, 2026 22:31
@premiumjibles premiumjibles merged commit 6898848 into main Mar 19, 2026
4 checks passed
@premiumjibles premiumjibles deleted the feat/portfolio-loading-ux-cache branch March 19, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant