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

The held line on the signed-in home names its next action when nothing is held #12470

Merged opened this

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

Merged

torque/forge:torque/12462-the-held-line-on-the-signed-in-home-name → main 5 commits fork 3 threads · 3 unresolved

  • Merged. torque/12462-the-held-line-on-the-signed-in-home-name was merged into main as ed907eb.

Review

Sign in to review this change.
4 files changed +38 −6
src/web/studio/held.ts +13 −3
@@ -31,10 +31,20 @@ function holds(ctx: Ctx, user: User) {
3131 return out;
3232 }
3333
34 /** One line for each gate that holds work back; nothing where none does. */
35 export function heldLine(ctx: Ctx, user: User): Html | null {
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 {
3639 const found = holds(ctx, user);
37 if (found.length === 0) return null;
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">

Principle 1 and 8: a status sentence plus 'Next:' is a second prompt on a page that already has the composer. One confident sentence with the action as the link. The terminal's heldLines has no matching idle line (both doors).

44 Ready for the next issue: <a href="/new/issue">open one</a>.
45 </p>
46 </section>`;
47 }
3848 return html`<section class="stack stack-tight" id="held-line" aria-label="Held back">
3949 ${found.map(
4050 ({ repo, hold }) =>
src/web/studio/home.ts +1 −1
@@ -300,7 +300,7 @@ export async function studioHome(
300300 // Before the first tell the card is the one box and carries the key line and the composer.
301301 const firstTell = steps.some((s) => s.key === "tell" && !s.done);
302302 const lean = html`<h1 class="sr-only">Home</h1>
303 ${firstSteps} ${address} ${firstTell ? null : crewKeyCard(ctx)} ${heldLine(ctx, user)} ${apps}
303 ${firstSteps} ${address} ${firstTell ? null : crewKeyCard(ctx)} ${heldLine(ctx, user, !firstTell)} ${apps}
304304 <div class="stack">
305305 ${firstTell ? null : composer(ctx, user)}
306306 <p class="small muted">
test/later-gate.test.ts +16 −2
@@ -3,6 +3,8 @@
33 * and when; a held issue says so at its top with Lift; the `Later` label and
44 * the gate are one thing; and one pass over the lot proposes what to close.
55 */
6 import type { Ctx } from "../src/http/context.ts";
7 import { heldLine } from "../src/web/studio/held.ts";
68 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
79 import { mkdtemp, rm } from "node:fs/promises";
810 import { tmpdir } from "node:os";
@@ -87,9 +89,21 @@ describe("the Later gate in plain sight", () => {
8789 await rm(dataDir, { recursive: true, force: true });
8890 });
8991
90 test("a gate that holds nothing says nothing on home", async () => {
92 test("a gate that holds nothing says nothing on the first-tell home, and never a blank panel", async () => {
9193 expect(gateHold(app.db, fresh())).toBeUndefined();
92 expect(await get("/")).not.toContain("held-line");
94 const home = await get("/");
95 expect(home).not.toContain("held-line");
96 });
outdated

Add a fresh-forge case, a case that heldLine without idle stays null, and an assertion on the href by itself.

97
98 test("heldLine says the next action only when asked (idle), and never when the first-tell box is up", () => {
99 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"');
93107 });
94108
95109 test("a new gate shows up on home: how many, who set it", async () => {
test/next-steps-card.test.ts +8
@@ -161,6 +161,14 @@ describe("the next-steps card of a spawned forge", () => {
161161 expect(main).not.toContain('action="/settings/everyday"');
162162 });
163163
164 test("a fresh forge after its first tell names the next issue, in one sentence with a link", async () => {
165 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:");
170 });
171
164172 test("the admin's first home carries exactly three steps, in order, none done", async () => {
165173 const home = await page(owner);
166174 expect(keys(home)).toEqual(["everyday", "apps", "tell"]);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs