first commit

This commit is contained in:
2026-06-14 20:31:10 +08:00
parent c33b143176
commit 1ed3f576fa
51 changed files with 3362 additions and 810 deletions

View File

@@ -12,6 +12,7 @@ import { useLocation } from "react-router-dom";
import { SplashScreen } from "../components/pwa/SplashScreen";
const MIN_SPLASH_MS = 400;
const MAX_SPLASH_MS = 8000;
const SKIP_SPLASH_KEY = "sproutclaw-warm-boot";
type BootstrapRoute = "chat" | "settings";
@@ -44,6 +45,14 @@ export function BootstrapProvider({ children }: { children: ReactNode }) {
mountTime.current = Date.now();
}, [route]);
useEffect(() => {
if (readyRoutes[route]) return;
const timer = window.setTimeout(() => {
setReadyRoutes((prev) => (prev[route] ? prev : { ...prev, [route]: true }));
}, MAX_SPLASH_MS);
return () => window.clearTimeout(timer);
}, [route, readyRoutes]);
useEffect(() => {
if (!readyRoutes[route]) return;