Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions dashboard/e2e/landing-shots-prs.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { expect, test } from "@playwright/test";
import { capture, prepare, SHOTS_DIR } from "./landing-shots-kit";
import { mockOverview } from "./prs-overview-mock";
import { hideDevOverlay, mockInbox, skipLanding } from "./inbox-data";

// The Pull requests pages, and the same list and a merge on a phone, for
// coderhelm.com, from the same made up data as prs.spec.ts,
// prs-overview.spec.ts and phone-inbox.spec.ts (team Acme, invented people).
// Only runs with LANDING_SHOTS_DIR set (see landing-shots-kit.ts).

test.skip(!SHOTS_DIR, "LANDING_SHOTS_DIR not set");
test.beforeEach(({ page }) => prepare(page));

test.describe("desktop", () => {
test.use({ deviceScaleFactor: 2, viewport: { width: 1280, height: 800 } });

// Wide enough for the list and the open pull request side by side.
test("prs: grouped by whose turn it is, one open beside the list", async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 });
await mockOverview(page, "normal");
await page.goto("/prs?org=acme&pr=acme%2Fweb%23212");
await expect(page.getByTestId("pr-row").first()).toBeVisible();
await expect(page.getByRole("region", { name: "Path to merge" })).toBeVisible();
await capture(page, "prs");
});

test("prs-overview: the written summary of the org's pull requests", async ({ page }) => {
await mockOverview(page, "normal");
await page.goto("/prs/overview?org=acme");
await expect(page.getByTestId("overview-summary")).toBeVisible();
// The page title and the summary, under the tabs.
await page.getByRole("heading", { level: 1 }).scrollIntoViewIfNeeded();
await page.evaluate(() => window.scrollTo(0, 0));
await capture(page, "prs-overview");
});
});

test.describe("phone", () => {
test.use({ deviceScaleFactor: 2, viewport: { width: 375, height: 812 } });

test("phone-prs: the Pull requests list above the bottom bar", async ({ page }) => {
await mockOverview(page, "normal");
await skipLanding(page);
await page.goto("/prs?org=acme");
await expect(page.getByTestId("pr-row").first()).toBeVisible();
await expect(page.getByTestId("phone-bar")).toBeVisible();
await capture(page, "phone-prs");
});

test("phone-merge: merging a pull request from the phone", async ({ page }) => {
await mockInbox(page);
await hideDevOverlay(page);
await skipLanding(page);
await page.goto("/inbox/pr?repo=acme%2Fweb&number=812&run=run_m1");
await expect(page.getByTestId("pr-verdict")).toContainText("Approved");
await page.getByTestId("pr-actions").getByRole("button", { name: "Merge" }).click();
await expect(page.getByRole("dialog", { name: "Merge #812?" })).toBeVisible();
await capture(page, "phone-merge");
});
});
15 changes: 13 additions & 2 deletions dashboard/scripts/home-shots.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

SIDEBAR = 504 # px at 2x: the dashboard's left menu

# site name: (raw file, crop) where crop is None for the full window, or
# "main" for the content area beside the menu, at 16:10.
# site name: (raw file, crop) where crop is None for the full window,
# "main" for the content area beside the menu, at 16:10, or "phone" for a
# whole phone screen, kept at its own width (750 at 2x).
JOBS = {
"hero": ("run.png", None),
"hero-main": ("run.png", "main"), # the hero on phones, without the menu
Expand All @@ -24,6 +25,10 @@
"release": ("release.png", "main"),
"chat": ("chat.png", ("main", 270)),
"app-map": ("app-map.png", None),
"prs": ("prs.png", "main"),
"prs-overview": ("prs-overview.png", "main"),
"phone-prs": ("phone-prs.png", "phone"),
"phone-merge": ("phone-merge.png", "phone"),
}

only = set(sys.argv[3:])
Expand All @@ -35,6 +40,12 @@
print(f"{name}: missing {src}")
continue
im = Image.open(p).convert("RGB")
if crop == "phone":
im.save(out / f"{name}-{im.width}.webp", "WEBP", quality=82, method=6)
im.save(out / f"{name}-{im.width}.avif", "AVIF", quality=60, speed=4)
im.quantize(colors=256, method=Image.Quantize.MEDIANCUT, dither=Image.Dither.NONE).save(out / f"{name}.png", optimize=True)
print(f"{name}: width {im.width} height {im.height}")
continue
if crop:
top = crop[1] if isinstance(crop, tuple) else 0
w = im.width - SIDEBAR
Expand Down
5 changes: 4 additions & 1 deletion docs/components/home.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link';
import type { ReactNode } from 'react';
import { BookOpen, Bot, Cloud, Code, KeyRound, MessagesSquare, Server, ShieldCheck, Sparkles, Wrench } from 'lucide-react';
import { BookOpen, Bot, ChartColumn, Cloud, Code, GitPullRequest, KeyRound, MessagesSquare, Server, ShieldCheck, Smartphone, Sparkles, Wrench } from 'lucide-react';

// The docs home: three paths (use it, self-host it, build on it), then the
// newest features and the topics. The text stays in the MDX, so the page's
Expand All @@ -9,9 +9,12 @@ import { BookOpen, Bot, Cloud, Code, KeyRound, MessagesSquare, Server, ShieldChe
const ICONS = {
bot: Bot,
book: BookOpen,
chart: ChartColumn,
cloud: Cloud,
code: Code,
key: KeyRound,
phone: Smartphone,
pr: GitPullRequest,
chat: MessagesSquare,
server: Server,
shield: ShieldCheck,
Expand Down
1 change: 1 addition & 0 deletions docs/content/docs/getting-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Open **Runs** in the dashboard. The run moves through Triage, Plan, Build, Test,
## Next steps

- [Connect Atlassian](/getting-started/atlassian) to start runs from Jira tickets and read Confluence pages.
- Open [Pull requests](/getting-started/pull-requests) to see every open pull request by whose turn it is, and its [overview](/getting-started/pull-requests-overview) for how your org's pull requests are moving. On a phone, you can [answer, approve and merge](/concepts/phone) from the same dashboard.
- Turn on the [PR reviewer](/getting-started/reviewer) for your team's own pull requests, or let [Setup](/getting-started/setup) recommend its settings for each repository.
- Turn on [security fixes](/getting-started/security-fixes) for the advisories your code reaches, [infrastructure vulnerabilities](/getting-started/infrastructure-vulnerabilities) for what you run on AWS, and [stale pull requests](/getting-started/stale-pull-requests) to close the ones nobody is working on.
- Add a [knowledge base](/concepts/knowledge) so Chat and the agents can search your specs and runbooks.
Expand Down
12 changes: 12 additions & 0 deletions docs/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ CoderHelm is an engineering platform for teams on GitHub and Jira. Assign it an
- [Connect Atlassian (Jira and Confluence)](/getting-started/atlassian)
- [Set up repos](/getting-started/setup)
- [Your first run](/getting-started/first-run)
- [Pull requests](/getting-started/pull-requests)
- [Pull requests overview](/getting-started/pull-requests-overview)
- [Turn on the reviewer](/getting-started/reviewer)
- [Security fixes](/getting-started/security-fixes)
- [Infrastructure vulnerabilities](/getting-started/infrastructure-vulnerabilities)
Expand Down Expand Up @@ -48,6 +50,16 @@ Releases are published on [GitHub](https://github.com/CoderHelm/coderhelm-platfo
## New in CoderHelm

<Tiles>
{/* TODO(for-you): add a "For you" tile first when it ships (dashboard #547, platform #990). It covers the phone too, so the phone tile below then points to it. */}
<Tile title="Pull requests overview" href="/getting-started/pull-requests-overview" icon="chart" badge="new">
A written summary of all your org's pull requests: what went stale, what failed, whether review happened and what needs attention, measured against your org's own history.
</Tile>
<Tile title="Pull requests" href="/getting-started/pull-requests" icon="pr" badge="new">
Every open pull request grouped by whose turn it is, with what each needs and from whom, its path to merge, saved views and keyboard shortcuts.
</Tile>
<Tile title="On your phone" href="/concepts/phone" icon="phone" badge="new">
Answer CoderHelm's questions, approve and merge, or hand a failing check back to CoderHelm, from the bottom bar.
</Tile>
<Tile title="Set up repos" href="/getting-started/setup" icon="wrench" badge="new">
Do it for me reads each repository and turns on what fits, with the reason for each. Your settings stay, and any change can be undone.
</Tile>
Expand Down
21 changes: 21 additions & 0 deletions e2e/landing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ for (const width of widths) {
const headings = await page.locator("main h2").allTextContents();
expect(headings).toEqual([
"What the platform does",
"Every open pull request, and whose turn it is",
"From ticket to pull request",
"An example pull request",
"After the pull request opens",
Expand Down Expand Up @@ -72,6 +73,26 @@ test("each part of the platform has its own screenshot, sized and lazy", async (
}
});

test("every open pull request: the overview, the list and the phone, each linked to its docs", async ({ page }) => {
await page.goto("/");
const s = page.locator("#pull-requests");
await expect(s.locator("h3")).toHaveText(["Pull requests overview", "Pull requests list", "From your phone"]);
await expect(s.getByRole("link", { name: "Pull requests overview" })).toHaveAttribute("href", "https://docs.coderhelm.com/getting-started/pull-requests-overview/");
await expect(s.getByRole("link", { name: "Pull requests list" })).toHaveAttribute("href", "https://docs.coderhelm.com/getting-started/pull-requests/");
await expect(s.getByRole("link", { name: "From your phone" })).toHaveAttribute("href", "https://docs.coderhelm.com/concepts/phone/");
// Two desktop screens and two phone screens, each described and loading.
const imgs = s.locator("img");
await expect(imgs).toHaveCount(4);
for (const img of await imgs.all()) {
expect((await img.getAttribute("alt"))?.length ?? 0).toBeGreaterThan(30);
await expect(img).toHaveAttribute("loading", "lazy");
await img.scrollIntoViewIfNeeded();
await expect.poll(() => img.evaluate((el) => (el as HTMLImageElement).naturalWidth)).toBeGreaterThan(0);
}
// The phone's Inbox is not named on the page.
expect(await s.innerText()).not.toMatch(/\bInbox\b/);
});

test("every section shares one container width", async ({ page }) => {
await page.setViewportSize({ width: 1440, height: 900 });
await page.goto("/");
Expand Down
Binary file added public/shots/home/phone-merge-750.avif
Binary file not shown.
Binary file added public/shots/home/phone-merge-750.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/phone-merge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/phone-prs-750.avif
Binary file not shown.
Binary file added public/shots/home/phone-prs-750.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/phone-prs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/prs-1280.avif
Binary file not shown.
Binary file added public/shots/home/prs-1280.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/prs-2400.avif
Binary file not shown.
Binary file added public/shots/home/prs-2400.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/prs-overview-1280.avif
Binary file not shown.
Binary file added public/shots/home/prs-overview-1280.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/prs-overview-2400.avif
Binary file not shown.
Binary file added public/shots/home/prs-overview-2400.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/prs-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/shots/home/prs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 72 additions & 9 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,7 @@ function Platform() {
<ProductShot id={p.shot} sizes="(min-width: 1152px) 540px, (min-width: 768px) 46vw, calc(100vw - 2rem)" />
</div>
)}
<h3 className="mt-6 text-[18px] font-semibold text-text-primary">
{p.href ? (
<GoLink href={p.href} className="underline decoration-text-muted/40 underline-offset-[6px] hover:decoration-text-primary">
{p.title}
</GoLink>
) : (
p.title
)}
</h3>
<PartTitle title={p.title} href={p.href} />
<p className="mt-2 max-w-lg text-[16px] leading-relaxed text-text-secondary">
<Inline text={p.text} />
</p>
Expand All @@ -126,6 +118,76 @@ function Platform() {
);
}

// The title of a part, a link when it has its own page.
function PartTitle({ title, href }: { title: string; href?: string }) {
return (
<h3 className="mt-6 text-[18px] font-semibold text-text-primary">
{href ? (
<GoLink href={href} className="underline decoration-text-muted/40 underline-offset-[6px] hover:decoration-text-primary">
{title}
</GoLink>
) : (
title
)}
</h3>
);
}

// Every open pull request: the overview and the list as two screens, then the
// phone as its own row, its words beside two phone screens.
function PullRequests() {
const s = section("pull-requests");
const intro = first(s, "p");
const parts = first(s, "cards").items;
const wide = parts.filter((p) => !p.also);
const phone = parts.find((p) => p.also);
return (
<section id={s.id} aria-labelledby={`${s.id}-h`} className="scroll-mt-20 border-t border-line">
<div className={`${wrap} py-20 lg:py-28`}>
<H2 s={s} className="max-w-3xl" />
<p className="mt-6 max-w-2xl text-[17px] leading-relaxed text-text-secondary">
<Inline text={intro.text} />
</p>
<ul className="mt-12 grid gap-x-10 gap-y-14 md:grid-cols-2 lg:gap-x-12 lg:gap-y-16">
{wide.map((p) => (
<li key={p.title} className="flex min-w-0 flex-col">
{p.shot && (
<div className={frame}>
<ProductShot id={p.shot} sizes="(min-width: 1152px) 540px, (min-width: 768px) 46vw, calc(100vw - 2rem)" />
</div>
)}
<PartTitle title={p.title} href={p.href} />
<p className="mt-2 max-w-lg text-[16px] leading-relaxed text-text-secondary">
<Inline text={p.text} />
</p>
</li>
))}
</ul>
{phone && (
<div className="mt-14 grid items-center gap-8 border-t border-line pt-14 md:grid-cols-[1fr_1.25fr] lg:mt-16 lg:gap-12 lg:pt-16">
<div className="max-w-md md:order-2">
<PartTitle title={phone.title} href={phone.href} />
<p className="mt-2 text-[16px] leading-relaxed text-text-secondary">
<Inline text={phone.text} />
</p>
</div>
<div className="grid max-w-[34rem] grid-cols-2 gap-4 sm:gap-6 md:order-1">
{[phone.shot, phone.also].map(
(id) =>
id && (
<div key={id} className={`${frame} rounded-[1.25rem]`}>
<ProductShot id={id} sizes="(min-width: 768px) 260px, calc(50vw - 1.5rem)" />
</div>
),
)}
</div>
</div>
)}
</div>
</section>
);
}

// Heading on the left, the four steps as a plain numbered list on the right.
function HowItWorks() {
const s = section("how-it-works");
Expand Down Expand Up @@ -287,6 +349,7 @@ export default function Home() {
<Shell page={page}>
<Hero />
<Platform />
<PullRequests />
<HowItWorks />
<ARealOne />
<AfterThePullRequest />
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductShot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function ProductShot({ id, sizes, priority = false, className = "" }: { i
const s = SHOTS[id];
const img = s.desktop;
const base = img.src.replace(/\.png$/, "");
const set = (ext: string) => `${base}-1280.${ext} 1280w, ${base}-2400.${ext} ${s.large ?? 2400}w`;
const set = (ext: string) => (s.only ? `${base}-${s.only}.${ext} ${s.only}w` : `${base}-1280.${ext} 1280w, ${base}-2400.${ext} ${s.large ?? 2400}w`);
// Phones get a crop without the dashboard's menu, so the words stay readable.
const phoneBase = s.phone?.src.replace(/\.png$/, "");
const phoneSet = (ext: string) => `${phoneBase}-1280.${ext} 1280w`;
Expand Down
10 changes: 9 additions & 1 deletion src/content/shots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ type Img = { src: string; width: number; height: number };
// e2e/landing-shots-*.spec.ts, made by dashboard/scripts/home-shots.py into `<name>.png`
// (1280 wide), `<name>-1280.{avif,webp}` and `<name>-2400.{avif,webp}`, the
// larger one `large` pixels wide. Cropped ones leave out the dashboard's menu.
type Shot = { alt: string; desktop: Img; phone?: Img; large?: number };
// `only` is a picture made at one width alone (`<name>-<only>.{avif,webp}`),
// as the phone screens are.
type Shot = { alt: string; desktop: Img; phone?: Img; large?: number; only?: number };

const phoneScreen = (name: string, alt: string): Shot => ({ alt, only: 750, desktop: { src: `/shots/home/${name}.png`, width: 750, height: 1624 } });

const home = (name: string, alt: string, large = 2056): Shot => ({ alt, large, desktop: { src: `/shots/home/${name}.png`, width: 1280, height: 800 } });

Expand Down Expand Up @@ -58,5 +62,9 @@ export const SHOTS: Record<ShotId, Shot> = {
homeAlert: home("alert", "A checkout 5xx incident in acme/api on the Logs page: its cause, a payments timeout lowered to 2 seconds, the checks CoderHelm ran, and fix pull request #482 waiting for a person's review."),
homeRelease: home("release", "The Releases page with acme/api v3.8.0 open: published to GitHub, Confluence and email, and its release notes listing five pull requests."),
homeChat: home("chat", "CoderHelm Chat answering how checkout talks to the payments service in four numbered steps, each citing a file, above the list of cited source files from acme/web and acme/api."),
homePrs: home("prs", "The Pull requests list for team Acme, grouped by whose turn it is: two waiting on you, each with one sentence on what it needs, and acme/web #212 open beside the list, where CoderHelm is fixing a failing lint check, above its path to merge."),
homePrsOverview: home("prs-overview", "The Pull requests overview for team Acme: Healthy, 38 merged in the usual range and a shorter median time to merge, tiles for stale, failures and reviewed, and three pull requests that need attention, each with an owner and an age."),
homePhonePrs: phoneScreen("phone-prs", "The Pull requests list on a phone, grouped by whose turn it is, above the bottom bar that keeps runs, pull requests and Chat in reach."),
homePhoneMerge: phoneScreen("phone-merge", "Merging acme/web #812 from a phone: a sheet that says the checks pass and nothing blocks it, with Merge on GitHub."),
homeAppMap: home("app-map", "The App map of an online store: the website, API, payments service, background jobs, data stores and outside services as cards joined by lines, with its journeys and screens listed beside them.", 2400),
};
19 changes: 19 additions & 0 deletions src/content/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,25 @@ const home: Page = {
},
],
},
{
id: "pull-requests",
heading: "Every open pull request, and whose turn it is",
blocks: [
{
type: "p",
text: "People's, bots' and CoderHelm's, in every repository it is installed on. Each one says what it needs next and from whom.",
},
{
type: "cards",
items: [
{ title: "Pull requests overview", text: "A written summary of your org's pull requests: what went stale, what failed, whether review happened, and what needs attention, with an owner and an age for each. Waits are compared with your org's own history, not someone else's.", href: `${SITE.docsUrl}/getting-started/pull-requests-overview/`, shot: "homePrsOverview" },
{ title: "Pull requests list", text: "Every open pull request grouped by whose turn it is, with one sentence on what it needs and from whom. Open one for its path to merge, where its time went and its timeline. Saved views and keyboard shortcuts keep it quick.", href: `${SITE.docsUrl}/getting-started/pull-requests/`, shot: "homePrs" },
{ title: "From your phone", text: "Answer CoderHelm's questions, approve and merge from your phone, or hand a failing check back to CoderHelm. The bottom bar keeps runs, pull requests and Chat in reach.", href: `${SITE.docsUrl}/concepts/phone/`, shot: "homePhonePrs", also: "homePhoneMerge" },
// TODO(for-you): add the "For you" card here when it ships (dashboard #547, platform #990). It covers the desktop and the phone, so the phone card above then points to it.
],
},
],
},
{
id: "how-it-works",
heading: "From ticket to pull request",
Expand Down
10 changes: 8 additions & 2 deletions src/content/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export type ShotId =
| "homeAlert"
| "homeRelease"
| "homeChat"
| "homeAppMap";
| "homeAppMap"
| "homePrs"
| "homePrsOverview"
// Phone screens, kept at their own width (750 at 2x) with no crop.
| "homePhonePrs"
| "homePhoneMerge";

// A real pull request CoderHelm opened in a public repository, quoted word
// for word: the review thread and the commits, with links to check them.
Expand All @@ -55,7 +60,8 @@ export type Block =
| { type: "p"; text: string }
| { type: "list"; items: string[] }
| { type: "steps"; items: { title: string; text: string }[] }
| { type: "cards"; items: { title: string; text: string; href?: string; shot?: ShotId }[] }
// `also` is a second picture shown beside `shot`, such as two phone screens.
| { type: "cards"; items: { title: string; text: string; href?: string; shot?: ShotId; also?: ShotId }[] }
| { type: "faq"; items: { q: string; a: string }[] }
| { type: "table"; head: string[]; rows: string[][] }
| { type: "pr"; pr: PullRequest }
Expand Down
Loading