From 2b3ee73292b6a633719ed766ec7e1377aeabc932 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Mon, 7 Sep 2026 21:54:43 +0700 Subject: [PATCH] Wallet QR + mint UX: honest scan feedback, truthful auto-distribute affordance (1.2.27) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QR scanner (CashuWalletCard.handleQRScanResult): - The classifier recognizes bitcoin_address, npub, and CLINK offer/debit codes, but all of them fell through to a misleading "Could not recognize the scanned content" toast. Now each gets an honest, specific message: • Bitcoin address → "On-chain not supported here" (this is an ecash/Lightning wallet with no on-chain send) • npub → "That's a Nostr profile" • noffer/ndebit → "Payment code not supported yet" Only genuinely unclassified input shows the generic "unrecognized" message. MintPrivacyManager: - Auto-distribute toggle was a live Switch that flipped on and then admitted "Coming soon — does nothing." Replaced with a disabled switch + "Soon" badge so users can't think they enabled a feature that isn't real. Removed the now dead autoDistribute state. - Dropped unused imports (Progress, Lock, Eye, EyeOff). The mint manager itself (distribution viz, privacy score, trust/balance removal warnings) was already excellent and left untouched. Co-authored-by: shakespeare.diy --- package.json | 2 +- src/components/wallet/CashuWalletCard.tsx | 31 +++++++++++++++++--- src/components/wallet/MintPrivacyManager.tsx | 28 +++++++----------- 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 76ef175..d5fe35c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "skate-spots", "private": true, - "version": "1.2.26", + "version": "1.2.27", "type": "module", "homepage": "https://skate-spots.com", "scripts": { diff --git a/src/components/wallet/CashuWalletCard.tsx b/src/components/wallet/CashuWalletCard.tsx index 934cd25..4078684 100644 --- a/src/components/wallet/CashuWalletCard.tsx +++ b/src/components/wallet/CashuWalletCard.tsx @@ -242,11 +242,34 @@ function CashuWalletCardNative() { case 'lightning_address': setLightningAddress(result.value); break; + case 'bitcoin_address': + // Recognized, but this is an ecash/Lightning wallet — no on-chain send. + toast({ + variant: 'destructive', + title: 'On-chain not supported here', + description: 'That’s a Bitcoin address. This wallet only sends Cashu tokens and Lightning payments.', + }); + break; + case 'npub': + toast({ + variant: 'destructive', + title: 'That’s a Nostr profile', + description: 'Scan a Cashu token, Lightning invoice, or Lightning address to pay.', + }); + break; + case 'clink_offer': + case 'clink_debit': + toast({ + variant: 'destructive', + title: 'Payment code not supported yet', + description: 'This wallet can’t pay CLINK codes yet. Use a Lightning invoice or address instead.', + }); + break; default: - toast({ - variant: 'destructive', - title: 'Unknown QR code', - description: 'Could not recognize the scanned content' + toast({ + variant: 'destructive', + title: 'Unrecognized QR code', + description: 'Scan a Cashu token, Lightning invoice, or Lightning address.', }); } }, [coco, setTokenInput, setLightningInvoice, toast]); diff --git a/src/components/wallet/MintPrivacyManager.tsx b/src/components/wallet/MintPrivacyManager.tsx index ee5d9c5..abf18ae 100644 --- a/src/components/wallet/MintPrivacyManager.tsx +++ b/src/components/wallet/MintPrivacyManager.tsx @@ -6,7 +6,6 @@ import { Label } from '@/components/ui/label'; import { Badge } from '@/components/ui/badge'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { Switch } from '@/components/ui/switch'; -import { Progress } from '@/components/ui/progress'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { Shield, @@ -19,9 +18,6 @@ import { ChevronUp, Star, Globe, - Lock, - Eye, - EyeOff, } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useToast } from '@/hooks/useToast'; @@ -91,7 +87,6 @@ export function MintPrivacyManager({ const [mintUrl, setMintUrl] = useState(''); const [isAddingMint, setIsAddingMint] = useState(false); const [mintToRemove, setMintToRemove] = useState(null); - const [autoDistribute, setAutoDistribute] = useState(false); const { toast } = useToast(); // Calculate distribution across mints @@ -287,24 +282,23 @@ export function MintPrivacyManager({ Add Mint - {/* Auto Distribution Toggle */} -
+ {/* Auto Distribution Toggle — not yet implemented, so it's shown as a + disabled affordance with a "Soon" badge rather than a switch that + flips on but does nothing. */} +
- +
+ + + Soon + +

Spread received funds across multiple mints

- +
- {autoDistribute && ( -

- Coming soon - this feature is planned for a future update -

- )} {/* Privacy Tips Toggle */}