From 15c8040e35c8d50c44ae7c1b4dd11e79ef61b153 Mon Sep 17 00:00:00 2001 From: MK Fain Date: Wed, 3 Dec 2025 19:47:29 -0600 Subject: [PATCH] Fix: Move FloatingChatButton and GlobalChatPane inside Router The ModelSelector component uses useNavigate which requires Router context. Move the floating chat components from App.tsx into AppRouter.tsx where they have access to the BrowserRouter/HashRouter context. --- src/App.tsx | 4 ---- src/AppRouter.tsx | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c8c4dd06..2885bf32 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -29,8 +29,6 @@ import { OfflineIndicator } from '@/components/OfflineIndicator'; import { PWAUpdatePrompt } from '@/components/PWAUpdatePrompt'; import { ErrorBoundary } from '@/components/ErrorBoundary'; import { GlobalChatProvider } from '@/components/GlobalChatProvider'; -import { FloatingChatButton } from '@/components/FloatingChatButton'; -import { GlobalChatPane } from '@/components/GlobalChatPane'; import AppRouter from './AppRouter'; @@ -189,8 +187,6 @@ export function App() { - - diff --git a/src/AppRouter.tsx b/src/AppRouter.tsx index dd0f5e75..5dffe2df 100644 --- a/src/AppRouter.tsx +++ b/src/AppRouter.tsx @@ -2,6 +2,8 @@ import { BrowserRouter, HashRouter, Route, Routes } from "react-router-dom"; import { ScrollToTop } from "./components/ScrollToTop"; import { SessionMonitor } from "./components/SessionMonitor"; import { URLFragmentHandler } from "./components/URLFragmentHandler"; +import { FloatingChatButton } from "./components/FloatingChatButton"; +import { GlobalChatPane } from "./components/GlobalChatPane"; import Index from "./pages/Index"; import Clone from "./pages/Clone"; @@ -56,6 +58,9 @@ export function AppRouter() { {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */} } /> + {/* Global floating chat - available on all pages */} + + ); }