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

After a person's first ask, their forge's home leads with their app and the ask box, not with "Make your everyday account" #13808

Merged opened this in answer to

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

Merged

scout/forge:scout/13791-after-a-person-s-first-ask-their-forge-s → main 6 commits fork 3 threads · 3 unresolved

  • Merged. scout/13791-after-a-person-s-first-ask-their-forge-s was merged into main as 8839e6b.

Review

Sign in to review this change.
12 files changed +102 −149
docs/features/README.md +1
@@ -93,6 +93,7 @@ Read with the guide page [Your first app in five minutes](../guide-first-app.md)
9393 - [Start: an agent builds with only the forge's URL](start.md)
9494 - [The account screen of a forge you just started](welcome.md)
9595 - [The line about a sent forge's first screen](first-screen-line.md)
96 - [Home after the first ask](home-after-first-ask.md)
9697 - [Where a new app stands](onboarding-line.md)
9798
9899 ### Tell the crew
docs/features/home-after-first-ask.md added +8
@@ -0,0 +1,8 @@
1 # Home after the first ask
2
3 Once a person's first ask exists, their forge's home leads with what they made, not with account chores (#13791).
4
5 - **Web** (`src/web/studio/home.ts`, `src/web/pages/next-steps.ts`): the ask's state, a row per app a crew member is on, then the ask box (`composer`), the apps list, the crew-key card, any held-gate line, and last `everydayLine`: one muted sentence, a link to `/settings/everyday` and a post-form button "Keep using admin". An app nobody is on has no row above; the apps list carries it.
6 - **The everyday line** shows only for the admin, after the first ask, while the everyday step is not done (account made, or kept as admin). Not for anyone else, and not once done.
7 - **Terminal** (`src/tui/screens/dashboard.ts`, `loadClientLines`): already in this order, and has no everyday offer on either side of the first ask: the ask's status line, then one line per app with its crew's sentence, and `t` asks for something. Nothing changed there; `test/tui-first-tell.test.ts` holds it.
8 - Tests: `test/next-steps-card.test.ts`, `test/first-login.test.ts`, `test/tui-first-tell.test.ts`.
src/web/pages/next-steps.ts +20 −63
@@ -22,26 +22,12 @@ import { hasPassword, type User } from "../../core/users.ts";
2222 import { passkeyIds } from "../../core/passkeys.ts";
2323 import type { Ctx } from "../../http/context.ts";
2424 import { html, type Html } from "../html.ts";
25 import { icon } from "../icons.ts";
26 import { badge, btn, row } from "../ui.ts";
27 import { EVERYDAY_WHY } from "../../core/everyday.ts";
25 import { btn, row } from "../ui.ts";
2826 import { askRepos, askStatus, type AskStatus } from "../../core/ask-status.ts";
2927 import { crewCanRun, crewFirstLine } from "../studio/crew_key.ts";
3028 import { NEW_APP_TARGET } from "../studio/feed.ts";
3129 import { COMPOSER_FIELDS, TELL_MAX } from "../share_target.ts";
3230
33 /** One line per app, "<name> is <doing what>" as the row's title and the app its meta; with nobody on it, the app is the title. */
34 export function crewAtWork(ctx: Ctx, repos: Awaited<ReturnType<typeof spawnedRepos>>): Html[] {
35 return appCrew(ctx.app.db, repos).map((c) => {
36 const href = `/${c.repo.ownerName}/${c.repo.name}`;
37 return row({
38 href,
39 title: html`${c.who === null ? c.repo.name : c.says}`,
40 meta: html`${c.who === null ? c.says : c.repo.name}`,
41 });
42 });
43 }
44
4531 /** The apps whose crew row shows beside the ask's: a builder at work is said once, so while the ask is building, its app's row goes. */
4632 export function besideAsk<R extends { readonly id: string }>(repos: readonly R[], ask: AskStatus | null): R[] {
4733 return ask?.state === "building" ? repos.filter((r) => r.id !== ask.repoId) : [...repos];
@@ -55,26 +41,6 @@ export function askBlock(s: AskStatus): Html {
5541 </div>`;
5642 }
5743
58 /** One step: its row (title, "Done" trail; the primary one in bold), then its
59 * body as a block of its own under the title. `.row-meta` is one clipped line,
60 * no place for a form. */
61 function stepBlock(step: NextStep, primary: boolean, body: Html | null): Html {
62 const head = row({
63 lead: step.done ? icon("check") : icon("issue"),
64 title: primary ? html`<b>${step.title}</b>` : html`${step.title}`,
65 ...(step.done ? { trail: badge("Done", { tone: "success" }) } : {}),
66 data: {
67 step: step.key,
68 done: step.done ? "yes" : "no",
69 ...(primary ? { primary: "" } : {}),
70 },
71 });
72 return html`<ul class="list">
73 ${head}
74 </ul>
75 ${!step.done && body ? html`<div class="step-body">${body}</div>` : null}`;
76 }
77
7844 /** Enter sends the first ask; Shift+Enter (or composing text) makes a newline. */
7945 export const firstAskJs = /* js */ `
8046 (function () {
@@ -121,42 +87,33 @@ export async function nextStepsCard(
12187 ): Promise<Html | null> {
12288 if (!steps || steps.every((s) => s.done)) return null;
12389 const repos = await spawnedRepos(ctx.app, user);
124 const crew = crewAtWork(ctx, repos);
12590 if (steps.some((s) => s.key === "tell" && !s.done)) return firstTell(ctx, user);
126 const primary = steps.find((s) => !s.done)?.key;
12791 const ask = askStatus(ctx.app.db, await askRepos(ctx.app, user), user.id, crewCanRun(ctx.app), user.isAdmin === true);
128 const others = ask?.state === "building" ? crewAtWork(ctx, besideAsk(repos, ask)) : crew;
129 const bodies: Record<NextStep["key"], Html | null> = {
130 // The account is made on its own page; here the step is one sentence, the way there, and the way to decline.
131 everyday: html`<p class="muted small">${EVERYDAY_WHY}</p>
132 <p>
133 ${btn("Make an everyday account", { href: "/settings/everyday", size: "sm", ...(primary === "everyday" ? { variant: "primary" as const } : {}) })}
134 ${btn("Keep using admin", { form: "everyday-keep", variant: "link", size: "sm" })}
135 </p>
136 <form id="everyday-keep" method="post" action="/settings/everyday/keep" hidden></form>`,
137 apps:
138 repos.length === 0
139 ? null
140 : html`<p>${repos.map((r) => html`${btn(r.name, { href: `/${r.ownerName}/${r.name}`, size: "sm" })} `)}</p>`,
141 tell: html`<p class="muted small">
142 Say what you want in one sentence, in the box below; the crew takes it
143 from there.
144 ${btn("Tell the crew", {
145 href: "#composer",
146 size: "sm",
147 ...(primary === "tell" ? { variant: "primary" as const } : {}),
148 })}
149 </p>`,
150 };
92 // What the person made leads: the ask's state, then each app a crew member is on. An app nobody
93 // is on says nothing here; the apps list below carries it.
94 const rows = appCrew(ctx.app.db, ask?.state === "building" ? besideAsk(repos, ask) : repos)
95 .filter((c) => c.who !== null)
96 .map((c) => row({ href: `/${c.repo.ownerName}/${c.repo.name}`, title: html`${c.says}`, meta: html`${c.repo.name}` }));
97 if (!ask && rows.length === 0) return null;
15198 return html`<section id="next-steps">
152 <h2>Your next steps</h2>
15399 ${ask ? askBlock(ask) : null}
154 ${others.length > 0 ? html`<ul class="list">${others}</ul>` : null}
155 ${steps.map((s) => stepBlock(s, s.key === primary, bodies[s.key]))}
100 ${rows.length > 0 ? html`<ul class="list">${rows}</ul>` : null}
156101 ${secondPasskeyLine(ctx, user)}
157102 </section>`;
158103 }
159104
105 /**
106 * The everyday account, offered once a tell exists, as the quiet last line of home: never a step to
107 * take first.
108 */
109 export function everydayLine(steps: readonly NextStep[] | undefined): Html | null {
110 if (!steps || steps.some((s) => s.key === "tell" && !s.done)) return null;
111 if (!steps.some((s) => s.key === "everyday" && !s.done)) return null;
112 return html`<p class="small muted" data-step="everyday">Signed in as admin. ${btn("Make an everyday account", { href: "/settings/everyday", size: "sm", variant: "link" })}
113 ${btn("Keep using admin", { form: "everyday-keep", variant: "link", size: "sm" })}</p>
114 <form id="everyday-keep" method="post" action="/settings/everyday/keep" hidden></form>`;
115 }
116
160117 /** The steps once per request, for the card and for the lean home to share. */
161118 export function nextStepsOf(
162119 ctx: Ctx,
src/web/studio/held.ts +3 −13
@@ -31,20 +31,10 @@ function holds(ctx: Ctx, user: User) {
3131 return out;
3232 }
3333
34 /**
35 * One line for each gate that holds work back; where none does, the one next action, but only
36 * if `idle` (the first-tell box already carries its own).
37 */
38 export function heldLine(ctx: Ctx, user: User, idle = false): Html | null {
34 /** One line for each gate that holds work back; none where none does. */
35 export function heldLine(ctx: Ctx, user: User): Html | null {
3936 const found = holds(ctx, user);
40 if (found.length === 0) {
41 if (!idle) return null;
42 return html`<section class="stack stack-tight" id="held-line" aria-label="Held back">
43 <p class="small muted">
44 Ready for the next issue: <a href="/new/issue">open one</a>.
45 </p>
46 </section>`;
47 }
37 if (found.length === 0) return null;
4838 return html`<section class="stack stack-tight" id="held-line" aria-label="Held back">
4939 ${found.map(
5040 ({ repo, hold }) =>
src/web/studio/home.ts +2 −3
@@ -80,7 +80,7 @@ import { newLine, newSince } from "../../feed/last_seen.ts";
8080 import { homeTabs, unshippedAsks } from "./home_tabs.ts";
8181 import { homeFlowPage } from "../pages/home_flow.ts";
8282 import { crewKeyCard } from "./crew_key.ts";
83 import { firstAskJs, nextStepsCard, nextStepsOf } from "../pages/next-steps.ts";
83 import { everydayLine, firstAskJs, nextStepsCard, nextStepsOf } from "../pages/next-steps.ts";
8484 import { spawnedForge } from "../../spawn/claim.ts";
8585 import { readableNotes } from "../../actions/desk.ts";
8686 import { deskStrip } from "../desk_strip.ts";
@@ -316,9 +316,8 @@ export async function studioHome(
316316 // Before the first tell the card is the one box and carries the key line and the composer.
317317 const firstTell = steps.some((s) => s.key === "tell" && !s.done);
318318 const lean = html`<h1 class="sr-only">Home</h1>
319 ${firstSteps} ${address} ${startedFromLine(ctx.app.db, ctx.app.config.dataDir, user)} ${firstTell ? null : crewKeyCard(ctx)} ${heldLine(ctx, user, !firstTell)} ${apps}
319 ${firstSteps} ${address} ${startedFromLine(ctx.app.db, ctx.app.config.dataDir, user)} ${firstTell ? null : composer(ctx, user)} ${apps} ${firstTell ? null : crewKeyCard(ctx)} ${heldLine(ctx, user)} ${everydayLine(steps)}
320320 <div class="stack">
321 ${firstTell ? null : composer(ctx, user)}
322321 <p class="small muted">
323322 <a href="/?all=1">Show everything</a>
324323 </p>
test/first-ask-flash.test.ts +1 −1
@@ -56,7 +56,7 @@ test("with no credit the flash still names them, and keeps the way forward", asy
5656 expect(home).toContain("data-ask-status");
5757 expect(home).toContain("No AI account and no included credit left");
5858 const card = home.slice(home.indexOf('id="next-steps"'));
59 const status = card.slice(card.indexOf("data-ask-status"), card.indexOf("data-step="));
59 const status = card.slice(card.indexOf("data-ask-status"), card.indexOf("</section>"));
6060 expect(status).toContain("Add a model key");
6161 expect(status).not.toContain('data-variant="primary"');
6262 } finally {
test/first-login-words.test.ts +1 −1
@@ -55,7 +55,7 @@ describe("the first-login page of a spawned forge, in plain words", () => {
5555 const told = await forge.post(owner, "/marias/bakery/tell", { text: "Add a weekly menu page." });
5656 expect(told.status).toBeLessThan(400);
5757 const html = await (await fetch(url("/"), { headers: { cookie: owner } })).text();
58 expect(mainOf(html)).toContain("Your next steps");
58 expect(mainOf(html)).toContain("id=\"next-steps\"");
5959 expect(jargonIn(html)).toEqual([]);
6060 });
6161
test/first-login.test.ts +16 −18
@@ -36,7 +36,7 @@ const PASSWORD = "a-long-first-login-passphrase";
3636 const FORGE_JSON = JSON.stringify({
3737 app: { run: "bun run index.ts", health: "/" },
3838 });
39 const CARD = "Your next steps";
39 const CARD = 'id="next-steps"';
4040
4141 describe("the first login to a spawned forge", () => {
4242 let dir = "";
@@ -220,24 +220,22 @@ describe("the first login to a spawned forge", () => {
220220 expect(card).not.toContain("arrive here");
221221 });
222222
223 test("once a tell exists the card carries three steps, and the everyday offer comes after it", async () => {
223 test("once a tell exists the home leads with the crew's work and the ask box; the everyday account is one quiet line", async () => {
224224 const told = await post(owner, "/marias/bakery/tell", { text: "Add a weekly menu page." });
225225 expect(told.status).toBeLessThan(400);
226226 const home = await page(owner);
227227 expect(home).toContain(CARD);
228 expect(home).toContain("Make your everyday account");
229 expect(home).toContain("Open your apps");
230 expect(home).toContain("Tell the crew something");
231 expect(steps(home)).toEqual({ everyday: "no", apps: "no", tell: "yes" });
228 expect(home).not.toContain("Your next steps");
229 expect(home).not.toContain("Make your everyday account");
230 expect(home).not.toContain("can break the forge");
231 expect(home).not.toContain("nobody is on it yet");
232 expect(home).not.toContain("Ready for the next issue");
233 expect(home).not.toContain("data-first-tell");
232234 expect(home).toContain('href="/settings/everyday"');
233 expect(home).not.toContain('action="/settings/everyday"');
234 expect(home.split("Make your everyday account").length - 1).toBe(1);
235 expect(home).not.toContain('data-first-tell');
236 // The crew's rows appear once the first ask exists.
235 expect(home.split("Make an everyday account").length - 1).toBe(1);
237236 expect(home).toMatch(/href="\/marias\/bakery\/?"[^>]*>[\s\S]*?atlas/);
238 expect(home).not.toMatch(/class="[^"]*\bsteps\b/);
239 expect(home).not.toMatch(/data-step[\s\S]{0,400}row-meta/);
240 expect(home).toMatch(/<div class="step-body">\s*<p class="muted small">/);
237 expect(home.indexOf('id="composer"')).toBeGreaterThan(-1);
238 expect(home.indexOf('id="composer"')).toBeLessThan(home.indexOf('href="/settings/everyday"'));
241239 });
242240
243241 test("the everyday account, made first, joins the client's org and sees the card part-way, every step one it can do", async () => {
@@ -253,13 +251,13 @@ describe("the first login to a spawned forge", () => {
253251 daily = (res.headers.get("set-cookie") ?? "").split(";")[0]!;
254252 expect(getUserByName(child.db, "maria-me")).toBeDefined();
255253 const home = await page(daily);
256 expect(steps(home)).toEqual({ everyday: "yes", apps: "no", tell: "yes" });
254 expect(home).not.toContain('href="/settings/everyday"');
257255 // It can read the client's own apps, and the crew line reads for it too.
258256 expect(home).toContain('href="/marias/bakery"');
259257 expect(home).not.toContain("Your apps arrive here");
260258 expect(home).toContain("atlas is ready to work toward Run Maria");
261259 // The admin's card moves along with it.
262 expect(steps(await page(owner)).everyday).toBe("yes");
260 expect(await page(owner)).not.toContain('href="/settings/everyday"');
263261 });
264262
265263 test("each app is one line: the crew member on it and what they do now, or that nobody is", async () => {
@@ -282,12 +280,12 @@ describe("the first login to a spawned forge", () => {
282280 const home = await page(owner);
283281 expect(home).toMatch(/class="row-title"[^>]*>atlas is working toward Run Maria(?:'|&#39;|&#x27;)s bakery\.?<\/span\s*>\s*<span class="row-meta">bakery</);
284282 expect(home.slice(home.indexOf("id=\"next-steps\""), home.indexOf("</section>"))).not.toContain("Direction:");
285 expect(home).toMatch(/class="row-title"[^>]*>spare<\/span\s*>\s*<span class="row-meta">nobody is on it yet</);
283 expect(home).not.toContain("nobody is on it yet");
286284 // A direction closed or unassigned is nobody on it, too.
287285 child.db.query("UPDATE issue SET state = 'closed' WHERE id = ?1").run(bakery.direction_issue_id);
288 expect(await page(owner)).toMatch(/class="row-title"[^>]*>bakery<\/span\s*>\s*<span class="row-meta">nobody is on it yet</);
286 expect(await page(owner)).not.toContain("nobody is on it yet");
289287 child.db.query("UPDATE issue SET state = 'open', assignee_id = NULL WHERE id = ?1").run(bakery.direction_issue_id);
290 expect(await page(owner)).toMatch(/class="row-title"[^>]*>bakery<\/span\s*>\s*<span class="row-meta">nobody is on it yet</);
288 expect(await page(owner)).not.toContain("nobody is on it yet");
291289 child.db.query("UPDATE issue SET assignee_id = ?2 WHERE id = ?1").run(bakery.direction_issue_id, atlasId);
292290 });
293291
test/later-gate.test.ts +2 −8
@@ -95,15 +95,9 @@ describe("the Later gate in plain sight", () => {
9595 expect(home).not.toContain("held-line");
9696 });
9797
98 test("heldLine says the next action only when asked (idle), and never when the first-tell box is up", () => {
98 test("heldLine is null where no gate holds anything", () => {
9999 expect(gateHold(app.db, fresh())).toBeUndefined();
100 const ctx = { app } as unknown as Ctx;
101 expect(heldLine(ctx, alice)).toBeNull();
102 expect(heldLine(ctx, alice, false)).toBeNull();
103 const idle = String(heldLine(ctx, alice, true));
104 expect(idle).toContain('id="held-line"');
105 expect(idle).toContain("Ready for the next issue:");
106 expect(idle).toContain('href="/new/issue"');
100 expect(heldLine({ app } as unknown as Ctx, alice)).toBeNull();
107101 });
108102
109103 test("a new gate shows up on home: how many, who set it", async () => {
test/next-steps-card.test.ts +40 −32
@@ -8,6 +8,7 @@
88 import { readFileSync, writeFileSync } from "node:fs";
99 import { join } from "node:path";
1010 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
11 import { createRepo } from "../src/actions/repos.ts";
1112 import { createSession } from "../src/core/sessions.ts";
1213 import { nextStepsFor } from "../src/core/next-steps.ts";
1314 import { createUser, getUserByName } from "../src/core/users.ts";
@@ -17,7 +18,7 @@ import { passkeyFields } from "./helpers/passkey.ts";
1718
1819 quietLogs();
1920
20 const CARD = "Your next steps";
21 const CARD = 'id="next-steps"';
2122
2223 describe("the next-steps card of a spawned forge", () => {
2324 let forge: ClaimedForge;
@@ -31,14 +32,6 @@ describe("the next-steps card of a spawned forge", () => {
3132 );
3233 const post = (cookie: string, path: string, form: Record<string, string>) =>
3334 forge.post(cookie, path, form);
34 const steps = (html: string) => {
35 const card = html.slice(html.indexOf(CARD));
36 return {
37 everyday: /data-step="everyday"[^>]*data-done="(yes|no)"/.exec(card)?.[1],
38 apps: /data-step="apps"[^>]*data-done="(yes|no)"/.exec(card)?.[1],
39 tell: /data-step="tell"[^>]*data-done="(yes|no)"/.exec(card)?.[1],
40 };
41 };
4235
4336 beforeAll(async () => {
4437 forge = await claimedForge("forge-next-steps-card-");
@@ -161,34 +154,42 @@ describe("the next-steps card of a spawned forge", () => {
161154 expect(main).not.toContain('action="/settings/everyday"');
162155 });
163156
164 test("a fresh forge after its first tell names the next issue, in one sentence with a link", async () => {
157 test("a fresh forge after its first tell leads with the ask box and apps, not a list of steps", async () => {
165158 const home = await page(owner);
166 const line = home.slice(home.indexOf('id="held-line"'), home.indexOf("</section>", home.indexOf('id="held-line"')));
167 expect(line).toContain("Ready for the next issue:");
168 expect(line).toContain('href="/new/issue"');
169 expect(line).not.toContain("Next:");
159 expect(home).toContain('id="composer"');
160 expect(home).toContain('href="/marias/bakery');
161 expect(home).not.toContain("Your next steps");
170162 });
171163
172 test("the admin's first home carries exactly three steps, in order, none done", async () => {
164 test("an app nobody is on is still reachable from the apps list on home", async () => {
165 const made = await createRepo(forge.child, getUserByName(forge.child.db, "maria")!, { owner: "marias", name: "quiet-shop", visibility: "private" });
outdated

This line is whitespace only. Remove it.

166 expect(made.ok).toBe(true);
173167 const home = await page(owner);
174 expect(keys(home)).toEqual(["everyday", "apps", "tell"]);
175 expect(steps(home)).toEqual({ everyday: "no", apps: "no", tell: "yes" });
176 const titles = ["Make your everyday account", "Open your apps", "Tell the crew something"];
177 const at = titles.map((t) => cardOf(home).indexOf(t));
178 expect(at.every((n) => n >= 0)).toBe(true);
179 expect([...at].sort((a, b) => a - b)).toEqual(at);
168 const main = home.slice(home.indexOf("<main"), home.indexOf("</main>"));
169 expect(main).toMatch(/<a [^>]*href="\/marias\/quiet-shop\/?"/);
170 const res = await fetch(url("/marias/quiet-shop"), { headers: { cookie: owner }, redirect: "manual" });
171 expect(res.status).toBe(200);
180172 });
181173
182 test("the steps are one plain section, not boxed in cards", async () => {
183 const card = cardOf(await page(owner));
184 expect(card).not.toContain('class="card');
185 expect(card).not.toContain("card-body");
186 // A pending step's body is a block under its row, never an inline sibling of the title.
187 expect(card).toMatch(/<\/ul>\s*<div class="step-body">/);
188 // The first pending step, and only it, is the primary one.
189 expect(card).toMatch(/data-step="everyday"[^>]*data-primary/);
190 expect(card.match(/data-primary/g)?.length).toBe(1);
191 expect(keys(await page(owner))).toEqual(["everyday", "apps", "tell"]);
174 test("the everyday line is one muted sentence: a link, and the keep as a post-form button", async () => {
175 const home = await page(owner);
176 const at = home.indexOf('data-step="everyday"');
177 expect(at).toBeGreaterThan(-1);
178 const line = home.slice(home.lastIndexOf("<p", at), home.indexOf("</p>", at));
179 expect(line).toContain("muted");
180 expect(line).toContain('<a ');
181 expect(line).toContain('href="/settings/everyday"');
182 expect(line).toContain('form="everyday-keep"');
183 expect(home).toContain('<form id="everyday-keep" method="post" action="/settings/everyday/keep"');
184 });
185
186 test("the admin's home after the first tell has the ask box first, and the everyday account as one quiet link", async () => {
187 const home = await page(owner);
188 expect(home).toContain('id="composer"');
189 expect(home).not.toContain("Make your everyday account");
190 expect(home).not.toContain("can break the forge");
191 expect(home).toContain(`href="/settings/everyday"`);
192 expect(home.indexOf('id="composer"')).toBeLessThan(home.indexOf('href="/settings/everyday"'));
192193 });
193194
194195 test("each step's way in answers 200 for the admin", async () => {
@@ -200,7 +201,7 @@ describe("the next-steps card of a spawned forge", () => {
200201 // Tell the crew: the card points at the composer, which must be on the page.
201202 expect(home).toContain('id="composer"');
202203 // Make your everyday account: the card links to the step's own page.
203 expect(card).toContain('href="/settings/everyday"');
204 expect(home).toContain('href="/settings/everyday"');
204205 const paths = [...new Set([...apps, "/settings/everyday"])];
205206 for (const p of paths) {
206207 const res = await fetch(url(p), { headers: { cookie: owner }, redirect: "manual" });
@@ -227,6 +228,7 @@ describe("the next-steps card of a spawned forge", () => {
227228 const home = await page(`forge_session=${session.token}`);
228229 expect(home).not.toContain(CARD);
229230 expect(home).not.toContain('data-step="');
231 expect(home).not.toContain("/settings/everyday");
230232 });
231233
232234 test("once the everyday account exists, its step reads done", async () => {
@@ -242,5 +244,11 @@ describe("the next-steps card of a spawned forge", () => {
242244 expect((await nextStepsFor(forge.child, user))?.map((x) => x.done)).toEqual([true, true, true]);
243245 expect(await page(owner)).not.toContain(CARD);
244246 expect(await page(daily)).not.toContain(CARD);
247 // Done is done: the quiet line is gone too.
248 for (const who of [owner, daily]) {
249 const home = await page(who);
250 expect(home).not.toContain('data-step="everyday"');
251 expect(home).not.toContain('href="/settings/everyday"');
252 }
245253 });
246254 });
test/next-steps-crew-words.test.ts +4 −10
@@ -13,9 +13,7 @@ import { createRepo } from "../src/actions/repos.ts";
1313 import { claimRun, createRun } from "../src/core/runs.ts";
1414 import { createUser, getUserByName } from "../src/core/users.ts";
1515 import { getRepoById } from "../src/core/repos.ts";
16 import type { Ctx } from "../src/http/context.ts";
1716 import { appCrew } from "../src/core/app-crew.ts";
18 import { crewAtWork } from "../src/web/pages/next-steps.ts";
1917 import { quietLogs } from "./helpers/globals.ts";
2018
2119 quietLogs();
@@ -48,13 +46,9 @@ async function appWith(title: string) {
4846 const run = createRun(app.db, { repoId: created.value.id, kind: "agent", issueId: issue.value.id, actorId: atlas.id, reason: "assigned" });
4947 claimRun(app.db, run.id);
5048 const repo = getRepoById(app.db, created.value.id)!;
51 const rows = crewAtWork({ app } as unknown as Ctx, [repo]).map(String).join(" ");
52 const text = rows
53 .replace(/<[^>]*>/g, " ")
54 .replace(/&#39;|&#x27;/g, "'")
55 .replace(/\s+/g, " ")
56 .trim();
57 return { repo, text, rows, runId: run.id, says: appCrew(app.db, [repo])[0]!.says };
49 const says = appCrew(app.db, [repo])[0]!.says;
50 const text = `${says} ${repo.name}`;
51 return { repo, text, runId: run.id, says };
5852 }
5953
6054 beforeAll(async () => {
@@ -68,7 +62,7 @@ test("a clause that introduces a pull number or branch goes with it: the whole s
6862 const a = await appWith("Run Maria's bakery, as in PR #42 on mason/12-menu-page");
6963 expect(a.says).toBe("atlas is working toward Run Maria's bakery");
7064 expect(a.text).toBe(`atlas is working toward Run Maria's bakery ${a.repo.name}`);
71 expect(a.rows).not.toContain(a.runId);
65 expect(a.text).not.toContain(a.runId);
7266 expect(a.text).not.toMatch(/#\d|\bPR\b|mason\/|\/issues\//);
7367 });
7468
test/tui-first-tell.test.ts +4
@@ -62,5 +62,9 @@ test("before the first tell the home says what to do and never offers an everyda
6262 await settleApp(after.app);
6363 expect(after.text()).not.toContain("What do you want built?");
6464 expect(after.text()).not.toContain("K keeps using admin");
65 // It already leads with the apps and the ask (same order as the web home): the app's line is
66 // there, and the key to ask again.
67 expect(after.text()).toContain("bakery");
68 expect(after.text()).toContain("ask for something");
6569 after.app.stop();
6670 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs