Feature/replace demo dashboard data on web with wallet scoped live portfolio mapping - #240
Merged
Conversation
…mapping This commit implements wallet-scoped live data fetching and removes all demo/fallback data from the dashboard production path, addressing issue Zyntarivoid#177. Key Changes: - Remove DEMO_ADDRESS and mock pricing assumptions from dashboard API - Add wallet address validation requiring 'G' prefix - Integrate real oracle price fetching for accurate USD values - Implement proper health factor calculation with Infinity handling - Add wallet-scoped data fetching with error boundaries UI/UX Improvements: - Add comprehensive loading states with skeleton placeholders - Implement detailed error handling with actionable error messages - Show connected wallet address in dashboard header - Display last updated timestamp for data freshness - Add proper empty states for no assets/activity - Improve number formatting with proper decimal places Wallet Integration: - Add connection status display in landing page - Implement retry logic for connection failures - Add Freighter wallet installation detection and prompts - Show wallet address truncation throughout the app Component Enhancements: - Add variant support to WalletConnect (default, compact, full) - Enhance WalletStatus with tooltip error display - Improve Layout components with cn utility and responsive grid - Add GridResponsive for better responsive layouts - Add onSuccess/onError callbacks for wallet actions New Files: - src/lib/api/dashboard-client.ts: Client-side dashboard API wrapper - src/lib/hooks/useDashboardData.ts: React hook for dashboard data Technical Improvements: - Add proper TypeScript types with no implicit any - Implement abort controller for request cancellation - Add automatic retry with exponential backoff - Implement stale state detection and refresh - Add visibility change handling for data freshness - Improve error messages with actionable guidance Breaking Changes: - fetchDashboardData now requires wallet address parameter - Removed demo fallback address (DEMO_ADDRESS) - Dashboard requires authenticated wallet connection
…eliability This commit addresses multiple TypeScript errors and enhances the data fetching layer with better type safety, error handling, and component support. Key Changes: TypeScript Fixes: - Fix type predicate error in dashboard-client.ts by using null filtering pattern - Fix type error in usePositionSync.ts with proper address validation - Add missing tooltip.tsx UI component for WalletStatus - Install @vitest/ui and upgrade vitest to v3.2.7 for test support Data Fetching Improvements (dashboard-client.ts): - Refactor transaction mapping to use null filtering pattern - Add explicit ActivityEvent type for better type safety - Enhance asset symbol extraction with common asset detection (USDC, XLM, BTC, ETH) - Improve transaction type mapping with support for SUPPLY, REPAYMENT, WITHDRAWAL - Add console warnings for unknown transaction types Position Sync Improvements (usePositionSync.ts): - Add proper address validation before fetching - Implement AbortController for request cancellation - Reset state on address changes - Improve error handling with abort error detection - Add cleanup on unmount to prevent memory leaks - Type-safe refs with proper TypeScript types UI Components: - Add tooltip.tsx component with Radix UI integration - Tooltip supports dark theme matching application design Dependencies: - Add @vitest/ui for test UI interface - Upgrade vitest from 3.2.6 to 3.2.7 Related Issues: - Resolves TypeScript errors: TS2307, TS2677, TS2345
- Remove unused imports (Skeleton, Flex) - Fix setState-in-effect errors with setTimeout wrappers - Move helper functions outside component in dashboard/page - Fix default export anonymous object in Layout - Add proper ref handling for recursive fetch calls - Clean up ESLint disable directives Files affected: - src/app/dashboard/page.tsx - src/app/page.tsx - src/components/Layout.tsx - src/components/WalletConnect.tsx - src/lib/hooks/useDashboardData.ts - src/lib/hooks/usePositionSync.ts
Cedarich
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace demo/fallback dashboard data with wallet-scoped live portfolio data from the indexer. Dashboard now requires authenticated wallet connection and fetches real positions, transactions, and oracle prices.
Closes #177
Scope
Validation
Security and data handling
Reviewer notes
fetchDashboardData()now requires wallet address parameter;DEMO_ADDRESSfallback removedDashboardClientwith AbortController support and exponential backoff retryuseDashboardDatahook handles auto-refresh, stale detection, and visibility change handlingcompact,full, anddefaultvariants with tooltip supportCloses #177