From 264a9e323299fbe09ac54d450e88e72647a92e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 1 Oct 2026 12:08:02 -0400 Subject: [PATCH] =?UTF-8?q?T48a=20Docs=20=C2=B7=20Frame=20passes=20review;?= =?UTF-8?q?=20an=20id-less=20heading=20fails=20the=20build,=20protocol-rel?= =?UTF-8?q?ative=20links=20stay=20native?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TASKS.md | 2 +- frontend/src/docs/guides.ts | 1 + frontend/src/pages/Docs.tsx | 2 +- frontend/src/styles.css | 3 +-- tasks/reviews.md | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/TASKS.md b/TASKS.md index a914af9..971a844 100644 --- a/TASKS.md +++ b/TASKS.md @@ -164,7 +164,7 @@ Per-component lines live in `tasks/`. Tags there: - [x] T46a Site · Owner's notes: the city title whole, header icons on one line, less space above a story, no visible scroll bars, each story named by its first component, every page laid out at phone, tablet and desktop widths - [x] T47 Ship: GitHub repo (public), CI, Cloudflare deploy through `npx wrangler` - [ ] T48 Docs: a Docs tab after gpui-kit.com/docs, a rail of guides, an on-this-page list, previous and next; every claim checked against the code, every full Rust sample an example `scripts/check.sh` compiles and the page imports as text -- [ ] T48a Docs · Frame: the Docs tab, `/docs/` and `/docs/$page/`, Markdown pages, the rail, the on-this-page list, previous and next, code blocks, light and dark, phone to desktop +- [x] T48a Docs · Frame: the Docs tab, `/docs/` and `/docs/$page/`, Markdown pages, the rail, the on-this-page list, previous and next, code blocks, light and dark, phone to desktop - [ ] T48b Docs · Introduction: what Ely is, the order to read, what is stable, a first example, license - [ ] T48c Docs · Installation: Rust, the git dependencies, gpui_platform's fonts, runtime shaders, the gallery as a check, what `init` refuses - [ ] T48d Docs · Getting started: an app from `init` to a window under a root `FocusScope`, with a Button diff --git a/frontend/src/docs/guides.ts b/frontend/src/docs/guides.ts index ee874e9..9653f90 100644 --- a/frontend/src/docs/guides.ts +++ b/frontend/src/docs/guides.ts @@ -50,6 +50,7 @@ function read(file: string, files: string[]): Guide { } const html = this.parser.parseInline(tokens); const id = slugify(words); + if (!id) throw new Error(`docs: ${file}.md has a heading with no id: ${words}`); if (ids.has(id)) throw new Error(`docs: ${file}.md repeats heading ${id}`); ids.add(id); if (depth === 2) toc.push({ id, text: words }); diff --git a/frontend/src/pages/Docs.tsx b/frontend/src/pages/Docs.tsx index d291d62..bec9f38 100644 --- a/frontend/src/pages/Docs.tsx +++ b/frontend/src/pages/Docs.tsx @@ -35,7 +35,7 @@ export function Docs() { const target = e.target as HTMLElement; const button = target.closest("button.copy"); if (button) return void copy(button); - const link = target.closest("a[href^='/']"); + const link = target.closest("a[href^='/']:not([href^='//'])"); if (!link || e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0) return; e.preventDefault(); const url = new URL(link.href); diff --git a/frontend/src/styles.css b/frontend/src/styles.css index 21659e9..dc89dc8 100644 --- a/frontend/src/styles.css +++ b/frontend/src/styles.css @@ -190,8 +190,7 @@ img.shot { display: block; max-width: 100%; height: auto; } .prose td { color: color-mix(in srgb, var(--fg) 82%, var(--bg)); } .code { position: relative; margin: 28px 0; background: var(--code); border-radius: 12px; } .code figcaption { padding: 14px 88px 0 20px; font: 400 12px/18px var(--mono); color: var(--faint); overflow-wrap: anywhere; } -.code pre { margin: 0; padding: 14px 20px 20px; overflow-x: auto; } -.code button + pre { padding-top: 20px; } +.code pre { margin: 0; padding: 16px 20px 20px; overflow-x: auto; } .code code { display: block; font: 400 13.5px/22px var(--mono); background: none; padding: 0; color: var(--fg); } .code .copy { position: absolute; top: 10px; right: 12px; padding: 4px 8px; font-size: 12px; color: var(--muted); transition: color 160ms ease-out; } .code .copy:hover { color: var(--fg); } diff --git a/tasks/reviews.md b/tasks/reviews.md index 92bf279..73a19b7 100644 --- a/tasks/reviews.md +++ b/tasks/reviews.md @@ -327,3 +327,6 @@ | T46 | 1 | FAIL | the typing test passed without typing; two home tests passed with no frame mounted; full screen and window captures checked by class and srcset only | | T46 | 2 | PASS | | | T46a | 1 | PASS | notes fixed after: the hero title fits its column at every width, the icon comment, AGENTS.md's wording | +| T48a | 1 | FAIL | escaped entities in titles and the list; section links broke under the trailing slash; long inline code widened 280px; no guide list under 1024px | +| T48a | 2 | FAIL | the rail and list clipped the focus ring's left side | +| T48a | 3 | PASS | rendering moved to build time first: a bad guide fails the build; notes fixed after (an id-less heading fails, protocol-relative links stay native, dead padding rule gone) |