From 545de89a811ce8e596a0a561d44baa88ccb3d04e Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Mon, 26 Oct 2026 14:35:16 -0400 Subject: [PATCH 1/2] Hybrid linking: plain words for the new results and the Link confirmation The hosted side now asks people to confirm a GitHub link on a page that names the install, and refuses a link for three new reasons. The dashboard and the docs install guide say each one in a sentence with what to do next: no_write_access (the person can push to nothing in that installation), declined (they chose Cancel) and install_off (the install isn't verified and active). Both places that send people to GitHub say CoderHelm will show the install's address and ask them to press Link. e2e at 1440 and 390. docs/platform.lock.json moves to the platform commit with the hybrid threat model, so the docs site publishes it. --- dashboard/e2e/hybrid.spec.ts | 25 +++++++++++++++++++++ dashboard/src/components/hybrid-section.tsx | 2 +- dashboard/src/lib/hybrid.ts | 15 +++++++++++++ docs/components/install/wizard.tsx | 2 +- docs/e2e/install.spec.ts | 22 ++++++++++++++++++ docs/lib/install/core.ts | 3 +++ docs/platform.lock.json | 2 +- 7 files changed, 68 insertions(+), 3 deletions(-) diff --git a/dashboard/e2e/hybrid.spec.ts b/dashboard/e2e/hybrid.spec.ts index 4f8893dc..73fb7f0e 100644 --- a/dashboard/e2e/hybrid.spec.ts +++ b/dashboard/e2e/hybrid.spec.ts @@ -256,6 +256,9 @@ for (const [outcome, words, tone] of [ ["linked_elsewhere", "already linked to another install", "error"], ["used_by_hosted_team", "used by a team on Coderhelm's hosted service", "error"], ["signin_failed", "didn't confirm who you are", "error"], + ["no_write_access", "can't push to any repository", "error"], + ["declined", "you chose Cancel", "error"], + ["install_off", "verified and active", "error"], ] as const) { test(`GitHub sent back ${outcome}: one sentence and the fix, and the address is cleaned`, async ({ page }) => { await setup(page, SELF, { registered: true, verified: true, mode: "hosted" }); @@ -403,6 +406,28 @@ test("hosted: any other OAuth callback (404 from the hand-off) finishes as befor expect(calls.filter((c) => c.path === "/hybrid/oauth/callback")).toHaveLength(1); }); +for (const [label, viewport] of [["1440", { width: 1440, height: 1000 }], ["390", { width: 390, height: 844 }]] as const) { + test(`linking refusals read plainly and fit at ${label}, and the install step names the Link confirmation`, async ({ page }) => { + await page.setViewportSize(viewport); + await setup(page, SELF, { registered: true, verified: true, mode: "hosted" }); + await page.goto("/settings/system/#hybrid"); + await expect(page.getByTestId("hybrid-github")).toContainText("press Link"); + await expect(page.getByTestId("hybrid-github")).toContainText("only the repositories you can push to"); + for (const [outcome, title, fix] of [ + ["no_write_access", "can't push to any repository in that installation", "get write access on GitHub"], + ["declined", "you chose Cancel on Coderhelm's confirmation page", "choose Link"], + ["install_off", "verified and active, so nothing was linked", "Press Check again"], + ] as const) { + await page.goto(`/settings/system/?hybrid_github=${outcome}#hybrid`); + const box = page.getByTestId("hybrid-github-outcome"); + await expect(box).toHaveAttribute("data-outcome", outcome); + await expect(box).toContainText(title); + await expect(box).toContainText(fix); + expect(await page.evaluate(() => document.scrollingElement!.scrollWidth <= window.innerWidth)).toBe(true); + } + }); +} + test("on a phone the Hybrid section fits", async ({ page }) => { await page.setViewportSize({ width: 390, height: 844 }); await setup(page, SELF, { registered: true, verified: true, mode: "hosted", links: [{ installation_id: 77, account: "example-org", repositories: ["example-org/web", "example-org/api"] }], name: { name: "example-org", hostname: "example-org.coderhelm.com", code: "ok" } }); diff --git a/dashboard/src/components/hybrid-section.tsx b/dashboard/src/components/hybrid-section.tsx index 8be1cff0..5d0d17d1 100644 --- a/dashboard/src/components/hybrid-section.tsx +++ b/dashboard/src/components/hybrid-section.tsx @@ -511,7 +511,7 @@ function GithubRow({ hybrid, s }: RowProps) {
{s.github.links.length === 0 ? (
-

Install Coderhelm's app on the GitHub account or organization that owns your repositories. GitHub brings you back here.

+

Install Coderhelm's app on the GitHub account or organization that owns your repositories. Coderhelm then shows which install it is about to link: check that the address is this one and press Link. Tokens reach only the repositories you can push to.