From d3e652bce3282e312b591818e1e72520b9a61fd9 Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Sun, 1 Mar 2026 12:17:28 -0500 Subject: [PATCH] feat(machine): redesign cash-in with split-screen layout Split-screen for insertingBills (amounts left, bill visual right) and displayingQR (info left, QR right). Add StepIndicator with success flow accent header. Replace Skeleton with BounceDots, remove ScrollArea and Card wrappers, wrap states in Transition for fade animations. Co-Authored-By: Claude Opus 4.6 --- apps/machine/src/views/CashInView.vue | 550 +++++++++++++------------- 1 file changed, 286 insertions(+), 264 deletions(-) diff --git a/apps/machine/src/views/CashInView.vue b/apps/machine/src/views/CashInView.vue index 49df04b..3316a2c 100644 --- a/apps/machine/src/views/CashInView.vue +++ b/apps/machine/src/views/CashInView.vue @@ -3,18 +3,32 @@ import { watch, computed, ref } from 'vue' import { useRouter } from 'vue-router' import { useAtmStore } from '@/stores/atm' import { Button } from '@/components/ui/button' -import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Alert, AlertDescription } from '@/components/ui/alert' -import { Skeleton } from '@/components/ui/skeleton' import { Input } from '@/components/ui/input' -import { ScrollArea } from '@/components/ui/scroll-area' import QRCode from '@/components/QRCode.vue' +import BounceDots from '@/components/BounceDots.vue' +import StepIndicator from '@/components/StepIndicator.vue' const router = useRouter() const atmStore = useAtmStore() const isElectron = typeof window !== 'undefined' && window.electronAPI !== undefined +const cashInSteps = ['Insert', 'Scan', 'Done'] + +const currentStepIndex = computed(() => { + switch (nestedState.value) { + case 'fetchingRate': + case 'insertingBills': + return 0 + case 'generatingNdebit': + case 'displayingQR': + return 1 + default: + return 2 + } +}) + // Whether the header cancel button should be visible // State machine routes CANCEL to confirmAbandon when bills are present const showCancelButton = computed(() => { @@ -158,13 +172,8 @@ function simulateBill(denomination: number) { // Convert npub to hex pubkey if needed function normalizePubkey(input: string): string { const trimmed = input.trim() - // If it's an npub, we'd need to decode it - for now just pass through - // In production, use nostr-tools nip19.decode() if (trimmed.startsWith('npub1')) { - // Simple check - in production decode properly console.log('[CashIn] npub detected, would decode in production') - // For now, just return as-is and let the CLINK client handle it - // TODO: Properly decode npub using nostr-tools } return trimmed } @@ -206,76 +215,80 @@ const isProcessing = computed(() => atmStore.isPayingInvoice || atmStore.isReque