Skip to content

Open source alternative to Semrush and Ahrefs

Port the agent setup page to shadcn and keep its tab in the URL (EVE-300) (#744)

Carter Smithdd5aca2d9e24
diff --git a/src/client/components/ui/button.tsx b/src/client/components/ui/button.tsx
index 0dee8fcd..985cf280 100644
--- a/src/client/components/ui/button.tsx
+++ b/src/client/components/ui/button.tsx
@@ -20,11 +20,10 @@ const buttonVariants = cva(
link: "text-primary underline-offset-4 hover:underline",
},
size: {
- default:
- "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
- xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
- sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
- lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
+ default: "h-8 gap-1.5 px-2.5",
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3.5",
+ lg: "h-9 gap-1.5 px-2.5",
icon: "size-8",
"icon-xs":
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
diff --git a/src/client/components/ui/toggle-group.tsx b/src/client/components/ui/toggle-group.tsx
index 6b9a9906..11c4a9c4 100644
--- a/src/client/components/ui/toggle-group.tsx
+++ b/src/client/components/ui/toggle-group.tsx
@@ -72,7 +72,7 @@ function ToggleGroupItem({
data-size={context.size || size}
data-spacing={context.spacing}
className={cn(
- "shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
+ "shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
toggleVariants({
variant: context.variant || variant,
size: context.size || size,
diff --git a/src/client/components/ui/toggle.tsx b/src/client/components/ui/toggle.tsx
index ded9f6e9..a7cadc54 100644
--- a/src/client/components/ui/toggle.tsx
+++ b/src/client/components/ui/toggle.tsx
@@ -11,10 +11,9 @@ const toggleVariants = cva(
outline: "border border-input bg-transparent hover:bg-muted",
},
size: {
- default:
- "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
- sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
- lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
+ default: "h-8 min-w-8 px-2.5",
+ sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] [&_svg:not([class*='size-'])]:size-3.5",
+ lg: "h-9 min-w-9 px-2.5",
},
},
defaultVariants: {
diff --git a/src/client/features/ai-mcp/AgentList.tsx b/src/client/features/ai-mcp/AgentList.tsx
index d0f856fb..2f50186c 100644
--- a/src/client/features/ai-mcp/AgentList.tsx
+++ b/src/client/features/ai-mcp/AgentList.tsx
@@ -20,13 +20,13 @@ export function AgentList() {
{AGENTS.map(({ name, Icon }) => (
<li
key={name}
- className="flex items-center gap-1.5 text-xs text-base-content/60"
+ className="flex items-center gap-1.5 text-xs text-muted-foreground"
>
<Icon className="size-4" />
{name}
</li>
))}
- <li className="text-xs text-base-content/45">or any MCP client</li>
+ <li className="text-xs text-muted-foreground/75">or any MCP client</li>
</ul>
);
}
diff --git a/src/routes/_app/ai.tsx b/src/routes/_app/ai.tsx
index 625cd295..719be982 100644
--- a/src/routes/_app/ai.tsx
+++ b/src/routes/_app/ai.tsx
@@ -1,10 +1,21 @@
import { createFileRoute } from "@tanstack/react-router";
+import { z } from "zod";
import {
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "@/client/components/ui/tabs";
+import { Alert, AlertDescription } from "@/client/components/ui/alert";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+} from "@/client/components/ui/card";
+import { PageHeader } from "@/client/components/PageHeader";
import { ArrowUpRight, ShieldAlert } from "lucide-react";
import { getAuthMode } from "@/lib/auth-mode";
import { captureClientEvent } from "@/client/lib/posthog";
@@ -17,6 +28,10 @@ import { AgentList } from "@/client/features/ai-mcp/AgentList";
const DOCS_URL = "https://openseo.so/docs/agent-setup";
const COACH_DOCS_URL = "https://openseo.so/docs/skills/seo-coach";
+const LINK_CLASS =
+ "text-foreground underline decoration-foreground/25 underline-offset-4 hover:decoration-foreground";
+const MUTED_LINK_CLASS =
+ "inline-flex items-center gap-1 text-sm text-muted-foreground underline decoration-foreground/25 underline-offset-4 hover:text-foreground";
const SKILLS = [
["seo-coach", "Explains where you stand and picks your next step."],
[
@@ -39,11 +54,19 @@ const SKILLS = [
["seo-report", "Saves any of the above as a report on your Reports page."],
];
+const aiSearchSchema = z.object({
+ // Active tab. Omitted for the default "setup" tab.
+ tab: z.enum(["skills"]).optional().catch(undefined),
+});
+
export const Route = createFileRoute("/_app/ai")({
+ validateSearch: aiSearchSchema,
component: AiPage,
});
function AiPage() {
+ const { tab = "setup" } = Route.useSearch();
+ const navigate = Route.useNavigate();
const origin = window.location.origin;
const mcpUrl = `${origin}/mcp`;
const prompt = getAgentSetupPrompt(origin);
@@ -51,69 +74,89 @@ function AiPage() {
return (
<div className="h-full overflow-auto px-4 py-12 md:px-6 md:py-16 pb-24 md:pb-12">
<div className="mx-auto max-w-2xl">
- <h1 className="text-2xl font-semibold tracking-tight">Agent setup</h1>
- <p className="mt-3 text-pretty text-sm leading-relaxed text-base-content/70">
- The most powerful way to use OpenSEO is through the AI agent you
- already use. Set it up once, then ask it anything.
- </p>
+ <PageHeader
+ title="Agent setup"
+ description="The most powerful way to use OpenSEO is through the AI agent you already use. Set it up once, then ask it anything."
+ />
- <Tabs defaultValue="setup" className="mt-8">
+ <Tabs
+ value={tab}
+ onValueChange={(value) =>
+ void navigate({
+ search: { tab: value === "skills" ? "skills" : undefined },
+ replace: true,
+ })
+ }
+ className="mt-8"
+ >
<TabsList variant="line">
<TabsTrigger value="setup">Set up your agent</TabsTrigger>
<TabsTrigger value="skills">Skills</TabsTrigger>
</TabsList>
<TabsContent value="setup">
<div className="mt-6 space-y-5">
- <section className="rounded-xl border border-base-300 bg-base-100 p-5 sm:p-6">
- <h2 className="text-base font-semibold">Set up your agent</h2>
- <p className="mt-2 text-sm leading-relaxed text-base-content/60">
- Paste the setup prompt into your agent to connect OpenSEO and
- install its SEO skills. It will guide you through any manual
- steps.
- </p>
- <AgentList />
- <div className="mt-5 flex flex-wrap items-center gap-x-5 gap-y-3">
- <CopyButton
- variant="default"
- size="lg"
- className="h-11 gap-2 px-4"
- value={prompt}
- label="Copy setup prompt"
- successMessage="Setup prompt copied"
- onCopy={() => captureClientEvent("mcp:setup_prompt_copy")}
- />
- <a
- href={`${DOCS_URL}#set-up-your-agent`}
- target="_blank"
- rel="noreferrer"
- className="inline-flex items-center gap-1 text-sm text-base-content/60 underline decoration-base-content/25 underline-offset-4 hover:text-base-content"
- >
- Setup instructions
- <ArrowUpRight className="size-3.5" />
- </a>
- </div>
- <p className="mt-5 border-t border-base-300 pt-4 text-sm leading-relaxed text-base-content/60">
- Once connected, ask your agent to use{" "}
- <a
- href={COACH_DOCS_URL}
- target="_blank"
- rel="noreferrer"
- className="text-base-content underline decoration-base-content/25 underline-offset-4 hover:decoration-base-content"
- >
- SEO Coach
- </a>{" "}
- to help you choose what to do next.
- </p>
- </section>
+ <Card size="lg">
+ <CardHeader>
+ <CardTitle>
+ <h2>Set up your agent</h2>
+ </CardTitle>
+ <CardDescription>
+ Paste the setup prompt into your agent to connect OpenSEO
+ and install its SEO skills. It will guide you through any
+ manual steps.
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ <AgentList />
+ <div className="mt-5 flex flex-wrap items-center gap-x-5 gap-y-3">
+ <CopyButton
+ variant="default"
+ size="lg"
+ className="h-11 gap-2 px-4"
+ value={prompt}
+ label="Copy setup prompt"
+ successMessage="Setup prompt copied"
+ onCopy={() => captureClientEvent("mcp:setup_prompt_copy")}
+ />
+ <a
+ href={`${DOCS_URL}#set-up-your-agent`}
+ target="_blank"
+ rel="noreferrer"
+ className={MUTED_LINK_CLASS}
+ >
+ Setup instructions
+ <ArrowUpRight className="size-3.5" />
+ </a>
+ </div>
+ </CardContent>
+ <CardFooter className="text-muted-foreground">
+ <p>
+ Once connected, ask your agent to use{" "}
+ <a
+ href={COACH_DOCS_URL}
+ target="_blank"
+ rel="noreferrer"
+ className={LINK_CLASS}
+ >
+ SEO Coach
+ </a>{" "}
+ to help you choose what to do next.
+ </p>
+ </CardFooter>
+ </Card>
- <section className="rounded-xl border border-base-300 bg-base-100 p-5 sm:p-6">
- <h2 className="text-base font-semibold">Update your skills</h2>
- <p className="mt-2 text-sm leading-relaxed text-base-content/60">
- Already connected? Paste the update prompt into your agent to
- get the latest OpenSEO skills while preserving your connection
- settings and personal edits.
- </p>
- <div className="mt-5 flex flex-wrap items-center gap-x-5 gap-y-3">
+ <Card size="lg">
+ <CardHeader>
+ <CardTitle>
+ <h2>Update your skills</h2>
+ </CardTitle>
+ <CardDescription>
+ Already connected? Paste the update prompt into your agent
+ to get the latest OpenSEO skills while preserving your
+ connection settings and personal edits.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-wrap items-center gap-x-5 gap-y-3">
<CopyButton
variant="default"
size="lg"
@@ -127,19 +170,19 @@ function AiPage() {
href={`${DOCS_URL}#update-your-skills`}
target="_blank"
rel="noreferrer"
- className="inline-flex items-center gap-1 text-sm text-base-content/60 underline decoration-base-content/25 underline-offset-4 hover:text-base-content"
+ className={MUTED_LINK_CLASS}
>
Update instructions
<ArrowUpRight className="size-3.5" />
</a>
- </div>
- </section>
+ </CardContent>
+ </Card>
</div>
{getAuthMode(import.meta.env.AUTH_MODE) === "cloudflare_access" ? (
- <div className="alert alert-warning mt-8 text-sm" role="alert">
- <ShieldAlert className="size-4 shrink-0" />
- <span>
+ <Alert variant="warning" className="mt-8">
+ <ShieldAlert />
+ <AlertDescription>
This instance is behind Cloudflare Access. MCP clients cannot
connect until Managed OAuth is enabled on your Access
application.{" "}
@@ -147,18 +190,18 @@ function AiPage() {
href="https://openseo.so/docs/self-hosting/cloudflare#connect-the-mcp-server-through-cloudflare-access"
target="_blank"
rel="noreferrer"
- className="link font-medium"
+ className="font-medium"
>
Setup guide
</a>
- </span>
- </div>
+ </AlertDescription>
+ </Alert>
) : null}
- <div className="mt-10 flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-base-300 pt-5 text-xs text-base-content/55">
+ <div className="mt-10 flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-border pt-5 text-xs text-muted-foreground">
<span>
MCP server URL for this instance:{" "}
- <code className="font-mono text-base-content/80">{mcpUrl}</code>
+ <code className="font-mono text-foreground/80">{mcpUrl}</code>
</span>
<CopyButton
value={mcpUrl}
@@ -169,7 +212,7 @@ function AiPage() {
</TabsContent>
<TabsContent value="skills">
<section className="mt-6">
- <p className="text-sm text-base-content/60">
+ <p className="text-sm text-muted-foreground">
The setup prompt installs these. Run one by name when you want a
full report instead of a quick answer.
</p>
@@ -183,11 +226,11 @@ function AiPage() {
href={`https://openseo.so/docs/skills/${name}`}
target="_blank"
rel="noreferrer"
- className="shrink-0 font-mono text-[13px] text-base-content underline decoration-base-content/25 underline-offset-4 hover:decoration-base-content sm:w-48"
+ className={`shrink-0 font-mono text-[13px] sm:w-48 ${LINK_CLASS}`}
>
/{name}
</a>
- <span className="text-base-content/60">{blurb}</span>
+ <span className="text-muted-foreground">{blurb}</span>
</li>
))}
</ul>