fix: hide the global AI chat widget on /coming-soon
All checks were successful
build-and-release / build (push) Successful in 2m21s

AiChatWidget renders unconditionally in the root layout for every
route - looked out of place on the pre-launch marketing page (a
floating chat bubble implying app functionality that doesn't exist
yet). Hidden via a small route-exclusion set keyed off useLocation(),
rather than threading a prop through every route.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Ashwin Kumar Sivakumar 2026-08-14 04:48:24 +05:30
parent f51a94b777
commit 97f1b61979

View file

@ -1,15 +1,22 @@
import { MetaProvider, Title } from "@solidjs/meta";
import { Router } from "@solidjs/router";
import { Router, useLocation } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { ErrorBoundary, Suspense } from "solid-js";
import { ErrorBoundary, Suspense, Show } from "solid-js";
import { AuthProvider } from "~/lib/auth";
import { AiChatWidget } from "~/components/AiChatWidget";
import "./app.css";
// Standalone pre-launch pages that shouldn't show the logged-out-app chrome
// (the AI chat widget assumes an app context - it doesn't make sense on a
// pure marketing/waitlist page).
const NO_CHAT_WIDGET_ROUTES = new Set(["/coming-soon"]);
export default function App() {
return (
<Router
root={(props) => (
root={(props) => {
const location = useLocation();
return (
<MetaProvider>
<Title>Nxtgauge</Title>
<AuthProvider>
@ -42,11 +49,14 @@ export default function App() {
)}
>
<Suspense>{props.children}</Suspense>
<Show when={!NO_CHAT_WIDGET_ROUTES.has(location.pathname)}>
<AiChatWidget />
</Show>
</ErrorBoundary>
</AuthProvider>
</MetaProvider>
)}
);
}}
>
<FileRoutes />
</Router>