Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| 4 | import { VISITOR_LINKS, projectPages, usesAppShell } from "./chrome.ts"; | |
| 5 | ||
| 6 | test("someone signed in always gets the sidebar", () => { | |
| 7 | for (const path of ["/", "/pricing", "/acme/web", "/explore", "/does/not/exist"]) { | |
| 8 | assert.equal(usesAppShell(path, true), true, path); | |
| 9 | } | |
| 10 | }); | |
| 11 | ||
| 12 | test("a visitor gets the sidebar on app pages", () => { | |
| 13 | for (const path of [ | |
| 14 | "/acme/web", | |
| 15 | "/acme/web/code", | |
| 16 | "/acme/web/issues/4", | |
| 17 | "/acme", | |
| 18 | "/nothing/here/at/all", | |
| 19 | ]) { | |
| 20 | assert.equal(usesAppShell(path, false), true, path); | |
| 21 | } | |
| 22 | }); | |
| 23 | ||
| 24 | test("a visitor gets the marketing frame on the front, pricing and sign-in pages", () => { | |
| Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036) | 25 | for (const path of ["/", "/pricing", "/pricing/", "/login", "/register", "/verify", "/confirm-email", "/forgot", "/reset", "/device", "/oauth/authorize"]) { |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 26 | assert.equal(usesAppShell(path, false), false, path); |
| 27 | } | |
| 28 | }); | |
| 29 | ||
| Chat controls, public profiles, shadcn selects, and no Docs tab in a project | 30 | test("a visitor reads profiles, Explore and Search in the public frame, with no sidebar", () => { |
| 31 | for (const path of ["/u/ada", "/u/ada/", "/explore", "/explore/", "/search"]) { | |
| 32 | assert.equal(usesAppShell(path, false), false, path); | |
| 33 | } | |
| 34 | // A workspace named like a page is still a workspace. | |
| 35 | assert.equal(usesAppShell("/u", false), true); | |
| 36 | assert.equal(usesAppShell("/explorers", false), true); | |
| 37 | }); | |
| 38 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 39 | test("a visitor reads the policies, security, support and status in the marketing frame", () => { |
| 40 | for (const path of ["/policies", "/policies/terms", "/policies/privacy/", "/security", "/support", "/status"]) { | |
| 41 | assert.equal(usesAppShell(path, false), false, path); | |
| 42 | } | |
| 43 | // A workspace's own security page is still the app's. | |
| 44 | assert.equal(usesAppShell("/acme/-/security", false), true); | |
| 45 | }); | |
| 46 | ||
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 47 | test("a visitor's sidebar offers Explore and Search", () => { |
| 48 | assert.deepEqual(VISITOR_LINKS.map((link) => link.to), ["/explore", "/search"]); | |
| 49 | }); | |
| 50 | ||
| 51 | test("a project's menu hides member-only pages from everyone else", () => { | |
| 52 | const visitor = projectPages(false); | |
| 53 | assert.deepEqual(visitor.slice(0, 5), ["code", "issues", "pulls", "agents", "actions"]); | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 54 | for (const page of ["security", "settings"] as const) { |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 55 | assert.ok(!visitor.includes(page), page); |
| 56 | assert.ok(projectPages(true).includes(page), page); | |
| 57 | } | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 58 | // Security needs push once the role is known: Read and Triage do not see it. |
| 59 | assert.ok(!projectPages(true, { push: false }).includes("security")); | |
| 60 | assert.ok(projectPages(true, { push: true }).includes("security")); | |
| 61 | // Anyone who can read a repository sees its deployments. | |
| 62 | assert.ok(visitor.includes("deployments") && projectPages(true).includes("deployments")); | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 63 | }); |
This file's history is long; its oldest lines are credited to the oldest commit read.