From 9f6e524ea964b8a4589ec836ab11f14c875c409c Mon Sep 17 00:00:00 2001
From: Alejandro
Date: Sun, 18 Jan 2026 23:22:00 +0100
Subject: [PATCH] feat: add tap-to-blur privacy feature for wallet balances
(#143)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat: add tap-to-blur privacy feature for wallet balances
Implement privacy toggle for wallet balances and transaction amounts.
Tapping any balance display toggles a global blur effect across all
wallet UIs. Persisted to localStorage for consistent privacy.
- Add walletBalancesBlurred state to GrimoireState
- Add toggleWalletBalancesBlur pure function in core/logic
- Make big balance in WalletViewer clickable with eye icon indicator
- Apply blur to all transaction amounts in list and detail views
- Add blur to send/receive dialog amounts
- Make balance in user menu wallet info clickable with eye icon
- Apply blur to balance in dropdown menu item
UX matches common financial app pattern: tap balance → blur on/off
* refactor: replace blur with fixed-width placeholders for privacy
Prevent balance size information leakage by using fixed-width
placeholder characters instead of blur effect. A blurred "1000000"
would still reveal it's a large balance vs "100" even when blurred.
Changes:
- Replace blur-sm class with conditional placeholder text
- Use "••••••" for main balances
- Use "••••" for transaction amounts in lists
- Use "•••••• sats" for detailed amounts with unit
- Use "•••• sats" for smaller amounts like fees
Security improvement: No information about balance size is leaked
when privacy mode is enabled. All hidden amounts appear identical.
* refactor: improve privacy UX with stars and clearer send flow
Three UX improvements to the wallet privacy feature:
1. Don't hide amounts in send confirmation dialog
- Users need to verify invoice amounts before sending
- Privacy mode now only affects viewing, not sending
2. Replace bullet placeholders (••••) with stars (✦✦✦✦)
- More visually distinct and recognizable as privacy indicator
- Unicode BLACK FOUR POINTED STAR (U+2726)
- Better matches common "redacted" aesthetic
3. Reduce eye icon sizes for subtler presence
- Main balance: size-6 → size-5
- Wallet info dialog: size-3.5 → size-3
- Smaller icons feel less intrusive
Result: Clearer privacy state, safer payment flow, better aesthetics.
---------
Co-authored-by: Claude
---
src/components/WalletViewer.tsx | 37 ++++++++++++++++++++++++------
src/components/nostr/user-menu.tsx | 37 +++++++++++++++++++++++++-----
src/core/logic.ts | 9 ++++++++
src/core/state.ts | 5 ++++
src/types/app.ts | 1 +
5 files changed, 76 insertions(+), 13 deletions(-)
diff --git a/src/components/WalletViewer.tsx b/src/components/WalletViewer.tsx
index 7034f14..23e7e8e 100644
--- a/src/components/WalletViewer.tsx
+++ b/src/components/WalletViewer.tsx
@@ -20,6 +20,8 @@ import {
LogOut,
ChevronDown,
ChevronRight,
+ Eye,
+ EyeOff,
} from "lucide-react";
import { Virtuoso } from "react-virtuoso";
import { useWallet } from "@/hooks/useWallet";
@@ -341,7 +343,11 @@ function TransactionLabel({ transaction }: { transaction: Transaction }) {
}
export default function WalletViewer() {
- const { state, disconnectNWC: disconnectNWCFromState } = useGrimoire();
+ const {
+ state,
+ disconnectNWC: disconnectNWCFromState,
+ toggleWalletBalancesBlur,
+ } = useGrimoire();
const {
wallet,
balance,
@@ -1053,9 +1059,20 @@ export default function WalletViewer() {
{/* Big Centered Balance */}