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

The owner's home has no things-for-me list #2756

Parked opened this
Closed without merging

scout/forge:scout/2738-the-owner-s-home-has-no-things-for-me-li → main 2 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
17 files changed +116 −63
README.md +1 −1
@@ -566,7 +566,7 @@ my machine", and the dashboard grows an **On your machine** card listing them.
566566 The server remembers only the choice — nothing about the state of a laptop —
567567 and `forge sync` below is what acts on it.
568568
569 **What an ask row waits for.** Every ask row carries one word, `waitingFor` (`src/core/waiting_for.ts`, computed once), and who it waits on, e.g. "ready to land · on you". The first that applies wins: `conflicts with main` (the last sweep found files stopping the pull, on its author), `ready to land` (a green change to look at and ship), `a review` (a review or a hand-over), `assigned to you` (the pull or issue is assigned to the viewer), otherwise `a decision`. It shows as a chip on each row of the home, as `waitingFor: {word, on}` in `GET /api/v1/asks` and the MCP `asks` tool, and in the terminal's On you card. A grouped row shares one word (the weightiest of its items), and the terminal's card shows its row's word.
569 **What an ask row waits for.** Every ask row carries one word, `waitingFor` (`src/core/waiting_for.ts`, computed once), and who it waits on, e.g. "ready to land · on you". The first that applies wins: `conflicts with main` (the last sweep found files stopping the pull, on its author), `ready to land` (a green change to look at and ship), `a review` (a review or a hand-over), `assigned to you` (the pull or issue is assigned to the viewer), otherwise `a decision`. It shows as a chip on each row of the asks page (`/asks`), as `waitingFor: {word, on}` in `GET /api/v1/asks` and the MCP `asks` tool, and in the terminal's On you card. A grouped row shares one word (the weightiest of its items), and the terminal's card shows its row's word.
570570
571571 **Muting a repository from the home**: each ask row on the home carries a "Mute owner/name" chip. A muted repository's asks leave the home, `/api/v1/asks`, the header count and the phone's pushes (the same per-user mute the On you card uses, no new table); the home says "N muted repositories still ask" with a "Listen again" button, and an app's own page still counts them.
572572
docs/FEED.md +1 −1
@@ -62,7 +62,7 @@ that item has gone).
6262 `/` for a signed-in viewer is the feed (#599): the composer on top (a tell to
6363 one of your apps; through the outbox to `POST /api/v1/feed/tells`, or `POST
6464 /tell` without a script), then the first 20 items as posts, server-side; your
65 apps and what is on you in a narrow column on a desk, a tab away on a phone.
65 apps in a narrow column (what is on you is not on the home: it is `/asks`, linked from the top bar without a count) on a desk, a tab away on a phone.
6666 The app rows and the cost line are `/apps`. `/live/feed` answers the timeline
6767 region for the live-regions client (etag, 304). A post: who did it, what it
6868 says as a link into the thing, a small line of why, Steer (run
src/web/layout.ts +27
@@ -287,6 +287,7 @@ const STATIC_PALETTE: PaletteItem[] = [
287287 { t: "Apps", h: "/apps", c: "Go to" },
288288 { t: "Explore", h: "/explore", c: "Go to" },
289289 { t: "Map", h: "/map", c: "Go to" },
290 { t: "Asks", h: "/asks", c: "Go to" },
290291 { t: "What you asked for", h: "/asked", c: "Go to" },
291292 { t: "Front page", h: "/front", c: "Go to" },
292293 { t: "New app", h: "/apps/new", c: "Create" },
@@ -462,7 +463,33 @@ function topbar(
462463 )}
463464 <span class="spacer"></span>
464465 <span class="topbar-tools">
466 <<<<<<< HEAD
467 ${when(
468 user?.isAdmin === true,
469 () =>
470 html`<a
471 id="flow-link"
472 class="btn"
473 data-size="sm"
474 href="/flow"
475 title="The pipeline and its bottleneck"
476 >${icon("activity")}<span class="hide-sm">Flow</span></a
477 >`,
478 )}${when(
479 user !== undefined,
480 () =>
481 html`<a
482 id="asks-link"
483 class="btn"
484 data-size="sm"
485 href="/asks"
486 title="What is waiting for you"
487 >${icon("check")}<span class="hide-sm">Asks</span></a
488 >`,
489 )}${searchBar()}<span class="hide-sm">${helpButton()}</span>${themeMenu(theme)}
490 =======
465491 ${searchBar()}
492 >>>>>>> origin/main
466493 ${user
467494 ? html`<span class="hide-sm">${newMenu(ctx)}</span>${userMenu(
468495 ctx,
src/web/pages/board.ts +2 −2
@@ -394,7 +394,7 @@ function reviewStrip(ctx: Ctx, scope: BoardScope): Html | null {
394394 if (!none && waits.length === 0) return [];
395395 const oldest = waits.map((w) => w.since).sort()[0];
396396 return [
397 html`<a class="board-asks" href="/#needs-you"
397 html`<a class="board-asks" href="/asks"
398398 ><b>${repo.name}</b>: ${none ? "No reviewer: agent pulls wait for you" : "agent pulls wait for your review"}${waits.length === 0
399399 ? null
400400 : html` · <b>${waits.length}</b> waiting since ${oldest!.slice(0, 10)}`}</a
@@ -421,7 +421,7 @@ function asksStrip(ctx: Ctx): Html | null {
421421 const since = new Date(Date.now() - ASKS_WINDOW_DAYS * 86_400_000).toISOString();
422422 const m = askMeasure(ctx.app.db, user.id, since);
423423 if (m.raised + m.acted + m.dismissed + m.expired === 0) return null;
424 return html`<a class="board-asks" id="asks-measure" href="/#needs-you"
424 return html`<a class="board-asks" id="asks-measure" href="/asks"
425425 >Asks, ${ASKS_WINDOW_DAYS} days: <b>${m.raised}</b> raised · <b>${m.acted}</b> acted
426426 on · <b>${m.dismissed}</b> dismissed · <b>${m.expired}</b> went by themselves</a
427427 >`;
src/web/pages/site.ts +1 −2
@@ -24,7 +24,6 @@ import { hasAnyUser, verifyPasswordThrottled, type User } from "../../core/users
2424 import { isThemeName } from "../../design/themes.ts";
2525 import { cookieValue, crossOrigin, type Ctx } from "../../http/context.ts";
2626 import { studioDoor, studioHome } from "../studio/home.ts";
27 import { homeTop } from "../studio/asks_page.ts";
2827 import { edgeLoginUrl } from "../../http/edge.ts";
2928 import { sshCommand } from "../../ssh/command.ts";
3029 import { hostOf, pageHead, signInFirst } from "../chrome.ts";
@@ -208,7 +207,7 @@ export function terminalCard(ctx: Ctx): Html {
208207 export async function home(ctx: Ctx): Promise<Response> {
209208 const user = ctx.auth.user;
210209 if (user === undefined) return studioDoor(ctx);
211 return await studioHome(ctx, user, homeTop(ctx));
210 return await studioHome(ctx, user);
212211 }
213212
214213 // ---- authentication ----
src/web/studio/asks_page.ts +12 −15
@@ -27,7 +27,7 @@ import { needLine } from "../../actions/health.ts";
2727 import type { Degraded } from "../../kernel/vitals.ts";
2828 import type { Ctx } from "../../http/context.ts";
2929 import type { User } from "../../core/users.ts";
30 import { onYouAnswer, studioHome } from "./home.ts";
30 import { asksHome, onYouAnswer } from "./home.ts";
3131 import { notFoundPage, repoBase, signInFirst } from "../chrome.ts";
3232 import { backTo, field, readForm } from "../form.ts";
3333 import { MAX_BODY } from "../../core/issues.ts";
@@ -332,15 +332,12 @@ export interface AsksTop {
332332 readonly reason?: string;
333333 }
334334
335 /** GET /asks — the home, scrolled to what needs you; `?op=<id>` (a bulk
336 * action's receipt) rides along. */
335 /** GET /asks — what needs you, on its own page; `?op=<id>` (a bulk
336 * action's receipt) or `?decided=<id>` rides along. */
337337 export function asksPage(ctx: Ctx): Response {
338 const op = ctx.url.searchParams.get("op");
339 return redirect(
340 op === null
341 ? "/#needs-you"
342 : `/?op=${encodeURIComponent(op)}#asks-bulk-result`,
343 );
338 const user = ctx.auth.user;
339 if (!user) return signInFirst(ctx);
340 return asksHome(ctx, user, homeTop(ctx));
344341 }
345342
346343 /** The receipt `?op=<id>` names on the home, when it is the viewer's own. */
@@ -487,12 +484,12 @@ export function needsYouSection(
487484 return { body, scriptJs: SELECT_JS };
488485 }
489486
490 /** The home with a bulk step's preview or receipt on top of what needs
487 /** The asks page with a bulk step's preview or receipt on top of what needs
491488 * you — where every bulk answer lands. */
492489 async function asksScreen(ctx: Ctx, top: AsksTop): Promise<Response> {
493490 const user = ctx.auth.user;
494491 if (!user) return signInFirst(ctx);
495 return await studioHome(ctx, user, top);
492 return asksHome(ctx, user, top);
496493 }
497494
498495 // ---- many at once: select, preview, do it, undo — all on this screen ----
@@ -641,7 +638,7 @@ export async function asksBulkSubmit(ctx: Ctx): Promise<Response> {
641638 : `${why.length} not done: ${[...new Set(why.filter((w) => w !== ""))].join("; ") || "refused"}`;
642639 return onYouAnswer(ctx, ctx.auth.user, note);
643640 }
644 return redirect(`/?op=${op.value.id}#asks-bulk-result`);
641 return redirect(`/asks?op=${op.value.id}#asks-bulk-result`);
645642 }
646643 const plan = previewAsksBulk(ctx.app, ctx.auth.user, action, items, reason);
647644 if (!plan.ok) return await asksScreen(ctx, nothingDone(plan.error.message));
@@ -675,7 +672,7 @@ export async function asksBulkUndo(ctx: Ctx): Promise<Response> {
675672 return op.error.code === "not_found"
676673 ? notFoundPage(ctx)
677674 : await asksScreen(ctx, nothingDone(op.error.message));
678 return redirect(`/?op=${op.value.id}#asks-bulk-result`);
675 return redirect(`/asks?op=${op.value.id}#asks-bulk-result`);
679676 }
680677
681678 /** POST /asks/decide — hand one hand-over card to the decider; the ledger keeps what it saw. */
@@ -685,7 +682,7 @@ export async function asksDecide(ctx: Ctx): Promise<Response> {
685682 if (form instanceof Response) return form;
686683 const done = await decideAsk(ctx.app, ctx.auth.user, field(form, "ask"));
687684 if (!done.ok) return await asksScreen(ctx, nothingDone(done.error.message));
688 return redirect(`/?decided=${done.value.id}#asks-bulk-result`);
685 return redirect(`/asks?decided=${done.value.id}#asks-bulk-result`);
689686 }
690687
691688 /** POST /asks/proposal/:id/(approve|redirect|later|again) — one wave proposal, then back to the page the person came from. */
@@ -732,7 +729,7 @@ export async function asksDecideUndo(ctx: Ctx): Promise<Response> {
732729 return undone.error.code === "not_found"
733730 ? notFoundPage(ctx)
734731 : await asksScreen(ctx, nothingDone(undone.error.message));
735 return redirect(`/?decided=${undone.value.id}#asks-bulk-result`);
732 return redirect(`/asks?decided=${undone.value.id}#asks-bulk-result`);
736733 }
737734
738735 /** POST /asks/listen — take back the viewer's own mute of the repositories named. */
src/web/studio/home.ts +19 −8
@@ -202,12 +202,7 @@ export function liveOnYouFragment(ctx: Ctx): Response {
202202 * your repositories are one step away on your own page. On a phone they are
203203 * a tab away. The app rows and the cost line live on `/apps`.
204204 */
205 export async function studioHome(
206 ctx: Ctx,
207 user: User,
208 top?: AsksTop,
209 ): Promise<Response> {
210 const needsYou = needsYouSection(ctx, user, top);
205 export async function studioHome(ctx: Ctx, user: User): Promise<Response> {
211206 const { repos: appRepos } = writableAppsOf(ctx, user);
212207 // A spawned forge says where it lives: the address its person shares.
213208 const spawned = await spawnedOrg(ctx.app);
@@ -256,7 +251,7 @@ export async function studioHome(
256251 ${homeTabs("feed")}
257252 <div class="dash">
258253 <div class="dash-main stack">
259 ${onYouRegion(ctx, user, undefined, needsYou.body)} ${composer(ctx, user)}
254 ${composer(ctx, user)}
260255 <div class="bar feed-head">
261256 <span class="spacer"></span>
262257 <a class="small muted" href="/asked">What you asked for</a>
@@ -281,7 +276,23 @@ export async function studioHome(
281276 ctx,
282277 title: "Home",
283278 body,
284 scriptJs: `${liveClientJs}\n${liveRegionsJs}\n${feedJs}\n${needsYou.scriptJs}${ask ? `\n${passkeyJs}` : ""}`,
279 scriptJs: `${liveClientJs}\n${liveRegionsJs}\n${feedJs}${ask ? `\n${passkeyJs}` : ""}`,
280 });
281 }
282
283 /**
284 * The asks, on their own page (#2738): what is on the viewer, with a bulk
285 * step's preview or receipt on top. The home carries none of it; the top
286 * bar links here, without a count.
287 */
288 export function asksHome(ctx: Ctx, user: User, top?: AsksTop): Response {
289 const needsYou = needsYouSection(ctx, user, top);
290 return page({
291 ctx,
292 title: "Asks",
293 body: html`<h1 class="sr-only">Asks</h1>
294 <div class="stack">${onYouRegion(ctx, user, undefined, needsYou.body)}</div>`,
295 scriptJs: `${liveClientJs}\n${liveRegionsJs}\n${needsYou.scriptJs}`,
285296 });
286297 }
287298
test/asks-bulk.test.ts +1 −1
@@ -76,7 +76,7 @@ describe("acting on many asks at once", () => {
7676 });
7777 const location = res.headers.get("location");
7878 if (res.status === 303 && location !== null) {
79 expect(location).toStartWith("/?op=");
79 expect(location).toStartWith("/asks?op=");
8080 const next = await fetch(`${servers.url}${location}`, { headers, redirect: "manual" });
8181 expect(next.status).toBe(200);
8282 return (await next.text()).replace(/\s+/g, " ");
test/asks-expiry.test.ts +7 −7
@@ -126,7 +126,7 @@ describe("asks that expire, hold and collapse", () => {
126126 pears = await botPull("pears", [{ path: "PEARS.md", content: "pears\n" }]);
127127 green(apples);
128128 green(pears);
129 const page = await get("/");
129 const page = await get("/asks");
130130 expect(sentence(page)).toBe("1 thing needs you");
131131 expect(headerCount(page)).toBe(1);
132132 expect(page).toContain("2 green changes wait for your look");
@@ -152,7 +152,7 @@ describe("asks that expire, hold and collapse", () => {
152152 // card at all, so there is nothing to mute.
153153 const fragment = await get("/live/feed");
154154 expect(fragment).not.toContain('data-kind="ask"');
155 const home = await get("/");
155 const home = await get("/asks");
156156 expect(home).toContain('<section id="needs-you"');
157157 const at = home.indexOf('<section id="needs-you"');
158158 expect(home.slice(at, home.indexOf("</section>", at))).not.toContain(
@@ -169,7 +169,7 @@ describe("asks that expire, hold and collapse", () => {
169169 repoId: repo.id,
170170 actorId: null,
171171 });
172 let page = await get("/");
172 let page = await get("/asks");
173173 expect(sentence(page)).toBe("All fine");
174174 expect(headerCount(page)).toBe(0);
175175 expect(askLinesFor(app.db, aliceUser)).toHaveLength(0);
@@ -179,7 +179,7 @@ describe("asks that expire, hold and collapse", () => {
179179 // A new check on one of them: that one asks again, on its own.
180180 await tick();
181181 green(apples);
182 page = await get("/");
182 page = await get("/asks");
183183 expect(sentence(page)).toBe("1 thing needs you");
184184 const pinned = page.slice(
185185 page.indexOf('<section id="needs-you"'),
@@ -203,7 +203,7 @@ describe("asks that expire, hold and collapse", () => {
203203 repoId: repo.id,
204204 actorId: null,
205205 });
206 expect(sentence(await get("/"))).toBe("All fine");
206 expect(sentence(await get("/asks"))).toBe("All fine");
207207 // The merge box is the change's Files step (#628).
208208 const change = await get(
209209 `/${repo.ownerName}/${repo.name}/pulls/${apples.number}/files`,
@@ -231,7 +231,7 @@ describe("asks that expire, hold and collapse", () => {
231231 });
232232 await sweepStaleAsks(app);
233233 expect(askLinesFor(app.db, aliceUser)).toHaveLength(0);
234 expect(sentence(await get("/"))).toBe("All fine");
234 expect(sentence(await get("/asks"))).toBe("All fine");
235235 // The feed and the MCP's asks carry no green line for it either.
236236 expect(
237237 readFeed(app.db, aliceUser, { limit: 50 }).items.some(
@@ -241,7 +241,7 @@ describe("asks that expire, hold and collapse", () => {
241241 expect(JSON.stringify(asksAnswer({ app, auth: { user: aliceUser } } as never, aliceUser))).not.toContain("is green");
242242 // Assigned to alice, the home's one list says it conflicts, never ready.
243243 setAssignee(app.db, plums.id, aliceUser.id);
244 const home = await get("/");
244 const home = await get("/asks");
245245 expect(home).toContain("conflicts with main");
246246 expect(askLinesFor(app.db, aliceUser).map((l) => l.waitingFor.word)).toEqual(["conflicts with main"]);
247247 // Its own page still says why it cannot ship.
test/asks-mute.test.ts +1 −1
@@ -60,7 +60,7 @@ describe("muting a repository's asks", () => {
6060 return ((await res.json()) as { rows: unknown[] }).rows;
6161 };
6262 const home = async () =>
63 await fetch(`${servers.url}/`, { headers: headers(cookie) }).then((r) => r.text());
63 await fetch(`${servers.url}/asks`, { headers: headers(cookie) }).then((r) => r.text());
6464
6565 const signIn = async (username: string) => {
6666 const res = await fetch(`${servers.url}/signin`, {
test/asks-rank.test.ts +4 −4
@@ -204,7 +204,7 @@ describe("asks that earn their place", () => {
204204 expect(row.words).toEqual(ASK_WORDS.look);
205205 expect(row.words.options.length).toBeGreaterThan(0);
206206 }
207 const asks = await page("/");
207 const asks = await page("/asks");
208208 expect(asks).toContain("If nobody acts, it waits; nothing ships.");
209209 expect(asks).toContain("<b>security</b>");
210210 // The long sentence the card used to repeat is gone.
@@ -236,7 +236,7 @@ describe("asks that earn their place", () => {
236236 for (const name of ["r4", "r5", "r6"])
237237 await greenPull(name, `Work in ${name}`);
238238 // What needs you is pinned on the home (#634): count its own cards.
239 const home = await page("/");
239 const home = await page("/asks");
240240 const asks = home.slice(home.indexOf('<section id="needs-you"'));
241241 const cards = (s: string) => (s.match(/class="card[" ]/g) ?? []).length;
242242 // Two before the phone's "more", three more inside it before the wide
@@ -340,7 +340,7 @@ describe("asks that earn their place", () => {
340340 expect((await mcpAsks()).measure.raised).toBe(6);
341341 });
342342 test("a phone's ask is a full-width row: kind and repo on one line, the decider apart, the rest behind More", async () => {
343 const home = await page("/");
343 const home = await page("/asks");
344344 const asks = home.slice(home.indexOf('<section id="needs-you"'));
345345 expect(asks).toContain("ask-card");
346346 expect(asks).toContain('<b class="ask-kind">');
@@ -357,7 +357,7 @@ describe("asks that earn their place", () => {
357357 // The security pull went red above; a new green one joins it in a row of two.
358358 check(security, "ok");
359359 await greenPull("security", "Another change here");
360 const asks = await page("/");
360 const asks = await page("/asks");
361361 expect(asks).toContain("2 green changes wait for your look");
362362 expect(asks).toContain("<b>security</b>: \u201cWiden the board id\u201d");
363363 // On a phone the row is its head line, its two asks one tap away; a
test/asks-waiting-for.test.ts +1 −1
@@ -150,7 +150,7 @@ describe("the word on a row", () => {
150150 expect(text).toContain("ready to land");
151151 expect(text).toContain("waitingFor");
152152
153 const page = await (await fetch(`${servers.url}/`, { headers: { cookie } })).text();
153 const page = await (await fetch(`${servers.url}/asks`, { headers: { cookie } })).text();
154154 expect(page).toContain('data-waiting="ready to land"');
155155 expect(page).toContain('<span class="sr-only">waiting for </span>ready to land');
156156 expect(page).toContain("ready to land · on you");
test/asks.test.ts +15 −15
@@ -104,16 +104,16 @@ describe("the asks page", () => {
104104 });
105105
106106 test("when nothing asks, it says All fine, and so does the header", async () => {
107 const page = await get(alice, "/");
107 const page = await get(alice, "/asks");
108108 expect(sentence(page)).toBe("All fine");
109109 expect(headerCount(page)).toBe(0);
110 expect(await get(alice, "/")).not.toContain('<section id="needs-you"');
110 expect(await get(alice, "/asks")).not.toContain('<section id="needs-you"');
111111 });
112112
113 test("/asks lands on the home's pinned needs-you, and a signed-out reader there gets the door, no asks", async () => {
113 test("/asks is its own page, and a signed-out reader gets the sign-in, no asks", async () => {
114114 const response = await fetch(`${servers.url}/asks`, { redirect: "manual" });
115115 expect(response.status).toBe(303);
116 expect(response.headers.get("location")).toBe("/#needs-you");
116 expect(response.headers.get("location")).toStartWith("/signin");
117117 const door = await (await fetch(`${servers.url}/`)).text();
118118 expect(door).not.toContain('id="needs-you"');
119119 expect(door).not.toContain('id="asks-sentence"');
@@ -146,7 +146,7 @@ describe("the asks page", () => {
146146 claimRun(app.db, run.id);
147147 finishRun(app.db, run.id, { state: "failed", summary: "red" });
148148 // Failed but the crew is still trying: that is working, not an ask.
149 expect(sentence(await get(alice, "/"))).toBe("All fine");
149 expect(sentence(await get(alice, "/asks"))).toBe("All fine");
150150 recordDecision(app.db, {
151151 kind: "retry",
152152 repoId: repo.id,
@@ -157,16 +157,16 @@ describe("the asks page", () => {
157157 by: "rule",
158158 ms: 1,
159159 });
160 const page = await get(alice, "/");
160 const page = await get(alice, "/asks");
161161 expect(sentence(page)).toBe("1 thing needs you");
162162 expect(page).toContain("Bot did a thing");
163163 expect(headerCount(page)).toBe(1);
164164 // The home counts it in the header's Asks link; the dev dashboard's
165165 // own "needs you" line went with the dashboard (#625).
166 const home = await get(alice, "/");
166 const home = await get(alice, "/asks");
167167 expect(headerCount(home)).toBe(1);
168168 // Bob can read the public repository but cannot write it: not his ask.
169 expect(sentence(await get(bob, "/"))).toBe("All fine");
169 expect(sentence(await get(bob, "/asks"))).toBe("All fine");
170170 });
171171
172172 test("a forge health problem is a card for an admin and for no one else", async () => {
@@ -174,11 +174,11 @@ describe("the asks page", () => {
174174 app.db
175175 .query("UPDATE run SET created_at = ?1 WHERE state = 'queued'")
176176 .run(new Date(Date.now() - 3 * 3_600_000).toISOString());
177 const admin = await get(alice, "/");
177 const admin = await get(alice, "/asks");
178178 expect(admin).toContain("behind one lane");
179179 expect(sentence(admin)).toBe("2 things need you");
180180 expect(headerCount(admin)).toBe(2);
181 const other = await get(bob, "/");
181 const other = await get(bob, "/asks");
182182 expect(other).not.toContain("behind one lane");
183183 expect(sentence(other)).toBe("All fine");
184184 });
@@ -224,17 +224,17 @@ describe("the asks page", () => {
224224 ms: 1,
225225 });
226226 const card = `id="ask-stopped:${pull.id}"`;
227 expect(await get(alice, "/")).toContain(card);
227 expect(await get(alice, "/asks")).toContain(card);
228228 // The re-run passes: the stop is answered, and the pull is green.
229229 check("ok");
230230 resolveOpen(app.db, pull.id, "retry", "green");
231 const green = await get(alice, "/");
231 const green = await get(alice, "/asks");
232232 expect(green).not.toContain(card);
233233 expect(green).toContain(`id="ask-look:${pull.id}"`);
234234 // Red again, before anything new is decided: the old stop is spent, and
235235 // the crew's tries are what the card is counted from.
236236 check("failed");
237 expect(await get(alice, "/")).not.toContain(card);
237 expect(await get(alice, "/asks")).not.toContain(card);
238238 });
239239
240240 test("a green change's card says what its tests did", async () => {
@@ -309,11 +309,11 @@ describe("the asks page", () => {
309309 expect(card.says).toContain("alice");
310310 expect(card.says).toContain("checks.concurrency");
311311 expect(ASK_WORDS.setting.options).toEqual(["Keep", "Put back"]);
312 const page = await get(alice, "/");
312 const page = await get(alice, "/asks");
313313 expect(page).toContain("Keep");
314314 expect(page).toContain("Put back");
315315 // not for a person who cannot put it back
316 expect(await get(bob, "/")).not.toContain("Put back");
316 expect(await get(bob, "/asks")).not.toContain("Put back");
317317 expect(listEvents(app.db, { kind: "issue.assigned" }).length).toBe(0);
318318 });
319319
test/hand-decider.test.ts +1 −1
@@ -81,7 +81,7 @@ describe("let the decider answer a hand-over", () => {
8181 redirect: "manual",
8282 });
8383
84 const home = async (path = "/"): Promise<string> =>
84 const home = async (path = "/asks"): Promise<string> =>
8585 (await (await fetch(`${servers.url}${path}`, { headers: { cookie } })).text()).replace(/\s+/g, " ");
8686
8787 beforeAll(async () => {
test/home-feed.test.ts +21 −2
@@ -371,7 +371,7 @@ describe("home is the feed", () => {
371371 if (!one.ok || !two.ok) throw new Error("issues");
372372 for (const [repo, issue] of [[garden, one.value], [vault, two.value]] as const)
373373 expect(assignIssue(app, alice, repo, issue, alice).ok).toBe(true);
374 const text = await (await get("/", aliceCookie)).text();
374 const text = await (await get("/asks", aliceCookie)).text();
375375 const card = text.slice(text.indexOf('id="live-on-you"')).replace(/\s+/g, " ");
376376 expect(card).toContain("things need you");
377377 expect(card).toContain("assigned to you");
@@ -389,7 +389,26 @@ describe("home is the feed", () => {
389389 expect(text).toContain("fleet.operated");
390390 expect(text).toContain("data-pick");
391391 // Alone, a single row stays a plain link.
392 const bobCard = await (await get("/", bobCookie)).text();
392 const bobCard = await (await get("/asks", bobCookie)).text();
393393 expect(bobCard).not.toContain('id="asks-bulk"');
394394 });
395 test("The owner's home carries no list of what is on them: six open asks are on /asks and nowhere on /", async () => {
396 const titles = ["Mow", "Prune", "Weed", "Rake", "Water", "Mulch"].map((w) => `Home-free ask: ${w}`);
397 for (const title of titles) {
398 const made = openIssue(app, alice, garden, { title });
399 if (!made.ok) throw new Error("issue");
400 expect(assignIssue(app, alice, garden, made.value, alice).ok).toBe(true);
401 }
402 const asks = await (await get("/asks", aliceCookie)).text();
403 for (const title of titles) expect(asks).toContain(title);
404 const home = await (await get("/", aliceCookie)).text();
405 // The feed may tell of the issues; the list of asks to act on is not there.
406 expect(home).not.toContain("assigned to you");
407 expect(home).not.toContain("things need you");
408 expect(home).not.toContain("assigned:");
409 for (const marker of ['id="needs-you"', 'id="live-on-you"', 'id="asks-sentence"', 'id="asks-bulk"'])
410 expect(home).not.toContain(marker);
411 // The top bar links to them, with no count.
412 expect(home).toMatch(/<a\s+id="asks-link"[^>]*href="\/asks"[^>]*>[^<]*<svg[\s\S]*?<\/svg><span class="hide-sm">Asks<\/span>/);
413 });
395414 });
test/proposal-card.test.ts +1 −1
@@ -156,7 +156,7 @@ describe("a wave proposal is one inbox card", () => {
156156 test("home shows the Redirect box on the card, and Later's way back", async () => {
157157 const id = propose("Home wave");
158158 const get = async () =>
159 (await (await fetch(`${servers.url}/`, { headers: { cookie: `${aliceCookie}; forge_mode=studio` } })).text());
159 (await (await fetch(`${servers.url}/asks`, { headers: { cookie: `${aliceCookie}; forge_mode=studio` } })).text());
160160 expect(await get()).toContain(`/asks/proposal/${id}/redirect`);
161161 await post(aliceCookie, `/asks/proposal/${id}/later`, [["back", "/"]]);
162162 const page = await get();
test/review-wait.test.ts +1 −1
@@ -34,7 +34,7 @@ describe("a green agent pull and its reviewer", () => {
3434
3535 const home = async (): Promise<string> =>
3636 (
37 await (await fetch(`${servers.url}/`, { headers: { cookie } })).text()
37 await (await fetch(`${servers.url}/asks`, { headers: { cookie } })).text()
3838 ).replace(/\s+/g, " ");
3939 const wordCtx = (): WordCtx => ({ db: app.db }) as unknown as WordCtx;
4040

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs