From 752e14e480373833829f8d186ae77ea373b87b38 Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Wed, 17 Dec 2025 03:44:54 +0000 Subject: [PATCH] Improve theme switching animation for a smoother user experience Refactor `switchClearance` function in `os.tsx` to use a single `setTimeout` for mode switching, ensuring a smooth, non-repeating transition animation. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 279f1558-c0e3-40e4-8217-be7e9f4c6eca Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 144d7508-e90b-43b4-a0a4-a459de6f69ab Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/b984cb14-1d19-4944-922b-bc79e821ed35/279f1558-c0e3-40e4-8217-be7e9f4c6eca/nBprVcr Replit-Helium-Checkpoint-Created: true --- client/src/pages/os.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/pages/os.tsx b/client/src/pages/os.tsx index c145d39..fdc64eb 100644 --- a/client/src/pages/os.tsx +++ b/client/src/pages/os.tsx @@ -205,9 +205,14 @@ export default function AeThexOS() { const switchClearance = useCallback(() => { const newMode: ClearanceMode = clearanceMode === 'foundation' ? 'corp' : 'foundation'; + setIsSwitchingClearance(true); setShowStartMenu(false); - setClearanceMode(newMode); - addToast(`Switched to ${CLEARANCE_THEMES[newMode].name}`, 'success'); + + setTimeout(() => { + setClearanceMode(newMode); + setIsSwitchingClearance(false); + addToast(`Switched to ${CLEARANCE_THEMES[newMode].name}`, 'success'); + }, 600); }, [clearanceMode, addToast]); useEffect(() => {