From 2f1b83f35b998c3f13c66329cc7236f1ed3feeb2 Mon Sep 17 00:00:00 2001 From: Dylan Trotter Date: Tue, 27 Oct 2026 15:53:55 +0000 Subject: [PATCH] stewards: show nextAction verbatim and put the deployment phrase first (BB-86) --- plugins/stewards/DESIGN.md | 9 +++++---- plugins/stewards/README.md | 4 +++- plugins/stewards/sidebar-app.test.tsx | 4 ++-- plugins/stewards/sidebar.test.ts | 23 +++++++++++++---------- plugins/stewards/sidebar.ts | 9 ++++++--- 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/plugins/stewards/DESIGN.md b/plugins/stewards/DESIGN.md index dd285fa6..c5d4d76e 100644 --- a/plugins/stewards/DESIGN.md +++ b/plugins/stewards/DESIGN.md @@ -1511,10 +1511,11 @@ project steward footer row is the grey ring. else `on hold`; `stuck` for an open stuck escalation; `N worker(s) running` counting only workers whose worker-table status is `running` (a busy steward or reviewer with no running worker falls through, rather than reading `0 workers -running`); `waiting on ` when the status actor is `other` (an -external wait is not a block, so its colour follows the glyph); the newest -deployment watch's state (`deploying`, `deployed`, `deploy failed`); the status -`nextAction`; otherwise `no report yet`. The phrase's colour follows the +running`); the newest deployment watch's state (`deploying`, `deployed`, +`deploy failed`), ahead of the free-text `nextAction` whatever the actor (BB-86); +the status `nextAction` verbatim, with `the other party` standing in for an +`other` actor that has no report (an external wait is not a block, so its colour +follows the glyph); otherwise `no report yet`. The phrase's colour follows the glyph's. `sidebar.ts` derives `state`, `section` and `phrase` as pure functions and sorts by the section rules; `sidebar.test.ts` covers every rule and the precedence. diff --git a/plugins/stewards/README.md b/plugins/stewards/README.md index a48b2175..9f534d5f 100644 --- a/plugins/stewards/README.md +++ b/plugins/stewards/README.md @@ -402,7 +402,9 @@ switchable from where you are. **The row and the glyphs (BB-76).** An effort row is two lines: the glyph, the entity key in bold and the title on line one; the kind (`ticket`, `pull request`, `review`, `ops`), the entity's phase when it has one, and the status -phrase on line two. A row that needs you adds its prompt and one-click actions +phrase on line two (first match wins: `needs you`, `blocked on …`, a hold, +`stuck`, `N worker(s) running`, the deployment state, then the report's +`nextAction` verbatim). A row that needs you adds its prompt and one-click actions under line two, in the same row. The glyph is one of four, in precedence order `you › blocked › running › quiet`: a solid yellow dot when it waits on you, an empty red ring when blocked, a blue ring that pulses slowly while a worker or diff --git a/plugins/stewards/sidebar-app.test.tsx b/plugins/stewards/sidebar-app.test.tsx index 3f9d47b9..2c1d7b0a 100644 --- a/plugins/stewards/sidebar-app.test.tsx +++ b/plugins/stewards/sidebar-app.test.tsx @@ -507,7 +507,7 @@ describe("the stewards sidebar sections, glyphs and phrases (BB-76)", () => { expect(inflight.textContent).toContain("Waiting ticket"); expect(inflight.textContent).not.toContain("Needs you"); expect(glyphOf(slot, "Waiting ticket")).toBe("quiet"); - expect(lineTwo(slot, "Waiting ticket")).toBe("ticket · waiting on an author push"); + expect(lineTwo(slot, "Waiting ticket")).toBe("ticket · an author push"); // Monitors holds the ops wait, grey, once opened. fireEvent.click(slot.getByRole("button", { name: /Monitors/u })); await waitFor(() => expect(slot.getByText("Ops watch: acme/web")).toBeTruthy()); @@ -518,7 +518,7 @@ describe("the stewards sidebar sections, glyphs and phrases (BB-76)", () => { const monitors = slot.getByRole("button", { name: /Monitors/u }).closest("section")!; expect(monitors.textContent).toContain("Ops watch: acme/web"); expect(glyphOf(slot, "Ops watch: acme/web")).toBe("quiet"); - expect(lineTwo(slot, "Ops watch: acme/web")).toBe("ops · waiting on Next scheduled look"); + expect(lineTwo(slot, "Ops watch: acme/web")).toBe("ops · Next scheduled look"); const threads = slot.getByRole("button", { name: /Threads/u }).closest("section")!; expect(threads.textContent).toContain("One-off"); slot.lifecycle.unmount(); diff --git a/plugins/stewards/sidebar.test.ts b/plugins/stewards/sidebar.test.ts index b595b6ab..d0fa9611 100644 --- a/plugins/stewards/sidebar.test.ts +++ b/plugins/stewards/sidebar.test.ts @@ -242,7 +242,7 @@ describe("stewards sidebar grouping", () => { // ops + other is a monitor, grey, with the wait phrase. expect(tab.monitors.map((e) => e.key)).toEqual(["acme/deps"]); expect(tab.monitors[0]!.state).toBe("quiet"); - expect(tab.monitors[0]!.phrase).toBe("waiting on Next scheduled look"); + expect(tab.monitors[0]!.phrase).toBe("Next scheduled look"); // ops with blockedOn or needsUser is still blocked, out of monitors. expect(tab.blocked.map((e) => e.key).sort()).toEqual(["acme/ns", "acme/sentry"]); // ticket + other is in flight, grey, with the wait phrase; review + other @@ -250,7 +250,7 @@ describe("stewards sidebar grouping", () => { expect(tab.efforts.map((e) => e.key).sort()).toEqual(["ENG-1", "acme/web#728"]); const ticketWait = tab.efforts.find((e) => e.key === "ENG-1")!; expect(ticketWait.state).toBe("quiet"); - expect(ticketWait.phrase).toBe("waiting on an author push"); + expect(ticketWait.phrase).toBe("an author push"); const reviewWait = tab.efforts.find((e) => e.key === "acme/web#728")!; expect(reviewWait.state).toBe("running"); expect(reviewWait.phrase).toBe("1 worker running"); @@ -342,23 +342,26 @@ describe("stewards sidebar state, section and phrase (BB-76)", () => { expect(effortPhrase(effort({ key: "d", hold: "a freeze" }))).toBe("on hold"); // 4. stuck expect(effortPhrase(effort({ key: "e", stuck: true }))).toBe("stuck"); - // 5. running workers, before the external wait so a waiting effort with a - // running worker reads the count (BB-81). + // 5. running workers, before the deployment watch and the free-text + // nextAction, so a waiting effort with a running worker reads the count (BB-81). expect(effortPhrase(effort({ key: "g", runningWorkers: 2 }))).toBe("2 workers running"); expect(effortPhrase(effort({ key: "h", runningWorkers: 1 }))).toBe("1 worker running"); // A busy steward or reviewer with no running worker falls through, not "0 workers running". expect(effortPhrase(effort({ key: "g2", busy: true, statusNextAction: "a reviewer is checking" }))).toBe("a reviewer is checking"); expect(effortPhrase(effort({ key: "g3", busy: true }))).toBe("no report yet"); - // 6. actor = other, after the count - expect(effortPhrase(effort({ key: "f", statusActor: "other", statusNextAction: "an owner LGTM" }))).toBe("waiting on an owner LGTM"); - expect(effortPhrase(effort({ key: "f2", statusActor: "other", statusNextAction: "the vendor", runningWorkers: 1 }))).toBe("1 worker running"); - // 7. deployment + // 6. deployment, ahead of the free-text nextAction whatever the actor (BB-86). expect(effortPhrase(effort({ key: "i", deployment: "merged" }))).toBe("deploying"); expect(effortPhrase(effort({ key: "j", deployment: "deployed" }))).toBe("deployed"); expect(effortPhrase(effort({ key: "k", deployment: "failed" }))).toBe("deploy failed"); - // 8. nextAction + expect(effortPhrase(effort({ key: "i2", statusActor: "other", deployment: "merged", statusNextAction: "Wait for a bb-server build" }))).toBe("deploying"); + expect(effortPhrase(effort({ key: "i3", statusActor: "other", runningWorkers: 1, deployment: "merged" }))).toBe("1 worker running"); + // 7. nextAction, verbatim for every actor (BB-86): the external wait is not a prefix. expect(effortPhrase(effort({ key: "l", statusNextAction: "wait for the review" }))).toBe("wait for the review"); - // 9. no report + expect(effortPhrase(effort({ key: "f", statusActor: "other", statusNextAction: "an owner LGTM" }))).toBe("an owner LGTM"); + expect(effortPhrase(effort({ key: "f2", statusActor: "other", statusNextAction: "Wait for the hold to lift." }))).toBe("Wait for the hold to lift."); + expect(effortPhrase(effort({ key: "f3", statusActor: "other", statusNextAction: "the vendor", runningWorkers: 1 }))).toBe("1 worker running"); + // 8. no report: `the other party` stands in for an external wait with no nextAction. + expect(effortPhrase(effort({ key: "n", statusActor: "other" }))).toBe("the other party"); expect(effortPhrase(effort({ key: "m" }))).toBe("no report yet"); }); diff --git a/plugins/stewards/sidebar.ts b/plugins/stewards/sidebar.ts index 2c184054..a365b3d0 100644 --- a/plugins/stewards/sidebar.ts +++ b/plugins/stewards/sidebar.ts @@ -209,8 +209,11 @@ export function deploymentPhrase(state: DeployState): string { } /** - * Line two's status phrase, first match wins (BB-76): - * needs you › blockedOn › hold › stuck › running › actor=other › deployment › nextAction › no report. + * Line two's status phrase, first match wins (BB-76, BB-86): + * needs you › blockedOn › hold › stuck › running › deployment › nextAction › no report. + * An external wait is not a prefix: an `other` actor reads its `nextAction` + * verbatim like any other actor, and `the other party` only stands in when + * there is no report at all. */ export function effortPhrase(e: EffortStatus): string { if (e.needsUser) return "needs you"; @@ -225,9 +228,9 @@ export function effortPhrase(e: EffortStatus): string { const n = e.runningWorkers; return `${n} worker${n === 1 ? "" : "s"} running`; } - if (e.statusActor === "other") return `waiting on ${e.statusNextAction ?? "the other party"}`; if (e.deployment !== null) return deploymentPhrase(e.deployment); if (e.statusNextAction !== null) return e.statusNextAction; + if (e.statusActor === "other") return "the other party"; return "no report yet"; }