From 47e9edc4486815c07f12ccccbcb0d3934a36af70 Mon Sep 17 00:00:00 2001 From: Don Kackman Date: Wed, 25 Mar 2026 17:02:47 -0500 Subject: [PATCH 1/2] debounce wallet drop down on hover fix https://github.com/xch-dev/sage/issues/769 --- src/components/WalletSwitcher.tsx | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/components/WalletSwitcher.tsx b/src/components/WalletSwitcher.tsx index da1add4b4..91dacac08 100644 --- a/src/components/WalletSwitcher.tsx +++ b/src/components/WalletSwitcher.tsx @@ -14,13 +14,14 @@ import { } from '@/components/ui/tooltip'; import { CustomError } from '@/contexts/ErrorContext'; import { useWallet } from '@/contexts/WalletContext'; +import { useDebounce } from '@/hooks/useDebounce'; import { useErrors } from '@/hooks/useErrors'; import { clearState, loginAndUpdateState, logoutAndUpdateState } from '@/state'; import { t } from '@lingui/core/macro'; import { Trans } from '@lingui/react/macro'; import { platform } from '@tauri-apps/plugin-os'; import { ChevronDown, WalletIcon } from 'lucide-react'; -import { useEffect, useRef, useState } from 'react'; +import { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useTheme } from 'theme-o-rama'; import iconDark from '@/icon-dark.png'; @@ -40,9 +41,9 @@ export function WalletSwitcher({ isCollapsed, wallet }: WalletSwitcherProps) { const [loading, setLoading] = useState(true); const [isOpen, setIsOpen] = useState(false); const [isHovering, setIsHovering] = useState(false); + const debouncedIsHovering = useDebounce(isHovering, 300); const [isMigrationDialogOpen, setIsMigrationDialogOpen] = useState(false); const [migrationWallet, setMigrationWallet] = useState(null); - const timeoutRef = useRef(null); const isMobile = platform() === 'ios' || platform() === 'android'; useEffect(() => { @@ -61,12 +62,12 @@ export function WalletSwitcher({ isCollapsed, wallet }: WalletSwitcherProps) { }, [addError]); useEffect(() => { - return () => { - if (timeoutRef.current) { - clearTimeout(timeoutRef.current); - } - }; - }, []); + if (debouncedIsHovering) { + setIsOpen(true); + } else if (!isHovering) { + setIsOpen(false); + } + }, [debouncedIsHovering, isHovering]); const handleSwitchWallet = async (fingerprint: number) => { if (isSwitching) { @@ -122,20 +123,12 @@ export function WalletSwitcher({ isCollapsed, wallet }: WalletSwitcherProps) { const handleMouseEnter = () => { if (isMobile) return; - if (timeoutRef.current) { - clearTimeout(timeoutRef.current); - timeoutRef.current = null; - } setIsHovering(true); - setIsOpen(true); }; const handleMouseLeave = () => { if (isMobile) return; setIsHovering(false); - timeoutRef.current = setTimeout(() => { - setIsOpen(false); - }, 150); }; // Filter out current wallet from the list From bafdcea92c26e76a95c5f1ef097f9750ea7161bc Mon Sep 17 00:00:00 2001 From: Don Kackman Date: Sun, 5 Apr 2026 09:58:16 -0500 Subject: [PATCH 2/2] fix https://github.com/xch-dev/sage/issues/774 --- src/pages/QrScanner.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/pages/QrScanner.tsx b/src/pages/QrScanner.tsx index d15913b43..b0a9b2476 100644 --- a/src/pages/QrScanner.tsx +++ b/src/pages/QrScanner.tsx @@ -33,6 +33,23 @@ export default function QRScanner() { .finally(() => navigate(returnPath, { replace: true })); }, [navigate, returnPath]); + useEffect(() => { + // Remove body background image so camera feed shows through WebView + const body = document.body; + const hadBackgroundImage = body.classList.contains('has-background-image'); + const savedBackgroundImage = body.style.backgroundImage; + if (hadBackgroundImage) { + body.classList.remove('has-background-image'); + body.style.backgroundImage = 'none'; + } + return () => { + if (hadBackgroundImage) { + body.classList.add('has-background-image'); + body.style.backgroundImage = savedBackgroundImage; + } + }; + }, []); + useEffect(() => { const startScanning = async () => { try {