From b1e53173aa75c84b859fb1951363f4e9f56b5b74 Mon Sep 17 00:00:00 2001 From: Jeffery Orazulike Date: Sun, 22 Nov 2026 17:00:36 +0100 Subject: [PATCH 1/2] feat(site): prerender and add SEO metadata The page is rendered into index.html at build time, so crawlers that skip JavaScript read it. Title, Open Graph and SoftwareApplication JSON-LD come from one SEO block and package.json. --- AGENTS.md | 2 +- landing/index.html | 18 +---- landing/src/components/InstallBox.tsx | 10 +-- landing/src/components/Nav.tsx | 21 +++--- landing/src/entry-server.tsx | 7 ++ landing/src/main.tsx | 10 ++- landing/src/styles.css | 5 ++ landing/src/theme.ts | 31 ++++----- landing/vite.config.ts | 94 +++++++++++++++++++++++++-- 9 files changed, 139 insertions(+), 59 deletions(-) create mode 100644 landing/src/entry-server.tsx diff --git a/AGENTS.md b/AGENTS.md index 72af505..ab8907d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,7 +27,7 @@ | `src/adapters/opencode/plugin/` | The opencode plugin. Standalone (node built-ins only): install copies the built file into opencode's plugins folder | | `src/adapters/claude/plugin/` | The Claude plugin: `/bridge` (socket) and `/bridge-monitor` skills sharing `shared/peer-messages.md`, the monitor, and the bypass-guard hook. Registered by install through the repo's `.claude-plugin/marketplace.json` | | `docs/` | User docs (`concepts.md`, `install.md`, `agents/`) and the design record (`decisions.md`, `live-tests.md`, `adding-an-agent.md`, `open-questions.md`). Agent findings live in `docs/agents/.md`; never name a file there `claude.md`, macOS loads it as `CLAUDE.md` | -| `landing/` | The product page at logickoder.dev/agent-bridge. Its own Vite + React + Tailwind project with its own lockfile, deployed by `.github/workflows/site.yml`. Reads the version from the root `package.json`. The favicon and social card are served from `docs/assets` by a plugin in `landing/vite.config.ts`; edit them in `docs/assets`. Not part of the npm package | +| `landing/` | The product page at logickoder.dev/agent-bridge. Its own Vite + React + Tailwind project with its own lockfile, deployed by `.github/workflows/site.yml`. Reads the version from the root `package.json`. The favicon and social card are served from `docs/assets` by a plugin in `landing/vite.config.ts`; edit them in `docs/assets`. `vite build` prerenders the page into `index.html` (`buildApp` in `landing/vite.config.ts`, rendering `landing/src/entry-server.tsx`); title, meta and JSON-LD come from `SEO` there, so components must not touch `window` or `document` while rendering. Not part of the npm package | | `test/` | Tests that touch real files, sockets or processes. `e2e.test.ts` runs against `dist/cli.js`. `net*.test.ts` run several homes as separate users through `harness.ts` (homes, `until`, `socketRequest`, `tty` on a pseudo-terminal), with `proxy.ts` (a recording, tampering stand-in for the tunnel) | ## Rules diff --git a/landing/index.html b/landing/index.html index 52d5d9d..d97c589 100644 --- a/landing/index.html +++ b/landing/index.html @@ -3,25 +3,11 @@ - agent-bridge · live messaging between coding agents - - - - - - - - - - -
- + +
diff --git a/landing/src/components/InstallBox.tsx b/landing/src/components/InstallBox.tsx index 867f857..29d8f52 100644 --- a/landing/src/components/InstallBox.tsx +++ b/landing/src/components/InstallBox.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState, type KeyboardEvent } from 'react'; +import { useEffect, useRef, useState, useSyncExternalStore, type KeyboardEvent } from 'react'; import { INSTALL_NPM, INSTALL_SOURCE } from '../site'; import { CopyIcon } from './Icons'; import { OUTLINE_BUTTON } from './Layout'; @@ -17,13 +17,15 @@ const COPY_LABEL: Record = { failed: 'Copy failed', }; const RESET_MS = 2000; -// Client-only page: the clipboard API either works here or it doesn't, for the whole visit. -const CAN_COPY = Boolean(navigator.clipboard) && window.isSecureContext; +// The clipboard API works here or it doesn't, for the whole visit. Never in the prerendered HTML. +const noSubscribe = () => () => {}; +const canCopy = () => Boolean(navigator.clipboard) && window.isSecureContext; /** Tabbed install commands with a copy button (shown only where the clipboard API works). */ export function InstallBox() { const [active, setActive] = useState('npm'); const [copy, setCopy] = useState('idle'); + const showCopy = useSyncExternalStore(noSubscribe, canCopy, () => false); const tabRefs = useRef>>({}); const method = METHODS.find((m) => m.id === active) ?? METHODS[0]; @@ -104,7 +106,7 @@ export function InstallBox() {