lumina/PAGES_TO_UPDATE.md
2025-11-29 23:13:05 +03:00

98 lines
3.4 KiB
Markdown

# Frontend Pages That Need Updating
## โœ… ALREADY UPDATED
- `ui/views/explorer/pages/explorer-home-page-view.js` - Uses new components
- `ui/views/explorer/ledger/latest-ledgers-table.js` - NEW, uses Horizon
- `ui/views/explorer/transaction/latest-transactions-table.js` - NEW, uses Horizon
- `ui/views/explorer/asset/asset-list-view.js` - Updated to use `asset/horizon/list`
- `ui/views/graph/use-stellar-stream.js` - Updated to use SSE
## ๐Ÿ”ง NEEDS MINIMAL CHANGES
### Account Pages
These already use the existing account API which now fetches from Horizon:
- `ui/views/explorer/account/account-view.js` - Should work (uses `/account/:id`)
- `ui/views/explorer/account/account-history-tabs-view.js` - Should work
### Transaction Pages
- `ui/views/explorer/tx/tx-view.js` - Should work (uses `/tx/:hash`)
### Asset Pages
- `ui/views/explorer/asset/asset-view.js` - Should work (uses `/asset/:asset`)
- `ui/views/explorer/asset/assets-dashboard-view.js` - Uses asset-list-view (updated)
### Market Pages
- `ui/views/explorer/market/market-view.js` - Should work (uses existing market API)
- `ui/views/explorer/market/all-markets-view.js` - Should work
### Ledger Pages
- `ui/views/explorer/ledger/ledger-view.js` - Should work (uses `/ledger/:sequence`)
## ๐ŸŽฏ WHY MOST PAGES SHOULD WORK
The existing pages use API paths like:
- `/account/:id` โ†’ Now fetches from Horizon via our adapter
- `/tx/:hash` โ†’ Now fetches from Horizon via our adapter
- `/ledger/:sequence` โ†’ Now fetches from Horizon via our adapter
- `/asset/:asset` โ†’ Existing endpoint (may need Horizon fallback)
**The backend routes were updated to use Horizon, so frontend doesn't need changes!**
## ๐Ÿš€ WHAT TO DO NOW
1. **Restart API server** - Pick up new routes
```bash
cd api && node api.js
```
2. **Restart frontend** - Rebuild with new components
```bash
cd ui && pnpm dev-server
```
3. **Test navigation** - Click through pages:
- Homepage โ†’ Should show ledgers table โœ…
- Assets page โ†’ Should show asset list โœ…
- Click on account โ†’ Should load account details
- Click on transaction โ†’ Should load tx details
- Click on ledger โ†’ Should load ledger details
4. **Check browser console** - Look for errors
## ๐Ÿ› IF PAGES ARE BROKEN
Most likely issues:
1. **Data format mismatch** - Horizon returns different structure than MongoDB
2. **Missing fields** - Some fields may not exist in Horizon response
3. **API path wrong** - Check if page is using old API path
### Quick Fix Pattern:
```javascript
// If a page breaks, wrap the API call:
const {data, loading, error} = useExplorerApi('account/' + id + '/details')
// Add fallback for missing fields:
const balance = data?.balances?.[0]?.balance || '0'
```
## ๐Ÿ“ TESTING CHECKLIST
- [ ] Homepage loads with ledgers table
- [ ] Assets page shows asset list
- [ ] Click asset โ†’ Asset detail page loads
- [ ] Search for account โ†’ Account page loads
- [ ] Account transactions tab works
- [ ] Click transaction โ†’ Transaction detail loads
- [ ] Click ledger number โ†’ Ledger detail loads
- [ ] Markets page loads
- [ ] 3D graph page connects to stream
- [ ] No critical console errors
## ๐Ÿ’ก KEY INSIGHT
**We updated the BACKEND to fetch from Horizon, so the FRONTEND doesn't need major changes!**
The frontend still calls the same API paths, but now those paths fetch live data from Horizon instead of empty MongoDB.
This is the beauty of the adapter pattern! ๐ŸŽ‰