Fix the visual review's findings on the redesign
Before adoption: this commit came in with the history the project adopted, so no landing records it.
- Code tab: the file tree's column draws a filter and skeleton rows on the server and while its body and read load, never an empty box. - Landing now: below tablet a row's refusal and time sit under the title in its column, so every row keeps one shape. - Settings: the head script names the system's scheme in data-system, so the stylesheet shows what each theme choice gives before hydration. - Explore's intro ends its sentence. - Docs: below columns the index shows no repeated tree, and a page's headings fold into a disclosure ahead of the article. - A README's headings go down a level, so the project's name is the one h1. - Install: cards keep their own height, and a command hangs only from tablet. - How to take an ask: on a phone only the first step is a command box. - DESIGN.md records the platform pages' system-sans fallback for sign-off.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
24 files+436 added−108 removed
- tests:+170 added−7 removed
- other:+266 added−101 removed
Provenance
- Commit
13ab53f- Tree
7fcff61- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent
c96b333
24 files changed+436 added−108 removed
modified:apps/web/src/features/agents/install-page.tsx+1 added-1 removed
179 unmodified lines180 <p className="text-want text-muted-foreground font-normal">181 {INSTALL_LEDE}182 </p>183 </div>184- <div className="columns:grid-cols-2 grid gap-5">184+ <div className="columns:grid-cols-2 grid items-start gap-5">185 {installChannels(input).map((channel) => (186 <ChannelCard channel={channel} key={channel.id} />187 ))}188 </div>16 unmodified linesadded:apps/web/src/features/code/tree-skeleton.tsx+16 added
12345678910111213141516import { Skeleton } from "../../components/ui/skeleton.tsx";
const ROWS = ["w-32", "w-24", "w-40", "w-28", "w-36", "w-20", "w-44"] as const;
/** The file tree's shape while its body and its read are on the way, so the column never stands empty. */export const TreeSkeleton = () => ( <div aria-busy="true" className="flex min-h-0 flex-1 flex-col"> <output className="sr-only">Reading the files</output> <div aria-hidden="true" className="flex flex-col gap-3 px-3"> <Skeleton className="h-9 w-full sm:h-8" /> {ROWS.map((width) => ( <Skeleton className={`h-3 max-w-full ${width}`} key={width} /> ))} </div> </div>);modified:apps/web/src/features/docs/docs-view.tsx+87 added-58 removed
84 unmodified lines8586878889909189909394959697989910010110210310410510610791929394959697108109110111112113114115116117118119981211229910010110210310410510610710810911011111211311411511612411711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015113013113213313413513613713813914014114214314414515215315415515615715815916016116216316416516616716816917017117217317414714814915015115215315415517517617717817918018118218318484 unmodified lines </Button> );};
/** The page's headings and its Markdown, beside the article from `columns`, under it below. */const OnThisPage = ({ page }: { readonly page: DocPage }) => { const headings = docHeadings(page);type Headings = ReturnType<typeof docHeadings>;
return ( <aside aria-label="On this page" className="border-rule columns:sticky columns:top-[calc(var(--top-bar)+1.5rem)] columns:self-start columns:border-t-0 columns:pt-0 columns:mt-0 mt-8 flex min-w-0 flex-col gap-6 border-t pt-6" data-column="toc" > {headings.length === 0 ? null : ( <div className="flex flex-col gap-1"> <h2 className="text-ui font-semibold">On this page</h2> <ul className="flex flex-col"> {headings.map(({ id, text }) => ( <li key={id}> {/* An anchor in this page, not a page of its own. */} <a className={CONTENTS_LINK} href={`#${id}`}> {text}const Contents = ({ headings }: { readonly headings: Headings }) => ( <ul className="flex flex-col"> {headings.map(({ id, text }) => ( <li key={id}> {/* An anchor in this page, not a page of its own. */} <a className={CONTENTS_LINK} href={`#${id}`}> {text} </a> </li> ))} </ul> </div> )} <div className="flex flex-col gap-2"> <CopyMarkdown markdown={page.markdown} /> {/* A server route, not a page of the app. */} <a className={MARKDOWN_LINK} href={docsMarkdownPath(page.slug)}> <FileText aria-hidden="true" strokeWidth={1.75} /> View as .md </a> </div> </aside> </li> ))} </ul>);
/** * Below `columns` the headings fold into a disclosure above the article, so a * reader meets them before what they link to, not after. */const ContentsAhead = ({ headings }: { readonly headings: Headings }) => headings.length === 0 ? null : ( <details className="border-rule columns:hidden mb-6 border-y py-2"> <summary className="text-ui flex min-h-8 cursor-pointer items-center font-semibold"> On this page </summary> <Contents headings={headings} /> </details> );};
/** The page's headings and its Markdown, beside the article from `columns`; below, its Markdown under it. */const OnThisPage = ({ headings, page,}: { readonly headings: Headings; readonly page: DocPage;}) => ( <aside aria-label="On this page" className="border-rule columns:sticky columns:top-[calc(var(--top-bar)+1.5rem)] columns:self-start columns:border-t-0 columns:pt-0 columns:mt-0 mt-8 flex min-w-0 flex-col gap-6 border-t pt-6" data-column="toc" > {headings.length === 0 ? null : ( <div className="max-columns:hidden flex flex-col gap-1"> <h2 className="text-ui font-semibold">On this page</h2> <Contents headings={headings} /> </div> )} <div className="flex flex-col gap-2"> <CopyMarkdown markdown={page.markdown} /> {/* A server route, not a page of the app. */} <a className={MARKDOWN_LINK} href={docsMarkdownPath(page.slug)}> <FileText aria-hidden="true" strokeWidth={1.75} /> View as .md </a> </div> </aside>);
/** * The docs shell's main column: the article at the measure, then "On this * page", which stands to its right from `columns`. */export const DocsPageView = ({ page }: { readonly page: DocPage }) => ( <main className="flex min-w-0 flex-1 flex-col outline-none" data-scroll-restoration-id="main" id="main" tabIndex={-1} > <ContextBar crumbs={[ { label: "Docs", to: docsPath() }, { label: PART_TITLE[page.part] }, { label: page.title }, ]} /> <div className={`columns:grid columns:grid-cols-[minmax(0,1fr)_var(--column-docs-toc)] columns:gap-x-14 flex flex-col pt-6 pb-16 ${GUTTER}`}export const DocsPageView = ({ page }: { readonly page: DocPage }) => { const headings = docHeadings(page);
return ( <main className="flex min-w-0 flex-1 flex-col outline-none" data-scroll-restoration-id="main" id="main" tabIndex={-1} > <ContextBar crumbs={[ { label: "Docs", to: docsPath() }, { label: PART_TITLE[page.part] }, { label: page.title }, ]} /> <div className={`columns:grid columns:grid-cols-[minmax(0,1fr)_var(--column-docs-toc)] columns:gap-x-14 flex flex-col pt-6 pb-16 ${GUTTER}`} > <article className="max-w-(--measure) min-w-0" data-doc={page.slug}> <h1 className="text-headline text-balance break-words"> {page.title} <article className="max-w-(--measure) min-w-0" data-doc={page.slug}> <h1 className="text-headline text-balance break-words">{page.title}</h1> <p className="text-want mt-3 mb-6 font-normal">{page.summary}</p> <SiteMarkdown source={docBody(page)} /> </article> <OnThisPage page={page} /> </div> </main>); </h1> <p className="text-want mt-3 mb-6 font-normal">{page.summary}</p> <ContentsAhead headings={headings} /> <SiteMarkdown source={docBody(page)} /> </article> <OnThisPage headings={headings} page={page} /> </div> </main> );};modified:apps/web/src/features/explore/explore-page.tsx+1 added-1 removed
171 unmodified lines172 <div className="flex flex-col gap-3">173 <h1 className="text-headline">{EXPLORE_TITLE}</h1>174 <p className="text-body text-muted-foreground max-w-[72ch]">175 <Lede projects={projects} /> Looking for something to work on?{" "}176- <AppLink to={ASKS_PATH}>Every open ask</AppLink>176+ <AppLink to={ASKS_PATH}>See every open ask</AppLink>.177 </p>178 </div>179 <Body projects={projects} />180 </main>1 unmodified linemodified:apps/web/src/features/front/how-to.tsx+19 added-3 removed
87 unmodified lines88 const LINK = "decoration-rule underline hover:decoration-current";89 90 /**91 * The strip itself. Its onward line links Install through the router and92- * `llms.txt` as a plain anchor, since `llms.txt` is a server route.92+ * `llms.txt` as a plain anchor, since `llms.txt` is a server route. On a phone93+ * only the first step is a command box; the other two read as code in the94+ * list, so the strip never becomes a column of code blocks (ADR 0041).95 */96 export const HowToTake = ({97 onDismiss,98 }: {21 unmodified lines120 >121 <X aria-hidden="true" strokeWidth={1.75} />122 </Button>123 </div>122- <ol className="columns:grid-cols-3 grid gap-4">124+ <ol className="columns:grid-cols-3 tablet:gap-4 grid gap-3">125 {STEPS.map(({ command, label }, index) => (126 <li className="flex min-w-0 flex-col gap-1" key={command}>127 <p className="text-label text-muted-foreground">128 {index + 1}. {label}129 </p>130+ {index === 0 ? (128- <CommandLine command={command} numbered />131+ <CommandLine command={command} numbered />132+ ) : (133+ <>134+ <code135+ className="text-mono tablet:hidden font-mono [overflow-wrap:anywhere]"136+ data-step-text=""137+ >138+ {command}139+ </code>140+ <div className="max-tablet:hidden">141+ <CommandLine command={command} numbered />142+ </div>143+ </>144+ )}145 </li>146 ))}147 </ol>148 <p className="text-ui text-muted-foreground">15 unmodified linesmodified:apps/web/src/features/landing/landing-now-list.tsx+7 added-4 removed
24 unmodified lines25 /** A row's title: the ask's want as sentence text, or, when the list does not know it, the ask's id or the commit in mono. */26 const titleOf = (want: string | undefined, code: string): ReactNode =>27 want ?? <span className="text-mono font-mono">{code}</span>;28 29-/** One row: the mark, the project over what landed or was refused, why it was refused, and when. */29+/**30+ * One row: the mark, the project over what landed or was refused, why it was refused, and when. Below `tablet` why31+ * and when sit under the title in its column, so every row keeps one shape whatever the want's length.32+ */33 const Row = ({34 children,35 outcome,36 project,8 unmodified lines45 readonly to: string;46 readonly when: ReactNode;47 }) => (48 <li46- className="border-rule tablet:flex-nowrap flex min-h-16 flex-wrap items-center gap-x-4 gap-y-1 border-b py-2.5"49+ className="border-rule tablet:flex grid min-h-16 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-4 gap-y-1 border-b py-2.5"50 data-outcome={outcome}51 data-project={project}52 >53 <StateMarkIcon mark={outcome} />11 unmodified lines65 {title}66 </AppLink>67 </div>68 {children}66- <p className="text-ui tablet:w-32 tablet:text-right shrink-0 tabular-nums">69+ <p className="text-ui tablet:w-32 tablet:text-right col-start-2 shrink-0 tabular-nums">70 {when}71 </p>72 </li>73 );39 unmodified lines113 </span>114 </>115 }116 >114- <p className="text-ui tablet:max-w-64 tablet:text-right flex flex-wrap gap-x-3 gap-y-0.5">117+ <p className="text-ui tablet:max-w-64 tablet:text-right col-start-2 flex flex-wrap gap-x-3 gap-y-0.5">118 {/* Two lanes failing read as one tag: the list names no lane. */}119 {Arr.dedupeWith(120 refusals,121 (one, other) => labelOf(one) === labelOf(other)27 unmodified linesmodified:apps/web/src/features/markdown/markdown.tsx+18 added-5 removed
83 unmodified lines84 );85 86 const components: Components = { a: Anchor, img: Image };87 88-const PROSE = [88+const PROSE_BASE = [89 "prose prose-tokens text-body max-w-[70ch] min-w-0",90 "prose-headings:font-semibold prose-headings:tracking-[-0.01em]",91- "prose-h1:text-title prose-h1:mb-3 prose-h1:border-b prose-h1:border-rule prose-h1:pb-2",92- "prose-h2:text-title prose-h2:mt-8 prose-h2:mb-3",93- "prose-h3:text-want prose-h4:text-want",91 "prose-code:before:content-none prose-code:after:content-none prose-code:font-normal",92 "[&_:not(pre)>code]:bg-surface [&_:not(pre)>code]:text-mono [&_:not(pre)>code]:px-1 [&_:not(pre)>code]:py-px",93 "prose-pre:bg-surface prose-pre:text-foreground prose-pre:border prose-pre:border-rule prose-pre:rounded-none",94 "prose-pre:text-mono prose-pre:leading-terminal prose-pre:px-4 prose-pre:py-3",1 unmodified line96 "prose-blockquote:font-normal prose-blockquote:not-italic",97 "[&_blockquote_p]:before:content-none [&_blockquote_p]:after:content-none",98 "prose-img:my-0 prose-img:inline-block prose-img:max-w-full",99 "prose-table:text-ui prose-th:font-semibold",100+];101+102+/** A page's own Markdown: its `#` is the page's one h1. */103+const PROSE = [104+ ...PROSE_BASE,105+ "prose-h1:text-title prose-h1:mb-3 prose-h1:border-b prose-h1:border-rule prose-h1:pb-2",106+ "prose-h2:text-title prose-h2:mt-8 prose-h2:mb-3",107+ "prose-h3:text-want prose-h4:text-want",108 ].join(" ");109 110+/** A README, its headings a level down (`rehypeShiftHeadings`), drawn as they were before the shift. */111+const README_PROSE = [112+ ...PROSE_BASE,113+ "prose-h2:text-title prose-h2:mt-0 prose-h2:mb-3 prose-h2:border-b prose-h2:border-rule prose-h2:pb-2",114+ "prose-h3:text-title prose-h3:mt-8 prose-h3:mb-3",115+ "prose-h4:text-want prose-h5:text-want",116+].join(" ");117+118 export const RepoMarkdown = ({119 at,120 dir,121 project,122 source,123 }: RepoMarkdownProps): ReactNode => (111- <div className={PROSE}>124+ <div className={README_PROSE}>125 <Markdown126 components={components}127 rehypePlugins={rehypePluginsFor({ dir, project, sha: at })}128 remarkPlugins={remarkPlugins}37 unmodified linesmodified:apps/web/src/features/markdown/pipeline.ts+22 added-3 removed
4 unmodified lines5 * `user-content-` prefix, which the sanitizer adds next; 5. `rehypeSanitize`6 * with `schema`, the last gate (no script, handler, `javascript:` or `data:`7 * URL, iframe, style or form; every `id` and `name` prefixed, so a README8 * cannot clobber the page's globals); 6. `rehypeSlug`, after the sanitizer, so9- * `#usage` finds `## Usage` unprefixed; 7. `rehypeFragmentLinks`, last, once10- * every id is final. react-markdown's `defaultUrlTransform` stays on as a11- * second net.9+ * `#usage` finds `## Usage` unprefixed; 7. `rehypeFragmentLinks`, once10+ * every id is final; 8. `rehypeShiftHeadings`, a README's only, which moves no11+ * id or URL. react-markdown's `defaultUrlTransform` stays on as a second net.12 */13 import { Predicate } from "effect";14 import type { Element, Properties, Root } from "hast";15 import type { Options } from "react-markdown";161 unmodified lines177 }178 });179 };180 181+const SHIFTED = new Map([182+ ["h1", "h2"],183+ ["h2", "h3"],184+ ["h3", "h4"],185+ ["h4", "h5"],186+ ["h5", "h6"],187+]);188+189+/**190+ * A README sits under the page's own h1 (the project's name), so its headings191+ * go down a level: its `# name` reads as an h2, and an h6 stays an h6.192+ */193+export const rehypeShiftHeadings = () => (tree: Root) => {194+ visit(tree, "element", (node) => {195+ node.tagName = SHIFTED.get(node.tagName) ?? node.tagName;196+ });197+};198+199 export const remarkPlugins: PluggableList = [remarkGfm];200 201 export const rehypePluginsFor = (at: MarkdownAt): PluggableList => [202 rehypeRaw,1 unmodified line204 rehypeFootnoteIds,205 [rehypeSanitize, schema],206 rehypeSlug,207 rehypeFragmentLinks,208+ rehypeShiftHeadings,209 ];210 211 export const sitePlugins: PluggableList = [212 [rehypeSanitize, schema],3 unmodified linesmodified:apps/web/src/features/settings/appearance.tsx+7 added-1 removed
69 unmodified lines70 type="radio"71 value={choice}72 />73 <span className="font-medium">{CHOICE_LABELS[choice]}</span>74+ {/* Before React knows the system, the head script's `data-system` names it through the stylesheet. */}74- {system === undefined ? null : (75+ {system === undefined ? (76+ <span77+ className="text-muted-foreground ml-auto"78+ data-system-resolves={choice}79+ />80+ ) : (81 <span className="text-muted-foreground ml-auto">82 {THEME_LABELS[resolveTheme(system, choice)]}83 </span>84 )}112 unmodified linesmodified:apps/web/src/features/shared/shell/app-shell.tsx+28 added-12 removed
1 import { useHydrated, useLocation } from "@tanstack/react-router";2+import { cn } from "cn";3 import { Suspense, useCallback, useMemo, useState } from "react";4 import type { ReactNode } from "react";5 6 import { KeysProvider } from "../keys.tsx";7 import { SkipLink } from "../layout.tsx";8+import { docsPath } from "../paths.ts";9 import { ShellContext, ShellReadsContext } from "./context.ts";10 import type { Overlay, ShellReads } from "./context.ts";11 import { DocsNav } from "./docs-nav.tsx";12 import { Footer } from "./footer.tsx";12 unmodified lines25 {children}26 </div>27 );28 29+/**30+ * The article first, so it is read first; from `columns` the tree stands to its left. Below `columns` the index31+ * shows no tree under itself: the index already lists every page.32+ */33+const DocsFrame = ({ children }: { readonly children: ReactNode }) => {34+ const index = useLocation({35+ select: ({ pathname }) => pathname.replace(/\/$/u, "") === docsPath(),36+ });27-/** The article first, so it is read first; from `columns` the tree stands to its left. */28-const DocsFrame = ({ children }: { readonly children: ReactNode }) => (29- <div className="columns:grid columns:grid-cols-[var(--column-docs-nav)_minmax(0,1fr)] max-w-site mx-auto flex w-full flex-1 flex-col">30- <div className="columns:col-start-2 columns:row-start-1 flex min-w-0 flex-col">31- {children}37+38+ return (39+ <div className="columns:grid columns:grid-cols-[var(--column-docs-nav)_minmax(0,1fr)] max-w-site mx-auto flex w-full flex-1 flex-col">40+ <div className="columns:col-start-2 columns:row-start-1 flex min-w-0 flex-col">41+ {children}42+ </div>43+ <div44+ className={cn(45+ "border-rule columns:col-start-1 columns:row-start-1 columns:sticky columns:top-(--top-bar) columns:self-start columns:max-h-[calc(100dvh-var(--top-bar))] columns:overflow-y-auto columns:block columns:border-t-0 border-t py-6",46+ index && "hidden",47+ GUTTER48+ )}49+ data-docs-tree={index ? "index" : "page"}50+ >51+ <DocsNav />52+ </div>53 </div>33- <div34- className={`border-rule columns:col-start-1 columns:row-start-1 columns:sticky columns:top-(--top-bar) columns:self-start columns:max-h-[calc(100dvh-var(--top-bar))] columns:overflow-y-auto columns:border-t-0 border-t py-6 ${GUTTER}`}35- >36- <DocsNav />37- </div>38- </div>39-);54+ );55+};56 57 const FRAMES = {58 docs: DocsFrame,59 focus: ({ children }: { readonly children: ReactNode }) => (94 unmodified linesmodified:apps/web/src/features/shared/command.tsx+10 added-2 removed
1 import { Check, Copy } from "lucide-react";2+import type { CSSProperties } from "react";3 4 import { Button } from "../../components/ui/button.tsx";5 import { useCopy } from "./copy-action.tsx";6 import { useNumberedCommand } from "./keys.tsx";12 unmodified lines19 hang,20 line.length - Math.max(0, ...words.map(({ length }) => length))21 );22 23+/** The hang as a variable, which the line takes from `tablet` only: on a phone the words want the whole width. */24+const hangStyle = (25+ hang: number26+): CSSProperties & { readonly "--hang": string } => ({27+ "--hang": `${hang}ch`,28+});29+30 // Breaks between words, never after a word's own hyphen (`--project`) nor31 // before a closing ` \`.32 const wordsOf = (command: string) =>33 command.split("\n").map((line, at, lines) => {7 unmodified lines41 42 return (43 // A line never moves: its place in the command is its key.44 <span37- className="block"45+ className="tablet:pl-(--hang) tablet:-indent-(--hang) block"46 key={at}39- style={{ paddingLeft: `${hang}ch`, textIndent: `-${hang}ch` }}47+ style={hangStyle(hang)}48 >49 {parts.map((part, index) =>50 part.trim() === "" ? (51 part72 unmodified linesmodified:apps/web/src/features/shared/theme.ts+5 added-3 removed
107 unmodified lines108 * `resolveTheme` gives: sets `data-theme` on `<html>` before first paint and109 * colours a `theme-color` meta of its own, and does it again when the110 * system's scheme changes or another tab writes the preference. Plain ES5111 * with no imports; where it never runs, the stylesheet's media query and the112- * rendered metas are the fallback. `test/theme.test.ts` runs it.112+ * rendered metas are the fallback. It also names the system's own scheme in113+ * `data-system`, so /settings can show what each choice gives before React114+ * runs. `test/theme.test.ts` runs it.115 */114-export const THEME_SCRIPT = `(function(){var d=document,m=matchMedia(${JSON.stringify(DARK_SCHEME_QUERY)}),c=${JSON.stringify(themeColors)};function a(){var p,s;try{p=localStorage.getItem(${JSON.stringify(THEME_PREFERENCE_KEY)})}catch(x){}var t=m.matches!==(p==="opposite")?"dark":"light";d.documentElement.dataset.theme=t;s="meta[data-theme-color]";if(!d.querySelector(s))d.head.insertAdjacentHTML("afterbegin",${JSON.stringify(THEME_META)});d.querySelector(s).setAttribute("content",c[t])}a();m.addEventListener("change",a);addEventListener("storage",a)})()`;116+export const THEME_SCRIPT = `(function(){var d=document,m=matchMedia(${JSON.stringify(DARK_SCHEME_QUERY)}),c=${JSON.stringify(themeColors)};function a(){var p,s,e=d.documentElement.dataset;try{p=localStorage.getItem(${JSON.stringify(THEME_PREFERENCE_KEY)})}catch(x){}var t=m.matches!==(p==="opposite")?"dark":"light";e.theme=t;e.system=m.matches?"dark":"light";s="meta[data-theme-color]";if(!d.querySelector(s))d.head.insertAdjacentHTML("afterbegin",${JSON.stringify(THEME_META)});d.querySelector(s).setAttribute("content",c[t])}a();m.addEventListener("change",a);addEventListener("storage",a)})()`;117 118 /**119 * The script's hash as a CSP source. The web sets no Content-Security-Policy120 * on its pages; one added later lists this in `script-src`. A test holds it121 * to the script's text.122 */123 export const THEME_SCRIPT_SOURCE =122- "'sha256-AVNSogXudFMj8DxU6fv5GiySiexVFS9KraUSG8LLOSo='";124+ "'sha256-wBIkzc5HrsCSaxUQgB2fHQqInWgTrPnNbdSjB9xjqnk='";modified:apps/web/src/routes/$owner/$project/tree/-code-column.tsx+13 added-3 removed
1 unmodified line2 // (`-code-files.tsx`) once the page is up.3 import { ClientOnly } from "@tanstack/react-router";4 import { lazy, Suspense } from "react";5 6+import { TreeSkeleton } from "../../../../features/code/tree-skeleton.tsx";7 import { SideColumn } from "../../../../features/shared/shell/side-column.tsx";8 9 const Body = import.meta.env.SSR10 ? undefined11 : lazy(() => import("./-code-files.tsx"));12 13+// The server and the first paint draw the tree's shape, so the column never stands empty while its body loads.14+const waiting = (15+ <div className="flex min-h-0 flex-1 flex-col pt-3">16+ <TreeSkeleton />17+ </div>18+);19+20 const Later = ({ commit }: { readonly commit: boolean }) =>13- Body === undefined ? null : (14- <ClientOnly fallback={null}>15- <Suspense fallback={null}>21+ Body === undefined ? (22+ waiting23+ ) : (24+ <ClientOnly fallback={waiting}>25+ <Suspense fallback={waiting}>26 <Body commit={commit} />27 </Suspense>28 </ClientOnly>29 );14 unmodified linesmodified:apps/web/src/routes/$owner/$project/tree/-code-files.tsx+14 added-3 removed
29 unmodified lines30 diffAnchor,31 treeHref,32 whyHref,33 } from "../../../../features/code/paths.ts";34+import { TreeSkeleton } from "../../../../features/code/tree-skeleton.tsx";35 36 const isProject = Schema.is(ProjectName);37 38 const decode = Schema.decodeUnknownOption(CommitPageData);85 unmodified lines124 const ordered = useMemo(() => (paths ?? []).toSorted(treeOrder), [paths]);125 126 useCodeFileKeys(ordered, path, open);127 127- return shown && paths !== undefined ? (128+ if (!shown) {129+ return null;130+ }131+132+ if (AsyncResult.isInitial(read)) {133+ return <TreeSkeleton />;134+ }135+136+ return paths === undefined ? null : (137 <ClientTree138 current={path}139+ fallback={<TreeSkeleton />}140 key={`${project}@${rev}`}141 onOpen={open}142 paths={paths}143 />134- ) : null;144+ );145 };146 147 export const CodeFiles = ({148 always = false,5 unmodified lines154 155 return project === undefined ? null : (156 <div className="flex min-h-0 flex-1 flex-col">157 <div className="min-h-0 flex-1 pt-3">148- <ClientOnly fallback={null}>158+ <ClientOnly fallback={<TreeSkeleton />}>159 <ProjectTree160 kind={kind}161 path={path}162 project={project}45 unmodified lines208 <div className="min-h-0 flex-1 pt-3">209 <ClientTree210 counts={counts}211 current={current}212+ fallback={<TreeSkeleton />}213 key={paths.join("\n")}214 onOpen={open}215 open216 paths={paths}11 unmodified linesmodified:apps/web/src/styles.css+16 added
518 unmodified lines519 }520 }521 }522 523+/*524+ What each theme choice on /settings gives, before React can see the525+ system (ADR 0042): the head script names the system's scheme in526+ data-system, and these name the resolution the same way the component527+ does once it runs. Where the script never ran, nothing is named.528+*/529+:root[data-system="light"] [data-system-resolves="same"]::after,530+:root[data-system="dark"] [data-system-resolves="opposite"]::after {531+ content: "Light";532+}533+534+:root[data-system="dark"] [data-system-resolves="same"]::after,535+:root[data-system="light"] [data-system-resolves="opposite"]::after {536+ content: "Dark";537+}538+539 @layer base {540 * {541 @apply border-border outline-ring/50;542 }184 unmodified linesmodified:apps/web/test/code.test.tsx+21 added
50 unmodified lines51 import { readCommitPage } from "../src/routes/$owner/$project/commit/$sha.tsx";52 import { readLogPage } from "../src/routes/$owner/$project/commits/$rev.tsx";53 import { readRefsPage } from "../src/routes/$owner/$project/refs.tsx";54 import { readTreePage } from "../src/routes/$owner/$project/tree/$rev/$.tsx";55+import {56+ CodeColumn,57+ CommitColumn,58+} from "../src/routes/$owner/$project/tree/-code-column.tsx";59 import { elementWith, elementsWith } from "./records.ts";60 import { renderAt } from "./render.tsx";61 import { reachingTransport } from "./transport.ts";62 1961 unmodified lines2024 );2025 })2026 );2027 });2028+2029+// The column's body loads once the page is up; until then it draws the2030+// tree's shape, so it never stands as an empty box beside the page.2031+describe("the Code tab's side column before its body loads", () => {2032+ it.effect.each([2033+ ["the tree", <CodeColumn key="tree" />],2034+ ["a commit's files", <CommitColumn key="commit" />],2035+ ] as const)("draws %s as a filter and rows, busy", ([, column]) =>2036+ Effect.gen(function* () {2037+ const markup = yield* renderAt("/oscabriel/burrow/tree/main", column);2038+2039+ expect(markup).toContain('aria-busy="true"');2040+ expect(markup).toContain("Reading the files");2041+ expect(markup.match(/data-slot="skeleton"/gu)?.length).toBeGreaterThan(1);2042+ })2043+ );2044+});modified:apps/web/test/docs.test.tsx+49 added-1 removed
12 unmodified lines13 } from "../src/features/docs/docs-view.tsx";14 import { docsHead } from "../src/features/docs/head.ts";15 import { AppShell } from "../src/features/shared/shell/app-shell.tsx";16 import { docsMarkdownHandler } from "../src/routes/docs/{$page}[.]md.ts";17-import { textIn } from "./markup.ts";17+import { attributeOf, tagsWith, textIn } from "./markup.ts";18 import { renderAt } from "./render.tsx";19 20 const input = {21 commands,106 unmodified lines128 })129 );130 });131 132+/** The classes on the docs tree's wrapper. */133+const treeClasses = (tag: string) =>134+ (attributeOf(tag, "class") ?? "").split(" ");135+136+describe("the docs below `columns`", () => {137+ it.effect(138+ "fold a page's headings into a disclosure ahead of its body, linking what On this page links",139+ () =>140+ Effect.gen(function* () {141+ const markup = yield* inDocsShell("start-here");142+ const ahead = elementOf(markup, "details", 'class="');143+ const article = elementOf(markup, "article", "data-doc");144+145+ expect(ahead).toContain("columns:hidden");146+ expect(147+ linksOf(ahead).map(({ href, text }) => [href.slice(1), text])148+ ).toStrictEqual(contentsOf(markup));149+ expect(article.indexOf("<details")).toBeLessThan(150+ article.indexOf("<h2")151+ );152+ })153+ );154+155+ // The index already lists every page, so the tree under it would say it twice.156+ it.effect("show no tree under the index, and the tree under a page", () =>157+ Effect.gen(function* () {158+ const index = tagsWith(159+ yield* renderAt(160+ "/docs",161+ <AppShell>162+ <DocsIndexView pages={pages} />163+ </AppShell>164+ ),165+ "data-docs-tree"166+ );167+168+ const page = tagsWith(yield* inDocsShell("landing"), "data-docs-tree");169+170+ expect(171+ ["hidden", "columns:block"].filter(172+ (name) => !index.flatMap(treeClasses).includes(name)173+ )174+ ).toStrictEqual([]);175+ expect(page.flatMap(treeClasses)).not.toContain("hidden");176+ })177+ );178+});179+180 describe("the docs' links to setup", () => {181 it("send a reader to /install, never the old /agents", () => {182 expect(183 pages.flatMap(({ markdown, slug }) =>206 unmodified linesmodified:apps/web/test/front.test.tsx+22 added
548 unmodified lines549 })550 );551 552 it.effect(553+ "keeps one command box in the strip on a phone, the other two steps as code in the list",554+ () =>555+ Effect.gen(function* () {556+ const strip = stripIn(yield* front({}));557+558+ expect(559+ [560+ ...strip.matchAll(561+ /<code\b[^>]*data-step-text=""[^>]*>(?<command>[^<]*)<\/code>/gu562+ ),563+ ].map(({ groups }) => groups?.command)564+ ).toStrictEqual([565+ `${Brand.cli} check`,566+ `git push ${Brand.slug} HEAD:main`,567+ ]);568+ expect(strip.match(/<div class="max-tablet:hidden">/gu)).toHaveLength(569+ 2570+ );571+ })572+ );573+574+ it.effect(575 "puts one strip of three steps above the list, each a command, with a control that dismisses it",576 () =>577 Effect.gen(function* () {578 const markup = yield* front({});260 unmodified linesmodified:apps/web/test/markdown.test.tsx+14 added-4 removed
227 unmodified lines228 '<input type="checkbox" disabled=""/>',229 ]);230 });231 232+ // A README sits under the project's own h1, so its levels go down by one.232- it("gives a heading an id a link can point at", () => {233- expect(rendered("## Hello World")).toContain('<h2 id="hello-world">');233+ it("gives a heading an id a link can point at, a level under the page's h1", () => {234+ expect(rendered("## Hello World")).toContain('<h3 id="hello-world">');235 });236 237+ it("draws no h1 of its own, and keeps an h6 an h6", () => {238+ const markup = rendered("# burrow\n\n###### Small");239+240+ expect(markup).not.toContain("<h1");241+ expect(markup).toContain('<h2 id="burrow">');242+ expect(markup).toContain('<h6 id="small">');243+ });244+245 describe("a footnote", () => {246 const markup = rendered("Text[^1]\n\n[^1]: Note.");247 248 const targetOf = (attribute: string) =>90 unmodified lines339 it("keeps lines to 70 characters", () => {340 expect(proseClasses().has("max-w-[70ch]")).toBeTruthy();341 });342 343+ // Its `#` is an h2 by then (`rehypeShiftHeadings`), under the page's own h1.334- it("sets its h1 at the title size, under the page's own headline", () => {335- expect(proseClasses().has("prose-h1:text-title")).toBeTruthy();344+ it("sets its top heading at the title size, under the page's own headline", () => {345+ expect(proseClasses().has("prose-h2:text-title")).toBeTruthy();346 });347 348 it("sizes every element from the type scale, never an arbitrary size", () => {349 expect(30 unmodified linesmodified:apps/web/test/settings.test.tsx+48 added
8 unmodified lines9 } from "../src/features/settings/appearance.tsx";10 import { SettingsView } from "../src/features/settings/settings-page.tsx";11 import {12 readPreference,13+ resolveTheme,14 THEME_PREFERENCE_KEY,15+ THEME_PREFERENCES,16 writePreference,17 } from "../src/features/shared/theme.ts";18 import type { Theme, ThemePreference } from "../src/features/shared/theme.ts";19 import { attributeOf, textIn } from "./markup.ts";20 import { renderAt } from "./render.tsx";21 import { keptStorage, refusingStorage } from "./storage.ts";22 import { themePage } from "./theme-page.ts";23 24+import styles from "../src/styles.css?raw";25+26 const ignore = () => {};27 28 /** Each choice as its label reads, and the radio it holds. */29 const choicesIn = (markup: string) =>9 unmodified lines39 };40 }41 );42 43+/** The word the stylesheet draws after a choice's span on a system, before React can see it. */44+const drawnBefore = (system: Theme, choice: ThemePreference) => {45+ const css = styles.replaceAll(/\/\*[\s\S]*?\*\//gu, "");46+ const selector = `:root[data-system="${system}"] [data-system-resolves="${choice}"]::after`;47+48+ return [49+ ...css.matchAll(/(?<selectors>[^{}]+)\{\s*content: "(?<word>\w+)";\s*\}/gu),50+ ].flatMap(({ groups }) =>51+ groups?.selectors?.split(",").some((each) => each.trim() === selector) ===52+ true53+ ? [groups.word]54+ : []55+ );56+};57+58 const appearanceAt = (system: Theme | undefined, preference: ThemePreference) =>59 renderAt(60 "/settings",61 <AppearanceView onChoose={ignore} preference={preference} system={system} />35 unmodified lines97 "Opposite of system",98 ]);99 })100 );101+102+ // The head script names the system before first paint, so the stylesheet103+ // can show what each choice gives without waiting for React.104+ it.effect(105+ "marks each choice for the stylesheet until the system is known",106+ () =>107+ Effect.gen(function* () {108+ const markup = yield* appearanceAt(undefined, "same");109+110+ expect(111+ [...markup.matchAll(/data-system-resolves="(?<choice>\w+)"/gu)].map(112+ ({ groups }) => groups?.choice113+ )114+ ).toStrictEqual([...THEME_PREFERENCES]);115+ })116+ );117+118+ it.each(["light", "dark"] as const)(119+ "draws, before React runs, what each choice gives on a %s system",120+ (system) => {121+ expect(122+ THEME_PREFERENCES.map((choice) => drawnBefore(system, choice))123+ ).toStrictEqual(124+ THEME_PREFERENCES.map((choice) => [125+ resolveTheme(system, choice) === "dark" ? "Dark" : "Light",126+ ])127+ );128+ }129+ );130 });131 132 describe(SettingsView, () => {133 it.effect(147 unmodified linesmodified:apps/web/test/shared.test.tsx+2 added-2 removed
142 unmodified lines143 144 const hangs = (command: string) =>145 [146 ...markupOf(<CommandLine command={command} />).matchAll(147- /padding-left:(?<hang>\d+)ch;text-indent:-\k<hang>ch/gu147+ /class="tablet:pl-\(--hang\) tablet:-indent-\(--hang\) block" style="--hang:(?<hang>\d+)ch"/gu148 ),149 ].map((found) => Number(found.groups?.hang));150 151 describe(CommandLine, () => {19 unmodified lines171 // The words keep the command's own spaces between them.172 expect(textOf(<CommandLine command={command} />)).toContain(command);173 });174 175- it("hangs a line 6ch, less when its longest word would not fit beside the hang", () => {175+ it("hangs a line 6ch from tablet, less when its longest word would not fit beside the hang", () => {176 // `today` (5ch) beside a 6ch hang needs 11ch; the line is 9ch, so the177 // box hugging it would break the word in two. It never wraps, so its178 // hang never shows.179 expect(hangs(`${Brand.cli} today`)).toStrictEqual([4]);77 unmodified linesmodified:apps/web/test/theme-page.ts+2 added
119 unmodified lines120 for (const listener of stored) {121 listener({ key });122 }123 },124+ /** The system's own scheme, as the head script names it. */125+ system: () => root.system,126 theme: () => root.theme,127 /** The system turns the other way, as at sunset. */128 turnSystem: () => {129 scheme.matches = !scheme.matches;7 unmodified linesmodified:apps/web/test/theme.test.ts+12 added
142 unmodified lines143 expect(page.theme()).toBe("light");144 expect(page.shownColour()).toBe(themeColors.light);145 });146 147+ it("names the system's own scheme whatever the preference, as it turns", () => {148+ const page = themePage("light");149+150+ runHeadScript(page, storedAs("opposite"));151+152+ expect(page.system()).toBe("light");153+154+ page.turnSystem();155+156+ expect(page.system()).toBe("dark");157+ });158+159 it("follows a preference another tab writes", () => {160 const page = themePage("light");161 const storage = storedAs("same");162 60 unmodified linesmodified:DESIGN.md+2 added-2 removed
430 unmodified lines431 ### Project header and tabs432 433 - **Header:** the name (`owner / project`, the owner muted, both in the UI sans at Headline size), the posture (`PostureBadge`), the description (the README's first sentence), a facts row in UI type, muted (open asks, last landing, latest tag, licence if known, deciders), and three actions at the right: **Watch** (a popover: what already follows the project, this page and its events, plus `myr status --project` for your own claims and answers; the CLI has no watch command), **Clone** (a popover: the `git clone` URL, `myr claim <ask> --project`, and that forks come with a claim), **Contribute** (a popover: take an ask, propose an ask, read the policy). It never changes between tabs.434 - **Tabs:** Overview · Code · Asks · Landings · Proposals · People · Policy · Visibility, each a text tab with its count in label type; the current one ink at 500 with a 2 px ink underline (the one current-tab style of the whole web), the rest muted. The header and tabs stick under the top bar together; on a phone the tabs scroll sideways inside their own strip.435-- **Overview** (the default tab): open asks, recent landings and the README in the main column; the about column (`--column-about`) with clone, how a change lands (the seven stages), who decides, a visibility summary and languages.435+- **Overview** (the default tab): open asks, recent landings and the README in the main column (its headings a level down, so the project's name stays the page's one h1); the about column (`--column-about`) with clone, how a change lands (the seven stages), who decides, a visibility summary and languages.436 - **Code:** under the header, the code bar: a Files/Commits toggle, the ref switcher (`main`, tags, and answers in forks, ADR 0043), the HEAD commit, Go to file and Clone; then the file tree in `--column-tree` beside every page of the tab. The history of commits is the Code tab's; the Landings tab opens Overview's recent landings until it has a page of its own.437 - **Visibility:** posture, layers, held-back checks, the environment (once "Env shape") and the ledger, one tab.438 439 ### Cards138 unmodified lines578 - **The control:** two radios in a fieldset, each a plain bordered row with the choice, then the theme it gives, muted, at the right. The server cannot see the system, so it names no theme until the page is up.579 580 ### The platform's own pages581 582-Sign-in (with the MCP consent), sign-up, the Google handle page, the code, add-email and reset pages, the problem page and the platform's `/` load nothing (no script, no web font), so they carry the sage garden palette as hex literals in their inline style, copied from `apps/web/src/styles.css` for both schemes: paper, card, ink, surface, muted, rule, the 3:1 control border, primary with its on-primary text, refused only for a refusal, and waiting for the marked "Warning" line in the loopback case; `color-scheme: light dark`. Their faces are named as the web's are, IBM Plex Sans then the system sans at 16 px and IBM Plex Mono then the system mono, so Plex shows only where the reader has it installed. Every page but `/` is the focus shell: the wordmark as text from `@repo/brand` above one card with a hairline border and a 2 px radius, no edge accent, no navigation and no eyebrow, its h1 first. The consent names the client, its publisher when known, and the host that receives access; on sign-in and sign-up it also lists what the client may do as the person, and says it never sees the password. The platform's `/` keeps a plain document frame.582+Sign-in (with the MCP consent), sign-up, the Google handle page, the code, add-email and reset pages, the problem page and the platform's `/` load nothing (no script, no web font), so they carry the sage garden palette as hex literals in their inline style, copied from `apps/web/src/styles.css` for both schemes: paper, card, ink, surface, muted, rule, the 3:1 control border, primary with its on-primary text, refused only for a refusal, and waiting for the marked "Warning" line in the loopback case; `color-scheme: light dark`. Their faces are named as the web's are, IBM Plex Sans then the system sans at 16 px and IBM Plex Mono then the system mono, so Plex shows only where the reader has it installed. This is the one place the type is not the web's, kept by design and awaiting the maintainer's sign-off: loading Plex would mean a `font-src` in the pages' policy and about 60 KB of font inlined in every page the Worker sends. Every page but `/` is the focus shell: the wordmark as text from `@repo/brand` above one card with a hairline border and a 2 px radius, no edge accent, no navigation and no eyebrow, its h1 first. The consent names the client, its publisher when known, and the host that receives access; on sign-in and sign-up it also lists what the client may do as the person, and says it never sees the password. The platform's `/` keeps a plain document frame.583 584 ### shadcn585 586 shadcn 4.21.2, style `base-lyra` on Base UI, in `src/components/ui/` (generated, restyled to the tokens). The pages use its button, badge, table, textarea, tooltip, dialog and sheet, select, combobox, popover and skeleton. Overlays load after hydration in their own chunk.33 unmodified lines