7.3 KiB
7.3 KiB
UI Views Implementation
✅ Completed Views
Đã implement 3 views chính với Shadcn-vue components và mobile-first design:
1. WalletView (src/views/Wallet/WalletView.vue)
Features:
- ✅ Balance display (Available + Pending)
- ✅ Receiving address with copy button
- ✅ Action buttons (Send, Backup File, Backup Seed)
- ✅ Wallet status indicator
- ✅ Loading states
- ✅ Mobile responsive design
Components used:
- Card (CardHeader, CardTitle, CardContent)
- Button (primary, outline variants)
- Label, Separator
- Lucide icons (Wallet, Send, FileDown, Key, Copy, Check)
Mock data:
- Balance:
125.45678900 XNT - Address:
nep1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh
TODO:
- Integrate with
useNeptuneWalletcomposable - Implement send transaction flow
- Implement backup features with Tauri commands
2. UTXOView (src/views/UTXO/UTXOView.vue)
Features:
- ✅ Summary cards (Total Count + Total Amount)
- ✅ UTXO list with mobile cards + desktop table
- ✅ Refresh button
- ✅ Loading & empty states
- ✅ Responsive layout (cards on mobile, table on desktop)
Components used:
- Card (CardHeader, CardTitle, CardContent)
- Button (outline, icon variants)
- Label, Separator
- Lucide icons (Database, RefreshCw)
Mock data:
- 3 UTXOs with hashes, amounts, block heights
- Total:
125.50000000 XNT
Layout:
- Mobile (<768px): Individual UTXO cards
- Desktop (≥768px): Data table
TODO:
- Integrate with
getUtxos()API - Add pagination for large lists
- Add sorting/filtering
3. NetworkView (src/views/Network/NetworkView.vue)
Features:
- ✅ Network information display
- ✅ Current block height
- ✅ Last update time
- ✅ Connection status indicators
- ✅ Refresh button
- ✅ Error state with retry
- ✅ Loading states
Components used:
- Card (CardHeader, CardTitle, CardContent)
- Button (outline variant)
- Label, Separator
- Lucide icons (Network, Activity, RefreshCw, AlertCircle)
Mock data:
- Network:
Neptune mainnet - Block Height:
123,456 - Status: Connected, Synced
Auto-refresh: Ready for 60s polling (commented out)
TODO:
- Integrate with
getBlockHeight()API - Enable auto-refresh polling
- Add more network stats (peer count, etc.)
🎨 Design System
Colors (from Tailwind + Shadcn)
- Primary: Royal Blue
oklch(0.488 0.15 264.5) - Background: White (light) / Dark blue tint (dark)
- Muted: Light gray backgrounds
- Foreground: Text colors
- Border: Subtle borders
- Destructive: Error/alert red
Typography
- Font: Montserrat Variable Font
- Sizes: text-xs, text-sm, text-base, text-lg, text-2xl, text-4xl
- Weights: font-medium, font-semibold, font-bold
Spacing
- Padding: p-3, p-4, p-6
- Gap: gap-2, gap-3, gap-4, gap-6
- Margin: Tailwind utilities
Components
- Card: Border, shadow, rounded corners
- Button: Primary (filled), Outline, Ghost, Icon
- Icons: Lucide Vue Next (size-4, size-5, size-6)
📱 Mobile Optimization
Responsive Breakpoints
- Mobile: < 768px (sm)
- Desktop: ≥ 768px (md)
Mobile Features
- ✅ Touch-optimized buttons (min 44px height)
- ✅ Card-based layouts for mobile
- ✅ Table view for desktop
- ✅ Bottom navigation (4 tabs)
- ✅ Safe area insets for notched devices
- ✅ Smooth scrolling
- ✅ No overscroll
Layout Structure
┌─────────────────────┐
│ Header (56px) │
├─────────────────────┤
│ │
│ Main Content │
│ (scrollable) │
│ │
├─────────────────────┤
│ Bottom Nav (48px) │
└─────────────────────┘
🔄 Router Configuration
Updated routes:
{
path: '/',
component: Layout,
children: [
{ path: '', name: 'wallet', component: WalletPage }, // Default
{ path: '/utxo', name: 'utxo', component: UTXOPage },
{ path: '/network', name: 'network', component: NetworkPage },
{ path: '/transaction-history', name: 'transaction-history', component: TransactionHistoryPage },
]
}
Bottom Navigation Order:
- 💰 Wallet (/) - Default
- 📦 UTXO (/utxo)
- 🌐 Network (/network)
- 📜 History (/transaction-history)
🚧 Commented Out Logic
WASM-related code (temporarily disabled)
// import { useNeptuneWallet } from '@/composables/useNeptuneWallet'
// const { getBalance, getUtxos, getBlockHeight } = useNeptuneWallet()
API Calls (ready to uncomment)
// const loadWalletData = async () => {
// const result = await getBalance()
// availableBalance.value = result.balance
// }
Auto-refresh Polling (ready to enable)
// let pollingInterval: number | null = null
// const startPolling = () => { ... }
// onMounted(() => { startPolling() })
🎯 Integration Steps
Phase 1: Enable API Calls (No WASM)
- Uncomment
useNeptuneWalletimports - Uncomment API call functions
- Test with mock API data
- Remove mock data
Phase 2: Enable WASM
- Fix Tauri + WASM loading issues
- Uncomment WASM-related logic
- Test wallet generation flow
- Test full integration
Phase 3: Implement Tauri Commands
generate_keys_from_seedcreate_keystoredecrypt_keystorebuild_transaction
📊 Current Status
| View | UI | Mock Data | API Ready | WASM Ready | Status |
|---|---|---|---|---|---|
| Wallet | ✅ | ✅ | 🚧 | ❌ | UI Done |
| UTXO | ✅ | ✅ | 🚧 | ❌ | UI Done |
| Network | ✅ | ✅ | 🚧 | ❌ | UI Done |
Legend:
- ✅ Complete
- 🚧 Ready to integrate
- ❌ Blocked on Tauri/WASM
🧪 Testing
Manual Testing Steps
- Start dev server:
npm run dev - Navigate to each view:
- http://localhost:5173/ → Wallet
- http://localhost:5173/utxo → UTXO
- http://localhost:5173/network → Network
- Test responsive:
- Desktop view (>768px)
- Mobile view (<768px)
- Chrome DevTools mobile emulation
- Test interactions:
- Copy address button
- Refresh buttons
- Bottom navigation
- Dark mode toggle
📝 Notes
- Dark Mode: Fully supported via Shadcn theme variables
- Icons: Lucide Vue Next (tree-shakeable)
- Animations: Tailwind transitions + CSS animations
- Accessibility: ARIA labels, keyboard navigation
- Performance: Lazy-loaded routes, optimized re-renders
🚀 Next Steps
- ✅ UI Complete - All 3 views designed and implemented
- 🚧 Fix Tauri WASM - Resolve CSP and asset loading issues
- 🚧 Integrate APIs - Connect to Neptune node
- 🚧 Implement Tauri Commands - Keystore, transaction signing
- 🚧 Add Transaction History View - List of past transactions
- 🚧 E2E Testing - Full wallet flow testing
🎨 Screenshots (Recommended)
Take screenshots of:
- Wallet view (light + dark mode)
- UTXO view (mobile cards + desktop table)
- Network view (all states)
- Bottom navigation active states
Store in: docs/screenshots/