Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: share anchor ids instead of suppressing the unique id lint

Richie McIlroy590dc4708346
diff --git a/apps/web/components/pages/agents/Harnesses.tsx b/apps/web/components/pages/agents/Harnesses.tsx
index a5317d586..45202be80 100644
--- a/apps/web/components/pages/agents/Harnesses.tsx
+++ b/apps/web/components/pages/agents/Harnesses.tsx
@@ -14,6 +14,7 @@ import {
MONO,
} from "@/components/pages/HomeTwo/theme";
import {
+ ANCHORS,
type HarnessKey,
harnesses,
INSTALLERS,
@@ -90,8 +91,10 @@ export const Harnesses = () => {
if (!active) return null;
return (
- // biome-ignore lint/correctness/useUniqueElementIds: stable anchor target linked from the docs
- <section id="harnesses" className="scroll-mt-24 px-5 pb-20 lg:pb-28">
+ <section
+ id={ANCHORS.harnesses}
+ className="scroll-mt-24 px-5 pb-20 lg:pb-28"
+ >
<style>{TAB_CSS}</style>
<div className="mx-auto max-w-[1200px]">
<div className="mx-auto flex max-w-[760px] flex-col items-center text-center">
diff --git a/apps/web/components/pages/agents/Hero.tsx b/apps/web/components/pages/agents/Hero.tsx
index 6c7a31a31..40ffed9d2 100644
--- a/apps/web/components/pages/agents/Hero.tsx
+++ b/apps/web/components/pages/agents/Hero.tsx
@@ -22,7 +22,7 @@ import {
MONO,
} from "@/components/pages/HomeTwo/theme";
import { CAP_AGENT_PROMPT } from "@/data/agent-prompt";
-import { HARNESS_NAMES, POINTER_URL } from "./content";
+import { ANCHORS, HARNESS_NAMES, POINTER_URL } from "./content";
import { CopyIconButton, CopyLabelButton } from "./copy";
const DARK = {
@@ -81,7 +81,7 @@ export const Hero = () => {
Copy the setup prompt
</CopyLabelButton>
<a
- href="#setup"
+ href={`#${ANCHORS.setup}`}
className={`${BTN_SECONDARY} group cursor-pointer gap-2.5`}
>
See how it works
diff --git a/apps/web/components/pages/agents/SetupPrompt.tsx b/apps/web/components/pages/agents/SetupPrompt.tsx
index d0fda5100..32d5507d6 100644
--- a/apps/web/components/pages/agents/SetupPrompt.tsx
+++ b/apps/web/components/pages/agents/SetupPrompt.tsx
@@ -16,7 +16,7 @@ import {
meshStyle,
} from "@/components/pages/HomeTwo/theme";
import { CAP_AGENT_PROMPT } from "@/data/agent-prompt";
-import { POINTER_PROMPT, setupSteps } from "./content";
+import { ANCHORS, POINTER_PROMPT, setupSteps } from "./content";
import { CopyLabelButton, Snippet } from "./copy";
const DARK = {
@@ -39,8 +39,7 @@ export const SetupPrompt = () => {
const [expanded, setExpanded] = useState(false);
return (
- // biome-ignore lint/correctness/useUniqueElementIds: stable anchor target for the hero's "See how it works" link
- <section id="setup" className="scroll-mt-24 px-5 py-20 lg:py-28">
+ <section id={ANCHORS.setup} className="scroll-mt-24 px-5 py-20 lg:py-28">
<div className="mx-auto max-w-[1200px]">
<div className="max-w-[760px]">
<Eyebrow accent={MODE_THEME.instant.accent}>One prompt</Eyebrow>
diff --git a/apps/web/components/pages/agents/content.ts b/apps/web/components/pages/agents/content.ts
index ea5461057..2975dd12b 100644
--- a/apps/web/components/pages/agents/content.ts
+++ b/apps/web/components/pages/agents/content.ts
@@ -27,6 +27,11 @@ export const agentsSeo = {
export const POINTER_URL = "https://cap.so/agents";
+export const ANCHORS = {
+ setup: "setup",
+ harnesses: "harnesses",
+} as const;
+
export const POINTER_PROMPT =
"Read https://cap.so/agents and follow it to set up Cap for me, then ask what I want to record or review.";