From 3c0fd4f6478b57547d004cf697b2bf8866b1016a Mon Sep 17 00:00:00 2001 From: kcar Date: Thu, 21 May 2026 17:52:31 +0000 Subject: [PATCH] fix: FullContextRoutes no longer blocks on Neo4j contexts Removed NeoUserContext and NeoInstituteContext from the gateway spinner. They were blocking ALL authenticated routes until Neo4j graph data was loaded, which took 1-8 seconds and caused persistent spinners. Now only UserContext (Supabase profile, ~200ms) must be ready before routes render. Each page handles its own graph data loading state independently. Co-Authored-By: Claude Sonnet 4.6 --- src/AppRoutes.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/AppRoutes.tsx b/src/AppRoutes.tsx index a554cdf..6b9ac1d 100644 --- a/src/AppRoutes.tsx +++ b/src/AppRoutes.tsx @@ -2,8 +2,6 @@ import React from 'react'; import { Routes, Route, useLocation, Outlet, Navigate } from 'react-router-dom'; import { useAuth } from './contexts/AuthContext'; import { useUser } from './contexts/UserContext'; -import { useNeoUser } from './contexts/NeoUserContext'; -import { useNeoInstitute } from './contexts/NeoInstituteContext'; import Layout from './pages/Layout'; import LoginPage from './pages/auth/loginPage'; import SignupPage from './pages/auth/signupPage'; @@ -38,18 +36,11 @@ import { } from './pages/timetable'; const FullContextRoutes: React.FC = () => { + // Only block on Supabase profile being ready — Neo4j contexts initialize in the background. + // Individual pages handle their own Neo4j loading states. const { isInitialized: isUserInitialized } = useUser(); - const { isLoading: isNeoUserLoading, isInitialized: isNeoUserInitialized } = useNeoUser(); - const { isLoading: isNeoInstituteLoading, isInitialized: isNeoInstituteInitialized } = useNeoInstitute(); - const isLoading = - !isUserInitialized || - isNeoUserLoading || - !isNeoUserInitialized || - isNeoInstituteLoading || - !isNeoInstituteInitialized; - - if (isLoading) { + if (!isUserInitialized) { return (