From ab73390ac8ab0c83956425d96dcf2c9b74cc98ec Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Sat, 17 Jan 2026 09:21:22 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20fix:=20suppress=20tutorial=20too?= =?UTF-8?q?ltips=20during=20splash=20screens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../splashScreens/SplashScreenProvider.tsx | 26 +++++++++++++------ src/browser/contexts/TutorialContext.tsx | 4 ++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/browser/components/splashScreens/SplashScreenProvider.tsx b/src/browser/components/splashScreens/SplashScreenProvider.tsx index 01c3268980..16a1868015 100644 --- a/src/browser/components/splashScreens/SplashScreenProvider.tsx +++ b/src/browser/components/splashScreens/SplashScreenProvider.tsx @@ -1,7 +1,20 @@ -import React, { useState, useCallback, useEffect, type ReactNode } from "react"; +import React, { + createContext, + useContext, + useState, + useCallback, + useEffect, + type ReactNode, +} from "react"; import { SPLASH_REGISTRY, DISABLE_SPLASH_SCREENS, type SplashConfig } from "./index"; import { useAPI } from "@/browser/contexts/API"; +const SplashScreenActiveContext = createContext(false); + +export function useIsSplashScreenActive(): boolean { + return useContext(SplashScreenActiveContext); +} + export function SplashScreenProvider({ children }: { children: ReactNode }) { const { api } = useAPI(); const [queue, setQueue] = useState([]); @@ -55,15 +68,12 @@ export function SplashScreenProvider({ children }: { children: ReactNode }) { setQueue((q) => q.slice(1)); }, [currentSplash, api]); - // Don't render splash until we've loaded the viewed state - if (!loaded) { - return <>{children}; - } + const isSplashScreenActive = loaded && currentSplash !== null; return ( - <> + {children} - {currentSplash && void dismiss()} />} - + {loaded && currentSplash && void dismiss()} />} + ); } diff --git a/src/browser/contexts/TutorialContext.tsx b/src/browser/contexts/TutorialContext.tsx index afda259893..32af3080a4 100644 --- a/src/browser/contexts/TutorialContext.tsx +++ b/src/browser/contexts/TutorialContext.tsx @@ -6,6 +6,7 @@ import { type TutorialState, type TutorialSequence, } from "@/common/constants/storage"; +import { useIsSplashScreenActive } from "@/browser/components/splashScreens/SplashScreenProvider"; import { readPersistedState, updatePersistedState } from "@/browser/hooks/usePersistedState"; // Tutorial step definitions for each sequence @@ -73,6 +74,7 @@ export function TutorialProvider({ children }: TutorialProviderProps) { const [tutorialState, setTutorialState] = useState(() => readPersistedState(TUTORIAL_STATE_KEY, DEFAULT_TUTORIAL_STATE) ); + const isSplashScreenActive = useIsSplashScreenActive(); const [activeSequence, setActiveSequence] = useState(null); const [currentStepIndex, setCurrentStepIndex] = useState(0); @@ -158,7 +160,7 @@ export function TutorialProvider({ children }: TutorialProviderProps) { return ( {children} - {currentStep && activeSteps && ( + {!isSplashScreenActive && currentStep && activeSteps && (