Public: anyone can read this; the crew can change it.

/apps at 390 px lists each app as one row: name, state word, crew activity in plain words #13080

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/13004-apps-at-390-px-lists-each-app-as-one-row → main 11 commits fork 2 threads · 2 unresolved

  • Merged. mason/13004-apps-at-390-px-lists-each-app-as-one-row was merged into main as e254aad.

Review

Sign in to review this change.
10 files changed +398 −25
docs/features/README.md +1
@@ -190,6 +190,7 @@ Read with the guide page [Ship and undo](../guide-ship-and-undo.md).
190190 Read with the guide page [Your apps](../guide-your-apps.md).
191191
192192 - [An app refused an outside host says so in the forge's words](app-egress-refused.md)
193 - [What the crew is doing, as one sentence per app](apps-crew-sentence.md)
193194 - [A child forge's own source](own-source.md)
194195 - [A forge that runs its own code](own-code.md)
195196 - [Absorb, reviewed from several angles](absorb-review.md)
docs/features/apps-crew-sentence.md added +13
@@ -0,0 +1,13 @@
1 # What the crew is doing, as one sentence per app
2
3 On `/apps` each app's row says what the crew is doing in plain words, under its name, and the terminal says the same in **What the crew is doing** (Ctrl-K, `src/tui/screens/apps_crew.ts`). Both come from `crewLine` (`src/web/studio/crew_line.ts`) through `shelfRows` (`src/web/studio/shelf.ts`), so they cannot disagree.
4
5 > Alice is working on Add the login page
6
7 - **Words**: working, a change ready for a look, shipped, a problem, waiting. A row with none of these keeps its own line ("quiet — tell the crew something").
8 - **Who and what** are named only to someone who may direct the crew on that app (the same gate as the crew and its cost). Anyone else reads "The crew is working", with no name and no title. A sealed issue's title is shown only to those who may see it (`mayView`).
9 - A name starts with a capital. A title longer than 60 characters is cut with an ellipsis in the row; the whole title is in the row's `title` attribute.
10 - It is opt-in per page (`sentence` in `shelfRows`'s reads); Home's *Your apps* and an organisation's apps keep the bare word.
11 - The terminal reads the sentence through `onSentence`, one call per row, from the same single batched read of titles.
12
13 Tests: `test/apps-crew-sentence.test.ts`.
src/tui/screens/apps_crew.ts added +96
@@ -0,0 +1,96 @@
1 /**
2 * What the crew is doing on each app, in the terminal: the sentence under each
3 * app's name on /apps ("Alice is working on Add the login page"), from the same
4 * `crewLine` and the same gates as the web (`shelfRows`'s `onSentence`) — who and
5 * what it is about only where the viewer may know. Enter opens the About card.
6 */
7
8 import { appsForRepos } from "../../core/apps.ts";
9 import { listReposVisibleTo, type Repo } from "../../core/repos.ts";
10 import { shelfRows } from "../../web/studio/shelf.ts";
11 import type { Ctx, Screen } from "../app/app.ts";
12 import { binding } from "../app/keys.ts";
13 import type { Session } from "../session.ts";
14 import { fill, len, split } from "../ui/layout.ts";
15 import { style } from "../term/style.ts";
16 import { truncate } from "../term/width.ts";
17 import { emptyState } from "../ui/widgets.ts";
18 import { aboutScreen } from "./about.ts";
19 import { ListState, drawList, type ListRow } from "./common.ts";
20 import type { PaletteEntry } from "./entries.ts";
21 import { local } from "./where.ts";
22
23 interface CrewRow {
24 readonly repo: Repo;
25 /** The sentence, or "" when the app has nothing moving to say. */
26 readonly says: string;
27 }
28
29 /** Every app the viewer may see, newest first, each with its sentence. */
30 export async function crewRows(f: Session): Promise<CrewRow[]> {
31 const visible = listReposVisibleTo(f.db, f.user, { limit: 200, withoutArchived: true });
32 const withApp = appsForRepos(f.db, visible.map((r) => r.id));
33 const repos = visible.filter((r) => withApp.has(r.id));
34 const says = new Map<string, string>();
35 const url = new URL("http://forge.local/apps");
36 await shelfRows(
37 {
38 app: f.app,
39 request: new Request(url.href),
40 url,
41 params: {},
42 auth: { user: f.user, scope: undefined, via: f.user === undefined ? ("none" as const) : ("session" as const) },
43 theme: undefined,
44 },
45 repos,
46 { onSentence: (id, sentence) => says.set(id, sentence) },
47 );
48 return repos.map((repo) => ({ repo, says: says.get(repo.id) ?? "" }));
49 }
50
51 export function appsCrewScreen(f: Session, ctx: Ctx): Screen {
52 const state = new ListState();
53 let rows: CrewRow[] | undefined;
54 void crewRows(f).then((r) => {
55 rows = r;
56 ctx.invalidate();
57 });
58 const screen: Screen = {
59 title: "What the crew is doing",
60 keys: [binding(["j", "k"], "move cursor"), binding(["enter"], "about")],
61 render(area, s) {
62 const c = ctx.theme.c;
63 const [head, body] = split(area, "v", [len(1), fill(1)]);
64 if (rows === undefined) return;
65 if (rows.length === 0) {
66 emptyState(s, body!, c, { title: "No apps yet." });
67 return;
68 }
69 s.text(head!.x, head!.y, truncate("enter opens the app", head!.w), style(c.mutedFg, c.bg), head!.x + head!.w);
70 const list: ListRow[] = rows.map((r) => ({
71 title: r.repo.name,
72 secondary: r.says === "" ? "quiet" : r.says,
73 }));
74 drawList(s, body!, c, state, list);
75 },
76 key(e) {
77 if (rows === undefined) return false;
78 if (state.key(e, rows.length)) return true;
79 if (e.ctrl || e.alt || e.key !== "enter") return false;
80 const row = rows[state.index];
81 if (row === undefined) return false;
82 ctx.push(aboutScreen(f, ctx, screen, local(f, row.repo), undefined, ""));
83 return true;
84 },
85 };
86 return screen;
87 }
88
89 /** The sentence under each app on /apps, as a list. */
90 export const entry: PaletteEntry = {
91 id: "apps-crew",
92 title: "What the crew is doing",
93 hint: "one plain sentence per app: who is on what",
94 offered: () => true,
95 run: (session, ctx) => ctx.push(appsCrewScreen(session, ctx)),
96 };
src/tui/screens/entries.ts +5 −1
@@ -13,6 +13,7 @@ import { entry as accountAccess } from "./account_access.ts";
1313 import { entry as agents } from "./agents.ts";
1414 import { entry as askData } from "./ask_data.ts";
1515 import { entry as archived } from "./archived.ts";
16 import { entry as appsCrew } from "./apps_crew.ts";
1617 import { entry as audit } from "./audit.ts";
1718 import { entry as appTemplates } from "./app_templates.ts";
1819 import { entry as dotfiles } from "./dotfiles.ts";
@@ -186,6 +187,7 @@ export const ENTRIES: readonly PaletteEntry[] = [
186187 orgGrants,
187188 agents,
188189 archived,
190 appsCrew,
189191 invites,
190192 billingLinks,
191193 planRow,
@@ -225,7 +227,9 @@ export const ENTRIES: readonly PaletteEntry[] = [
225227 newIssue,
226228 ];
227229
228 /** Put each entry the session is offered into `commands`, after the command it names or at the end. */
230 /**
231 * Put each entry the session is offered into `commands`, after the command it names or at the end.
232 */
229233 export function addEntries(commands: Command[], session: Session, ctx: Ctx): void {
230234 const placed = new Map<string, number>();
231235 for (const e of ENTRIES) {
src/web/pages/apps.ts +8 −3
@@ -236,7 +236,7 @@ export async function appsList(ctx: Ctx): Promise<Response> {
236236 shelfRows(
237237 ctx,
238238 shown.map((e) => e.repo),
239 { firstPreview: firstPreviews(ctx.app.db, shown.map((e) => e.record)), under: wake },
239 { firstPreview: firstPreviews(ctx.app.db, shown.map((e) => e.record)), under: wake, sentence: true },

Both doors: the terminal's apps screen needs the same sentence, and the how-to belongs in docs/features/<name>.md with a row in docs/features/README.md.

240240 ),
241241 );
242242 const cost = timePhase(ctx.request, "cost", () =>
@@ -731,14 +731,19 @@ export function previewSection(
731731 </section>`;
732732 }
733733
734 /** How loud a preview reads: danger when it failed or errs, attn when only its last deploy failed. */
734 /**
735 * How loud a preview reads: danger when it failed or errs, attn when only its last deploy failed.
736 */
735737 export function envTone(env: EnvStatus): "danger" | "attn" | undefined {
736738 if (env.state === "failed" || env.error !== undefined) return "danger";
737739 if (env.failedDeploy !== undefined) return "attn";
738740 return undefined;
739741 }
740742
741 /** Where this pull's preview stands, with the way in: a plain block under an h2, the home page's language. */
743 /**
744 * Where this pull's preview stands, with the way in: a plain block under an h2, the home page's
745 * language.
746 */
742747 export function previewBlock(ctx: Ctx, repo: Repo, pull: Pull): Html {
743748 const view = appView(ctx.app, ctx.auth.user, repo);
744749 if (!view.ok) return html``;
src/web/studio/crew_line.ts added +45
@@ -0,0 +1,45 @@
1 /**
2 * What the crew is doing on an app, in a sentence a client with no technical
3 * background can read: "Ada is working on the login page". Pure: a studio
4 * word, who (when the viewer may know), and what it is about (when the viewer
5 * may know) go in; plain text comes out, or undefined for a word that has no
6 * plain sentence and keeps the row's own. It names none of the words a
7 * stranger is never shown (`STRANGER_NEVER_SEES`). A name starts with a
8 * capital, so a username reads as a name, not a typo. A title cut to fit a row
9 * is shown whole in the row's title attribute (`shelfRows`).
10 */
11

Principle 8 and cleanliness: this comment promises a title attribute that nothing sets. Set it on the row's strong, or remove the claim. Truncating to 60 characters with no way to read the rest is a phone problem.

12 import type { Word } from "./words.ts";
13
14 /** A title short enough to sit in one row. */
15 const MAX_ABOUT = 60;
16
17 function tidy(about: string | undefined): string | undefined {
18 const text = (about ?? "").replace(/\s+/g, " ").trim();
19 if (text === "") return undefined;
20 return text.length <= MAX_ABOUT ? text : `${text.slice(0, MAX_ABOUT - 1).trimEnd()}…`;
21 }
22
23 /** The sentence for one app's row; undefined when the word has none. */
24 export function crewLine(
25 word: Word,
26 who: string | undefined,
27 about: string | undefined,
28 ): string | undefined {
29 const subject = who === undefined ? "The crew" : `${who.slice(0, 1).toUpperCase()}${who.slice(1)}`;
30 const on = tidy(about);
31 switch (word) {
32 case "working":
33 return on === undefined ? `${subject} is working` : `${subject} is working on ${on}`;
34 case "look":
35 return on === undefined ? `${subject} has a change ready for you` : `${on} is ready for a look`;
36 case "shipped":
37 return on === undefined ? `${subject} shipped a change` : `${subject} shipped ${on}`;
38 case "stopped":
39 return on === undefined ? `${subject} hit a problem` : `${subject} hit a problem with ${on}`;
40 case "waiting":
41 return on === undefined ? `${subject} is waiting` : `${on} is waiting`;
42 default:
43 return undefined;
44 }
45 }
src/web/studio/shelf.ts +55 −16
@@ -28,7 +28,9 @@ import { spanWords } from "../../apps/golden_path.ts";
2828 import { appsRuntime, type EnvStatus } from "../../apps/runtime.ts";
2929 import { appsForRepos, type AppRecord } from "../../core/apps.ts";
3030 import { reposWithBuilder } from "../../core/agents.ts";
31 import { reposWithUnclaimedTell } from "../../core/issues.ts";
31 import { getIssuesByIds, reposWithUnclaimedTell } from "../../core/issues.ts";
32 import { mayView } from "../../core/sealed.ts";
33 import { crewLine } from "./crew_line.ts";
3234 import { openPullsForRepos } from "../../core/pulls.ts";
3335 import { notePhase } from "../../core/route_timing.ts";
3436 import { enterableApps, ownerFactRepoIds, type Repo } from "../../core/repos.ts";
@@ -67,6 +69,11 @@ export interface ShelfReads {
6769 readonly firstPreview?: ReadonlyMap<string, number> | undefined;
6870 /** Something to hang under a row, by repo id (the archived list's Wake). */
6971 readonly under?: ReadonlyMap<string, Html> | undefined;
72 /** Say what the crew is doing as a sentence ("Ada is working on the
73 * login page") where the row would give the bare word. The /apps list. */
74 readonly sentence?: boolean | undefined;
75 /** Hear each row's sentence by repo id (the terminal's screen); implies `sentence`. */
76 readonly onSentence?: ((repoId: string, sentence: string) => void) | undefined;
7077 }
7178
7279 /**
@@ -231,6 +238,20 @@ export async function shelfRows(
231238 (id) => !withBuilder.has(id),
232239 ),
233240 );
241 // What each moving thing is about, for the sentence: one read for the
242 // whole shelf, and only when the page asks for sentences.
243 const wantsSentence = reads.sentence === true || reads.onSentence !== undefined;
244 const abouts = wantsSentence
245 ? getIssuesByIds(
246 db,
247 [
248 ...[...latestRuns.values()].flatMap((r) =>
249 r.issueId === null ? [] : [r.issueId],
250 ),
251 ...[...openPulls.values()].map((p) => p.id),
252 ],
253 )
254 : new Map();
234255 lap("pulls");
235256
236257 const rows = await Promise.all(
@@ -313,24 +334,42 @@ export async function shelfRows(
313334 // see this app is never invited to it, the same floor `ownerFacts` holds
314335 // for who worked and what it cost.
315336 const canTell = ownerFacts.has(repo.id);
337 const aboutIssue = useOpenPull
338 ? abouts.get(openPull.id)
339 : latest?.issueId == null
340 ? undefined
341 : abouts.get(latest.issueId);
342 const about =
343 canTell && aboutIssue !== undefined && mayView(db, repo, aboutIssue, user)
344 ? aboutIssue.title
345 : undefined;
346 const sentence =
347 wantsSentence && word !== undefined
348 ? crewLine(word.word, who, about)
349 : undefined;
350 if (sentence !== undefined) reads.onSentence?.(repo.id, sentence);
351 // When this moved last: an open change's own update, production's fact,
352 // or the run's end. Only read for a row that has a word.
353 const movedAt = (): string =>
354 useOpenPull
355 ? openPull.updatedAt
356 : useDeployFact
357 ? deployFact!.at
358 : latest!.finishedAt ?? latest!.createdAt;
359 const quiet = stuck.has(repo.id)
360 ? html`<span class="muted">open — ${NOBODY_ON_CREW} to take it</span>`
361 : canTell
362 ? html`<span class="muted">quiet — tell the crew something</span>`
363 : html`<span class="muted">quiet</span>`;
316364 const happening =
317365 word === undefined
318 ? stuck.has(repo.id)
319 ? html`<span class="muted"
320 >open — ${NOBODY_ON_CREW} to take it</span
321 >`
322 : canTell
323 ? html`<span class="muted">quiet — tell the crew something</span>`
324 : html`<span class="muted">quiet</span>`
325 : html`<strong data-word="${word.word}">${word.word}</strong>
366 ? quiet
367 : sentence !== undefined
368 ? html`<strong data-word="${word.word}" title="${about ?? sentence}">${sentence}</strong>
369 ${word.word === "working" ? null : html`· ${time(movedAt())}`}`
370 : html`<strong data-word="${word.word}">${word.word}</strong>
326371 ${who ? html`· ${who}` : null}
327 ${word.word === "working"
328 ? html`· now`
329 : useOpenPull
330 ? html`· ${time(openPull.updatedAt)}`
331 : useDeployFact
332 ? html`· ${time(deployFact!.at)}`
333 : html`· ${time(latest!.finishedAt ?? latest!.createdAt)}`}`;
372 ${word.word === "working" ? html`· now` : html`· ${time(movedAt())}`}`;
334373 // Two apps can share a bare name across owners — a row for one that is
335374 // not the viewer's own names its owner, everywhere a row can appear.
336375 const mine = user !== undefined && repo.ownerId === user.id;
test/apps-crew-sentence.test.ts added +159
@@ -0,0 +1,159 @@
1 /**
2 * /apps says what the crew is doing as a plain sentence per app (#13004):
3 * "Ada is working on Add the login page", no technical words.
4 */
5 import { afterAll, beforeAll, expect, test } from "bun:test";
6 import { mkdtempSync, rmSync } from "node:fs";
7 import { tmpdir } from "node:os";
8 import { join } from "node:path";
9 import { createApp, type App } from "../src/app.ts";
10 import { enableApp } from "../src/actions/apps.ts";
11 import { createRepo } from "../src/actions/repos.ts";
12 import { createIssue } from "../src/core/issues.ts";
13 import { claimRun, createRun, finishRun } from "../src/core/runs.ts";
14 import { createUser, getUserByName, type User } from "../src/core/users.ts";
15 import type { Repo } from "../src/core/repos.ts";
16 import type { Ctx } from "../src/http/context.ts";
17 import { STRANGER_NEVER_SEES } from "../src/design/first_five_minutes.ts";
18 import { crewLine } from "../src/web/studio/crew_line.ts";
19 import { crewRows } from "../src/tui/screens/apps_crew.ts";
20 import type { Session } from "../src/tui/session.ts";
21 import { shelfRows } from "../src/web/studio/shelf.ts";
22 import { quietLogs } from "./helpers/globals.ts";
23 import { proveAll } from "./helpers/verified.ts";
24
25 quietLogs();
26
27 let root = "";
28 let app: App;
29 let alice: User;
30 let repo: Repo;
31
32 const ctx = (): Ctx => ({
33 app,
34 request: new Request("http://forge.test/apps"),
35 url: new URL("http://forge.test/apps"),
36 params: {},
37 auth: { user: alice, scope: undefined, via: "session" },
38 theme: undefined,
39 });
40
41 beforeAll(async () => {
42 root = mkdtempSync(join(tmpdir(), "forge-crew-sentence-"));
43 app = createApp({ dataDir: root, port: 0 });
44 const u = await createUser(app.db, {
45 origin: "seed", trusted: true, username: "alice", email: "[email protected]",
46 password: "a-good-passphrase", adminIfFirst: true,
47 });
48 if (!u.ok) throw new Error(u.error);
49 alice = u.value;
50 proveAll(app);
51 const made = await createRepo(app, alice, { name: "shop", visibility: "public" });
52 if (!made.ok) throw new Error(String(made.error));
53 repo = made.value;
54 const enabled = enableApp(app, alice, repo, { slug: "shop" });
55 if (!enabled.ok) throw new Error(String(enabled.error));
56 const issue = createIssue(app.db, { repoId: repo.id, authorId: alice.id, title: "Add the login page", kind: "issue" });
57 if (!issue.ok) throw new Error(issue.error);
58 const run = createRun(app.db, { repoId: repo.id, kind: "agent", reason: "tell", issueId: issue.value.id, actorId: alice.id });
59 claimRun(app.db, run.id);
60 });
61 afterAll(() => {
62 app.close();
63 rmSync(root, { recursive: true, force: true });
64 });
65
66 const text = (h: { text: string }): string => h.text.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ");
67
68 test("a row for a moving app says who is doing what, in words", async () => {
69 const [plain] = await shelfRows(ctx(), [repo], { sentence: true });
70 expect(text(plain!)).toContain("Alice is working on Add the login page");
71 // Without the opt-in the shelf is what it always was.
72 const [bare] = await shelfRows(ctx(), [repo]);
73 expect(text(bare!)).not.toContain("is working on");
74 });
75
76 test("a reader who cannot direct the crew is not told what it is about", async () => {
77 const bob = await createUser(app.db, { origin: "seed", trusted: true, username: "bob", email: "[email protected]", password: "a-good-passphrase" });
78 if (!bob.ok) throw new Error(bob.error);
79 const c = { ...ctx(), auth: { user: bob.value, scope: undefined, via: "session" as const } };
80 const [row] = await shelfRows(c, [repo], { sentence: true });
81 expect(text(row!)).not.toContain("login page");
82 expect(text(row!)).toContain("The crew is working");
83 });
84
85 test("every sentence is free of the words a stranger never sees", () => {
86 const banned = new RegExp(`\\b(${STRANGER_NEVER_SEES.join("|")})`, "i");
87 for (const word of ["working", "look", "shipped", "stopped", "waiting"] as const)
88 for (const who of [undefined, "ada"])
89 for (const about of [undefined, "the login page"]) {
90 const line = crewLine(word, who, about);
91 expect(line).toBeDefined();
92 expect(banned.test(line!)).toBe(false);
93 }
94 expect(crewLine("silent", "ada", "x")).toBeUndefined();
95 expect(crewLine("working", "ada", "x".repeat(200))!.length).toBeLessThan(90);
96 });
97
98 /** A new app on the shelf with one pull written straight into the database, as shelf-forty does. */
99 async function appWithPull(name: string, title: string, sealed: boolean): Promise<Repo> {
100 const made = await createRepo(app, alice, { name, visibility: "public" });
101 if (!made.ok) throw new Error(String(made.error));
102 const enabled = enableApp(app, alice, made.value, { slug: name });
103 if (!enabled.ok) throw new Error(String(enabled.error));
104 const issue = createIssue(app.db, { repoId: made.value.id, authorId: alice.id, title, kind: "pull", sealed });
105 if (!issue.ok) throw new Error(issue.error);
106 app.db
107 .query("INSERT INTO pull (issue_id, base_branch, head_branch, base_oid, head_oid, head_repo_id) VALUES (?1, 'main', 'work', ?2, ?3, ?4)")
108 .run(issue.value.id, "0".repeat(40), "1".repeat(40), made.value.id);
109 return made.value;
110 }
111
112 test("an open change reads by its title as waiting, to the one who directs the crew", async () => {
113 const r = await appWithPull("menu", "Fix the menu", false);
114 const [row] = await shelfRows(ctx(), [r], { sentence: true });
115 expect(text(row!)).toContain("Fix the menu is waiting");
116 // The whole title rides in the title attribute, for a phone where the row cuts it.
117 expect(row!.text).toContain('title="Fix the menu"');
118 });
119
120 test("a sealed change's title is never shown to a reader, and a reader is not told who", async () => {
121 const r = await appWithPull("vault", "Close the hole in login", true);
122 const bob = await createUser(app.db, { origin: "seed", trusted: true, username: "carol", email: "[email protected]", password: "a-good-passphrase" });
123 if (!bob.ok) throw new Error(bob.error);
124 const c = { ...ctx(), auth: { user: bob.value, scope: undefined, via: "session" as const } };
125 const [row] = await shelfRows(c, [r], { sentence: true });
126 expect(row!.text).not.toContain("hole");
127 expect(row!.text).not.toContain("Alice");
128 // Signed out too.
129 const anon = { ...ctx(), auth: { user: undefined, scope: undefined, via: "none" as const } };
130 const [seen] = await shelfRows(anon, [r], { sentence: true });
131 expect(seen!.text).not.toContain("hole");
132 });
133
134 test("a run that failed reads as a problem with its title", async () => {
135 const made = await createRepo(app, alice, { name: "broken", visibility: "public" });
136 if (!made.ok) throw new Error(String(made.error));
137 const enabled = enableApp(app, alice, made.value, { slug: "broken" });
138 if (!enabled.ok) throw new Error(String(enabled.error));
139 const issue = createIssue(app.db, { repoId: made.value.id, authorId: alice.id, title: "Add search", kind: "issue" });
140 if (!issue.ok) throw new Error(issue.error);
141 const run = createRun(app.db, { repoId: made.value.id, kind: "agent", reason: "tell", issueId: issue.value.id, actorId: alice.id });
142 claimRun(app.db, run.id);
143 finishRun(app.db, run.id, { state: "failed", summary: "boom" });
144 const [row] = await shelfRows(ctx(), [made.value], { sentence: true });
145 expect(text(row!)).toContain("Alice hit a problem with Add search");
146 });
147
148 test("the terminal says the same sentence, from the same gates", async () => {
149 const f = { app, db: app.db, user: alice } as unknown as Session;
150 const rows = await crewRows(f);
151 const shop = rows.find((r) => r.repo.name === "shop")!;
152 expect(shop.says).toBe("Alice is working on Add the login page");
153 const vault = rows.find((r) => r.repo.name === "vault")!;
154 expect(vault.says).toContain("Close the hole in login");
155 const carol = getUserByName(app.db, "carol")!;
156 const theirs = await crewRows({ app, db: app.db, user: carol } as unknown as Session);
157 expect(theirs.find((r) => r.repo.name === "shop")!.says).toBe("The crew is working");
158 expect(theirs.map((r) => r.says).join(" ")).not.toContain("hole");
159 });
test/palette-roster.test.ts +6 −1
@@ -193,6 +193,7 @@ test("a site-admin person is offered the whole roster", () => {
193193 ["lapsed", "Lapsed forges", "forges asleep until paid, when their data goes, pay again"],
194194 ["codes", "Gift codes", "make a code that gives a plan for free, and revoke one"],
195195 ["archived", "Archived repositories", "put away, not gone: open one or restore it"],
196 ["apps-crew", "What the crew is doing", "one plain sentence per app: who is on what"],
196197 ["cloud", "Cloud accounts", "provider tokens, what they are used for, today's calls"],
197198 ["pinned", "Pinned forges", "deploy, update and roll back a forge on your cloud"],
198199 ["bets", "Bets", "back, stop and finish a repository\'s bets"],
@@ -289,6 +290,7 @@ test("a site-admin agent is offered the roster without the person-only entries",
289290 ["traffic-sources", "Traffic sources", "where people come from and where they go, for the forge"],
290291 ["audit", "Who can do what", "each app's doors from its contract.json: yes, own or no"],
291292 ["archived", "Archived repositories", "put away, not gone: open one or restore it"],
293 ["apps-crew", "What the crew is doing", "one plain sentence per app: who is on what"],
292294 ["plan-row", "Plan", "this forge's plan, and where its owner manages billing"],
293295 ["cloud", "Cloud accounts", "provider tokens, what they are used for, today's calls"],
294296 ["pinned", "Pinned forges", "deploy, update and roll back a forge on your cloud"],
@@ -383,6 +385,7 @@ test("a member person is offered the signed-in roster without the admin entries"
383385 ["health-voice", "Health — spoken", "how the forge is, in two plain sentences"],
384386 ["audit", "Who can do what", "each app's doors from its contract.json: yes, own or no"],
385387 ["archived", "Archived repositories", "put away, not gone: open one or restore it"],
388 ["apps-crew", "What the crew is doing", "one plain sentence per app: who is on what"],
386389 ["claim-start", "Take an agent's work", "claim the repositories an agent started, from its one-time link"],
387390 ["claim-link", "A fresh claim link for a forge I sent", "the old link stops; shown once"],
388391 ["bulk", "Bulk actions", "your last bulk actions; u undoes one inside its day"],
@@ -442,6 +445,7 @@ test("signed out, the palette offers sign-in and the public entries", () => {
442445 ["bugs", "Bugs", "open bugs and the bug clock"],
443446 ["health-voice", "Health — spoken", "how the forge is, in two plain sentences"],
444447 ["audit", "Who can do what", "each app's doors from its contract.json: yes, own or no"],
448 ["apps-crew", "What the crew is doing", "one plain sentence per app: who is on what"],
445449 ["front", "Front page", "the apps a first visitor sees, ranked; an admin pins or hides"],
446450 ["origin-ahead", "New commits upstream", "mirrors whose origin has moved on: take them"],
447451 ["front-milestones", "Milestones", "the biggest open milestones: how far, what landed this week"],
@@ -539,7 +543,8 @@ describe("on a pull's Files step the palette lists what the page offers this rea
539543 for (const [tab, path] of [["Conversation", thread], ["Files", `${thread}/files`]] as const) {
540544 test(`on the ${tab} tab a ${who}'s action rows are exactly the page's forms`, async () => {
541545 const { rows, forms } = await read(path, kind());
542 // The Files tab has no comment form of its own: its Comment row links to the Conversation's.
546 // The Files tab has no comment form of its own: its Comment row links to the
547 // Conversation's.
543548 const acts = rows.map((r) => r.t).filter((t) => !READING.includes(t) && !(tab === "Files" && t === "Comment"));
544549 const same = (t: string) => (t === "Bring up to date" ? "Ship" : t);
545550 expect(acts.map(same).sort()).toEqual([...new Set(forms)].sort());
test/studio-shipping.test.ts +10 −4
@@ -305,10 +305,10 @@ describe("a stranger sees the app, not the owner's books", () => {
305305
306306 test("the studio home names the crew for the owner, but only 'the crew' for a signed-in reader of the same public app", async () => {
307307 const asStranger = await (await get("/apps", strangerCookie)).text();
308 expect(asStranger).not.toContain("keeper");
308 expect(asStranger.toLowerCase()).not.toContain("keeper");
309309 expect(asStranger).toContain("beacon");
310310 const asOwner = await (await get("/apps", ownerCookie)).text();
311 expect(asOwner).toContain("keeper");
311 expect(asOwner.toLowerCase()).toContain("keeper");
312312 expect(asOwner).toContain("beacon");
313313 });
314314
@@ -1206,7 +1206,10 @@ describe("previewLatency: the median seconds from push to serving", () => {
12061206 app.db.query("DELETE FROM run WHERE repo_id = ?1").run(repo.id);
12071207 });
12081208
1209 /** A deploy run stamped with a known push instant and, unless null, known started/serving instants. */
1209 /**
1210 * A deploy run stamped with a known push instant and, unless null, known started/serving
1211 * instants.
1212 */
12101213 const seedDeploy = (
12111214 createdAt: string,
12121215 startedAt: string | null,
@@ -1523,7 +1526,10 @@ describe("the studio's own words for how fast a change reaches its preview", ()
15231526 redirect: "manual",
15241527 });
15251528
1526 /** A deploy run stamped with a known push instant and serving instant, and unless null a known started instant. */
1529 /**
1530 * A deploy run stamped with a known push instant and serving instant, and unless null a known
1531 * started instant.
1532 */
15271533 const seedDeploy = (
15281534 createdAt: string,
15291535 startedAt: string | null,

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs