Skip to content

Commit 122a4af

Browse files
committed
fix(gitignore): anchor legacy-ignore rules to root so nested src/docs is tracked
The bare `docs/` rule was ignoring apps/web/src/components/docs/cheatcode-101-sections.tsx (breaking @cheatcode/web typecheck in CI). Anchor cheatcode//docs//tasks//plans/ to the repo root so only the legacy V1 tree + pre-V2 notes are ignored, and commit the missing docs component.
1 parent b0ef0ee commit 122a4af

3 files changed

Lines changed: 113 additions & 4 deletions

File tree

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ supabase/.temp/
2020
packages/skills/src/generated.ts
2121

2222
# Preserved legacy V1 tree and pre-V2 notes. Section 20 cleanup requires a git snapshot first.
23-
cheatcode/
24-
docs/
25-
tasks/
26-
plans/
23+
# Anchored to repo root so nested source dirs (e.g. apps/web/src/components/docs) aren't ignored.
24+
/cheatcode/
25+
/docs/
26+
/tasks/
27+
/plans/
2728

2829
# Local debugging artifacts (agent-browser screenshots, clipboard scratch)
2930
/*.png
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
import type { Cheatcode101Block, Cheatcode101Section } from "@/content/cheatcode-101";
2+
3+
export function Cheatcode101Toc({ sections }: { sections: readonly Cheatcode101Section[] }) {
4+
return (
5+
<nav aria-label="cheatcode 101 sections" className="text-sm">
6+
<p className="mb-3 font-mono text-[10px] text-thread-text-muted uppercase tracking-[0.24em]">
7+
On this page
8+
</p>
9+
<ol className="space-y-2">
10+
{sections.map((section, index) => (
11+
<li key={section.id}>
12+
<a
13+
className="text-thread-text-secondary transition-colors hover:text-thread-text-primary"
14+
href={`#${section.id}`}
15+
>
16+
{`${index + 1}. ${section.title}`}
17+
</a>
18+
</li>
19+
))}
20+
</ol>
21+
</nav>
22+
);
23+
}
24+
25+
export function Cheatcode101SectionView({ section }: { section: Cheatcode101Section }) {
26+
return (
27+
<section
28+
className="scroll-mt-24 border-thread-border-subtle border-t pt-8 first:border-t-0 first:pt-0"
29+
id={section.id}
30+
>
31+
<h2 className="flex items-center gap-3 font-medium text-white text-xl tracking-tight">
32+
{section.title}
33+
{section.draft ? (
34+
<span className="rounded-full border border-thread-border bg-black/25 px-2 py-0.5 font-mono text-[9px] text-thread-text-muted uppercase tracking-[0.18em]">
35+
draft
36+
</span>
37+
) : null}
38+
</h2>
39+
<div className="mt-4 space-y-4">
40+
{section.blocks.map((block) => (
41+
<Cheatcode101BlockView block={block} key={blockKey(block)} />
42+
))}
43+
</div>
44+
</section>
45+
);
46+
}
47+
48+
function blockKey(block: Cheatcode101Block): string {
49+
if (block.kind === "replayCard") {
50+
return `replay-${block.replaySlug}`;
51+
}
52+
if (block.kind === "bullets") {
53+
return `bullets-${block.items[0] ?? ""}`;
54+
}
55+
return `${block.kind}-${block.text.slice(0, 32)}`;
56+
}
57+
58+
function Cheatcode101BlockView({ block }: { block: Cheatcode101Block }) {
59+
if (block.kind === "paragraph") {
60+
return <p className="text-sm text-thread-text-muted leading-7">{block.text}</p>;
61+
}
62+
if (block.kind === "bullets") {
63+
return (
64+
<ul className="space-y-2 text-sm text-thread-text-muted leading-7">
65+
{block.items.map((item) => (
66+
<li className="flex gap-2" key={item}>
67+
<span aria-hidden="true" className="text-thread-text-muted">
68+
69+
</span>
70+
<span>{item}</span>
71+
</li>
72+
))}
73+
</ul>
74+
);
75+
}
76+
if (block.kind === "footnote") {
77+
return (
78+
<p className="rounded-2xl border border-thread-border bg-thread-surface/50 px-4 py-3 text-thread-text-muted text-xs leading-6">
79+
{block.text}
80+
</p>
81+
);
82+
}
83+
return <ReplayCardPlaceholder replaySlug={block.replaySlug} title={block.title} />;
84+
}
85+
86+
function ReplayCardPlaceholder({ replaySlug, title }: { replaySlug: string; title: string }) {
87+
return (
88+
<div
89+
className="flex items-center justify-between gap-4 rounded-2xl border border-thread-border bg-thread-surface/50 px-4 py-3"
90+
data-replay-slug={replaySlug}
91+
>
92+
<div className="min-w-0">
93+
<p className="truncate font-medium text-sm text-thread-text-primary">{title}</p>
94+
<p className="font-mono text-[10px] text-thread-text-muted uppercase tracking-[0.18em]">
95+
Replay
96+
</p>
97+
</div>
98+
<button
99+
className="shrink-0 cursor-not-allowed rounded-md border border-thread-border px-3 py-1.5 font-mono text-[10px] text-thread-text-muted uppercase tracking-widest opacity-60"
100+
disabled
101+
title="Replays are coming soon"
102+
type="button"
103+
>
104+
Open replay
105+
</button>
106+
</div>
107+
);
108+
}

context.tar

-168 KB
Binary file not shown.

0 commit comments

Comments
 (0)