diff --git a/docs/screenshots/build-dark.webp b/docs/screenshots/build-dark.webp
index 03b803c..b134dcd 100644
Binary files a/docs/screenshots/build-dark.webp and b/docs/screenshots/build-dark.webp differ
diff --git a/docs/screenshots/build-light.webp b/docs/screenshots/build-light.webp
index f1c384d..76b769e 100644
Binary files a/docs/screenshots/build-light.webp and b/docs/screenshots/build-light.webp differ
diff --git a/docs/screenshots/dashboard-dark.webp b/docs/screenshots/dashboard-dark.webp
index fb5d24f..783df29 100644
Binary files a/docs/screenshots/dashboard-dark.webp and b/docs/screenshots/dashboard-dark.webp differ
diff --git a/docs/screenshots/dashboard-light.webp b/docs/screenshots/dashboard-light.webp
index a6e902d..55d766a 100644
Binary files a/docs/screenshots/dashboard-light.webp and b/docs/screenshots/dashboard-light.webp differ
diff --git a/docs/screenshots/dashboard-utilities-dark.webp b/docs/screenshots/dashboard-utilities-dark.webp
index ed2c67e..981c72f 100644
Binary files a/docs/screenshots/dashboard-utilities-dark.webp and b/docs/screenshots/dashboard-utilities-dark.webp differ
diff --git a/docs/screenshots/dashboard-utilities-light.webp b/docs/screenshots/dashboard-utilities-light.webp
index b4812bc..6a0f792 100644
Binary files a/docs/screenshots/dashboard-utilities-light.webp and b/docs/screenshots/dashboard-utilities-light.webp differ
diff --git a/docs/screenshots/doc-dark.webp b/docs/screenshots/doc-dark.webp
index 12b928d..d3fae10 100644
Binary files a/docs/screenshots/doc-dark.webp and b/docs/screenshots/doc-dark.webp differ
diff --git a/docs/screenshots/doc-light.webp b/docs/screenshots/doc-light.webp
index 14a9e71..cc3f4d5 100644
Binary files a/docs/screenshots/doc-light.webp and b/docs/screenshots/doc-light.webp differ
diff --git a/docs/screenshots/finish-dark.webp b/docs/screenshots/finish-dark.webp
index 2f4b404..6f3be0a 100644
Binary files a/docs/screenshots/finish-dark.webp and b/docs/screenshots/finish-dark.webp differ
diff --git a/docs/screenshots/finish-light.webp b/docs/screenshots/finish-light.webp
index be37a32..43524ff 100644
Binary files a/docs/screenshots/finish-light.webp and b/docs/screenshots/finish-light.webp differ
diff --git a/docs/screenshots/question-dark.webp b/docs/screenshots/question-dark.webp
index 38a18b2..b6fca59 100644
Binary files a/docs/screenshots/question-dark.webp and b/docs/screenshots/question-dark.webp differ
diff --git a/docs/screenshots/question-light.webp b/docs/screenshots/question-light.webp
index 7b07644..2662561 100644
Binary files a/docs/screenshots/question-light.webp and b/docs/screenshots/question-light.webp differ
diff --git a/docs/screenshots/signoff-dark.webp b/docs/screenshots/signoff-dark.webp
index b49e09a..830a139 100644
Binary files a/docs/screenshots/signoff-dark.webp and b/docs/screenshots/signoff-dark.webp differ
diff --git a/docs/screenshots/signoff-light.webp b/docs/screenshots/signoff-light.webp
index 8a8e9be..9d8d665 100644
Binary files a/docs/screenshots/signoff-light.webp and b/docs/screenshots/signoff-light.webp differ
diff --git a/scripts/test-web-console-page-ask.mjs b/scripts/test-web-console-page-ask.mjs
index 8378f68..6e0f17a 100644
--- a/scripts/test-web-console-page-ask.mjs
+++ b/scripts/test-web-console-page-ask.mjs
@@ -1,6 +1,6 @@
// Page tests for the Ask tab: a Quick question and the agent's reply, the
// starters, a retry after a failed send, a new conversation, a picture attached
-// to a note, and the Subagents tab. Run with:
+// to a note, the Subagents tab, and the Ask for suggestions chip. Run with:
// node --test scripts/test-web-console-page-ask.mjs
//
// Each test drives the real console in a real Chrome or Edge through
@@ -323,3 +323,167 @@ test("the Subagents tab shows a reported helper's strength line and none for a h
assert.equal(await badges.first().locator(".sa-bars i.on").count(), 2);
assert.equal(await rows.filter({ hasText: "Check the tests" }).locator(".sa-strength").count(), 0);
});
+
+// Ask for suggestions: the chip in the Notes on this panel.
+
+const opt = (k, text) => ({ k, text, detail: `The ${text.toLowerCase()} option.` });
+
+// The page's own staged answers, from the module app.js loaded.
+const stagedOn = (s) =>
+ s.page.evaluate(async () => {
+ const { page } = await import("/state.js");
+ return page.local.staged;
+ });
+
+// Opens a question from the sidebar and waits for its card.
+async function goTo(s, id, title) {
+ await s.page.locator("#sidebar").getByRole("button", { name: new RegExp(title) }).click();
+ await itemCard(s.page, id).waitFor();
+ await s.page.waitForFunction((want) => document.getElementById("aside").dataset.item === want, id);
+}
+
+const chipOf = (s) => s.page.locator("#aside").getByRole("button", { name: "Ask Plan2Code for suggestions on this question" });
+
+// What a person sees break: the chip on a card where there is nothing to pick,
+// on a settled record, or missing where they are unsure what to pick.
+test("the Ask for suggestions chip shows on open choice, multi and confirm cards only", async (t) => {
+ const s = await openSession(await suite.browser(), {
+ t,
+ workflow: "plan",
+ payload: {
+ items: [
+ { id: "c1", kind: "choice", title: "Export format", body: "Which format?", options: [opt("A", "CSV"), opt("B", "JSON")] },
+ { id: "m1", kind: "multi", title: "Columns", body: "Which?", options: [opt("1", "Date"), opt("2", "User")] },
+ { id: "y1", kind: "confirm", title: "Keep going", body: "Carry on?" },
+ { id: "t1", kind: "text", title: "What to call it", body: "A name.", required: false },
+ { id: "d1", kind: "choice", title: "Old pick", body: "Which?", options: [opt("A", "CSV"), opt("B", "JSON")], status: "answered", answer: { k: "B" } },
+ ],
+ agent: { status: "waiting" },
+ },
+ });
+ for (const [id, title, shown] of [["c1", "Export format", 1], ["m1", "Columns", 1], ["y1", "Keep going", 1], ["t1", "What to call it", 0], ["d1", "Old pick", 0]]) {
+ await goTo(s, id, title);
+ assert.equal(await chipOf(s).count(), shown, `chip on ${id}`);
+ if (shown) assert.equal(await textOf(chipOf(s)), "Ask for suggestions");
+ }
+});
+
+// What a person sees break: asking for suggestions sends or clears picks they
+// staged, locks the card, or keeps the note they typed in the box.
+test("Ask for suggestions sends one flagged note and leaves every staged pick staged", async (t) => {
+ const s = await openSession(await suite.browser(), {
+ t,
+ workflow: "plan",
+ payload: {
+ items: [
+ { id: "c1", kind: "choice", title: "Export format", body: "Which format?", options: [opt("A", "CSV"), opt("B", "JSON")] },
+ { id: "c2", kind: "choice", title: "Where it goes", body: "Where?", options: [opt("A", "Email"), opt("B", "Slack")] },
+ ],
+ agent: { status: "waiting" },
+ },
+ });
+ await goTo(s, "c2", "Where it goes");
+ await itemCard(s.page, "c2").getByLabel("Slack").check();
+ await goTo(s, "c1", "Export format");
+ await itemCard(s.page, "c1").getByLabel("JSON").check();
+ await s.page.waitForFunction(async () => {
+ const { page } = await import("/state.js");
+ return page.local.staged.c1 && page.local.staged.c2;
+ });
+ await fillBox(s.page.locator("#thread-c1"), "I lean B");
+ await chipOf(s).click();
+
+ const got = collect(s);
+ assert.equal(got.actions.length, 1, `one action: ${JSON.stringify(got.actions)}`);
+ const [action] = got.actions;
+ assert.equal(action.i, "c1");
+ assert.equal(action.type, "comment");
+ assert.equal(action.suggest, true);
+ assert.equal(action.text, "I lean B");
+ assert.ok(got.reply.startsWith("Suggestions wanted on Export format: I lean B"), got.reply);
+
+ await s.page.waitForFunction(() => document.getElementById("suggest-c1")?.disabled);
+ const staged = await stagedOn(s);
+ assert.equal(staged.c1 && staged.c1.k, "B", "the pick on this card is still staged");
+ assert.equal(staged.c2 && staged.c2.k, "B", "the pick on the other card is still staged");
+ const card = itemCard(s.page, "c1");
+ assert.match(await textOf(card), /Ready to send/i);
+ assert.equal(await card.getByLabel("CSV").isEnabled(), true, "the card is still a live form");
+ assert.equal(await boxValue(s.page.locator("#thread-c1")), "");
+ await goTo(s, "c2", "Where it goes");
+ assert.match(await textOf(itemCard(s.page, "c2")), /Ready to send/i);
+});
+
+// What a person sees break: a request for suggestions that vanishes with no
+// sign it went, or a chip that never comes back once the agent has answered.
+test("a request for suggestions shows tagged and waiting, and the chip comes back once the agent replies", async (t) => {
+ const s = await openSession(await suite.browser(), {
+ t,
+ workflow: "plan",
+ payload: {
+ items: [{ id: "c1", kind: "choice", title: "Export format", body: "Which format?", options: [opt("A", "CSV"), opt("B", "JSON")] }],
+ agent: { status: "waiting" },
+ },
+ });
+ await itemCard(s.page, "c1").waitFor();
+ await chipOf(s).click();
+ const got = collect(s);
+ assert.ok(got.reply.startsWith("Suggestions wanted on Export format: (no note)"), got.reply);
+
+ const mine = s.page.locator("#aside .msg.you.pending");
+ await mine.locator(".suggest-tag", { hasText: "Asked for suggestions" }).waitFor();
+ assert.match(await textOf(mine), /Sent, waiting for Plan2Code/i);
+ await s.page.waitForFunction(() => document.getElementById("suggest-c1")?.disabled);
+
+ s.post({ items: [{ id: "c1", thread: [{ who: "agent", text: "I would pick JSON: your scripts read it directly." }] }], agent: { status: "waiting" } });
+ await s.page.locator("#aside .msg", { hasText: "I would pick JSON" }).waitFor();
+ await s.page.waitForFunction(() => document.getElementById("suggest-c1") && !document.getElementById("suggest-c1").disabled);
+ assert.equal(await s.page.locator("#aside .msg.you .suggest-tag").count(), 1, "the request keeps its tag once answered");
+});
+
+// What a person sees break: a pick on an option the agent took away still
+// staged and sent, or the other picks on the card cleared with it.
+test("a re-post that removes a staged multi option clears only that pick and says so", async (t) => {
+ const s = await openSession(await suite.browser(), {
+ t,
+ workflow: "plan",
+ payload: {
+ items: [{ id: "m1", kind: "multi", title: "Columns", body: "Which?", options: [opt("1", "Date"), opt("2", "User"), opt("3", "Action")] }],
+ agent: { status: "waiting" },
+ },
+ });
+ const card = itemCard(s.page, "m1");
+ await card.getByLabel("Date").check();
+ await card.getByLabel("Action").check();
+ await s.page.waitForFunction(async () => {
+ const { page } = await import("/state.js");
+ return (page.local.staged.m1?.ks || []).length === 2;
+ });
+
+ s.post({ items: [{ id: "m1", body: "Which, now that Action is gone?", options: [opt("1", "Date"), opt("2", "User")] }] });
+ await s.page.locator("#banner", { hasText: "no longer matches the reworded question" }).waitFor();
+ assert.match(await textOf(s.page.locator("#banner")), /A pick on Columns no longer matches/);
+ assert.deepEqual((await stagedOn(s)).m1.ks, ["1"]);
+ await itemCard(s.page, "m1").getByText("Which, now that Action is gone?").waitFor();
+ assert.equal(await itemCard(s.page, "m1").getByLabel("Date").isChecked(), true);
+ // A notice, not a fault: it clears by itself.
+ await s.page.locator("#banner").waitFor({ state: "hidden", timeout: 20000 });
+});
+
+// What a person sees break: a chip that sends past the Implementation Loop,
+// which answers for the agent while it drives.
+test("the Ask for suggestions chip stays away while the loop drives, even on a card waiting for the person", async (t) => {
+ const s = await openSession(await suite.browser(), {
+ t,
+ workflow: "implement",
+ open: ["--loop"],
+ env: { PLAN2CODE_IN_APP: "1" },
+ payload: {
+ items: [{ id: "c1", kind: "choice", title: "Export format", body: "Which format?", options: [opt("A", "CSV"), opt("B", "JSON")] }],
+ agent: { status: "waiting" },
+ },
+ });
+ await itemCard(s.page, "c1").getByLabel("JSON").waitFor();
+ await s.page.locator("#thread-c1").waitFor();
+ assert.equal(await chipOf(s).count(), 0, "no chip while the loop drives");
+});
diff --git a/src/web-console/console.md b/src/web-console/console.md
index 877870a..500e3a6 100644
--- a/src/web-console/console.md
+++ b/src/web-console/console.md
@@ -39,6 +39,8 @@ With nothing to post, `node "
+ On a question with options to pick, Ask for suggestions + asks Plan2Code what it would pick and why, on its own: anything you + already ticked stays as it is, and anything typed in the note box goes + along with it. The answer appears in the same panel, and sometimes the + question comes back reworded. +
Three ways, whichever is handiest: