Merge web/simplify-landing into main
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by oscabriel · committed by oscabriel · parents 6b698bc, 455a8da · Browse files · 7 files·+30 added−125 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
7 files+30 added−125 removed
- tests:+10 added−23 removed
- other:+20 added−102 removed
Provenance
- Commit
6e2833d- Tree
9358a72- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent 1
6b698bc- Parent 2
455a8da
7 files changed+30 added−125 removed
modified:apps/web/src/features/landing/music-box/music-box.tsx+1 added-4 removed
369 unmodified lines370 {REST_POSE.readout}371 </span>372 </div>373 </div>374- <figcaption className="flex flex-col gap-3">374+ <figcaption>375 <dl className="tablet:grid-cols-2 columns:grid-cols-3 grid gap-x-8 gap-y-2.5">376 {KEYS.map((key) => (377 <div className="text-ui" data-key={key.word} key={key.word}>378 <dt className="inline font-medium">3 unmodified lines382 <dd className="text-muted-foreground inline">{key.part}</dd>383 </div>384 ))}385 </dl>386- <p className="text-ui text-muted-foreground max-w-(--measure)">387- {FIGURE.caption}388- </p>386 </figcaption>387 </figure>388 );389 };modified:apps/web/src/features/landing/music-box/words.ts-2 removed
12345456761 unmodified lines/** The music box's card and legend: what each part stands for, in GLOSSARY.md's words. */
export const FIGURE = { caption: "Everything on main is public, under glass. A project states each change it wants as a tooth that plays sour; anyone can claim it and push an answer. The gate checks every answer, cheapest stage first: a refused answer drops into that stage's tray with its reason, and one that passes every stage is pinned by the press, which alone writes the cylinder.", fig: "Fig 1", hint: "Click or press Space for the next step", label: "A cylinder music box under an open glass lid, with a seven-stage gate along its front. The ask is a comb tooth that plays sour. A first answer, a strip of pins, is refused at the second stage and drops into its tray with a printed slip; a second passes all seven, and the press turns it onto the cylinder while a tape prints its credit. Arrow keys step through the story.",61 unmodified linesmodified:apps/web/src/features/landing/gate-drawing.tsx+2 added-3 removed
106 unmodified linesExpand all10710810911011111211311111211311411511612 unmodified lines106 unmodified linesExpand all <div className="flex flex-col gap-8"> <figure className="flex flex-col gap-4"> <Stages /> <figcaption className="text-ui text-muted-foreground max-w-(--measure)"> The seven bridges of Fig 1, in order, cheapest first. The first stage that fails refuses the answer, with every reason that stage found; an answer that passes them all lands on main. Cheapest first: the first stage that fails refuses the answer with every reason it found, and one that passes all seven lands on main. </figcaption> </figure> <div className="columns:grid-cols-2 grid gap-5"> <Output12 unmodified linesmodified:apps/web/src/features/landing/landing-page.tsx+4 added-71 removed
1 import { installCommand } from "@repo/agent-kit/install";2 import type { ReactNode } from "react";3 4 import { buttonVariants } from "../../components/ui/button.tsx";5-import { ID, LINK } from "../shared/classes.ts";5+import { LINK } from "../shared/classes.ts";6 import { CommandLine } from "../shared/command.tsx";7 import { AppLink } from "../shared/link.tsx";8 import {9 ASKS_PATH,10 EXPLORE_PATH,11 IMPORT_PATH,12- INSTALL_PATH,12 LANDING_NOW_ANCHOR,13 TOUR_PATH,14 } from "../shared/paths.ts";15 import { GUTTER } from "../shared/shell/gutter.ts";1 unmodified line17 import { LandingNowList } from "./landing-now-list.tsx";18 import type { LandingNow } from "./landing-now.ts";19 import { MusicBox } from "./music-box/music-box.tsx";20 import { WaysIn } from "./ways-in.tsx";22-import { CONCURRENCY, HEADLINE, HERO_LEDE, RUN_A_PROJECT } from "./words.ts";21+import { HEADLINE, HERO_LEDE, RUN_A_PROJECT } from "./words.ts";22 23 /** The page's main action, a size up from a toolbar's button. */24 const PRIMARY = buttonVariants({25 className: "text-want h-11 px-6 no-underline",6 unmodified lines32 size: "lg",33 variant: "outline",34 });35 37-const Code = ({ children }: { readonly children: ReactNode }) => (38- <code className={ID}>{children}</code>39-);40-36 const MAIN = "main";37 38 /** The headline's two sentences, one line each from `tablet`: the want, then the gate. */39 const Headline = () => {60 unmodified lines100 {children}101 </AppLink>102 );103 109-interface Noun {110- readonly noun: string;111- readonly means: ReactNode;112-}113-114-/** GLOSSARY.md's definitions, word for word. */115-const NOUNS: readonly Noun[] = [116- {117- means: (118- <>119- A file on <Code>main</Code> in which a project states one change it120- wants: a behavioural want, a territory, and a check that fails on{" "}121- <Code>main</Code>.122- </>123- ),124- noun: "Ask",125- },126- {127- means: "A commit in a claimant's fork offered to satisfy one ask.",128- noun: "Answer",129- },130- {131- means:132- "The predicate that judges an answer: the ask's own check plus the project's checks, run by the platform on the exact merged tree.",133- noun: "Check",134- },135- {136- means:137- "One or more members of the closed, typed union the platform returns instead of landing, all from the cheapest failing stage, each with a reason, a reproducing command, a next step, and whether retrying can help.",138- noun: "Refusal",139- },140-];141-142-const Nouns = () => (143- <dl className="tablet:grid-cols-2 columns:grid-cols-4 grid gap-x-8 gap-y-6">144- {NOUNS.map(({ means, noun }) => (145- <div146- className="border-rule flex flex-col gap-1.5 border-t pt-4"147- data-noun={noun.toLowerCase()}148- key={noun}149- >150- <dt className="text-title">{noun}</dt>151- <dd className="text-ui text-muted-foreground">{means}</dd>152- </div>153- ))}154- </dl>155-);156-104 export const LandingView = ({105 landings,106 platformUrl,107 webUrl,6 unmodified lines114 className="flex min-w-0 flex-1 flex-col pb-8 outline-none"115 id="main"116 tabIndex={-1}117 >171- {/* The hero: the headline and its lede centred between the rails, the two ways in under them, then Fig 1 across the frame. */}118+ {/* The hero: the headline and its one lede centred between the rails, the two ways in under them, then Fig 1 across the frame. */}119 <div120 className={`tablet:pt-20 flex flex-col items-center gap-12 pt-12 pb-16 ${GUTTER}`}121 data-hero=""122 >3 unmodified lines126 </h1>127 <p className="text-lede text-muted-foreground max-w-(--measure-lede) text-pretty">128 <WithMain text={HERO_LEDE} />129 </p>183- <p184- className="text-ui text-muted-foreground max-w-(--measure-lede) text-pretty"185- data-concurrency=""186- >187- <WithMain text={CONCURRENCY} />188- </p>130 </div>131 <div className="flex max-w-full flex-col items-center gap-4">132 <div className="flex max-w-full flex-wrap justify-center gap-3">133 <AppLink className={PRIMARY} data-action="asks" to={ASKS_PATH}>18 unmodified lines152 <Part id="gate" title="The gate">153 <GateDrawing platformUrl={platformUrl} />154 </Part>155 215- <Part id="nouns" title="Four words">216- <Nouns />217- </Part>218-156 <Part157 aside={<More to={EXPLORE_PATH}>Explore projects</More>}158 id={LANDING_NOW_ANCHOR}159 title="Landing now"160 >161 <LandingNowList landings={landings} />162 </Part>163 227- <Part228- aside={<More to={INSTALL_PATH}>All the ways in</More>}229- id="ways-in"230- title="Every way in"231- >164+ <Part id="ways-in" title="Every way in">165 <WaysIn platformUrl={platformUrl} webUrl={webUrl} />166 </Part>167 </main>168 );modified:apps/web/src/features/landing/ways-in.tsx+13 added-18 removed
2 unmodified lines3 import { commands } from "../agents/catalog.ts";4 import { AppLink } from "../shared/link.tsx";5 import { INSTALL_PATH } from "../shared/paths.ts";6 7-/** Every way in that works today, each a link to its place on the Install page. */7+/** Every way in that works today, by name and audience, each a link to its place on the Install page, which says the rest. */8 export const WaysIn = ({9 platformUrl,10 webUrl,11 }: {1 unmodified line13 readonly webUrl: string;14 }) => (15 <ul className="tablet:grid-cols-2 columns:grid-cols-3 grid gap-x-8 gap-y-6">16 {installChannels({ commands, platformUrl, webUrl }).map(17- ({ audience, id, summary, title }) => (17+ ({ audience, id, title }) => (18 <li19- className="border-rule flex min-w-0 flex-col gap-1.5 border-t pt-4"19+ className="border-rule flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 border-t pt-4"20 data-way={id}21 key={id}22 >23- <div className="flex flex-wrap items-baseline gap-x-3 gap-y-1">24- <h3 className="text-title">25- <AppLink26- className="no-underline hover:underline"27- hash={id}28- to={INSTALL_PATH}29- >30- {title}31- </AppLink>32- </h3>33- <p className="text-label text-muted-foreground ml-auto">23+ <h3 className="text-title">24+ <AppLink25+ className="no-underline hover:underline"26+ hash={id}27+ to={INSTALL_PATH}28+ >29+ {title}30+ </AppLink>31+ </h3>32+ <p className="text-label text-muted-foreground ml-auto">{audience}</p>34- {audience}35- </p>36- </div>37- <p className="text-ui text-muted-foreground">{summary}</p>33 </li>34 )35 )}36 </ul>1 unmodified linemodified:apps/web/src/features/landing/words.ts-4 removed
7 unmodified lines8 /** The hero's lede: what the gate does, in three sentences. */9 export const HERO_LEDE =10 "A project writes the changes it wants as asks, each with a check that fails on main today. Anyone, person or agent, can claim one and push an answer. The gate lands it, or tells git exactly why not.";11 12-/** The hero's line on many agents at once, under the lede. */13-export const CONCURRENCY =14- "Many agents answer at once, each in a fork of its own, and main moves by one landing at a time.";15-12 /** The maintainer's way in, as the hero, Explore and the footer name it. */13 export const RUN_A_PROJECT = "Run a project: bring a repo";14 15 /** The README's lede, the page's description where it unfurls. */2 unmodified linesmodified:apps/web/test/landing.test.tsx+10 added-23 removed
203 unmodified lines204 })205 );206 207 it.effect(208- "says under the lede that many agents answer at once while main moves one landing at a time, and that the merge stage merges again when main moves",208+ "keeps the hero to its headline, one lede and its actions, and lets the merge stage say it merges again when main moves",209 () =>210 Effect.gen(function* () {211 const main = mainOf(yield* pageWith(landed));212 const hero = main.slice(0, main.indexOf('data-figure="music-box"'));1 unmodified line214 215 const merge =216 /<li\b[^>]*data-stage="merge"[\s\S]*?<\/li>/u.exec(gate)?.[0] ?? "";217 218- expect(textIn(hero)).toContain(219- "Many agents answer at once, each in a fork of its own, and main moves by one landing at a time."220- );218+ expect(hero.match(/<p\b/gu)).toHaveLength(1);219 expect(textIn(merge)).toContain("merged again when main moves");220 })221 );222 225- it.effect("names the four words as GLOSSARY.md defines them", () =>226- Effect.gen(function* () {227- const markup = yield* pageWith(landed);228- const words = ["Ask", "Answer", "Check", "Refusal"];229-230- expect(231- [...markup.matchAll(/data-noun="(?<noun>[^"]+)"/gu)].map(232- (found) => found.groups?.noun233- )234- ).toStrictEqual(["ask", "answer", "check", "refusal"]);235- expect(236- words.filter(237- (word) => !textIn(markup).includes(defined(word) ?? `(${word})`)238- )239- ).toStrictEqual([]);240- })241- );242-223 it.effect(224 "links to every way in, to the projects, and to the tour under the hero's action",225 () =>226 Effect.gen(function* () {227 const main = mainOf(yield* pageWith(landed));228 const hrefs = hrefsOf(main);229 const hero = main.slice(0, main.indexOf('data-figure="music-box"'));230 251- expect(hrefs).toContain("/install");231+ const ways = [...main.matchAll(/data-way="(?<way>[^"]+)"/gu)].map(232+ (found) => found.groups?.way233+ );234+235+ expect(ways.length).toBeGreaterThan(0);236+ expect(237+ ways.filter((way) => !hrefs.includes(`/install#${way}`))238+ ).toStrictEqual([]);239 expect(hrefs).toContain("/explore");240 expect(hrefsOf(hero)).toStrictEqual(["/asks", "/import", "/tour"]);241 expect(textIn(hero)).toContain("Take the tour");242 })295 unmodified lines