Public: anyone can read this; the crew can change it.

/docs index answers under 40 ms and 15 KB, measured on production #13021

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/12997-docs-index-answers-under-40-ms-and-15-kb → main 7 commits fork 2 threads · 2 unresolved

  • Merged. scout/12997-docs-index-answers-under-40-ms-and-15-kb was merged into main as 7e2ff5c.

Review

Sign in to review this change.
6 files changed +35 −5
docs/design/areas/docs.md added +3
@@ -0,0 +1,3 @@
1 # Docs
2
3 - `.docs-index` — the list of documents on /docs: a bare link per `<li>`, title only, with the row's hover and a 44px hit area. It replaces `row()` there because 65 generic rows cost 130 bytes each; the index must answer in under 15 KB (`test/docs-link.test.ts`). Search results on /docs keep `row()` with their snippet.
forge.json +1 −1
@@ -4,7 +4,7 @@
44 "api.github.com"
55 ],
66 "app": {
7 "looks": ["/", "/front", "/explore", "/board", "/notes", "/feed", "/review", "/releases", "/apps", "/map", "/system", "/maintenance", "/talk", "/flow", "/resilience", "/boards?help", "/settings/crew", "/settings/crew?help", "/preview-admin/sample", "/preview-admin/sample/pulls/3", "/preview-admin/sample/next?pick", "/preview-admin/sample/bets", "/preview-admin/sample/waves", "/preview-admin/sample/space"],
7 "looks": ["/", "/front", "/docs", "/explore", "/board", "/notes", "/review", "/releases", "/apps", "/map", "/system", "/maintenance", "/talk", "/flow", "/resilience", "/boards?help", "/settings/crew", "/settings/crew?help", "/preview-admin/sample", "/preview-admin/sample/pulls/3", "/preview-admin/sample/next?pick", "/preview-admin/sample/bets", "/preview-admin/sample/waves", "/preview-admin/sample/space"],
88 "looksAsOwner": ["/", "/board", "/flow", "/boards?help", "/settings/crew", "/settings/crew?help", "/talk", "/system", "/maintenance", "/resilience", "/preview-admin/sample", "/preview-admin/sample/pulls/3", "/preview-admin/sample/next?pick", "/preview-admin/sample/bets", "/preview-admin/sample/waves", "/preview-admin/sample/space"],
99 "run": "bun run src/main.ts",
1010 "install": "",
src/web/style/components.ts +5
@@ -497,6 +497,11 @@ a.row:hover, .row[data-nav]:hover { background: var(--muted); color: inherit; }
497497 [data-look] a.look { position: relative; overflow: visible; }
498498 [data-look] a.look::after { content: ""; position: absolute; inset: -7px; }
499499 a.row:hover .row-title { color: var(--accent); }
500 /* The docs index (/docs): a bare link per document, one line each, 44px to hit,
501 so 70 rows stay under 15 KB. */
502 .docs-index > li > a { display: block; padding: 12px 16px; color: inherit; transition: background-color 100ms var(--ease); }
503 .docs-index > li > a:hover { background: var(--muted); color: var(--accent); }

Principle 7: a second row style next to a.row. Keep it only if row() cannot be slimmed; and make sure the focus ring is visible (only outline-offset is set here).

504 .docs-index > li > a:focus-visible { outline-offset: -2px; }
500505 .row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
501506 .row-title {
502507 font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
test/forge-looks.test.ts +1 −1
@@ -23,6 +23,7 @@ quietLogs();
2323 const NOT_A_PAGE: Record<string, string> = {
2424 "/home": "the home's old address: a redirect to /, which is pictured",
2525 "/desk": "a POST that leaves a note on the desk; the desk is read on the home (/), which is pictured; covered by test/desk.test.ts",
26 "/feed": "no picture: its slot went to /docs; the page is covered by its own tests",
2627 "/pricing": "no picture: the cap of 24 looks is spent; the page is covered by test/pricing-order.test.ts",
2728 "/audit": "no picture: its slot went to /pinned; /audit.csv is its download, covered by test/audit.test.ts",
2829 "/deploy-to": "a form for a forge admin that fills from its link; covered by test/pinned-page.test.ts",
@@ -41,7 +42,6 @@ const NOT_A_PAGE: Record<string, string> = {
4142 "/openapi.json": "a redirect to the contract document",
4243 "/favicon.ico": "the tab icon, an image",
4344 "/releases.json": "JSON feed of /releases",
44 "/docs": "a redirect to the forge's documentation",
4545 "/changelog.atom": "Atom feed of /changelog",
4646 "/explore.atom": "Atom feed of /explore",
4747 "/sitemap.xml": "XML for crawlers",

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs