Skip to content
Myr

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

7 files+30 added−125 removed

modified:apps/web/src/features/landing/music-box/music-box.tsx+1 added-4 removed
369 unmodified lines
370 {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 lines
382 <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
modified:apps/web/src/features/landing/gate-drawing.tsx+2 added-3 removed
modified:apps/web/src/features/landing/landing-page.tsx+4 added-71 removed
1import { installCommand } from "@repo/agent-kit/install";2import type { ReactNode } from "react";34import { buttonVariants } from "../../components/ui/button.tsx";5import { ID, LINK } from "../shared/classes.ts";5import { LINK } from "../shared/classes.ts";6import { CommandLine } from "../shared/command.tsx";7import { AppLink } from "../shared/link.tsx";8import {9 ASKS_PATH,10 EXPLORE_PATH,11 IMPORT_PATH,12 INSTALL_PATH,12 LANDING_NOW_ANCHOR,13 TOUR_PATH,14} from "../shared/paths.ts";15import { GUTTER } from "../shared/shell/gutter.ts";
1 unmodified line
17import { LandingNowList } from "./landing-now-list.tsx";18import type { LandingNow } from "./landing-now.ts";19import { MusicBox } from "./music-box/music-box.tsx";20import { WaysIn } from "./ways-in.tsx";22import { CONCURRENCY, HEADLINE, HERO_LEDE, RUN_A_PROJECT } from "./words.ts";21import { HEADLINE, HERO_LEDE, RUN_A_PROJECT } from "./words.ts";2223/** The page's main action, a size up from a toolbar's button. */24const PRIMARY = buttonVariants({25 className: "text-want h-11 px-6 no-underline",
6 unmodified lines
32 size: "lg",33 variant: "outline",34});3537const Code = ({ children }: { readonly children: ReactNode }) => (38 <code className={ID}>{children}</code>39);4036const MAIN = "main";3738/** The headline's two sentences, one line each from `tablet`: the want, then the gate. */39const Headline = () => {
60 unmodified lines
100 {children}101 </AppLink>102);103109interface Noun {110 readonly noun: string;111 readonly means: ReactNode;112}113114/** GLOSSARY.md's definitions, word for word. */115const 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];141142const 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);156104export const LandingView = ({105 landings,106 platformUrl,107 webUrl,
6 unmodified lines
114 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 lines
126 </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 lines
152 <Part id="gate" title="The gate">153 <GateDrawing platformUrl={platformUrl} />154 </Part>155215 <Part id="nouns" title="Four words">216 <Nouns />217 </Part>218156 <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>163227 <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 lines
3import { commands } from "../agents/catalog.ts";4import { AppLink } from "../shared/link.tsx";5import { INSTALL_PATH } from "../shared/paths.ts";67/** 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. */8export const WaysIn = ({9 platformUrl,10 webUrl,11}: {
1 unmodified line
13 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 line
modified:apps/web/src/features/landing/words.ts-4 removed
7 unmodified lines
8/** The hero's lede: what the gate does, in three sentences. */9export 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.";1112/** The hero's line on many agents at once, under the lede. */13export const CONCURRENCY =14 "Many agents answer at once, each in a fork of its own, and main moves by one landing at a time.";1512/** The maintainer's way in, as the hero, Explore and the footer name it. */13export const RUN_A_PROJECT = "Run a project: bring a repo";1415/** The README's lede, the page's description where it unfurls. */
2 unmodified lines
modified:apps/web/test/landing.test.tsx+10 added-23 removed
203 unmodified lines
204 })205 );206207 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 line
214215 const merge =216 /<li\b[^>]*data-stage="merge"[\s\S]*?<\/li>/u.exec(gate)?.[0] ?? "";217218 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 );222225 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"];229230 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 );242223 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"'));230251 expect(hrefs).toContain("/install");231 const ways = [...main.matchAll(/data-way="(?<way>[^"]+)"/gu)].map(232 (found) => found.groups?.way233 );234235 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