Skip to content

Open source alternative to Semrush and Ahrefs

One app shell with no dead ends before the ShadCN port (EVE-280, EVE-290) (#716)

Ben Senescuc3351a7df91c
diff --git a/.agents/PAPERCUTS.md b/.agents/PAPERCUTS.md
index 88dae931..e38962d0 100644
--- a/.agents/PAPERCUTS.md
+++ b/.agents/PAPERCUTS.md
@@ -10,6 +10,7 @@ data, or sensitive paths.
## Open
+- [ ] `2026-09-27T19:32:00Z` — `claude` — Through the `pnpm dev:agents` portless `.localhost` URL, SAM chat opens then fails with "Failed to fetch": the agents client loads history over a URL that ends in `ERR_SSL_PROTOCOL_ERROR`. The same chat works at `http://127.0.0.1:<port>` from `.logs/dev-server.log`. Document that SAM QA needs the direct origin, or make the portless proxy carry the agents HTTP and WebSocket routes.
- [ ] `2026-09-24T21:20:00Z` — `claude` — `pnpm format:write` is `prettier . --write`, so passing file paths (`pnpm format:write src/foo.ts`) silently formats the whole repository instead of the named files, which surprises agents working in parallel on one checkout. Use `pnpm exec prettier --write <files>` for targeted runs, or make the script forward arguments.
- [ ] `2026-09-23T05:50:00Z` — `claude` — `pnpm install --frozen-lockfile` in `web/` rewrites the tracked `web/pnpm-workspace.yaml`, adding an `allowBuilds` block with `esbuild`/`workerd` set to the placeholder "set this to true or false". This leaves a dirty tree that is easy to commit by accident. Commit explicit `allowBuilds` values for those two packages.
- [ ] `2026-09-23T04:52:00Z` — `claude` — `pnpm dev:agents` names the portless host after the git branch, and Linear branch names like `carter/eve-125-keyword-research-city-and-county-volume-not-just-country` make a 64-character DNS label (limit 63), so browsers show `chrome-error` for the `.localhost` URL. Workaround: open `http://127.0.0.1:<port>` from `.logs/dev-server.log`; fix: pass a truncated `--name` to portless in the script.
diff --git a/src/client/components/AuthConfigErrorCard.tsx b/src/client/components/AuthConfigErrorCard.tsx
deleted file mode 100644
index c73450a4..00000000
--- a/src/client/components/AuthConfigErrorCard.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { ShieldAlert } from "lucide-react";
-
-const CLOUDFLARE_SETUP_GUIDE_URL =
- "https://github.com/every-app/open-seo/blob/main/docs/SELF_HOSTING_CLOUDFLARE.md#2-configure-authentication-and-secrets";
-
-type AuthConfigErrorCardProps = {
- message: string;
- onRetry: () => void;
-};
-
-export function AuthConfigErrorCard({
- message,
- onRetry,
-}: AuthConfigErrorCardProps) {
- // Only name a mode's settings when the client build names that mode. With
- // AUTH_MODE unset here the server mode is unknown, and the alert above
- // already carries the server's exact message.
- const clientAuthMode = import.meta.env.AUTH_MODE;
-
- return (
- <div className="card w-full max-w-2xl bg-base-100 border border-base-300 shadow-xl">
- <div className="card-body gap-4">
- <h2 className="card-title gap-2">
- <ShieldAlert className="size-5 text-error" />
- Authentication setup required
- </h2>
-
- <div className="alert alert-error">
- <span>{message}</span>
- </div>
-
- {clientAuthMode === "hosted" ? (
- <p className="text-sm text-base-content/70">
- Hosted mode requires{" "}
- <code className="mx-1">BETTER_AUTH_SECRET</code>
- (32+ characters), <code className="mx-1">BETTER_AUTH_URL</code>, and
- Google OAuth credentials on the deployment.
- </p>
- ) : null}
- {clientAuthMode === "cloudflare_access" ? (
- <p className="text-sm text-base-content/70">
- Cloudflare Access mode requires
- <code className="mx-1">TEAM_DOMAIN</code> (a full https URL) and
- <code className="mx-1">POLICY_AUD</code> set on the deployment, with
- an Access application protecting this hostname.
- </p>
- ) : null}
-
- <div className="card-actions justify-end">
- <button className="btn btn-ghost btn-sm" onClick={onRetry}>
- Try Again
- </button>
- <a
- className="btn btn-primary btn-sm"
- href={CLOUDFLARE_SETUP_GUIDE_URL}
- target="_blank"
- rel="noreferrer"
- >
- Open Setup Guide
- </a>
- </div>
- </div>
- </div>
- );
-}
diff --git a/src/client/components/AuthErrorCard.tsx b/src/client/components/AuthErrorCard.tsx
new file mode 100644
index 00000000..a38211a0
--- /dev/null
+++ b/src/client/components/AuthErrorCard.tsx
@@ -0,0 +1,141 @@
+import { useEffect, type ReactNode } from "react";
+import { ShieldAlert } from "lucide-react";
+import {
+ getErrorCode,
+ getStandardErrorMessage,
+} from "@/client/lib/error-messages";
+import { isHostedClientAuthMode } from "@/lib/auth-mode";
+import { getSignInHref, getSignInHrefForLocation } from "@/lib/auth-redirect";
+
+const CLOUDFLARE_SETUP_GUIDE_URL =
+ "https://github.com/every-app/open-seo/blob/main/docs/SELF_HOSTING_CLOUDFLARE.md#2-configure-authentication-and-secrets";
+
+type CardProps = {
+ message: string;
+ onRetry: () => void;
+};
+
+/**
+ * The card for an auth failure, else `fallback`. The route error boundary and
+ * the landing redirect both render errors through this, so each auth error
+ * code shows the same card everywhere.
+ */
+export function AuthErrorCard({
+ error,
+ onRetry,
+ fallback,
+}: {
+ error: unknown;
+ onRetry: () => void;
+ fallback: ReactNode;
+}) {
+ const errorCode = getErrorCode(error);
+ if (errorCode !== "AUTH_CONFIG_MISSING" && errorCode !== "UNAUTHENTICATED") {
+ return fallback;
+ }
+
+ const message = getStandardErrorMessage(
+ error,
+ "Something went wrong. Please try again.",
+ );
+ return (
+ <div className="flex h-full min-w-0 flex-1 items-center justify-center p-4">
+ {errorCode === "AUTH_CONFIG_MISSING" ? (
+ <AuthConfigErrorCard message={message} onRetry={onRetry} />
+ ) : (
+ <UnauthenticatedErrorCard message={message} onRetry={onRetry} />
+ )}
+ </div>
+ );
+}
+
+function AuthConfigErrorCard({ message, onRetry }: CardProps) {
+ // Only name a mode's settings when the client build names that mode. With
+ // AUTH_MODE unset here the server mode is unknown, and the alert above
+ // already carries the server's exact message.
+ const clientAuthMode = import.meta.env.AUTH_MODE;
+
+ return (
+ <div className="card w-full max-w-2xl bg-base-100 border border-base-300 shadow-xl">
+ <div className="card-body gap-4">
+ <h2 className="card-title gap-2">
+ <ShieldAlert className="size-5 text-error" />
+ Authentication setup required
+ </h2>
+
+ <div className="alert alert-error">
+ <span>{message}</span>
+ </div>
+
+ {clientAuthMode === "hosted" ? (
+ <p className="text-sm text-base-content/70">
+ Hosted mode requires{" "}
+ <code className="mx-1">BETTER_AUTH_SECRET</code>
+ (32+ characters), <code className="mx-1">BETTER_AUTH_URL</code>, and
+ Google OAuth credentials on the deployment.
+ </p>
+ ) : null}
+ {clientAuthMode === "cloudflare_access" ? (
+ <p className="text-sm text-base-content/70">
+ Cloudflare Access mode requires
+ <code className="mx-1">TEAM_DOMAIN</code> (a full https URL) and
+ <code className="mx-1">POLICY_AUD</code> set on the deployment, with
+ an Access application protecting this hostname.
+ </p>
+ ) : null}
+
+ <div className="card-actions justify-end">
+ <button className="btn btn-ghost btn-sm" onClick={onRetry}>
+ Try Again
+ </button>
+ <a
+ className="btn btn-primary btn-sm"
+ href={CLOUDFLARE_SETUP_GUIDE_URL}
+ target="_blank"
+ rel="noreferrer"
+ >
+ Open Setup Guide
+ </a>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+function UnauthenticatedErrorCard({ message, onRetry }: CardProps) {
+ const isHostedMode = isHostedClientAuthMode();
+ const signInHref =
+ typeof window === "undefined"
+ ? getSignInHref("/")
+ : getSignInHrefForLocation(window.location);
+
+ useEffect(() => {
+ if (typeof window === "undefined" || !isHostedMode) {
+ return;
+ }
+
+ window.location.replace(signInHref);
+ }, [isHostedMode, signInHref]);
+
+ if (isHostedMode) {
+ return null;
+ }
+
+ return (
+ <div className="card w-full max-w-md bg-base-100 border border-base-300 shadow-xl">
+ <div className="card-body gap-4">
+ <h2 className="card-title">Authentication required</h2>
+ <p className="text-sm text-base-content/70">{message}</p>
+ <p className="text-sm text-base-content/70">
+ This deployment uses external authentication. Refresh your access
+ session, then try again.
+ </p>
+ <div className="card-actions justify-end">
+ <button className="btn btn-primary btn-sm" onClick={onRetry}>
+ Try Again
+ </button>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/src/client/components/DefaultCatchBoundary.tsx b/src/client/components/DefaultCatchBoundary.tsx
index 62339332..4778e61a 100644
--- a/src/client/components/DefaultCatchBoundary.tsx
+++ b/src/client/components/DefaultCatchBoundary.tsx
@@ -6,9 +6,8 @@ import {
getErrorCode,
getStandardErrorMessage,
} from "@/client/lib/error-messages";
-import { AuthConfigErrorCard } from "@/client/components/AuthConfigErrorCard";
+import { AuthErrorCard } from "@/client/components/AuthErrorCard";
import { captureClientError } from "@/client/lib/posthog";
-import { UnauthenticatedErrorCard } from "@/client/components/UnauthenticatedErrorCard";
export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
const router = useRouter();
@@ -35,36 +34,7 @@ export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
});
}, [error, errorCode, pathname]);
- const showAuthConfigHelp = errorCode === "AUTH_CONFIG_MISSING";
- const showSignInHelp = errorCode === "UNAUTHENTICATED";
-
- if (showAuthConfigHelp) {
- return (
- <div className="min-w-0 flex-1 p-4 flex items-center justify-center">
- <AuthConfigErrorCard
- message={message}
- onRetry={() => {
- void router.invalidate();
- }}
- />
- </div>
- );
- }
-
- if (showSignInHelp) {
- return (
- <div className="min-w-0 flex-1 p-4 flex items-center justify-center">
- <UnauthenticatedErrorCard
- message={message}
- onRetry={() => {
- void router.invalidate();
- }}
- />
- </div>
- );
- }
-
- return (
+ const genericError = (
<div className="min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6">
<p className="text-center text-error">{message}</p>
<div className="flex gap-2 items-center flex-wrap">
@@ -95,4 +65,14 @@ export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
</div>
</div>
);
+
+ return (
+ <AuthErrorCard
+ error={error}
+ onRetry={() => {
+ void router.invalidate();
+ }}
+ fallback={genericError}
+ />
+ );
}
diff --git a/src/client/components/UnauthenticatedErrorCard.tsx b/src/client/components/UnauthenticatedErrorCard.tsx
deleted file mode 100644
index 5cfb9483..00000000
--- a/src/client/components/UnauthenticatedErrorCard.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { useEffect } from "react";
-import { getSignInHref, getSignInHrefForLocation } from "@/lib/auth-redirect";
-import { isHostedClientAuthMode } from "@/lib/auth-mode";
-
-type UnauthenticatedErrorCardProps = {
- message: string;
- onRetry: () => void;
-};
-
-export function UnauthenticatedErrorCard({
- message,
- onRetry,
-}: UnauthenticatedErrorCardProps) {
- const isHostedMode = isHostedClientAuthMode();
- const signInHref =
- typeof window === "undefined"
- ? getSignInHref("/")
- : getSignInHrefForLocation(window.location);
-
- useEffect(() => {
- if (typeof window === "undefined" || !isHostedMode) {
- return;
- }
-
- window.location.replace(signInHref);
- }, [isHostedMode, signInHref]);
-
- if (isHostedMode) {
- return null;
- }
-
- return (
- <div className="card w-full max-w-md bg-base-100 border border-base-300 shadow-xl">
- <div className="card-body gap-4">
- <h2 className="card-title">Authentication required</h2>
- <p className="text-sm text-base-content/70">{message}</p>
- <p className="text-sm text-base-content/70">
- This deployment uses external authentication. Refresh your access
- session, then try again.
- </p>
- <div className="card-actions justify-end">
- <button className="btn btn-primary btn-sm" onClick={onRetry}>
- Try Again
- </button>
- </div>
- </div>
- </div>
- );
-}
diff --git a/src/client/features/billing/FreePlanBanner.tsx b/src/client/features/billing/FreePlanBanner.tsx
index 11b53518..dcb62084 100644
--- a/src/client/features/billing/FreePlanBanner.tsx
+++ b/src/client/features/billing/FreePlanBanner.tsx
@@ -1,5 +1,6 @@
import { Link } from "@tanstack/react-router";
import { useCustomer } from "autumn-js/react";
+import { AppBanner } from "@/client/layout/AppBanner";
import { useSession } from "@/lib/auth-client";
import { getCustomerPlanStatus } from "@/client/features/billing/plan-detection";
import {
@@ -56,25 +57,25 @@ export function FreePlanBanner() {
if (isOutOfCredits) {
return (
- <BannerShell variant="error">
+ <AppBanner variant="error">
You&rsquo;ve used all your credits. {creditsActionLink} to continue
using OpenSEO.
- </BannerShell>
+ </AppBanner>
);
}
if (isLowCredits) {
return (
- <BannerShell variant="warning">
+ <AppBanner variant="warning">
You&rsquo;re running low on credits. {creditsActionLink} to keep using
OpenSEO.
- </BannerShell>
+ </AppBanner>
);
}
if (isFreePlan) {
return (
- <BannerShell variant="info">
+ <AppBanner variant="info">
We hope you&rsquo;re enjoying OpenSEO!{" "}
<Link
to={SUBSCRIBE_ROUTE}
@@ -88,34 +89,9 @@ export function FreePlanBanner() {
reach out with questions
</Link>
.
- </BannerShell>
+ </AppBanner>
);
}
return null;
}
-
-function BannerShell({
- variant,
- children,
-}: {
- variant: "info" | "warning" | "error";
- children: React.ReactNode;
-}) {
- const alertClass =
- variant === "error"
- ? "alert-error"
- : variant === "warning"
- ? "alert-warning"
- : "alert-info";
-
- return (
- <div className="shrink-0 px-4 py-2.5 md:px-6">
- <div className="mx-auto max-w-7xl">
- <div className={`alert text-sm ${alertClass}`}>
- <span>{children}</span>
- </div>
- </div>
- </div>
- );
-}
diff --git a/src/client/features/dashboard/DashboardCards.tsx b/src/client/features/dashboard/DashboardCards.tsx
index 589bad70..4327a7fb 100644
--- a/src/client/features/dashboard/DashboardCards.tsx
+++ b/src/client/features/dashboard/DashboardCards.tsx
@@ -161,7 +161,15 @@ export function AuditHealthCard({
</Link>
}
>
- {audit.topIssues.length === 0 ? (
+ {audit.status !== "completed" ? (
+ // A running or failed crawl has at most a partial issue list, and an
+ // empty one is not the same as a healthy site.
+ <p className="text-sm text-base-content/70">
+ {audit.status === "running"
+ ? "Issues appear here when the crawl finishes."
+ : "Run the audit again to see issues."}
+ </p>
+ ) : audit.topIssues.length === 0 ? (
<div className="flex items-center gap-2 text-sm text-base-content/70">
<Check className="size-4 text-success" />
No issues found — your site looks healthy.
diff --git a/src/client/features/onboarding/SearchConsoleOnboardingStep.tsx b/src/client/features/onboarding/SearchConsoleOnboardingStep.tsx
index 8770fcd3..1591f5fd 100644
--- a/src/client/features/onboarding/SearchConsoleOnboardingStep.tsx
+++ b/src/client/features/onboarding/SearchConsoleOnboardingStep.tsx
@@ -1,4 +1,5 @@
import * as React from "react";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { ArrowLeft, ArrowRight, Check } from "lucide-react";
import { GoogleGlyph } from "@/client/features/gsc/GoogleGlyph";
@@ -18,7 +19,6 @@ import {
useGoogleLinkPending,
} from "@/client/features/integrations/startGoogleLink";
import { captureClientEvent } from "@/client/lib/posthog";
-import { getProjects } from "@/serverFunctions/projects";
const GRANT_STATUS_KEY = ["gscGrantStatus"];
@@ -35,10 +35,7 @@ type NavigationProps = {
};
export function SearchConsoleOnboardingStep(props: NavigationProps) {
- const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
- });
+ const projectsQuery = useQuery(projectsQueryOptions());
const project = projectsQuery.data?.[0];
return (
@@ -119,7 +116,9 @@ function GscConnect({
captureClientEvent("gsc:property_select");
void queryClient.invalidateQueries({ queryKey: connectionKey });
// The dashboard checklist reads the same connection state.
- void queryClient.invalidateQueries({ queryKey: ["projects"] });
+ void queryClient.invalidateQueries({
+ queryKey: projectsQueryOptions().queryKey,
+ });
onNext();
},
});
diff --git a/src/client/features/projects/CreateProjectModal.tsx b/src/client/features/projects/CreateProjectModal.tsx
index 5f1bab02..7d65165a 100644
--- a/src/client/features/projects/CreateProjectModal.tsx
+++ b/src/client/features/projects/CreateProjectModal.tsx
@@ -1,4 +1,5 @@
import * as React from "react";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { useNavigate } from "@tanstack/react-router";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { toast } from "sonner";
@@ -32,7 +33,9 @@ export function CreateProjectModal({ onClose }: { onClose: () => void }) {
}),
onSuccess: async (created) => {
setLastProjectId(created.id);
- await queryClient.invalidateQueries({ queryKey: ["projects"] });
+ await queryClient.invalidateQueries({
+ queryKey: projectsQueryOptions().queryKey,
+ });
await queryClient.invalidateQueries({
queryKey: ["dashboardActivation"],
});
diff --git a/src/client/features/projects/ProjectGeneralSettings.tsx b/src/client/features/projects/ProjectGeneralSettings.tsx
index f6de96c7..dfda4f53 100644
--- a/src/client/features/projects/ProjectGeneralSettings.tsx
+++ b/src/client/features/projects/ProjectGeneralSettings.tsx
@@ -1,4 +1,5 @@
import * as React from "react";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { useNavigate } from "@tanstack/react-router";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { toast } from "sonner";
@@ -8,18 +9,11 @@ import {
clearLastProjectId,
getLastProjectId,
} from "@/client/lib/active-project";
-import {
- archiveProject,
- getProjects,
- updateProject,
-} from "@/serverFunctions/projects";
+import { archiveProject, updateProject } from "@/serverFunctions/projects";
import type { ProjectSummary } from "./types";
export function ProjectGeneralSettings({ projectId }: { projectId: string }) {
- const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
- });
+ const projectsQuery = useQuery(projectsQueryOptions());
return (
<QueryState
@@ -63,7 +57,9 @@ function GeneralSection({ project }: { project: ProjectSummary }) {
},
}),
onSuccess: async () => {
- await queryClient.invalidateQueries({ queryKey: ["projects"] });
+ await queryClient.invalidateQueries({
+ queryKey: projectsQueryOptions().queryKey,
+ });
toast.success("Project updated");
},
});
@@ -150,7 +146,9 @@ function DangerSection({
mutationFn: () => archiveProject({ data: { projectId: project.id } }),
onSuccess: async () => {
if (getLastProjectId() === project.id) clearLastProjectId();
- await queryClient.invalidateQueries({ queryKey: ["projects"] });
+ await queryClient.invalidateQueries({
+ queryKey: projectsQueryOptions().queryKey,
+ });
toast.success("Project archived");
// Re-resolve to a remaining project via the landing redirect.
void navigate({ to: "/" });
diff --git a/src/client/features/projects/ProjectSwitcher.tsx b/src/client/features/projects/ProjectSwitcher.tsx
index afceefff..68dfaa3f 100644
--- a/src/client/features/projects/ProjectSwitcher.tsx
+++ b/src/client/features/projects/ProjectSwitcher.tsx
@@ -1,4 +1,5 @@
import * as React from "react";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { Link, useRouter } from "@tanstack/react-router";
import { useQuery } from "@tanstack/react-query";
import { findLast } from "remeda";
@@ -10,7 +11,6 @@ import {
Search,
Settings,
} from "lucide-react";
-import { getProjects } from "@/serverFunctions/projects";
import { setLastProjectId } from "@/client/lib/active-project";
import { CreateProjectModal } from "@/client/features/projects/CreateProjectModal";
import type { ProjectSummary } from "./types";
@@ -44,10 +44,7 @@ export function ProjectSwitcher({
const searchInputRef = React.useRef<HTMLInputElement>(null);
const listRef = React.useRef<HTMLUListElement>(null);
- const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
- });
+ const projectsQuery = useQuery(projectsQueryOptions());
const projects = projectsQuery.data ?? [];
const activeProject =
projects.find((project) => project.id === activeProjectId) ?? null;
diff --git a/src/client/features/projects/projectQueries.ts b/src/client/features/projects/projectQueries.ts
new file mode 100644
index 00000000..51acdaba
--- /dev/null
+++ b/src/client/features/projects/projectQueries.ts
@@ -0,0 +1,10 @@
+import { queryOptions } from "@tanstack/react-query";
+import { getProjects } from "@/serverFunctions/projects";
+
+// The org's active projects. Invalidating this key also refreshes the
+// archived list, which lives under ["projects", "archived"].
+export const projectsQueryOptions = () =>
+ queryOptions({
+ queryKey: ["projects"],
+ queryFn: () => getProjects(),
+ });
diff --git a/src/client/features/projects/useProjectMarket.ts b/src/client/features/projects/useProjectMarket.ts
index bbf317c8..73ee44b2 100644
--- a/src/client/features/projects/useProjectMarket.ts
+++ b/src/client/features/projects/useProjectMarket.ts
@@ -1,13 +1,10 @@
import { useQuery } from "@tanstack/react-query";
-import { getProjects } from "@/serverFunctions/projects";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import type { ProjectMarket } from "./types";
/** The project's default market, or undefined until the projects query resolves. */
export function useProjectMarket(projectId: string): ProjectMarket | undefined {
- const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
- });
+ const projectsQuery = useQuery(projectsQueryOptions());
return projectsQuery.data?.find((project) => project.id === projectId);
}
diff --git a/src/client/features/rank-tracking/RankTrackingConfigModal.tsx b/src/client/features/rank-tracking/RankTrackingConfigModal.tsx
index 1316212c..32f431e7 100644
--- a/src/client/features/rank-tracking/RankTrackingConfigModal.tsx
+++ b/src/client/features/rank-tracking/RankTrackingConfigModal.tsx
@@ -1,4 +1,5 @@
import { useMemo, useState } from "react";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { useQuery } from "@tanstack/react-query";
import { toast } from "sonner";
import { Info, Loader2, X } from "lucide-react";
@@ -19,7 +20,6 @@ import { LocationSelect } from "@/client/components/LocationSelect";
import type { ProjectMarket } from "@/client/features/projects/types";
import { QueryError } from "@/client/components/QueryState";
import { Spinner } from "@/client/components/Spinner";
-import { getProjects } from "@/serverFunctions/projects";
import { SearchTargetingField } from "./SearchTargetingField";
import { KeywordSuggestionStep } from "./KeywordSuggestionStep";
import { useSaveConfigMutations } from "./useSaveConfigMutations";
@@ -47,8 +47,7 @@ export function RankTrackingConfigModal({
}: Props) {
// A new domain starts from the project's market, so it waits for projects.
const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
+ ...projectsQueryOptions(),
enabled: !existingConfig,
});
const initialMarket =
diff --git a/src/client/features/reports/ReportViewer.tsx b/src/client/features/reports/ReportViewer.tsx
index 097a1d52..5b31135d 100644
--- a/src/client/features/reports/ReportViewer.tsx
+++ b/src/client/features/reports/ReportViewer.tsx
@@ -1,3 +1,5 @@
+import { useState } from "react";
+import { Spinner } from "@/client/components/Spinner";
import { REPORT_IFRAME_SANDBOX } from "@/shared/report-sandbox";
/**
@@ -10,6 +12,10 @@ import { REPORT_IFRAME_SANDBOX } from "@/shared/report-sandbox";
* Framed, the document is served byte for byte — the app injects nothing here.
* The only injection is the print script on `?print=1`, which this viewer
* never requests.
+ *
+ * A spinner covers the frame until the document loads. The sandbox hides the
+ * response status from the app, so a failed load shows the error text the
+ * render route writes into the frame.
*/
export function ReportViewer({
src,
@@ -20,16 +26,25 @@ export function ReportViewer({
title: string;
className?: string;
}) {
+ const [loadedSrc, setLoadedSrc] = useState<string | null>(null);
return (
- <iframe
- src={src}
- sandbox={REPORT_IFRAME_SANDBOX}
- referrerPolicy="no-referrer"
- title={title}
- className={
- className ??
- "h-full w-full rounded-lg border border-base-300 bg-base-100"
- }
- />
+ <div className="relative h-full w-full">
+ <iframe
+ src={src}
+ sandbox={REPORT_IFRAME_SANDBOX}
+ referrerPolicy="no-referrer"
+ title={title}
+ onLoad={() => setLoadedSrc(src)}
+ className={
+ className ??
+ "h-full w-full rounded-lg border border-base-300 bg-base-100"
+ }
+ />
+ {loadedSrc !== src ? (
+ <div className="absolute inset-0 flex items-center justify-center">
+ <Spinner />
+ </div>
+ ) : null}
+ </div>
);
}
diff --git a/src/client/features/sam/SamChat.tsx b/src/client/features/sam/SamChat.tsx
index 8d264e4a..adce62a4 100644
--- a/src/client/features/sam/SamChat.tsx
+++ b/src/client/features/sam/SamChat.tsx
@@ -1,15 +1,10 @@
-import { useMutation, useQuery } from "@tanstack/react-query";
-import { Link, useNavigate } from "@tanstack/react-router";
+import { Link } from "@tanstack/react-router";
import { Suspense, useCallback, useEffect, useRef, useState } from "react";
import { Brain } from "lucide-react";
import { QueryError } from "@/client/components/QueryState";
import { Spinner } from "@/client/components/Spinner";
-import { createSamSession } from "@/serverFunctions/sam";
-import {
- invalidateSamSessions,
- samSessionsQueryOptions,
-} from "@/client/features/sam/samQueries";
import { useSamAccess } from "./useSamAccess";
+import { useSamSessions } from "./useSamSessions";
import { optInToSamBeta, useSamBetaOptIn } from "./samBetaOptIn";
import { SamBetaGate } from "./SamBetaGate";
import { SamSetupGate } from "./SamSetupGate";
@@ -28,48 +23,34 @@ export function SamChat({
projectId: string;
activeSessionId: string | undefined;
}) {
- const navigate = useNavigate();
const optedIn = useSamBetaOptIn();
const access = useSamAccess(projectId);
- const sessionsQuery = useQuery(samSessionsQueryOptions(projectId));
- const sessions = sessionsQuery.data ?? [];
-
- const goToSession = useCallback(
- (sessionId: string) =>
- void navigate({
- to: "/p/$projectId/sam",
- params: { projectId },
- search: { s: sessionId },
- replace: true,
- }),
- [navigate, projectId],
- );
+ const { sessionsQuery, sessions, goToSession, createSession } =
+ useSamSessions(projectId, { replace: true });
// The ref (not isPending) guards the auto-create below: React can re-run the
// effect before the mutation state updates, and it resets on settle so
// archiving the last chat starts a fresh one.
const creating = useRef(false);
- // Kept in state: the mutation's own callbacks fire for the create started
- // from the effect below, but the hook's `isError` can miss it and leave the
+ // Kept in state: the per-call callbacks fire for the create started from
+ // the effect below, but the hook's `isError` can miss it and leave the
// spinner up.
const [createError, setCreateError] = useState<Error | null>(null);
- const createSession = useMutation({
- mutationFn: () => createSamSession({ data: { projectId } }),
- onMutate: () => setCreateError(null),
- onError: (error) => setCreateError(error),
- onSuccess: ({ id }) => {
- invalidateSamSessions(projectId);
- goToSession(id);
- },
- onSettled: () => {
- creating.current = false;
- },
- });
+ const { mutate: createSessionMutate } = createSession;
+ const startChat = useCallback(() => {
+ creating.current = true;
+ setCreateError(null);
+ createSessionMutate(undefined, {
+ onError: setCreateError,
+ onSettled: () => {
+ creating.current = false;
+ },
+ });
+ }, [createSessionMutate]);
// Landing without a session: open the most recent one, or start a fresh
// chat when the project has none.
const firstSessionId = sessions[0]?.id;
- const { mutate: createSessionMutate } = createSession;
useEffect(() => {
if (activeSessionId || !optedIn || access.showSetupGate) return;
if (firstSessionId) {
@@ -77,8 +58,7 @@ export function SamChat({
return;
}
if (!sessionsQuery.isSuccess || creating.current) return;
- creating.current = true;
- createSessionMutate();
+ startChat();
}, [
activeSessionId,
optedIn,
@@ -86,9 +66,30 @@ export function SamChat({
firstSessionId,
sessionsQuery.isSuccess,
goToSession,
- createSessionMutate,
+ startChat,
]);
+ // The list holds every chat the user can open, so an id missing from it is
+ // archived, deleted, or not theirs. The cached list can predate the link,
+ // though (a chat started in another tab), so refetch once before saying so.
+ const activeSession = sessions.find(
+ (session) => session.id === activeSessionId,
+ );
+ // Gated on the cached list, not on isSuccess: a failed refetch keeps the
+ // old list but leaves the query in error.
+ const isMissing =
+ activeSessionId !== undefined &&
+ !activeSession &&
+ sessionsQuery.data !== undefined;
+ const [recheckedSessionId, setRecheckedSessionId] = useState<string>();
+ const { refetch: refetchSessions } = sessionsQuery;
+ useEffect(() => {
+ if (!isMissing || recheckedSessionId === activeSessionId) return;
+ void refetchSessions().finally(() =>
+ setRecheckedSessionId(activeSessionId),
+ );
+ }, [isMissing, recheckedSessionId, activeSessionId, refetchSessions]);
+
if (!optedIn) {
return <SamBetaGate onContinue={optInToSamBeta} />;
}
@@ -128,10 +129,7 @@ export function SamChat({
<QueryError
error={createError}
fallback="Failed to start a new chat."
- onRetry={() => {
- creating.current = true;
- createSessionMutate();
- }}
+ onRetry={startChat}
/>
) : (
<Spinner />
@@ -140,16 +138,53 @@ export function SamChat({
);
}
- const activeTitle = sessions.find(
- (session) => session.id === activeSessionId,
- )?.title;
+ // Never open a chat the list has not confirmed. Wait for the list and the
+ // one refetch, show the list error if either fails, else say it is gone.
+ if (!activeSession) {
+ const confirmed =
+ sessionsQuery.data !== undefined &&
+ recheckedSessionId === activeSessionId;
+ if (sessionsQuery.isFetching || (!confirmed && !sessionsQuery.isError)) {
+ return (
+ <div className="flex h-full items-center justify-center p-4">
+ <Spinner />
+ </div>
+ );
+ }
+ if (sessionsQuery.isError) {
+ return (
+ <div className="flex h-full items-center justify-center p-4">
+ <QueryError
+ error={sessionsQuery.error}
+ fallback="Failed to load your chats."
+ onRetry={() => void refetchSessions()}
+ />
+ </div>
+ );
+ }
+ return (
+ <div className="flex h-full flex-col items-center justify-center gap-3 p-4 text-center">
+ <p className="text-sm text-base-content/70">
+ This chat was archived or does not exist.
+ </p>
+ <button
+ type="button"
+ className="btn btn-primary btn-sm"
+ onClick={() => goToSession()}
+ >
+ Go to your latest chat
+ </button>
+ </div>
+ );
+ }
+
return (
<div className="flex h-full min-h-0 flex-col">
{/* Session title + the shortest path to inspect or correct the shared
memory SAM reads and writes during the conversation. */}
<div className="flex items-center justify-between gap-3 border-b border-base-300 px-5 py-3.5">
<span className="truncate text-sm font-medium text-base-content/80">
- {activeTitle ?? "Chat"}
+ {activeSession.title}
</span>
<Link
to="/p/$projectId/context"
diff --git a/src/client/features/sam/SamConversation.tsx b/src/client/features/sam/SamConversation.tsx
index 9afb86e5..3e20122e 100644
--- a/src/client/features/sam/SamConversation.tsx
+++ b/src/client/features/sam/SamConversation.tsx
@@ -2,7 +2,7 @@ import { useAgent } from "agents/react";
// Think speaks the same chat protocol as @cloudflare/ai-chat, but its hook
// variant skips the client->server transcript sync Think doesn't support.
import { useAgentChat } from "@cloudflare/think/react";
-import { useEffect, useRef } from "react";
+import { useEffect, useRef, useState } from "react";
import { RotateCcw } from "lucide-react";
import { findLast } from "remeda";
import { toast } from "sonner";
@@ -84,6 +84,16 @@ export function SamConversation({
});
}, [status, connectionError, sessionId, projectId]);
+ // The socket reconnects on its own after a drop; a close the server marks
+ // terminal sets connectionError and stops retrying until the user asks.
+ // `identified` is false before the first connect too, so "reconnecting"
+ // waits until one connect has succeeded.
+ const [hasConnected, setHasConnected] = useState(false);
+ useEffect(() => {
+ if (agent.identified) setHasConnected(true);
+ }, [agent.identified]);
+ const isReconnecting = hasConnected && !agent.identified && !connectionError;
+
// Rewind the server-side conversation to before `messageId`: the DO aborts
// any in-flight turn, then deletes the message and everything after it. Sync
// the local view from the server afterwards rather than slicing locally —
@@ -138,7 +148,7 @@ export function SamConversation({
}
if (wasBusyRef.current) {
wasBusyRef.current = false;
- invalidateSamSessions(projectId);
+ void invalidateSamSessions(projectId);
}
}, [isBusy, projectId]);
@@ -255,6 +265,20 @@ export function SamConversation({
<div className="flex-shrink-0 border-t border-base-300 px-5 py-3">
<div className="mx-auto w-full max-w-2xl">
+ {connectionError ? (
+ <div className="mb-2 flex flex-wrap items-center gap-3 text-sm text-error">
+ <span>Lost the connection to SAM.</span>
+ <button
+ type="button"
+ className="btn btn-outline btn-error btn-xs"
+ onClick={() => agent.reconnect()}
+ >
+ Reconnect
+ </button>
+ </div>
+ ) : isReconnecting ? (
+ <p className="mb-2 text-xs text-base-content/60">Reconnecting…</p>
+ ) : null}
<ChatComposer
busy={isBusy}
onSend={sendText}
diff --git a/src/client/features/sam/SamSidebarPanel.tsx b/src/client/features/sam/SamSidebarPanel.tsx
index bbd85808..d9796b0a 100644
--- a/src/client/features/sam/SamSidebarPanel.tsx
+++ b/src/client/features/sam/SamSidebarPanel.tsx
@@ -1,52 +1,13 @@
-import { Link, useLocation, useNavigate } from "@tanstack/react-router";
-import { useMutation, useQuery } from "@tanstack/react-query";
-import { useEffect, useState } from "react";
-import { Archive, Loader2, Plus, X } from "lucide-react";
-import { archiveSamSession, createSamSession } from "@/serverFunctions/sam";
+import { useLocation } from "@tanstack/react-router";
+import { useMutation, useQueryClient } from "@tanstack/react-query";
+import { Archive, Loader2, Plus } from "lucide-react";
+import { archiveSamSession } from "@/serverFunctions/sam";
import {
invalidateSamSessions,
samSessionsQueryOptions,
} from "@/client/features/sam/samQueries";
import { useSamBetaOptIn } from "./samBetaOptIn";
-
-const BETA_NOTICE_DISMISSED_KEY = "sam-beta-notice-dismissed";
-
-// Beta framing + the MCP power-path nudge, pinned to the bottom of the Chat
-// tab. Dismissible per browser; localStorage is read in an effect so SSR and
-// the first client render stay identical (same pattern as AppShell).
-function BetaNotice() {
- const [dismissed, setDismissed] = useState(true);
- useEffect(() => {
- setDismissed(localStorage.getItem(BETA_NOTICE_DISMISSED_KEY) === "1");
- }, []);
- if (dismissed) return null;
-
- return (
- <div className="mx-2 mb-2 rounded-lg border border-base-300 bg-base-100 p-3">
- <div className="flex items-center justify-between">
- <span className="badge badge-primary badge-sm">Beta</span>
- <button
- type="button"
- aria-label="Dismiss"
- className="btn btn-ghost btn-xs btn-square text-base-content/40"
- onClick={() => {
- localStorage.setItem(BETA_NOTICE_DISMISSED_KEY, "1");
- setDismissed(true);
- }}
- >
- <X className="size-3.5" />
- </button>
- </div>
- <p className="mt-1.5 text-xs text-base-content/70">
- For more powerful AI workflows, use the OpenSEO MCP with your own agent
- like Claude Code or Hermes.
- </p>
- <Link to="/ai" className="link link-primary mt-1.5 inline-block text-xs">
- Set up the MCP →
- </Link>
- </div>
- );
-}
+import { useSamSessions } from "./useSamSessions";
// Compact age label for the session list (PostHog-style "3h" / "12d").
// Timestamps come back as UTC from both backends: D1 as "YYYY-MM-DD HH:MM:SS"
@@ -74,39 +35,25 @@ export function SamSidebarPanel({
projectId: string;
onNavigate?: () => void;
}) {
- const navigate = useNavigate();
+ const queryClient = useQueryClient();
const location = useLocation();
const activeSessionId = (location.search as { s?: string }).s;
const optedIn = useSamBetaOptIn();
-
- const sessionsQuery = useQuery(samSessionsQueryOptions(projectId));
- const sessions = sessionsQuery.data ?? [];
-
- const goToSession = (sessionId: string | undefined) => {
- void navigate({
- to: "/p/$projectId/sam",
- params: { projectId },
- search: sessionId ? { s: sessionId } : {},
- });
- onNavigate?.();
- };
-
- const createSession = useMutation({
- mutationFn: () => createSamSession({ data: { projectId } }),
- onSuccess: ({ id }) => {
- invalidateSamSessions(projectId);
- goToSession(id);
- },
- });
+ const { sessionsQuery, sessions, goToSession, createSession } =
+ useSamSessions(projectId, { onNavigate });
const archiveSession = useMutation({
mutationFn: (sessionId: string) =>
archiveSamSession({ data: { sessionId } }),
onSuccess: (_result, sessionId) => {
- invalidateSamSessions(projectId);
- if (sessionId === activeSessionId) {
- goToSession(sessions.find((s) => s.id !== sessionId)?.id);
- }
+ // Drop the chat from the cached list before leaving it, so the chat
+ // route cannot pick it again as the most recent chat.
+ queryClient.setQueryData(
+ samSessionsQueryOptions(projectId).queryKey,
+ (current) => current?.filter((session) => session.id !== sessionId),
+ );
+ void invalidateSamSessions(projectId);
+ if (sessionId === activeSessionId) goToSession();
},
});
@@ -187,8 +134,6 @@ export function SamSidebarPanel({
})
)}
</div>
-
- <BetaNotice />
</div>
);
}
diff --git a/src/client/features/sam/samQueries.ts b/src/client/features/sam/samQueries.ts
index 1b751abc..f59be627 100644
--- a/src/client/features/sam/samQueries.ts
+++ b/src/client/features/sam/samQueries.ts
@@ -9,5 +9,7 @@ export const samSessionsQueryOptions = (projectId: string) =>
});
export function invalidateSamSessions(projectId: string) {
- void queryClient.invalidateQueries({ queryKey: ["samSessions", projectId] });
+ return queryClient.invalidateQueries({
+ queryKey: samSessionsQueryOptions(projectId).queryKey,
+ });
}
diff --git a/src/client/features/sam/useSamSessions.ts b/src/client/features/sam/useSamSessions.ts
new file mode 100644
index 00000000..420a3c94
--- /dev/null
+++ b/src/client/features/sam/useSamSessions.ts
@@ -0,0 +1,55 @@
+import { useMutation, useQuery } from "@tanstack/react-query";
+import { useNavigate } from "@tanstack/react-router";
+import { useCallback } from "react";
+import { createSamSession } from "@/serverFunctions/sam";
+import {
+ invalidateSamSessions,
+ samSessionsQueryOptions,
+} from "@/client/features/sam/samQueries";
+
+/**
+ * The project's chat list, a way to open a chat, and a way to start one. The
+ * chat route and the sidebar's Chat tab share this so both navigate the same
+ * way. `goToSession()` with no id opens the chat route, which picks the most
+ * recent chat or starts a new one.
+ */
+export function useSamSessions(
+ projectId: string,
+ {
+ replace = false,
+ onNavigate,
+ }: { replace?: boolean; onNavigate?: () => void } = {},
+) {
+ const navigate = useNavigate();
+ const sessionsQuery = useQuery(samSessionsQueryOptions(projectId));
+
+ const goToSession = useCallback(
+ (sessionId?: string) => {
+ void navigate({
+ to: "/p/$projectId/sam",
+ params: { projectId },
+ search: sessionId ? { s: sessionId } : {},
+ replace,
+ });
+ onNavigate?.();
+ },
+ [navigate, projectId, replace, onNavigate],
+ );
+
+ const createSession = useMutation({
+ mutationFn: () => createSamSession({ data: { projectId } }),
+ // Wait for the list to hold the new chat before opening it: the chat
+ // route treats an id missing from the list as archived or unknown.
+ onSuccess: async ({ id }) => {
+ await invalidateSamSessions(projectId);
+ goToSession(id);
+ },
+ });
+
+ return {
+ sessionsQuery,
+ sessions: sessionsQuery.data ?? [],
+ goToSession,
+ createSession,
+ };
+}
diff --git a/src/client/layout/AppBanner.tsx b/src/client/layout/AppBanner.tsx
new file mode 100644
index 00000000..754a6200
--- /dev/null
+++ b/src/client/layout/AppBanner.tsx
@@ -0,0 +1,29 @@
+import type { ReactNode } from "react";
+
+const variantClass = {
+ info: "alert-info",
+ warning: "alert-warning",
+ error: "alert-error",
+} as const;
+
+// The full-width notice strip above the page content in the app shell.
+export function AppBanner({
+ variant,
+ icon,
+ children,
+}: {
+ variant: keyof typeof variantClass;
+ icon?: ReactNode;
+ children: ReactNode;
+}) {
+ return (
+ <div className="shrink-0 px-4 py-2.5 md:px-6">
+ <div className="mx-auto max-w-7xl">
+ <div className={`alert text-sm ${variantClass[variant]}`}>
+ {icon}
+ <span>{children}</span>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/src/client/layout/AppShell.tsx b/src/client/layout/AppShell.tsx
index f4231f9b..35bf33d2 100644
--- a/src/client/layout/AppShell.tsx
+++ b/src/client/layout/AppShell.tsx
@@ -1,4 +1,5 @@
import * as React from "react";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { Link, useLocation } from "@tanstack/react-router";
import { useQuery } from "@tanstack/react-query";
import { Menu } from "lucide-react";
@@ -11,10 +12,8 @@ import { GscReEngagementModal } from "@/client/features/gsc/GscReEngagementModal
import { Sidebar } from "@/client/components/Sidebar";
import { BILLING_ROUTE } from "@/shared/billing";
import { getSeoApiKeyStatus } from "@/serverFunctions/config";
-import { getProjects } from "@/serverFunctions/projects";
import { getLastProjectId } from "@/client/lib/active-project";
-
-const DATAFORSEO_HELP_PATH = "/help/dataforseo-api-key";
+import { dataforseoHelpLinkOptions } from "@/client/navigation/items";
export function AuthenticatedAppLayout({
children,
@@ -27,23 +26,21 @@ export function AuthenticatedAppLayout({
}) {
const location = useLocation();
const [drawerOpen, setDrawerOpen] = React.useState(false);
- const setupModalRef = React.useRef<HTMLDivElement | null>(null);
const [showMissingSeoApiKeyModal, setShowMissingSeoApiKeyModal] =
React.useState(false);
// On non-project pages (e.g. /settings) there's no projectId in the URL, so
// derive one for the nav/switcher: prefer the last-visited project, else the
// most recent. The whole app tree is client-only (see root ClientOnly), so we
- // can read localStorage synchronously during the first render — this lets the
- // sidebar show the full project nav on the very first paint instead of briefly
- // flashing only the always-visible Connect group while projects load.
+ // can read localStorage synchronously during render — this lets the sidebar
+ // show the full project nav on the very first paint instead of briefly
+ // flashing only the always-visible Connect group while projects load. It is
+ // read on every render, not once: the shell stays mounted across project
+ // pages, which update the remembered project as the user moves between them.
const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
+ ...projectsQueryOptions(),
enabled: !projectId,
});
- const [rememberedProjectId] = React.useState<string | null>(() =>
- getLastProjectId(),
- );
+ const rememberedProjectId = getLastProjectId();
const fallbackProjects = projectsQuery.data ?? [];
const fallbackProjectId =
fallbackProjects.find((project) => project.id === rememberedProjectId)
@@ -56,7 +53,11 @@ export function AuthenticatedAppLayout({
// builds links that self-correct via the route guard once data arrives.
const sidebarProjectId =
projectId ?? fallbackProjectId ?? rememberedProjectId;
- const shouldCheckSeoApiKeyStatus = location.pathname !== BILLING_ROUTE;
+ // The setup guide is where the modal and banners send the user, so it shows
+ // neither: a banner there would link to the page the user is already on.
+ const shouldCheckSeoApiKeyStatus =
+ location.pathname !== BILLING_ROUTE &&
+ location.pathname !== dataforseoHelpLinkOptions.to;
const seoApiKeyStatusQuery = useQuery({
queryKey: ["seoApiKeyStatus"],
queryFn: () => getSeoApiKeyStatus(),
@@ -89,30 +90,10 @@ export function AuthenticatedAppLayout({
shouldCheckSeoApiKeyStatus,
]);
- const shouldShowMissingSeoApiKeyModal =
- showMissingSeoApiKeyModal && location.pathname !== DATAFORSEO_HELP_PATH;
-
const shouldShowSeoApiWarning =
!seoApiKeyStatusError &&
isSeoApiKeyConfigured === false &&
- !shouldShowMissingSeoApiKeyModal;
-
- React.useEffect(() => {
- if (!shouldShowMissingSeoApiKeyModal) return;
-
- setupModalRef.current?.focus();
-
- const onKeyDown = (event: KeyboardEvent) => {
- if (event.key === "Escape") {
- setShowMissingSeoApiKeyModal(false);
- }
- };
-
- window.addEventListener("keydown", onKeyDown);
- return () => {
- window.removeEventListener("keydown", onKeyDown);
- };
- }, [shouldShowMissingSeoApiKeyModal]);
+ !showMissingSeoApiKeyModal;
return (
<div className="flex h-[100dvh] bg-base-200">
@@ -148,15 +129,15 @@ export function AuthenticatedAppLayout({
onClose={() => setDrawerOpen(false)}
/>
- <MissingSeoSetupModal
- ref={setupModalRef}
- isOpen={shouldShowMissingSeoApiKeyModal}
- onClose={() => setShowMissingSeoApiKeyModal(false)}
- />
+ {showMissingSeoApiKeyModal ? (
+ <MissingSeoSetupModal
+ onClose={() => setShowMissingSeoApiKeyModal(false)}
+ />
+ ) : null}
<GscReEngagementModal
projectId={sidebarProjectId}
- suppressed={shouldShowMissingSeoApiKeyModal}
+ suppressed={showMissingSeoApiKeyModal}
/>
</div>
);
diff --git a/src/client/layout/AppShellParts.tsx b/src/client/layout/AppShellParts.tsx
index c4517623..591c4987 100644
--- a/src/client/layout/AppShellParts.tsx
+++ b/src/client/layout/AppShellParts.tsx
@@ -1,7 +1,8 @@
-import * as React from "react";
import { Link } from "@tanstack/react-router";
import { AlertTriangle, ExternalLink } from "lucide-react";
+import { Modal } from "@/client/components/Modal";
import { Sidebar } from "@/client/components/Sidebar";
+import { AppBanner } from "@/client/layout/AppBanner";
import { dataforseoHelpLinkOptions } from "@/client/navigation/items";
function SeoApiStatusBanners({
@@ -11,48 +12,29 @@ function SeoApiStatusBanners({
shouldShowSeoApiWarning: boolean;
seoApiKeyStatusError: boolean;
}) {
+ const icon = <AlertTriangle className="size-4 shrink-0" />;
+ const helpLink = (
+ <Link
+ {...dataforseoHelpLinkOptions}
+ className="link link-primary font-medium"
+ >
+ help page
+ </Link>
+ );
return (
<>
{shouldShowSeoApiWarning ? (
- <div className="shrink-0 px-4 py-2.5 md:px-6">
- <div className="mx-auto max-w-7xl">
- <div className="alert alert-warning">
- <AlertTriangle className="size-4 shrink-0" />
- <span className="text-sm">
- Setup needed: add your DataForSEO API key to use OpenSEO
- features. See the quick steps on the{" "}
- <Link
- {...dataforseoHelpLinkOptions}
- className="link link-primary font-medium"
- >
- help page
- </Link>
- .
- </span>
- </div>
- </div>
- </div>
+ <AppBanner variant="warning" icon={icon}>
+ Setup needed: add your DataForSEO API key to use OpenSEO features. See
+ the quick steps on the {helpLink}.
+ </AppBanner>
) : null}
{seoApiKeyStatusError ? (
- <div className="shrink-0 px-4 py-2.5 md:px-6">
- <div className="mx-auto max-w-7xl">
- <div className="alert alert-info">
- <AlertTriangle className="size-4 shrink-0" />
- <span className="text-sm">
- We could not verify your DataForSEO setup. If features are not
- working, check the setup steps on the{" "}
- <Link
- {...dataforseoHelpLinkOptions}
- className="link link-primary font-medium"
- >
- help page
- </Link>
- .
- </span>
- </div>
- </div>
- </div>
+ <AppBanner variant="info" icon={icon}>
+ We could not verify your DataForSEO setup. If features are not
+ working, check the setup steps on the {helpLink}.
+ </AppBanner>
) : null}
</>
);
@@ -84,64 +66,45 @@ function MobileSidebarDrawer({
);
}
-const MissingSeoSetupModal = React.forwardRef<
- HTMLDivElement,
- {
- isOpen: boolean;
- onClose: () => void;
- }
->(({ isOpen, onClose }, ref) => {
- if (!isOpen) return null;
-
+function MissingSeoSetupModal({ onClose }: { onClose: () => void }) {
return (
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4">
- <div
- ref={ref}
- role="dialog"
- aria-modal="true"
- aria-labelledby="dataforseo-setup-title"
- aria-describedby="dataforseo-setup-description"
- tabIndex={-1}
- className="w-full max-w-lg rounded-xl border border-base-300 bg-base-100 p-5 shadow-2xl"
- >
- <div className="flex items-start gap-3">
- <div className="rounded-full bg-warning/20 p-2 text-warning">
- <AlertTriangle className="size-5" />
- </div>
- <div className="space-y-2">
- <h2
- id="dataforseo-setup-title"
- className="text-lg font-semibold text-base-content"
- >
- One quick setup step
- </h2>
- <p
- id="dataforseo-setup-description"
- className="text-sm text-base-content/75"
- >
- Add your DataForSEO API key to start using OpenSEO.
- </p>
- </div>
+ <Modal
+ maxWidth="max-w-lg"
+ onClose={onClose}
+ labelledBy="dataforseo-setup-title"
+ >
+ <div className="flex items-start gap-3">
+ <div className="rounded-full bg-warning/20 p-2 text-warning">
+ <AlertTriangle className="size-5" />
</div>
-
- <div className="mt-5 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
- <button type="button" className="btn btn-ghost" onClick={onClose}>
- Dismiss
- </button>
- <Link
- {...dataforseoHelpLinkOptions}
- className="btn btn-primary"
- onClick={onClose}
+ <div className="space-y-2">
+ <h2
+ id="dataforseo-setup-title"
+ className="text-lg font-semibold text-base-content"
>
- Open setup guide
- <ExternalLink className="size-4" />
- </Link>
+ One quick setup step
+ </h2>
+ <p className="text-sm text-base-content/75">
+ Add your DataForSEO API key to start using OpenSEO.
+ </p>
</div>
</div>
- </div>
- );
-});
-MissingSeoSetupModal.displayName = "MissingSeoSetupModal";
+ <div className="mt-1 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
+ <button type="button" className="btn btn-ghost" onClick={onClose}>
+ Dismiss
+ </button>
+ <Link
+ {...dataforseoHelpLinkOptions}
+ className="btn btn-primary"
+ onClick={onClose}
+ >
+ Open setup guide
+ <ExternalLink className="size-4" />
+ </Link>
+ </div>
+ </Modal>
+ );
+}
export { MissingSeoSetupModal, MobileSidebarDrawer, SeoApiStatusBanners };
diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts
index 6f94645c..ecd16d70 100644
--- a/src/routeTree.gen.ts
+++ b/src/routeTree.gen.ts
@@ -15,7 +15,6 @@ import { Route as ForgotPasswordRouteImport } from './routes/forgot-password'
import { Route as AuthErrorRouteImport } from './routes/auth-error'
import { Route as AuthenticatedRouteImport } from './routes/_authenticated'
import { Route as AuthRouteImport } from './routes/_auth'
-import { Route as ProjectRouteRouteImport } from './routes/_project/route'
import { Route as AppRouteRouteImport } from './routes/_app/route'
import { Route as AppIndexRouteImport } from './routes/_app/index'
import { Route as RReportIdRouteImport } from './routes/r/$reportId'
@@ -43,31 +42,31 @@ import { Route as AppSettingsOrganizationRouteImport } from './routes/_app/setti
import { Route as AppHelpOpenrouterApiKeyRouteImport } from './routes/_app/help/openrouter-api-key'
import { Route as AppHelpDataforseoApiKeyRouteImport } from './routes/_app/help/dataforseo-api-key'
import { Route as AppBillingFixPaymentRouteImport } from './routes/_app/billing_.fix-payment'
-import { Route as ProjectPProjectIdRouteRouteImport } from './routes/_project/p/$projectId/route'
-import { Route as ProjectPProjectIdIndexRouteImport } from './routes/_project/p/$projectId/index'
+import { Route as AppPProjectIdRouteRouteImport } from './routes/_app/p/$projectId/route'
+import { Route as AppPProjectIdIndexRouteImport } from './routes/_app/p/$projectId/index'
import { Route as ApiGscOauthCallbackRouteImport } from './routes/api/gsc/oauth/callback'
import { Route as ApiGa4OauthCallbackRouteImport } from './routes/api/ga4/oauth/callback'
-import { Route as ProjectPProjectIdSettingsRouteImport } from './routes/_project/p/$projectId/settings'
-import { Route as ProjectPProjectIdSearchPerformanceRouteImport } from './routes/_project/p/$projectId/search-performance'
-import { Route as ProjectPProjectIdSavedRouteImport } from './routes/_project/p/$projectId/saved'
-import { Route as ProjectPProjectIdSamRouteImport } from './routes/_project/p/$projectId/sam'
-import { Route as ProjectPProjectIdRankTrackingRouteImport } from './routes/_project/p/$projectId/rank-tracking'
-import { Route as ProjectPProjectIdPromptExplorerRouteImport } from './routes/_project/p/$projectId/prompt-explorer'
-import { Route as ProjectPProjectIdKeywordsRouteImport } from './routes/_project/p/$projectId/keywords'
-import { Route as ProjectPProjectIdDomainRouteImport } from './routes/_project/p/$projectId/domain'
-import { Route as ProjectPProjectIdContextRouteImport } from './routes/_project/p/$projectId/context'
-import { Route as ProjectPProjectIdBrandLookupRouteImport } from './routes/_project/p/$projectId/brand-lookup'
-import { Route as ProjectPProjectIdBacklinksRouteImport } from './routes/_project/p/$projectId/backlinks'
-import { Route as ProjectPProjectIdSettingsIndexRouteImport } from './routes/_project/p/$projectId/settings/index'
-import { Route as ProjectPProjectIdReportsIndexRouteImport } from './routes/_project/p/$projectId/reports/index'
-import { Route as ProjectPProjectIdRankTrackingIndexRouteImport } from './routes/_project/p/$projectId/rank-tracking/index'
-import { Route as ProjectPProjectIdAuditIndexRouteImport } from './routes/_project/p/$projectId/audit/index'
-import { Route as ProjectPProjectIdSettingsIntegrationsRouteImport } from './routes/_project/p/$projectId/settings/integrations'
-import { Route as ProjectPProjectIdSettingsContextRouteImport } from './routes/_project/p/$projectId/settings/context'
-import { Route as ProjectPProjectIdReportsTemplatesRouteImport } from './routes/_project/p/$projectId/reports/templates'
-import { Route as ProjectPProjectIdReportsReportIdRouteImport } from './routes/_project/p/$projectId/reports/$reportId'
-import { Route as ProjectPProjectIdRankTrackingConfigIdRouteImport } from './routes/_project/p/$projectId/rank-tracking/$configId'
-import { Route as ProjectPProjectIdAuditIssuesResultIdRouteImport } from './routes/_project/p/$projectId/audit/issues/$resultId'
+import { Route as AppPProjectIdSettingsRouteImport } from './routes/_app/p/$projectId/settings'
+import { Route as AppPProjectIdSearchPerformanceRouteImport } from './routes/_app/p/$projectId/search-performance'
+import { Route as AppPProjectIdSavedRouteImport } from './routes/_app/p/$projectId/saved'
+import { Route as AppPProjectIdSamRouteImport } from './routes/_app/p/$projectId/sam'
+import { Route as AppPProjectIdRankTrackingRouteImport } from './routes/_app/p/$projectId/rank-tracking'
+import { Route as AppPProjectIdPromptExplorerRouteImport } from './routes/_app/p/$projectId/prompt-explorer'
+import { Route as AppPProjectIdKeywordsRouteImport } from './routes/_app/p/$projectId/keywords'
+import { Route as AppPProjectIdDomainRouteImport } from './routes/_app/p/$projectId/domain'
+import { Route as AppPProjectIdContextRouteImport } from './routes/_app/p/$projectId/context'
+import { Route as AppPProjectIdBrandLookupRouteImport } from './routes/_app/p/$projectId/brand-lookup'
+import { Route as AppPProjectIdBacklinksRouteImport } from './routes/_app/p/$projectId/backlinks'
+import { Route as AppPProjectIdSettingsIndexRouteImport } from './routes/_app/p/$projectId/settings/index'
+import { Route as AppPProjectIdReportsIndexRouteImport } from './routes/_app/p/$projectId/reports/index'
+import { Route as AppPProjectIdRankTrackingIndexRouteImport } from './routes/_app/p/$projectId/rank-tracking/index'
+import { Route as AppPProjectIdAuditIndexRouteImport } from './routes/_app/p/$projectId/audit/index'
+import { Route as AppPProjectIdSettingsIntegrationsRouteImport } from './routes/_app/p/$projectId/settings/integrations'
+import { Route as AppPProjectIdSettingsContextRouteImport } from './routes/_app/p/$projectId/settings/context'
+import { Route as AppPProjectIdReportsTemplatesRouteImport } from './routes/_app/p/$projectId/reports/templates'
+import { Route as AppPProjectIdReportsReportIdRouteImport } from './routes/_app/p/$projectId/reports/$reportId'
+import { Route as AppPProjectIdRankTrackingConfigIdRouteImport } from './routes/_app/p/$projectId/rank-tracking/$configId'
+import { Route as AppPProjectIdAuditIssuesResultIdRouteImport } from './routes/_app/p/$projectId/audit/issues/$resultId'
const VerifyEmailRoute = VerifyEmailRouteImport.update({
id: '/verify-email',
@@ -97,10 +96,6 @@ const AuthRoute = AuthRouteImport.update({
id: '/_auth',
getParentRoute: () => rootRouteImport,
} as any)
-const ProjectRouteRoute = ProjectRouteRouteImport.update({
- id: '/_project',
- getParentRoute: () => rootRouteImport,
-} as any)
const AppRouteRoute = AppRouteRouteImport.update({
id: '/_app',
getParentRoute: () => rootRouteImport,
@@ -238,15 +233,15 @@ const AppBillingFixPaymentRoute = AppBillingFixPaymentRouteImport.update({
path: '/billing/fix-payment',
getParentRoute: () => AppRouteRoute,
} as any)
-const ProjectPProjectIdRouteRoute = ProjectPProjectIdRouteRouteImport.update({
+const AppPProjectIdRouteRoute = AppPProjectIdRouteRouteImport.update({
id: '/p/$projectId',
path: '/p/$projectId',
- getParentRoute: () => ProjectRouteRoute,
+ getParentRoute: () => AppRouteRoute,
} as any)
-const ProjectPProjectIdIndexRoute = ProjectPProjectIdIndexRouteImport.update({
+const AppPProjectIdIndexRoute = AppPProjectIdIndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
const ApiGscOauthCallbackRoute = ApiGscOauthCallbackRouteImport.update({
id: '/api/gsc/oauth/callback',
@@ -258,128 +253,123 @@ const ApiGa4OauthCallbackRoute = ApiGa4OauthCallbackRouteImport.update({
path: '/api/ga4/oauth/callback',
getParentRoute: () => rootRouteImport,
} as any)
-const ProjectPProjectIdSettingsRoute =
- ProjectPProjectIdSettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
- } as any)
-const ProjectPProjectIdSearchPerformanceRoute =
- ProjectPProjectIdSearchPerformanceRouteImport.update({
+const AppPProjectIdSettingsRoute = AppPProjectIdSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
+ getParentRoute: () => AppPProjectIdRouteRoute,
+} as any)
+const AppPProjectIdSearchPerformanceRoute =
+ AppPProjectIdSearchPerformanceRouteImport.update({
id: '/search-performance',
path: '/search-performance',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdSavedRoute = ProjectPProjectIdSavedRouteImport.update({
+const AppPProjectIdSavedRoute = AppPProjectIdSavedRouteImport.update({
id: '/saved',
path: '/saved',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdSamRoute = ProjectPProjectIdSamRouteImport.update({
+const AppPProjectIdSamRoute = AppPProjectIdSamRouteImport.update({
id: '/sam',
path: '/sam',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdRankTrackingRoute =
- ProjectPProjectIdRankTrackingRouteImport.update({
+const AppPProjectIdRankTrackingRoute =
+ AppPProjectIdRankTrackingRouteImport.update({
id: '/rank-tracking',
path: '/rank-tracking',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdPromptExplorerRoute =
- ProjectPProjectIdPromptExplorerRouteImport.update({
+const AppPProjectIdPromptExplorerRoute =
+ AppPProjectIdPromptExplorerRouteImport.update({
id: '/prompt-explorer',
path: '/prompt-explorer',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdKeywordsRoute =
- ProjectPProjectIdKeywordsRouteImport.update({
- id: '/keywords',
- path: '/keywords',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
- } as any)
-const ProjectPProjectIdDomainRoute = ProjectPProjectIdDomainRouteImport.update({
+const AppPProjectIdKeywordsRoute = AppPProjectIdKeywordsRouteImport.update({
+ id: '/keywords',
+ path: '/keywords',
+ getParentRoute: () => AppPProjectIdRouteRoute,
+} as any)
+const AppPProjectIdDomainRoute = AppPProjectIdDomainRouteImport.update({
id: '/domain',
path: '/domain',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdContextRoute =
- ProjectPProjectIdContextRouteImport.update({
- id: '/context',
- path: '/context',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
- } as any)
-const ProjectPProjectIdBrandLookupRoute =
- ProjectPProjectIdBrandLookupRouteImport.update({
+const AppPProjectIdContextRoute = AppPProjectIdContextRouteImport.update({
+ id: '/context',
+ path: '/context',
+ getParentRoute: () => AppPProjectIdRouteRoute,
+} as any)
+const AppPProjectIdBrandLookupRoute =
+ AppPProjectIdBrandLookupRouteImport.update({
id: '/brand-lookup',
path: '/brand-lookup',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdBacklinksRoute =
- ProjectPProjectIdBacklinksRouteImport.update({
- id: '/backlinks',
- path: '/backlinks',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
- } as any)
-const ProjectPProjectIdSettingsIndexRoute =
- ProjectPProjectIdSettingsIndexRouteImport.update({
+const AppPProjectIdBacklinksRoute = AppPProjectIdBacklinksRouteImport.update({
+ id: '/backlinks',
+ path: '/backlinks',
+ getParentRoute: () => AppPProjectIdRouteRoute,
+} as any)
+const AppPProjectIdSettingsIndexRoute =
+ AppPProjectIdSettingsIndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => ProjectPProjectIdSettingsRoute,
+ getParentRoute: () => AppPProjectIdSettingsRoute,
} as any)
-const ProjectPProjectIdReportsIndexRoute =
- ProjectPProjectIdReportsIndexRouteImport.update({
+const AppPProjectIdReportsIndexRoute =
+ AppPProjectIdReportsIndexRouteImport.update({
id: '/reports/',
path: '/reports/',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdRankTrackingIndexRoute =
- ProjectPProjectIdRankTrackingIndexRouteImport.update({
+const AppPProjectIdRankTrackingIndexRoute =
+ AppPProjectIdRankTrackingIndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => ProjectPProjectIdRankTrackingRoute,
+ getParentRoute: () => AppPProjectIdRankTrackingRoute,
} as any)
-const ProjectPProjectIdAuditIndexRoute =
- ProjectPProjectIdAuditIndexRouteImport.update({
- id: '/audit/',
- path: '/audit/',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
- } as any)
-const ProjectPProjectIdSettingsIntegrationsRoute =
- ProjectPProjectIdSettingsIntegrationsRouteImport.update({
+const AppPProjectIdAuditIndexRoute = AppPProjectIdAuditIndexRouteImport.update({
+ id: '/audit/',
+ path: '/audit/',
+ getParentRoute: () => AppPProjectIdRouteRoute,
+} as any)
+const AppPProjectIdSettingsIntegrationsRoute =
+ AppPProjectIdSettingsIntegrationsRouteImport.update({
id: '/integrations',
path: '/integrations',
- getParentRoute: () => ProjectPProjectIdSettingsRoute,
+ getParentRoute: () => AppPProjectIdSettingsRoute,
} as any)
-const ProjectPProjectIdSettingsContextRoute =
- ProjectPProjectIdSettingsContextRouteImport.update({
+const AppPProjectIdSettingsContextRoute =
+ AppPProjectIdSettingsContextRouteImport.update({
id: '/context',
path: '/context',
- getParentRoute: () => ProjectPProjectIdSettingsRoute,
+ getParentRoute: () => AppPProjectIdSettingsRoute,
} as any)
-const ProjectPProjectIdReportsTemplatesRoute =
- ProjectPProjectIdReportsTemplatesRouteImport.update({
+const AppPProjectIdReportsTemplatesRoute =
+ AppPProjectIdReportsTemplatesRouteImport.update({
id: '/reports/templates',
path: '/reports/templates',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdReportsReportIdRoute =
- ProjectPProjectIdReportsReportIdRouteImport.update({
+const AppPProjectIdReportsReportIdRoute =
+ AppPProjectIdReportsReportIdRouteImport.update({
id: '/reports/$reportId',
path: '/reports/$reportId',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
-const ProjectPProjectIdRankTrackingConfigIdRoute =
- ProjectPProjectIdRankTrackingConfigIdRouteImport.update({
+const AppPProjectIdRankTrackingConfigIdRoute =
+ AppPProjectIdRankTrackingConfigIdRouteImport.update({
id: '/$configId',
path: '/$configId',
- getParentRoute: () => ProjectPProjectIdRankTrackingRoute,
+ getParentRoute: () => AppPProjectIdRankTrackingRoute,
} as any)
-const ProjectPProjectIdAuditIssuesResultIdRoute =
- ProjectPProjectIdAuditIssuesResultIdRouteImport.update({
+const AppPProjectIdAuditIssuesResultIdRoute =
+ AppPProjectIdAuditIssuesResultIdRouteImport.update({
id: '/audit/issues/$resultId',
path: '/audit/issues/$resultId',
- getParentRoute: () => ProjectPProjectIdRouteRoute,
+ getParentRoute: () => AppPProjectIdRouteRoute,
} as any)
export interface FileRoutesByFullPath {
@@ -402,7 +392,7 @@ export interface FileRoutesByFullPath {
'/accept-invitation/$id': typeof AcceptInvitationIdRoute
'/api/health': typeof ApiHealthRoute
'/r/$reportId': typeof RReportIdRoute
- '/p/$projectId': typeof ProjectPProjectIdRouteRouteWithChildren
+ '/p/$projectId': typeof AppPProjectIdRouteRouteWithChildren
'/billing/fix-payment': typeof AppBillingFixPaymentRoute
'/help/dataforseo-api-key': typeof AppHelpDataforseoApiKeyRoute
'/help/openrouter-api-key': typeof AppHelpOpenrouterApiKeyRoute
@@ -414,30 +404,30 @@ export interface FileRoutesByFullPath {
'/settings/': typeof AppSettingsIndexRoute
'/onboarding/': typeof AuthenticatedOnboardingIndexRoute
'/s/$token/': typeof STokenIndexRoute
- '/p/$projectId/backlinks': typeof ProjectPProjectIdBacklinksRoute
- '/p/$projectId/brand-lookup': typeof ProjectPProjectIdBrandLookupRoute
- '/p/$projectId/context': typeof ProjectPProjectIdContextRoute
- '/p/$projectId/domain': typeof ProjectPProjectIdDomainRoute
- '/p/$projectId/keywords': typeof ProjectPProjectIdKeywordsRoute
- '/p/$projectId/prompt-explorer': typeof ProjectPProjectIdPromptExplorerRoute
- '/p/$projectId/rank-tracking': typeof ProjectPProjectIdRankTrackingRouteWithChildren
- '/p/$projectId/sam': typeof ProjectPProjectIdSamRoute
- '/p/$projectId/saved': typeof ProjectPProjectIdSavedRoute
- '/p/$projectId/search-performance': typeof ProjectPProjectIdSearchPerformanceRoute
- '/p/$projectId/settings': typeof ProjectPProjectIdSettingsRouteWithChildren
+ '/p/$projectId/backlinks': typeof AppPProjectIdBacklinksRoute
+ '/p/$projectId/brand-lookup': typeof AppPProjectIdBrandLookupRoute
+ '/p/$projectId/context': typeof AppPProjectIdContextRoute
+ '/p/$projectId/domain': typeof AppPProjectIdDomainRoute
+ '/p/$projectId/keywords': typeof AppPProjectIdKeywordsRoute
+ '/p/$projectId/prompt-explorer': typeof AppPProjectIdPromptExplorerRoute
+ '/p/$projectId/rank-tracking': typeof AppPProjectIdRankTrackingRouteWithChildren
+ '/p/$projectId/sam': typeof AppPProjectIdSamRoute
+ '/p/$projectId/saved': typeof AppPProjectIdSavedRoute
+ '/p/$projectId/search-performance': typeof AppPProjectIdSearchPerformanceRoute
+ '/p/$projectId/settings': typeof AppPProjectIdSettingsRouteWithChildren
'/api/ga4/oauth/callback': typeof ApiGa4OauthCallbackRoute
'/api/gsc/oauth/callback': typeof ApiGscOauthCallbackRoute
- '/p/$projectId/': typeof ProjectPProjectIdIndexRoute
- '/p/$projectId/rank-tracking/$configId': typeof ProjectPProjectIdRankTrackingConfigIdRoute
- '/p/$projectId/reports/$reportId': typeof ProjectPProjectIdReportsReportIdRoute
- '/p/$projectId/reports/templates': typeof ProjectPProjectIdReportsTemplatesRoute
- '/p/$projectId/settings/context': typeof ProjectPProjectIdSettingsContextRoute
- '/p/$projectId/settings/integrations': typeof ProjectPProjectIdSettingsIntegrationsRoute
- '/p/$projectId/audit/': typeof ProjectPProjectIdAuditIndexRoute
- '/p/$projectId/rank-tracking/': typeof ProjectPProjectIdRankTrackingIndexRoute
- '/p/$projectId/reports/': typeof ProjectPProjectIdReportsIndexRoute
- '/p/$projectId/settings/': typeof ProjectPProjectIdSettingsIndexRoute
- '/p/$projectId/audit/issues/$resultId': typeof ProjectPProjectIdAuditIssuesResultIdRoute
+ '/p/$projectId/': typeof AppPProjectIdIndexRoute
+ '/p/$projectId/rank-tracking/$configId': typeof AppPProjectIdRankTrackingConfigIdRoute
+ '/p/$projectId/reports/$reportId': typeof AppPProjectIdReportsReportIdRoute
+ '/p/$projectId/reports/templates': typeof AppPProjectIdReportsTemplatesRoute
+ '/p/$projectId/settings/context': typeof AppPProjectIdSettingsContextRoute
+ '/p/$projectId/settings/integrations': typeof AppPProjectIdSettingsIntegrationsRoute
+ '/p/$projectId/audit/': typeof AppPProjectIdAuditIndexRoute
+ '/p/$projectId/rank-tracking/': typeof AppPProjectIdRankTrackingIndexRoute
+ '/p/$projectId/reports/': typeof AppPProjectIdReportsIndexRoute
+ '/p/$projectId/settings/': typeof AppPProjectIdSettingsIndexRoute
+ '/p/$projectId/audit/issues/$resultId': typeof AppPProjectIdAuditIssuesResultIdRoute
}
export interface FileRoutesByTo {
'/': typeof AppIndexRoute
@@ -469,33 +459,32 @@ export interface FileRoutesByTo {
'/settings': typeof AppSettingsIndexRoute
'/onboarding': typeof AuthenticatedOnboardingIndexRoute
'/s/$token': typeof STokenIndexRoute
- '/p/$projectId/backlinks': typeof ProjectPProjectIdBacklinksRoute
- '/p/$projectId/brand-lookup': typeof ProjectPProjectIdBrandLookupRoute
- '/p/$projectId/context': typeof ProjectPProjectIdContextRoute
- '/p/$projectId/domain': typeof ProjectPProjectIdDomainRoute
- '/p/$projectId/keywords': typeof ProjectPProjectIdKeywordsRoute
- '/p/$projectId/prompt-explorer': typeof ProjectPProjectIdPromptExplorerRoute
- '/p/$projectId/sam': typeof ProjectPProjectIdSamRoute
- '/p/$projectId/saved': typeof ProjectPProjectIdSavedRoute
- '/p/$projectId/search-performance': typeof ProjectPProjectIdSearchPerformanceRoute
+ '/p/$projectId/backlinks': typeof AppPProjectIdBacklinksRoute
+ '/p/$projectId/brand-lookup': typeof AppPProjectIdBrandLookupRoute
+ '/p/$projectId/context': typeof AppPProjectIdContextRoute
+ '/p/$projectId/domain': typeof AppPProjectIdDomainRoute
+ '/p/$projectId/keywords': typeof AppPProjectIdKeywordsRoute
+ '/p/$projectId/prompt-explorer': typeof AppPProjectIdPromptExplorerRoute
+ '/p/$projectId/sam': typeof AppPProjectIdSamRoute
+ '/p/$projectId/saved': typeof AppPProjectIdSavedRoute
+ '/p/$projectId/search-performance': typeof AppPProjectIdSearchPerformanceRoute
'/api/ga4/oauth/callback': typeof ApiGa4OauthCallbackRoute
'/api/gsc/oauth/callback': typeof ApiGscOauthCallbackRoute
- '/p/$projectId': typeof ProjectPProjectIdIndexRoute
- '/p/$projectId/rank-tracking/$configId': typeof ProjectPProjectIdRankTrackingConfigIdRoute
- '/p/$projectId/reports/$reportId': typeof ProjectPProjectIdReportsReportIdRoute
- '/p/$projectId/reports/templates': typeof ProjectPProjectIdReportsTemplatesRoute
- '/p/$projectId/settings/context': typeof ProjectPProjectIdSettingsContextRoute
- '/p/$projectId/settings/integrations': typeof ProjectPProjectIdSettingsIntegrationsRoute
- '/p/$projectId/audit': typeof ProjectPProjectIdAuditIndexRoute
- '/p/$projectId/rank-tracking': typeof ProjectPProjectIdRankTrackingIndexRoute
- '/p/$projectId/reports': typeof ProjectPProjectIdReportsIndexRoute
- '/p/$projectId/settings': typeof ProjectPProjectIdSettingsIndexRoute
- '/p/$projectId/audit/issues/$resultId': typeof ProjectPProjectIdAuditIssuesResultIdRoute
+ '/p/$projectId': typeof AppPProjectIdIndexRoute
+ '/p/$projectId/rank-tracking/$configId': typeof AppPProjectIdRankTrackingConfigIdRoute
+ '/p/$projectId/reports/$reportId': typeof AppPProjectIdReportsReportIdRoute
+ '/p/$projectId/reports/templates': typeof AppPProjectIdReportsTemplatesRoute
+ '/p/$projectId/settings/context': typeof AppPProjectIdSettingsContextRoute
+ '/p/$projectId/settings/integrations': typeof AppPProjectIdSettingsIntegrationsRoute
+ '/p/$projectId/audit': typeof AppPProjectIdAuditIndexRoute
+ '/p/$projectId/rank-tracking': typeof AppPProjectIdRankTrackingIndexRoute
+ '/p/$projectId/reports': typeof AppPProjectIdReportsIndexRoute
+ '/p/$projectId/settings': typeof AppPProjectIdSettingsIndexRoute
+ '/p/$projectId/audit/issues/$resultId': typeof AppPProjectIdAuditIssuesResultIdRoute
}
export interface FileRoutesById {
__root__: typeof rootRouteImport
'/_app': typeof AppRouteRouteWithChildren
- '/_project': typeof ProjectRouteRouteWithChildren
'/_auth': typeof AuthRouteWithChildren
'/_authenticated': typeof AuthenticatedRouteWithChildren
'/auth-error': typeof AuthErrorRoute
@@ -517,7 +506,7 @@ export interface FileRoutesById {
'/api/health': typeof ApiHealthRoute
'/r/$reportId': typeof RReportIdRoute
'/_app/': typeof AppIndexRoute
- '/_project/p/$projectId': typeof ProjectPProjectIdRouteRouteWithChildren
+ '/_app/p/$projectId': typeof AppPProjectIdRouteRouteWithChildren
'/_app/billing_/fix-payment': typeof AppBillingFixPaymentRoute
'/_app/help/dataforseo-api-key': typeof AppHelpDataforseoApiKeyRoute
'/_app/help/openrouter-api-key': typeof AppHelpOpenrouterApiKeyRoute
@@ -529,30 +518,30 @@ export interface FileRoutesById {
'/_app/settings/': typeof AppSettingsIndexRoute
'/_authenticated/onboarding/': typeof AuthenticatedOnboardingIndexRoute
'/s/$token/': typeof STokenIndexRoute
- '/_project/p/$projectId/backlinks': typeof ProjectPProjectIdBacklinksRoute
- '/_project/p/$projectId/brand-lookup': typeof ProjectPProjectIdBrandLookupRoute
- '/_project/p/$projectId/context': typeof ProjectPProjectIdContextRoute
- '/_project/p/$projectId/domain': typeof ProjectPProjectIdDomainRoute
- '/_project/p/$projectId/keywords': typeof ProjectPProjectIdKeywordsRoute
- '/_project/p/$projectId/prompt-explorer': typeof ProjectPProjectIdPromptExplorerRoute
- '/_project/p/$projectId/rank-tracking': typeof ProjectPProjectIdRankTrackingRouteWithChildren
- '/_project/p/$projectId/sam': typeof ProjectPProjectIdSamRoute
- '/_project/p/$projectId/saved': typeof ProjectPProjectIdSavedRoute
- '/_project/p/$projectId/search-performance': typeof ProjectPProjectIdSearchPerformanceRoute
- '/_project/p/$projectId/settings': typeof ProjectPProjectIdSettingsRouteWithChildren
+ '/_app/p/$projectId/backlinks': typeof AppPProjectIdBacklinksRoute
+ '/_app/p/$projectId/brand-lookup': typeof AppPProjectIdBrandLookupRoute
+ '/_app/p/$projectId/context': typeof AppPProjectIdContextRoute
+ '/_app/p/$projectId/domain': typeof AppPProjectIdDomainRoute
+ '/_app/p/$projectId/keywords': typeof AppPProjectIdKeywordsRoute
+ '/_app/p/$projectId/prompt-explorer': typeof AppPProjectIdPromptExplorerRoute
+ '/_app/p/$projectId/rank-tracking': typeof AppPProjectIdRankTrackingRouteWithChildren
+ '/_app/p/$projectId/sam': typeof AppPProjectIdSamRoute
+ '/_app/p/$projectId/saved': typeof AppPProjectIdSavedRoute
+ '/_app/p/$projectId/search-performance': typeof AppPProjectIdSearchPerformanceRoute
+ '/_app/p/$projectId/settings': typeof AppPProjectIdSettingsRouteWithChildren
'/api/ga4/oauth/callback': typeof ApiGa4OauthCallbackRoute
'/api/gsc/oauth/callback': typeof ApiGscOauthCallbackRoute
- '/_project/p/$projectId/': typeof ProjectPProjectIdIndexRoute
- '/_project/p/$projectId/rank-tracking/$configId': typeof ProjectPProjectIdRankTrackingConfigIdRoute
- '/_project/p/$projectId/reports/$reportId': typeof ProjectPProjectIdReportsReportIdRoute
- '/_project/p/$projectId/reports/templates': typeof ProjectPProjectIdReportsTemplatesRoute
- '/_project/p/$projectId/settings/context': typeof ProjectPProjectIdSettingsContextRoute
- '/_project/p/$projectId/settings/integrations': typeof ProjectPProjectIdSettingsIntegrationsRoute
- '/_project/p/$projectId/audit/': typeof ProjectPProjectIdAuditIndexRoute
- '/_project/p/$projectId/rank-tracking/': typeof ProjectPProjectIdRankTrackingIndexRoute
- '/_project/p/$projectId/reports/': typeof ProjectPProjectIdReportsIndexRoute
- '/_project/p/$projectId/settings/': typeof ProjectPProjectIdSettingsIndexRoute
- '/_project/p/$projectId/audit/issues/$resultId': typeof ProjectPProjectIdAuditIssuesResultIdRoute
+ '/_app/p/$projectId/': typeof AppPProjectIdIndexRoute
+ '/_app/p/$projectId/rank-tracking/$configId': typeof AppPProjectIdRankTrackingConfigIdRoute
+ '/_app/p/$projectId/reports/$reportId': typeof AppPProjectIdReportsReportIdRoute
+ '/_app/p/$projectId/reports/templates': typeof AppPProjectIdReportsTemplatesRoute
+ '/_app/p/$projectId/settings/context': typeof AppPProjectIdSettingsContextRoute
+ '/_app/p/$projectId/settings/integrations': typeof AppPProjectIdSettingsIntegrationsRoute
+ '/_app/p/$projectId/audit/': typeof AppPProjectIdAuditIndexRoute
+ '/_app/p/$projectId/rank-tracking/': typeof AppPProjectIdRankTrackingIndexRoute
+ '/_app/p/$projectId/reports/': typeof AppPProjectIdReportsIndexRoute
+ '/_app/p/$projectId/settings/': typeof AppPProjectIdSettingsIndexRoute
+ '/_app/p/$projectId/audit/issues/$resultId': typeof AppPProjectIdAuditIssuesResultIdRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
@@ -668,7 +657,6 @@ export interface FileRouteTypes {
id:
| '__root__'
| '/_app'
- | '/_project'
| '/_auth'
| '/_authenticated'
| '/auth-error'
@@ -690,7 +678,7 @@ export interface FileRouteTypes {
| '/api/health'
| '/r/$reportId'
| '/_app/'
- | '/_project/p/$projectId'
+ | '/_app/p/$projectId'
| '/_app/billing_/fix-payment'
| '/_app/help/dataforseo-api-key'
| '/_app/help/openrouter-api-key'
@@ -702,35 +690,34 @@ export interface FileRouteTypes {
| '/_app/settings/'
| '/_authenticated/onboarding/'
| '/s/$token/'
- | '/_project/p/$projectId/backlinks'
- | '/_project/p/$projectId/brand-lookup'
- | '/_project/p/$projectId/context'
- | '/_project/p/$projectId/domain'
- | '/_project/p/$projectId/keywords'
- | '/_project/p/$projectId/prompt-explorer'
- | '/_project/p/$projectId/rank-tracking'
- | '/_project/p/$projectId/sam'
- | '/_project/p/$projectId/saved'
- | '/_project/p/$projectId/search-performance'
- | '/_project/p/$projectId/settings'
+ | '/_app/p/$projectId/backlinks'
+ | '/_app/p/$projectId/brand-lookup'
+ | '/_app/p/$projectId/context'
+ | '/_app/p/$projectId/domain'
+ | '/_app/p/$projectId/keywords'
+ | '/_app/p/$projectId/prompt-explorer'
+ | '/_app/p/$projectId/rank-tracking'
+ | '/_app/p/$projectId/sam'
+ | '/_app/p/$projectId/saved'
+ | '/_app/p/$projectId/search-performance'
+ | '/_app/p/$projectId/settings'
| '/api/ga4/oauth/callback'
| '/api/gsc/oauth/callback'
- | '/_project/p/$projectId/'
- | '/_project/p/$projectId/rank-tracking/$configId'
- | '/_project/p/$projectId/reports/$reportId'
- | '/_project/p/$projectId/reports/templates'
- | '/_project/p/$projectId/settings/context'
- | '/_project/p/$projectId/settings/integrations'
- | '/_project/p/$projectId/audit/'
- | '/_project/p/$projectId/rank-tracking/'
- | '/_project/p/$projectId/reports/'
- | '/_project/p/$projectId/settings/'
- | '/_project/p/$projectId/audit/issues/$resultId'
+ | '/_app/p/$projectId/'
+ | '/_app/p/$projectId/rank-tracking/$configId'
+ | '/_app/p/$projectId/reports/$reportId'
+ | '/_app/p/$projectId/reports/templates'
+ | '/_app/p/$projectId/settings/context'
+ | '/_app/p/$projectId/settings/integrations'
+ | '/_app/p/$projectId/audit/'
+ | '/_app/p/$projectId/rank-tracking/'
+ | '/_app/p/$projectId/reports/'
+ | '/_app/p/$projectId/settings/'
+ | '/_app/p/$projectId/audit/issues/$resultId'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
AppRouteRoute: typeof AppRouteRouteWithChildren
- ProjectRouteRoute: typeof ProjectRouteRouteWithChildren
AuthRoute: typeof AuthRouteWithChildren
AuthenticatedRoute: typeof AuthenticatedRouteWithChildren
AuthErrorRoute: typeof AuthErrorRoute
@@ -794,13 +781,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthRouteImport
parentRoute: typeof rootRouteImport
}
- '/_project': {
- id: '/_project'
- path: ''
- fullPath: '/'
- preLoaderRoute: typeof ProjectRouteRouteImport
- parentRoute: typeof rootRouteImport
- }
'/_app': {
id: '/_app'
path: ''
@@ -990,19 +970,19 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AppBillingFixPaymentRouteImport
parentRoute: typeof AppRouteRoute
}
- '/_project/p/$projectId': {
- id: '/_project/p/$projectId'
+ '/_app/p/$projectId': {
+ id: '/_app/p/$projectId'
path: '/p/$projectId'
fullPath: '/p/$projectId'
- preLoaderRoute: typeof ProjectPProjectIdRouteRouteImport
- parentRoute: typeof ProjectRouteRoute
+ preLoaderRoute: typeof AppPProjectIdRouteRouteImport
+ parentRoute: typeof AppRouteRoute
}
- '/_project/p/$projectId/': {
- id: '/_project/p/$projectId/'
+ '/_app/p/$projectId/': {
+ id: '/_app/p/$projectId/'
path: '/'
fullPath: '/p/$projectId/'
- preLoaderRoute: typeof ProjectPProjectIdIndexRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdIndexRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
'/api/gsc/oauth/callback': {
id: '/api/gsc/oauth/callback'
@@ -1018,152 +998,152 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof ApiGa4OauthCallbackRouteImport
parentRoute: typeof rootRouteImport
}
- '/_project/p/$projectId/settings': {
- id: '/_project/p/$projectId/settings'
+ '/_app/p/$projectId/settings': {
+ id: '/_app/p/$projectId/settings'
path: '/settings'
fullPath: '/p/$projectId/settings'
- preLoaderRoute: typeof ProjectPProjectIdSettingsRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdSettingsRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/search-performance': {
- id: '/_project/p/$projectId/search-performance'
+ '/_app/p/$projectId/search-performance': {
+ id: '/_app/p/$projectId/search-performance'
path: '/search-performance'
fullPath: '/p/$projectId/search-performance'
- preLoaderRoute: typeof ProjectPProjectIdSearchPerformanceRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdSearchPerformanceRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/saved': {
- id: '/_project/p/$projectId/saved'
+ '/_app/p/$projectId/saved': {
+ id: '/_app/p/$projectId/saved'
path: '/saved'
fullPath: '/p/$projectId/saved'
- preLoaderRoute: typeof ProjectPProjectIdSavedRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdSavedRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/sam': {
- id: '/_project/p/$projectId/sam'
+ '/_app/p/$projectId/sam': {
+ id: '/_app/p/$projectId/sam'
path: '/sam'
fullPath: '/p/$projectId/sam'
- preLoaderRoute: typeof ProjectPProjectIdSamRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdSamRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/rank-tracking': {
- id: '/_project/p/$projectId/rank-tracking'
+ '/_app/p/$projectId/rank-tracking': {
+ id: '/_app/p/$projectId/rank-tracking'
path: '/rank-tracking'
fullPath: '/p/$projectId/rank-tracking'
- preLoaderRoute: typeof ProjectPProjectIdRankTrackingRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdRankTrackingRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/prompt-explorer': {
- id: '/_project/p/$projectId/prompt-explorer'
+ '/_app/p/$projectId/prompt-explorer': {
+ id: '/_app/p/$projectId/prompt-explorer'
path: '/prompt-explorer'
fullPath: '/p/$projectId/prompt-explorer'
- preLoaderRoute: typeof ProjectPProjectIdPromptExplorerRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdPromptExplorerRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/keywords': {
- id: '/_project/p/$projectId/keywords'
+ '/_app/p/$projectId/keywords': {
+ id: '/_app/p/$projectId/keywords'
path: '/keywords'
fullPath: '/p/$projectId/keywords'
- preLoaderRoute: typeof ProjectPProjectIdKeywordsRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdKeywordsRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/domain': {
- id: '/_project/p/$projectId/domain'
+ '/_app/p/$projectId/domain': {
+ id: '/_app/p/$projectId/domain'
path: '/domain'
fullPath: '/p/$projectId/domain'
- preLoaderRoute: typeof ProjectPProjectIdDomainRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdDomainRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/context': {
- id: '/_project/p/$projectId/context'
+ '/_app/p/$projectId/context': {
+ id: '/_app/p/$projectId/context'
path: '/context'
fullPath: '/p/$projectId/context'
- preLoaderRoute: typeof ProjectPProjectIdContextRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdContextRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/brand-lookup': {
- id: '/_project/p/$projectId/brand-lookup'
+ '/_app/p/$projectId/brand-lookup': {
+ id: '/_app/p/$projectId/brand-lookup'
path: '/brand-lookup'
fullPath: '/p/$projectId/brand-lookup'
- preLoaderRoute: typeof ProjectPProjectIdBrandLookupRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdBrandLookupRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/backlinks': {
- id: '/_project/p/$projectId/backlinks'
+ '/_app/p/$projectId/backlinks': {
+ id: '/_app/p/$projectId/backlinks'
path: '/backlinks'
fullPath: '/p/$projectId/backlinks'
- preLoaderRoute: typeof ProjectPProjectIdBacklinksRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdBacklinksRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/settings/': {
- id: '/_project/p/$projectId/settings/'
+ '/_app/p/$projectId/settings/': {
+ id: '/_app/p/$projectId/settings/'
path: '/'
fullPath: '/p/$projectId/settings/'
- preLoaderRoute: typeof ProjectPProjectIdSettingsIndexRouteImport
- parentRoute: typeof ProjectPProjectIdSettingsRoute
+ preLoaderRoute: typeof AppPProjectIdSettingsIndexRouteImport
+ parentRoute: typeof AppPProjectIdSettingsRoute
}
- '/_project/p/$projectId/reports/': {
- id: '/_project/p/$projectId/reports/'
+ '/_app/p/$projectId/reports/': {
+ id: '/_app/p/$projectId/reports/'
path: '/reports'
fullPath: '/p/$projectId/reports/'
- preLoaderRoute: typeof ProjectPProjectIdReportsIndexRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdReportsIndexRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/rank-tracking/': {
- id: '/_project/p/$projectId/rank-tracking/'
+ '/_app/p/$projectId/rank-tracking/': {
+ id: '/_app/p/$projectId/rank-tracking/'
path: '/'
fullPath: '/p/$projectId/rank-tracking/'
- preLoaderRoute: typeof ProjectPProjectIdRankTrackingIndexRouteImport
- parentRoute: typeof ProjectPProjectIdRankTrackingRoute
+ preLoaderRoute: typeof AppPProjectIdRankTrackingIndexRouteImport
+ parentRoute: typeof AppPProjectIdRankTrackingRoute
}
- '/_project/p/$projectId/audit/': {
- id: '/_project/p/$projectId/audit/'
+ '/_app/p/$projectId/audit/': {
+ id: '/_app/p/$projectId/audit/'
path: '/audit'
fullPath: '/p/$projectId/audit/'
- preLoaderRoute: typeof ProjectPProjectIdAuditIndexRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdAuditIndexRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/settings/integrations': {
- id: '/_project/p/$projectId/settings/integrations'
+ '/_app/p/$projectId/settings/integrations': {
+ id: '/_app/p/$projectId/settings/integrations'
path: '/integrations'
fullPath: '/p/$projectId/settings/integrations'
- preLoaderRoute: typeof ProjectPProjectIdSettingsIntegrationsRouteImport
- parentRoute: typeof ProjectPProjectIdSettingsRoute
+ preLoaderRoute: typeof AppPProjectIdSettingsIntegrationsRouteImport
+ parentRoute: typeof AppPProjectIdSettingsRoute
}
- '/_project/p/$projectId/settings/context': {
- id: '/_project/p/$projectId/settings/context'
+ '/_app/p/$projectId/settings/context': {
+ id: '/_app/p/$projectId/settings/context'
path: '/context'
fullPath: '/p/$projectId/settings/context'
- preLoaderRoute: typeof ProjectPProjectIdSettingsContextRouteImport
- parentRoute: typeof ProjectPProjectIdSettingsRoute
+ preLoaderRoute: typeof AppPProjectIdSettingsContextRouteImport
+ parentRoute: typeof AppPProjectIdSettingsRoute
}
- '/_project/p/$projectId/reports/templates': {
- id: '/_project/p/$projectId/reports/templates'
+ '/_app/p/$projectId/reports/templates': {
+ id: '/_app/p/$projectId/reports/templates'
path: '/reports/templates'
fullPath: '/p/$projectId/reports/templates'
- preLoaderRoute: typeof ProjectPProjectIdReportsTemplatesRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdReportsTemplatesRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/reports/$reportId': {
- id: '/_project/p/$projectId/reports/$reportId'
+ '/_app/p/$projectId/reports/$reportId': {
+ id: '/_app/p/$projectId/reports/$reportId'
path: '/reports/$reportId'
fullPath: '/p/$projectId/reports/$reportId'
- preLoaderRoute: typeof ProjectPProjectIdReportsReportIdRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdReportsReportIdRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
- '/_project/p/$projectId/rank-tracking/$configId': {
- id: '/_project/p/$projectId/rank-tracking/$configId'
+ '/_app/p/$projectId/rank-tracking/$configId': {
+ id: '/_app/p/$projectId/rank-tracking/$configId'
path: '/$configId'
fullPath: '/p/$projectId/rank-tracking/$configId'
- preLoaderRoute: typeof ProjectPProjectIdRankTrackingConfigIdRouteImport
- parentRoute: typeof ProjectPProjectIdRankTrackingRoute
+ preLoaderRoute: typeof AppPProjectIdRankTrackingConfigIdRouteImport
+ parentRoute: typeof AppPProjectIdRankTrackingRoute
}
- '/_project/p/$projectId/audit/issues/$resultId': {
- id: '/_project/p/$projectId/audit/issues/$resultId'
+ '/_app/p/$projectId/audit/issues/$resultId': {
+ id: '/_app/p/$projectId/audit/issues/$resultId'
path: '/audit/issues/$resultId'
fullPath: '/p/$projectId/audit/issues/$resultId'
- preLoaderRoute: typeof ProjectPProjectIdAuditIssuesResultIdRouteImport
- parentRoute: typeof ProjectPProjectIdRouteRoute
+ preLoaderRoute: typeof AppPProjectIdAuditIssuesResultIdRouteImport
+ parentRoute: typeof AppPProjectIdRouteRoute
}
}
}
@@ -1182,6 +1162,84 @@ const AppSettingsRouteWithChildren = AppSettingsRoute._addFileChildren(
AppSettingsRouteChildren,
)
+interface AppPProjectIdRankTrackingRouteChildren {
+ AppPProjectIdRankTrackingConfigIdRoute: typeof AppPProjectIdRankTrackingConfigIdRoute
+ AppPProjectIdRankTrackingIndexRoute: typeof AppPProjectIdRankTrackingIndexRoute
+}
+
+const AppPProjectIdRankTrackingRouteChildren: AppPProjectIdRankTrackingRouteChildren =
+ {
+ AppPProjectIdRankTrackingConfigIdRoute:
+ AppPProjectIdRankTrackingConfigIdRoute,
+ AppPProjectIdRankTrackingIndexRoute: AppPProjectIdRankTrackingIndexRoute,
+ }
+
+const AppPProjectIdRankTrackingRouteWithChildren =
+ AppPProjectIdRankTrackingRoute._addFileChildren(
+ AppPProjectIdRankTrackingRouteChildren,
+ )
+
+interface AppPProjectIdSettingsRouteChildren {
+ AppPProjectIdSettingsContextRoute: typeof AppPProjectIdSettingsContextRoute
+ AppPProjectIdSettingsIntegrationsRoute: typeof AppPProjectIdSettingsIntegrationsRoute
+ AppPProjectIdSettingsIndexRoute: typeof AppPProjectIdSettingsIndexRoute
+}
+
+const AppPProjectIdSettingsRouteChildren: AppPProjectIdSettingsRouteChildren = {
+ AppPProjectIdSettingsContextRoute: AppPProjectIdSettingsContextRoute,
+ AppPProjectIdSettingsIntegrationsRoute:
+ AppPProjectIdSettingsIntegrationsRoute,
+ AppPProjectIdSettingsIndexRoute: AppPProjectIdSettingsIndexRoute,
+}
+
+const AppPProjectIdSettingsRouteWithChildren =
+ AppPProjectIdSettingsRoute._addFileChildren(
+ AppPProjectIdSettingsRouteChildren,
+ )
+
+interface AppPProjectIdRouteRouteChildren {
+ AppPProjectIdBacklinksRoute: typeof AppPProjectIdBacklinksRoute
+ AppPProjectIdBrandLookupRoute: typeof AppPProjectIdBrandLookupRoute
+ AppPProjectIdContextRoute: typeof AppPProjectIdContextRoute
+ AppPProjectIdDomainRoute: typeof AppPProjectIdDomainRoute
+ AppPProjectIdKeywordsRoute: typeof AppPProjectIdKeywordsRoute
+ AppPProjectIdPromptExplorerRoute: typeof AppPProjectIdPromptExplorerRoute
+ AppPProjectIdRankTrackingRoute: typeof AppPProjectIdRankTrackingRouteWithChildren
+ AppPProjectIdSamRoute: typeof AppPProjectIdSamRoute
+ AppPProjectIdSavedRoute: typeof AppPProjectIdSavedRoute
+ AppPProjectIdSearchPerformanceRoute: typeof AppPProjectIdSearchPerformanceRoute
+ AppPProjectIdSettingsRoute: typeof AppPProjectIdSettingsRouteWithChildren
+ AppPProjectIdIndexRoute: typeof AppPProjectIdIndexRoute
+ AppPProjectIdReportsReportIdRoute: typeof AppPProjectIdReportsReportIdRoute
+ AppPProjectIdReportsTemplatesRoute: typeof AppPProjectIdReportsTemplatesRoute
+ AppPProjectIdAuditIndexRoute: typeof AppPProjectIdAuditIndexRoute
+ AppPProjectIdReportsIndexRoute: typeof AppPProjectIdReportsIndexRoute
+ AppPProjectIdAuditIssuesResultIdRoute: typeof AppPProjectIdAuditIssuesResultIdRoute
+}
+
+const AppPProjectIdRouteRouteChildren: AppPProjectIdRouteRouteChildren = {
+ AppPProjectIdBacklinksRoute: AppPProjectIdBacklinksRoute,
+ AppPProjectIdBrandLookupRoute: AppPProjectIdBrandLookupRoute,
+ AppPProjectIdContextRoute: AppPProjectIdContextRoute,
+ AppPProjectIdDomainRoute: AppPProjectIdDomainRoute,
+ AppPProjectIdKeywordsRoute: AppPProjectIdKeywordsRoute,
+ AppPProjectIdPromptExplorerRoute: AppPProjectIdPromptExplorerRoute,
+ AppPProjectIdRankTrackingRoute: AppPProjectIdRankTrackingRouteWithChildren,
+ AppPProjectIdSamRoute: AppPProjectIdSamRoute,
+ AppPProjectIdSavedRoute: AppPProjectIdSavedRoute,
+ AppPProjectIdSearchPerformanceRoute: AppPProjectIdSearchPerformanceRoute,
+ AppPProjectIdSettingsRoute: AppPProjectIdSettingsRouteWithChildren,
+ AppPProjectIdIndexRoute: AppPProjectIdIndexRoute,
+ AppPProjectIdReportsReportIdRoute: AppPProjectIdReportsReportIdRoute,
+ AppPProjectIdReportsTemplatesRoute: AppPProjectIdReportsTemplatesRoute,
+ AppPProjectIdAuditIndexRoute: AppPProjectIdAuditIndexRoute,
+ AppPProjectIdReportsIndexRoute: AppPProjectIdReportsIndexRoute,
+ AppPProjectIdAuditIssuesResultIdRoute: AppPProjectIdAuditIssuesResultIdRoute,
+}
+
+const AppPProjectIdRouteRouteWithChildren =
+ AppPProjectIdRouteRoute._addFileChildren(AppPProjectIdRouteRouteChildren)
+
interface AppRouteRouteChildren {
AppAiRoute: typeof AppAiRoute
AppBillingRoute: typeof AppBillingRoute
@@ -1189,6 +1247,7 @@ interface AppRouteRouteChildren {
AppSettingsRoute: typeof AppSettingsRouteWithChildren
AppSupportRoute: typeof AppSupportRoute
AppIndexRoute: typeof AppIndexRoute
+ AppPProjectIdRouteRoute: typeof AppPProjectIdRouteRouteWithChildren
AppBillingFixPaymentRoute: typeof AppBillingFixPaymentRoute
AppHelpDataforseoApiKeyRoute: typeof AppHelpDataforseoApiKeyRoute
AppHelpOpenrouterApiKeyRoute: typeof AppHelpOpenrouterApiKeyRoute
@@ -1201,6 +1260,7 @@ const AppRouteRouteChildren: AppRouteRouteChildren = {
AppSettingsRoute: AppSettingsRouteWithChildren,
AppSupportRoute: AppSupportRoute,
AppIndexRoute: AppIndexRoute,
+ AppPProjectIdRouteRoute: AppPProjectIdRouteRouteWithChildren,
AppBillingFixPaymentRoute: AppBillingFixPaymentRoute,
AppHelpDataforseoApiKeyRoute: AppHelpDataforseoApiKeyRoute,
AppHelpOpenrouterApiKeyRoute: AppHelpOpenrouterApiKeyRoute,
@@ -1210,107 +1270,6 @@ const AppRouteRouteWithChildren = AppRouteRoute._addFileChildren(
AppRouteRouteChildren,
)
-interface ProjectPProjectIdRankTrackingRouteChildren {
- ProjectPProjectIdRankTrackingConfigIdRoute: typeof ProjectPProjectIdRankTrackingConfigIdRoute
- ProjectPProjectIdRankTrackingIndexRoute: typeof ProjectPProjectIdRankTrackingIndexRoute
-}
-
-const ProjectPProjectIdRankTrackingRouteChildren: ProjectPProjectIdRankTrackingRouteChildren =
- {
- ProjectPProjectIdRankTrackingConfigIdRoute:
- ProjectPProjectIdRankTrackingConfigIdRoute,
- ProjectPProjectIdRankTrackingIndexRoute:
- ProjectPProjectIdRankTrackingIndexRoute,
- }
-
-const ProjectPProjectIdRankTrackingRouteWithChildren =
- ProjectPProjectIdRankTrackingRoute._addFileChildren(
- ProjectPProjectIdRankTrackingRouteChildren,
- )
-
-interface ProjectPProjectIdSettingsRouteChildren {
- ProjectPProjectIdSettingsContextRoute: typeof ProjectPProjectIdSettingsContextRoute
- ProjectPProjectIdSettingsIntegrationsRoute: typeof ProjectPProjectIdSettingsIntegrationsRoute
- ProjectPProjectIdSettingsIndexRoute: typeof ProjectPProjectIdSettingsIndexRoute
-}
-
-const ProjectPProjectIdSettingsRouteChildren: ProjectPProjectIdSettingsRouteChildren =
- {
- ProjectPProjectIdSettingsContextRoute:
- ProjectPProjectIdSettingsContextRoute,
- ProjectPProjectIdSettingsIntegrationsRoute:
- ProjectPProjectIdSettingsIntegrationsRoute,
- ProjectPProjectIdSettingsIndexRoute: ProjectPProjectIdSettingsIndexRoute,
- }
-
-const ProjectPProjectIdSettingsRouteWithChildren =
- ProjectPProjectIdSettingsRoute._addFileChildren(
- ProjectPProjectIdSettingsRouteChildren,
- )
-
-interface ProjectPProjectIdRouteRouteChildren {
- ProjectPProjectIdBacklinksRoute: typeof ProjectPProjectIdBacklinksRoute
- ProjectPProjectIdBrandLookupRoute: typeof ProjectPProjectIdBrandLookupRoute
- ProjectPProjectIdContextRoute: typeof ProjectPProjectIdContextRoute
- ProjectPProjectIdDomainRoute: typeof ProjectPProjectIdDomainRoute
- ProjectPProjectIdKeywordsRoute: typeof ProjectPProjectIdKeywordsRoute
- ProjectPProjectIdPromptExplorerRoute: typeof ProjectPProjectIdPromptExplorerRoute
- ProjectPProjectIdRankTrackingRoute: typeof ProjectPProjectIdRankTrackingRouteWithChildren
- ProjectPProjectIdSamRoute: typeof ProjectPProjectIdSamRoute
- ProjectPProjectIdSavedRoute: typeof ProjectPProjectIdSavedRoute
- ProjectPProjectIdSearchPerformanceRoute: typeof ProjectPProjectIdSearchPerformanceRoute
- ProjectPProjectIdSettingsRoute: typeof ProjectPProjectIdSettingsRouteWithChildren
- ProjectPProjectIdIndexRoute: typeof ProjectPProjectIdIndexRoute
- ProjectPProjectIdReportsReportIdRoute: typeof ProjectPProjectIdReportsReportIdRoute
- ProjectPProjectIdReportsTemplatesRoute: typeof ProjectPProjectIdReportsTemplatesRoute
- ProjectPProjectIdAuditIndexRoute: typeof ProjectPProjectIdAuditIndexRoute
- ProjectPProjectIdReportsIndexRoute: typeof ProjectPProjectIdReportsIndexRoute
- ProjectPProjectIdAuditIssuesResultIdRoute: typeof ProjectPProjectIdAuditIssuesResultIdRoute
-}
-
-const ProjectPProjectIdRouteRouteChildren: ProjectPProjectIdRouteRouteChildren =
- {
- ProjectPProjectIdBacklinksRoute: ProjectPProjectIdBacklinksRoute,
- ProjectPProjectIdBrandLookupRoute: ProjectPProjectIdBrandLookupRoute,
- ProjectPProjectIdContextRoute: ProjectPProjectIdContextRoute,
- ProjectPProjectIdDomainRoute: ProjectPProjectIdDomainRoute,
- ProjectPProjectIdKeywordsRoute: ProjectPProjectIdKeywordsRoute,
- ProjectPProjectIdPromptExplorerRoute: ProjectPProjectIdPromptExplorerRoute,
- ProjectPProjectIdRankTrackingRoute:
- ProjectPProjectIdRankTrackingRouteWithChildren,
- ProjectPProjectIdSamRoute: ProjectPProjectIdSamRoute,
- ProjectPProjectIdSavedRoute: ProjectPProjectIdSavedRoute,
- ProjectPProjectIdSearchPerformanceRoute:
- ProjectPProjectIdSearchPerformanceRoute,
- ProjectPProjectIdSettingsRoute: ProjectPProjectIdSettingsRouteWithChildren,
- ProjectPProjectIdIndexRoute: ProjectPProjectIdIndexRoute,
- ProjectPProjectIdReportsReportIdRoute:
- ProjectPProjectIdReportsReportIdRoute,
- ProjectPProjectIdReportsTemplatesRoute:
- ProjectPProjectIdReportsTemplatesRoute,
- ProjectPProjectIdAuditIndexRoute: ProjectPProjectIdAuditIndexRoute,
- ProjectPProjectIdReportsIndexRoute: ProjectPProjectIdReportsIndexRoute,
- ProjectPProjectIdAuditIssuesResultIdRoute:
- ProjectPProjectIdAuditIssuesResultIdRoute,
- }
-
-const ProjectPProjectIdRouteRouteWithChildren =
- ProjectPProjectIdRouteRoute._addFileChildren(
- ProjectPProjectIdRouteRouteChildren,
- )
-
-interface ProjectRouteRouteChildren {
- ProjectPProjectIdRouteRoute: typeof ProjectPProjectIdRouteRouteWithChildren
-}
-
-const ProjectRouteRouteChildren: ProjectRouteRouteChildren = {
- ProjectPProjectIdRouteRoute: ProjectPProjectIdRouteRouteWithChildren,
-}
-
-const ProjectRouteRouteWithChildren = ProjectRouteRoute._addFileChildren(
- ProjectRouteRouteChildren,
-)
-
interface AuthRouteChildren {
AuthSignInRoute: typeof AuthSignInRoute
AuthSignUpRoute: typeof AuthSignUpRoute
@@ -1343,7 +1302,6 @@ const AuthenticatedRouteWithChildren = AuthenticatedRoute._addFileChildren(
const rootRouteChildren: RootRouteChildren = {
AppRouteRoute: AppRouteRouteWithChildren,
- ProjectRouteRoute: ProjectRouteRouteWithChildren,
AuthRoute: AuthRouteWithChildren,
AuthenticatedRoute: AuthenticatedRouteWithChildren,
AuthErrorRoute: AuthErrorRoute,
diff --git a/src/routes/_app/index.tsx b/src/routes/_app/index.tsx
index 6b802f14..ea66c223 100644
--- a/src/routes/_app/index.tsx
+++ b/src/routes/_app/index.tsx
@@ -1,19 +1,15 @@
import { createFileRoute, useNavigate } from "@tanstack/react-router";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { useEffect } from "react";
import { useQuery } from "@tanstack/react-query";
-import { getProjects } from "@/serverFunctions/projects";
import {
clearLastProjectId,
getLastProjectId,
} from "@/client/lib/active-project";
-import {
- getErrorCode,
- getStandardErrorMessage,
-} from "@/client/lib/error-messages";
-import { AuthConfigErrorCard } from "@/client/components/AuthConfigErrorCard";
+import { getErrorCode } from "@/client/lib/error-messages";
+import { AuthErrorCard } from "@/client/components/AuthErrorCard";
import { QueryError } from "@/client/components/QueryState";
import { Spinner } from "@/client/components/Spinner";
-import { UnauthenticatedErrorCard } from "@/client/components/UnauthenticatedErrorCard";
import { SUBSCRIBE_ROUTE } from "@/shared/billing";
export const Route = createFileRoute("/_app/")({
@@ -24,8 +20,7 @@ function IndexRedirect() {
const navigate = useNavigate();
const { data, error, isError, isFetching, refetch } = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
+ ...projectsQueryOptions(),
retry: false,
});
@@ -59,35 +54,6 @@ function IndexRedirect() {
if (isError) {
const errorCode = getErrorCode(error);
- if (errorCode === "AUTH_CONFIG_MISSING") {
- return (
- <div className="flex items-center justify-center h-full p-4">
- <AuthConfigErrorCard
- message={getStandardErrorMessage(
- error,
- "An unexpected error occurred. Please check server logs.",
- )}
- onRetry={() => {
- void refetch();
- }}
- />
- </div>
- );
- }
-
- if (errorCode === "UNAUTHENTICATED") {
- return (
- <div className="flex items-center justify-center h-full p-4">
- <UnauthenticatedErrorCard
- message="Please sign in to access your OpenSEO organization."
- onRetry={() => {
- void refetch();
- }}
- />
- </div>
- );
- }
-
if (errorCode === "PAYMENT_REQUIRED") {
return (
<div className="flex items-center justify-center h-full p-4">
@@ -101,16 +67,22 @@ function IndexRedirect() {
}
return (
- <div className="flex items-center justify-center h-full p-4">
- <div className="w-full max-w-xl">
- <QueryError
- error={error}
- fallback="An unexpected error occurred. Please check server logs."
- onRetry={() => void refetch()}
- isRetrying={isFetching}
- />
- </div>
- </div>
+ <AuthErrorCard
+ error={error}
+ onRetry={() => void refetch()}
+ fallback={
+ <div className="flex items-center justify-center h-full p-4">
+ <div className="w-full max-w-xl">
+ <QueryError
+ error={error}
+ fallback="An unexpected error occurred. Please check server logs."
+ onRetry={() => void refetch()}
+ isRetrying={isFetching}
+ />
+ </div>
+ </div>
+ }
+ />
);
}
diff --git a/src/routes/_project/p/$projectId/audit/index.tsx b/src/routes/_app/p/$projectId/audit/index.tsx
similarity index 92%
rename from src/routes/_project/p/$projectId/audit/index.tsx
rename to src/routes/_app/p/$projectId/audit/index.tsx
index caf5627c..4cd7d922 100644
--- a/src/routes/_project/p/$projectId/audit/index.tsx
+++ b/src/routes/_app/p/$projectId/audit/index.tsx
@@ -4,8 +4,8 @@ import { auditSearchSchema } from "@/types/schemas/audit";
import { LaunchView } from "@/client/features/audit/launch/LaunchView";
import { AuditDetail } from "@/client/features/audit/AuditDetail";
-export const Route = createFileRoute<"/_project/p/$projectId/audit/">(
- "/_project/p/$projectId/audit/",
+export const Route = createFileRoute<"/_app/p/$projectId/audit/">(
+ "/_app/p/$projectId/audit/",
)({
validateSearch: auditSearchSchema,
component: SiteAuditPage,
diff --git a/src/routes/_project/p/$projectId/audit/issues/$resultId.tsx b/src/routes/_app/p/$projectId/audit/issues/$resultId.tsx
similarity index 92%
rename from src/routes/_project/p/$projectId/audit/issues/$resultId.tsx
rename to src/routes/_app/p/$projectId/audit/issues/$resultId.tsx
index bcfe1fd8..b4a7f814 100644
--- a/src/routes/_project/p/$projectId/audit/issues/$resultId.tsx
+++ b/src/routes/_app/p/$projectId/audit/issues/$resultId.tsx
@@ -3,7 +3,7 @@ import { LighthouseIssuesScreen } from "@/client/features/lighthouse/issues/Ligh
import { lighthouseIssuesSearchSchema } from "@/types/schemas/lighthouse";
export const Route = createFileRoute(
- "/_project/p/$projectId/audit/issues/$resultId",
+ "/_app/p/$projectId/audit/issues/$resultId",
)({
validateSearch: lighthouseIssuesSearchSchema,
component: AuditIssuesPage,
diff --git a/src/routes/_project/p/$projectId/backlinks.tsx b/src/routes/_app/p/$projectId/backlinks.tsx
similarity index 93%
rename from src/routes/_project/p/$projectId/backlinks.tsx
rename to src/routes/_app/p/$projectId/backlinks.tsx
index 9dc7541e..135ca6ad 100644
--- a/src/routes/_project/p/$projectId/backlinks.tsx
+++ b/src/routes/_app/p/$projectId/backlinks.tsx
@@ -6,7 +6,7 @@ import {
} from "@/types/schemas/backlinks";
import { defaultScopeForInput } from "@/shared/researchScope";
-export const Route = createFileRoute("/_project/p/$projectId/backlinks")({
+export const Route = createFileRoute("/_app/p/$projectId/backlinks")({
validateSearch: backlinksSearchSchema,
component: BacklinksRoute,
});
diff --git a/src/routes/_project/p/$projectId/brand-lookup.tsx b/src/routes/_app/p/$projectId/brand-lookup.tsx
similarity index 94%
rename from src/routes/_project/p/$projectId/brand-lookup.tsx
rename to src/routes/_app/p/$projectId/brand-lookup.tsx
index da8f1ff6..ab25459e 100644
--- a/src/routes/_project/p/$projectId/brand-lookup.tsx
+++ b/src/routes/_app/p/$projectId/brand-lookup.tsx
@@ -2,7 +2,7 @@ import { createFileRoute, useNavigate } from "@tanstack/react-router";
import { BrandLookupPage } from "@/client/features/ai-search/BrandLookupPage";
import { brandLookupSearchSchema } from "@/types/schemas/ai-search";
-export const Route = createFileRoute("/_project/p/$projectId/brand-lookup")({
+export const Route = createFileRoute("/_app/p/$projectId/brand-lookup")({
validateSearch: brandLookupSearchSchema,
component: BrandLookupRoute,
});
diff --git a/src/routes/_project/p/$projectId/context.tsx b/src/routes/_app/p/$projectId/context.tsx
similarity index 78%
rename from src/routes/_project/p/$projectId/context.tsx
rename to src/routes/_app/p/$projectId/context.tsx
index ea1cff27..e40ecd33 100644
--- a/src/routes/_project/p/$projectId/context.tsx
+++ b/src/routes/_app/p/$projectId/context.tsx
@@ -1,18 +1,15 @@
import { createFileRoute } from "@tanstack/react-router";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { useQuery } from "@tanstack/react-query";
import { ProjectContextPage } from "@/client/features/projects/project-context/ProjectContextPage";
-import { getProjects } from "@/serverFunctions/projects";
-export const Route = createFileRoute("/_project/p/$projectId/context")({
+export const Route = createFileRoute("/_app/p/$projectId/context")({
component: ProjectContextRoute,
});
function ProjectContextRoute() {
const { projectId } = Route.useParams();
- const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
- });
+ const projectsQuery = useQuery(projectsQueryOptions());
const project = projectsQuery.data?.find((entry) => entry.id === projectId);
return (
diff --git a/src/routes/_project/p/$projectId/domain.tsx b/src/routes/_app/p/$projectId/domain.tsx
similarity index 95%
rename from src/routes/_project/p/$projectId/domain.tsx
rename to src/routes/_app/p/$projectId/domain.tsx
index abbbee9f..89897d4c 100644
--- a/src/routes/_project/p/$projectId/domain.tsx
+++ b/src/routes/_app/p/$projectId/domain.tsx
@@ -38,7 +38,7 @@ const DEFAULT_DOMAIN_SEARCH = {
pMaxVol: undefined,
} as const;
-export const Route = createFileRoute("/_project/p/$projectId/domain")({
+export const Route = createFileRoute("/_app/p/$projectId/domain")({
validateSearch: domainSearchSchema,
search: {
middlewares: [stripSearchParams(DEFAULT_DOMAIN_SEARCH)],
diff --git a/src/routes/_project/p/$projectId/index.tsx b/src/routes/_app/p/$projectId/index.tsx
similarity index 81%
rename from src/routes/_project/p/$projectId/index.tsx
rename to src/routes/_app/p/$projectId/index.tsx
index 368671cf..8d9592bc 100644
--- a/src/routes/_project/p/$projectId/index.tsx
+++ b/src/routes/_app/p/$projectId/index.tsx
@@ -1,7 +1,7 @@
import { createFileRoute } from "@tanstack/react-router";
import { DashboardPage } from "@/client/features/dashboard/DashboardPage";
-export const Route = createFileRoute("/_project/p/$projectId/")({
+export const Route = createFileRoute("/_app/p/$projectId/")({
component: DashboardRoute,
});
diff --git a/src/routes/_project/p/$projectId/keywords.tsx b/src/routes/_app/p/$projectId/keywords.tsx
similarity index 95%
rename from src/routes/_project/p/$projectId/keywords.tsx
rename to src/routes/_app/p/$projectId/keywords.tsx
index 5d502f26..77acd10a 100644
--- a/src/routes/_project/p/$projectId/keywords.tsx
+++ b/src/routes/_app/p/$projectId/keywords.tsx
@@ -9,7 +9,7 @@ import {
} from "@/client/features/keywords/keywordSearchParams";
import { keywordsSearchSchema } from "@/types/schemas/keywords";
-export const Route = createFileRoute("/_project/p/$projectId/keywords")({
+export const Route = createFileRoute("/_app/p/$projectId/keywords")({
validateSearch: keywordsSearchSchema,
beforeLoad: ({ params, search }) => {
const { normalized, changed } = normalizeLegacyKeywordSearch(search);
diff --git a/src/routes/_project/p/$projectId/prompt-explorer.tsx b/src/routes/_app/p/$projectId/prompt-explorer.tsx
similarity index 94%
rename from src/routes/_project/p/$projectId/prompt-explorer.tsx
rename to src/routes/_app/p/$projectId/prompt-explorer.tsx
index 3aa64682..52be6e25 100644
--- a/src/routes/_project/p/$projectId/prompt-explorer.tsx
+++ b/src/routes/_app/p/$projectId/prompt-explorer.tsx
@@ -5,7 +5,7 @@ import {
promptExplorerSearchSchema,
} from "@/types/schemas/ai-search";
-export const Route = createFileRoute("/_project/p/$projectId/prompt-explorer")({
+export const Route = createFileRoute("/_app/p/$projectId/prompt-explorer")({
validateSearch: promptExplorerSearchSchema,
component: PromptExplorerRoute,
});
diff --git a/src/routes/_project/p/$projectId/rank-tracking.tsx b/src/routes/_app/p/$projectId/rank-tracking.tsx
similarity index 87%
rename from src/routes/_project/p/$projectId/rank-tracking.tsx
rename to src/routes/_app/p/$projectId/rank-tracking.tsx
index ea320140..f33b7a2d 100644
--- a/src/routes/_project/p/$projectId/rank-tracking.tsx
+++ b/src/routes/_app/p/$projectId/rank-tracking.tsx
@@ -1,6 +1,6 @@
import { createFileRoute, Outlet } from "@tanstack/react-router";
-export const Route = createFileRoute("/_project/p/$projectId/rank-tracking")({
+export const Route = createFileRoute("/_app/p/$projectId/rank-tracking")({
component: RankTrackingLayout,
});
diff --git a/src/routes/_project/p/$projectId/rank-tracking/$configId.tsx b/src/routes/_app/p/$projectId/rank-tracking/$configId.tsx
similarity index 97%
rename from src/routes/_project/p/$projectId/rank-tracking/$configId.tsx
rename to src/routes/_app/p/$projectId/rank-tracking/$configId.tsx
index 76a4d636..f2220b4d 100644
--- a/src/routes/_project/p/$projectId/rank-tracking/$configId.tsx
+++ b/src/routes/_app/p/$projectId/rank-tracking/$configId.tsx
@@ -7,7 +7,7 @@ import { PageLoading } from "@/client/components/Spinner";
import { RankTrackingConfigModal } from "@/client/features/rank-tracking/RankTrackingConfigModal";
export const Route = createFileRoute(
- "/_project/p/$projectId/rank-tracking/$configId",
+ "/_app/p/$projectId/rank-tracking/$configId",
)({
component: RankTrackingConfigRoute,
});
diff --git a/src/routes/_project/p/$projectId/rank-tracking/index.tsx b/src/routes/_app/p/$projectId/rank-tracking/index.tsx
similarity index 95%
rename from src/routes/_project/p/$projectId/rank-tracking/index.tsx
rename to src/routes/_app/p/$projectId/rank-tracking/index.tsx
index feaa2f7e..fb2167c8 100644
--- a/src/routes/_project/p/$projectId/rank-tracking/index.tsx
+++ b/src/routes/_app/p/$projectId/rank-tracking/index.tsx
@@ -4,7 +4,7 @@ import { useQueryClient } from "@tanstack/react-query";
import { RankTrackingDomainList } from "@/client/features/rank-tracking/RankTrackingDomainList";
import { RankTrackingConfigModal } from "@/client/features/rank-tracking/RankTrackingConfigModal";
-export const Route = createFileRoute("/_project/p/$projectId/rank-tracking/")({
+export const Route = createFileRoute("/_app/p/$projectId/rank-tracking/")({
component: RankTrackingIndex,
});
diff --git a/src/routes/_project/p/$projectId/reports/$reportId.tsx b/src/routes/_app/p/$projectId/reports/$reportId.tsx
similarity index 99%
rename from src/routes/_project/p/$projectId/reports/$reportId.tsx
rename to src/routes/_app/p/$projectId/reports/$reportId.tsx
index 9c9caa97..19911d52 100644
--- a/src/routes/_project/p/$projectId/reports/$reportId.tsx
+++ b/src/routes/_app/p/$projectId/reports/$reportId.tsx
@@ -34,9 +34,7 @@ import { getReport } from "@/serverFunctions/reports";
// pasted) comes back expanded.
const reportDetailSearchSchema = z.object({ full: z.boolean().optional() });
-export const Route = createFileRoute(
- "/_project/p/$projectId/reports/$reportId",
-)({
+export const Route = createFileRoute("/_app/p/$projectId/reports/$reportId")({
validateSearch: reportDetailSearchSchema,
component: ReportDetailPage,
});
diff --git a/src/routes/_project/p/$projectId/reports/index.tsx b/src/routes/_app/p/$projectId/reports/index.tsx
similarity index 97%
rename from src/routes/_project/p/$projectId/reports/index.tsx
rename to src/routes/_app/p/$projectId/reports/index.tsx
index 5c0ff689..81196ce3 100644
--- a/src/routes/_project/p/$projectId/reports/index.tsx
+++ b/src/routes/_app/p/$projectId/reports/index.tsx
@@ -11,7 +11,7 @@ import { QueryState } from "@/client/components/QueryState";
import { listReports, type ReportListItem } from "@/serverFunctions/reports";
import { REPORT_APP_LIST_LIMIT } from "@/types/schemas/reports";
-export const Route = createFileRoute("/_project/p/$projectId/reports/")({
+export const Route = createFileRoute("/_app/p/$projectId/reports/")({
component: ReportsPage,
});
diff --git a/src/routes/_project/p/$projectId/reports/templates.tsx b/src/routes/_app/p/$projectId/reports/templates.tsx
similarity index 98%
rename from src/routes/_project/p/$projectId/reports/templates.tsx
rename to src/routes/_app/p/$projectId/reports/templates.tsx
index 4d590081..9b99ffc3 100644
--- a/src/routes/_project/p/$projectId/reports/templates.tsx
+++ b/src/routes/_app/p/$projectId/reports/templates.tsx
@@ -18,9 +18,7 @@ import {
} from "@/serverFunctions/reportTemplates";
import type { ReportTemplate } from "@/types/schemas/report-templates";
-export const Route = createFileRoute(
- "/_project/p/$projectId/reports/templates",
-)({
+export const Route = createFileRoute("/_app/p/$projectId/reports/templates")({
component: ReportTemplatesPage,
});
diff --git a/src/routes/_project/p/$projectId/route.tsx b/src/routes/_app/p/$projectId/route.tsx
similarity index 75%
rename from src/routes/_project/p/$projectId/route.tsx
rename to src/routes/_app/p/$projectId/route.tsx
index 6cdccf38..ed7d5fd6 100644
--- a/src/routes/_project/p/$projectId/route.tsx
+++ b/src/routes/_app/p/$projectId/route.tsx
@@ -7,19 +7,14 @@ import {
import { useQuery } from "@tanstack/react-query";
import { useEffect } from "react";
import { setLastProjectId } from "@/client/lib/active-project";
-import { PageLoading } from "@/client/components/Spinner";
-import { useHostedAuthRouteGuard } from "@/client/features/auth/useHostedAuthRouteGuard";
-import { FreePlanBanner } from "@/client/features/billing/FreePlanBanner";
-import { useOnboardingRedirect } from "@/client/features/onboarding/useOnboardingRedirect";
import { getErrorCode } from "@/client/lib/error-messages";
-import { AuthenticatedAppLayout } from "@/client/layout/AppShell";
import {
getCurrentAuthRedirectFromHref,
getSignInSearch,
} from "@/lib/auth-redirect";
import { getProjectAccess } from "@/serverFunctions/projects";
-export const Route = createFileRoute("/_project/p/$projectId")({
+export const Route = createFileRoute("/_app/p/$projectId")({
// Everything under this subtree fetches its data client-side with
// react-query, so SSR would only render empty chrome.
ssr: false,
@@ -61,8 +56,6 @@ function useProjectAccessRedirect(projectId: string) {
function ProjectLayout() {
const { projectId } = Route.useParams();
- const authGate = useHostedAuthRouteGuard();
- useOnboardingRedirect();
useProjectAccessRedirect(projectId);
// Remember this as the last-visited project for the landing redirect.
@@ -72,7 +65,7 @@ function ProjectLayout() {
// the switcher and project creation set it themselves, settings page or not.)
const isSettingsPage =
useMatch({
- from: "/_project/p/$projectId/settings",
+ from: "/_app/p/$projectId/settings",
shouldThrow: false,
select: () => true,
}) ?? false;
@@ -81,16 +74,5 @@ function ProjectLayout() {
setLastProjectId(projectId);
}, [projectId, isSettingsPage]);
- if (!authGate.canRenderAuthenticatedContent) {
- return <PageLoading fullScreen />;
- }
-
- return (
- <AuthenticatedAppLayout
- projectId={projectId}
- banner={authGate.isHostedMode ? <FreePlanBanner /> : undefined}
- >
- <Outlet />
- </AuthenticatedAppLayout>
- );
+ return <Outlet />;
}
diff --git a/src/routes/_project/p/$projectId/sam.tsx b/src/routes/_app/p/$projectId/sam.tsx
similarity index 88%
rename from src/routes/_project/p/$projectId/sam.tsx
rename to src/routes/_app/p/$projectId/sam.tsx
index b6b6dc39..faa66bc3 100644
--- a/src/routes/_project/p/$projectId/sam.tsx
+++ b/src/routes/_app/p/$projectId/sam.tsx
@@ -7,7 +7,7 @@ const samSearchSchema = z.object({
s: z.string().optional(),
});
-export const Route = createFileRoute("/_project/p/$projectId/sam")({
+export const Route = createFileRoute("/_app/p/$projectId/sam")({
validateSearch: samSearchSchema,
component: SamRoute,
});
diff --git a/src/routes/_project/p/$projectId/saved.tsx b/src/routes/_app/p/$projectId/saved.tsx
similarity index 99%
rename from src/routes/_project/p/$projectId/saved.tsx
rename to src/routes/_app/p/$projectId/saved.tsx
index 23b9ab8f..011279a6 100644
--- a/src/routes/_project/p/$projectId/saved.tsx
+++ b/src/routes/_app/p/$projectId/saved.tsx
@@ -43,7 +43,7 @@ import {
} from "@/serverFunctions/keywords";
import type { SavedKeywordTag } from "@/types/keywords";
-export const Route = createFileRoute("/_project/p/$projectId/saved")({
+export const Route = createFileRoute("/_app/p/$projectId/saved")({
component: SavedKeywordsPage,
});
diff --git a/src/routes/_project/p/$projectId/search-performance.tsx b/src/routes/_app/p/$projectId/search-performance.tsx
similarity index 79%
rename from src/routes/_project/p/$projectId/search-performance.tsx
rename to src/routes/_app/p/$projectId/search-performance.tsx
index 4ddf2b4b..edbb4a5f 100644
--- a/src/routes/_project/p/$projectId/search-performance.tsx
+++ b/src/routes/_app/p/$projectId/search-performance.tsx
@@ -1,9 +1,7 @@
import { createFileRoute } from "@tanstack/react-router";
import { SearchPerformancePage } from "@/client/features/search-performance/SearchPerformancePage";
-export const Route = createFileRoute(
- "/_project/p/$projectId/search-performance",
-)({
+export const Route = createFileRoute("/_app/p/$projectId/search-performance")({
component: SearchPerformanceRoute,
});
diff --git a/src/routes/_project/p/$projectId/settings.tsx b/src/routes/_app/p/$projectId/settings.tsx
similarity index 89%
rename from src/routes/_project/p/$projectId/settings.tsx
rename to src/routes/_app/p/$projectId/settings.tsx
index e584b6a2..d96f0fac 100644
--- a/src/routes/_project/p/$projectId/settings.tsx
+++ b/src/routes/_app/p/$projectId/settings.tsx
@@ -1,9 +1,9 @@
import { createFileRoute, Link, Outlet } from "@tanstack/react-router";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { useQuery } from "@tanstack/react-query";
import { ChevronLeft } from "lucide-react";
-import { getProjects } from "@/serverFunctions/projects";
-export const Route = createFileRoute("/_project/p/$projectId/settings")({
+export const Route = createFileRoute("/_app/p/$projectId/settings")({
component: ProjectSettingsLayout,
});
@@ -14,10 +14,7 @@ const tabs = [
function ProjectSettingsLayout() {
const { projectId } = Route.useParams();
- const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
- });
+ const projectsQuery = useQuery(projectsQueryOptions());
const project = projectsQuery.data?.find((entry) => entry.id === projectId);
return (
diff --git a/src/routes/_app/p/$projectId/settings/context.tsx b/src/routes/_app/p/$projectId/settings/context.tsx
new file mode 100644
index 00000000..0d275387
--- /dev/null
+++ b/src/routes/_app/p/$projectId/settings/context.tsx
@@ -0,0 +1,13 @@
+import { createFileRoute, redirect } from "@tanstack/react-router";
+
+// Context moved out of settings to the project's AI group. Agents have already
+// pasted this URL into transcripts, so it redirects rather than 404s.
+export const Route = createFileRoute("/_app/p/$projectId/settings/context")({
+ beforeLoad: ({ params }) => {
+ throw redirect({
+ to: "/p/$projectId/context",
+ params: { projectId: params.projectId },
+ replace: true,
+ });
+ },
+});
diff --git a/src/routes/_project/p/$projectId/settings/index.tsx b/src/routes/_app/p/$projectId/settings/index.tsx
similarity index 92%
rename from src/routes/_project/p/$projectId/settings/index.tsx
rename to src/routes/_app/p/$projectId/settings/index.tsx
index df76258e..1e5d0fd8 100644
--- a/src/routes/_project/p/$projectId/settings/index.tsx
+++ b/src/routes/_app/p/$projectId/settings/index.tsx
@@ -6,7 +6,7 @@ import { ProjectGeneralSettings } from "@/client/features/projects/ProjectGenera
// them to the sub-page that now owns the cards.
const MOVED_TO_INTEGRATIONS = ["search-console", "google-analytics"];
-export const Route = createFileRoute("/_project/p/$projectId/settings/")({
+export const Route = createFileRoute("/_app/p/$projectId/settings/")({
beforeLoad: ({ params, location }) => {
const hash = location.hash.replace(/^#/, "");
if (!MOVED_TO_INTEGRATIONS.includes(hash)) return;
diff --git a/src/routes/_project/p/$projectId/settings/integrations.tsx b/src/routes/_app/p/$projectId/settings/integrations.tsx
similarity index 96%
rename from src/routes/_project/p/$projectId/settings/integrations.tsx
rename to src/routes/_app/p/$projectId/settings/integrations.tsx
index 9fafca16..4442eef1 100644
--- a/src/routes/_project/p/$projectId/settings/integrations.tsx
+++ b/src/routes/_app/p/$projectId/settings/integrations.tsx
@@ -5,7 +5,7 @@ import { GoogleConnectionCard } from "@/client/features/integrations/GoogleConne
import { CrawlerAccessSettings } from "@/client/features/settings/CrawlerAccessSettings";
export const Route = createFileRoute(
- "/_project/p/$projectId/settings/integrations",
+ "/_app/p/$projectId/settings/integrations",
)({
loader: ({ params }) => {
// Start both database checks on link intent without holding up navigation.
diff --git a/src/routes/_app/projects.tsx b/src/routes/_app/projects.tsx
index 23a77962..b6460d1a 100644
--- a/src/routes/_app/projects.tsx
+++ b/src/routes/_app/projects.tsx
@@ -1,11 +1,11 @@
import * as React from "react";
+import { projectsQueryOptions } from "@/client/features/projects/projectQueries";
import { Link, createFileRoute } from "@tanstack/react-router";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { ChevronRight, Plus } from "lucide-react";
import { toast } from "sonner";
import {
getArchivedProjects,
- getProjects,
restoreProject,
} from "@/serverFunctions/projects";
import { QueryState } from "@/client/components/QueryState";
@@ -25,10 +25,7 @@ function ProjectsPage() {
React.useEffect(() => {
setCurrentProjectId(getLastProjectId());
}, []);
- const projectsQuery = useQuery({
- queryKey: ["projects"],
- queryFn: () => getProjects(),
- });
+ const projectsQuery = useQuery(projectsQueryOptions());
return (
<div className="h-full overflow-auto bg-base-100 px-4 py-8 pb-24 md:px-6 md:py-12 md:pb-8">
@@ -110,7 +107,9 @@ function ArchivedProjects() {
restoreProject({ data: { archivedProjectId: projectId } }),
onSuccess: async () => {
// Prefix match invalidates both the active and archived lists.
- await queryClient.invalidateQueries({ queryKey: ["projects"] });
+ await queryClient.invalidateQueries({
+ queryKey: projectsQueryOptions().queryKey,
+ });
toast.success("Project restored");
},
});
diff --git a/src/routes/_app/route.tsx b/src/routes/_app/route.tsx
index 98c11d66..1e5a40e1 100644
--- a/src/routes/_app/route.tsx
+++ b/src/routes/_app/route.tsx
@@ -1,5 +1,6 @@
-import { Outlet, createFileRoute } from "@tanstack/react-router";
+import { Outlet, createFileRoute, useParams } from "@tanstack/react-router";
import { useHostedAuthRouteGuard } from "@/client/features/auth/useHostedAuthRouteGuard";
+import { FreePlanBanner } from "@/client/features/billing/FreePlanBanner";
import { PageLoading } from "@/client/components/Spinner";
import { AuthenticatedAppLayout } from "@/client/layout/AppShell";
import { useOnboardingRedirect } from "@/client/features/onboarding/useOnboardingRedirect";
@@ -8,16 +9,25 @@ export const Route = createFileRoute("/_app")({
component: AppRouteLayout,
});
+// One layout for app pages and project pages (/p/$projectId/...), so the
+// drawer, setup modal and GSC nudge keep their state when the user moves
+// between the two.
function AppRouteLayout() {
const authGate = useHostedAuthRouteGuard();
useOnboardingRedirect();
+ const { projectId } = useParams({ strict: false });
if (!authGate.canRenderAuthenticatedContent) {
return <PageLoading fullScreen />;
}
return (
- <AuthenticatedAppLayout>
+ <AuthenticatedAppLayout
+ projectId={projectId}
+ banner={
+ projectId && authGate.isHostedMode ? <FreePlanBanner /> : undefined
+ }
+ >
<Outlet />
</AuthenticatedAppLayout>
);
diff --git a/src/routes/_project/p/$projectId/settings/context.tsx b/src/routes/_project/p/$projectId/settings/context.tsx
deleted file mode 100644
index b488cdb0..00000000
--- a/src/routes/_project/p/$projectId/settings/context.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { createFileRoute, redirect } from "@tanstack/react-router";
-
-// Context moved out of settings to the project's AI group. Agents have already
-// pasted this URL into transcripts, so it redirects rather than 404s.
-export const Route = createFileRoute("/_project/p/$projectId/settings/context")(
- {
- beforeLoad: ({ params }) => {
- throw redirect({
- to: "/p/$projectId/context",
- params: { projectId: params.projectId },
- replace: true,
- });
- },
- },
-);
diff --git a/src/routes/_project/route.tsx b/src/routes/_project/route.tsx
deleted file mode 100644
index 9b641302..00000000
--- a/src/routes/_project/route.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Outlet, createFileRoute } from "@tanstack/react-router";
-
-export const Route = createFileRoute("/_project")({
- component: ProjectRouteLayout,
-});
-
-function ProjectRouteLayout() {
- return <Outlet />;
-}