diff --git a/docs/desktop-app.md b/docs/desktop-app.md index 96291fe..a86dd17 100644 --- a/docs/desktop-app.md +++ b/docs/desktop-app.md @@ -86,9 +86,10 @@ The taskbar entry also shows when Plan2Code needs you, the same states as the co a browser. On Windows a green dot means it is your move and a red dot means it needs attention, with one short burst of flashes when the window is not focused; on macOS the dock shows a red `!` badge on needs attention and bounces once; on Linux a count badge appears where the desktop supports it. There -is no dot while the agent is busy or the step is finished, and it clears when the agent ends or the -page reloads. Turn it off with **Show on the taskbar when Plan2Code needs me** under **User -Preferences → Desktop app** (shown only inside the app). The per-system details are in +is no dot while the agent is busy or once a finished step has nothing left to press (a finished screen +that still offers a button, such as back to the dashboard, keeps the green dot), and it clears when +the agent ends or the page reloads. Turn it off with **Show on the taskbar when Plan2Code needs +me** under **User Preferences → Desktop app** (shown only inside the app). The per-system details are in [plan2code-app/README.md](../plan2code-app/README.md#agents-and-the-taskbar). A slim top bar reads, left to right: the project folder's name, a menu holding its full path and @@ -144,7 +145,7 @@ anyway**. ## Permission checks are off by default, same as the terminal The launch card's permission-mode tick is **on by default** (checks off), matching `plan2code` run the -plain way: the agent starts with checks off (`--permission-mode bypassPermissions` in Claude Code, +plain way, where the same question defaults to prompts off: the agent starts with checks off (`--permission-mode bypassPermissions` in Claude Code, `--permission-mode bypass` in Devin, `--dangerously-bypass-approvals-and-sandbox` in Codex), reading, writing and running commands in your project folder without asking; the agent's amber **checks off** badge in the top bar says so while that agent runs. Untick it before pressing Start agent to keep the agent's normal approval prompts instead. diff --git a/plan2code-app/README.md b/plan2code-app/README.md index aeed2df..205dfc1 100644 --- a/plan2code-app/README.md +++ b/plan2code-app/README.md @@ -18,7 +18,7 @@ The app is optional. The Node web console and the skills never depend on it, so | macOS | no badge (the system badge cannot be green), one bounce when not focused | red `!` dock badge, and one bounce when not focused | | Linux | the urgency hint when not focused | a count badge of 1 where the desktop supports it, and the urgency hint | -There is no dot while busy or finished. The dot clears when the agent ends, the page reloads or the page stops answering, and a lit taskbar button goes back to normal when the window gets focus. **User Preferences → Desktop app** (shown only inside the app) has the switch **Show on the taskbar when Plan2Code needs me**, on by default; off clears the dot and stops flashes. It is saved as `taskbarSignal` in the app's own `~/.plan2code/app.json`. +There is no dot while busy or once a finished step has nothing left to press; a finished screen that still offers a button (back to the dashboard, a review) keeps the green dot. The dot clears when the agent ends, the page reloads or the page stops answering, and a lit taskbar button goes back to normal when the window gets focus. **User Preferences → Desktop app** (shown only inside the app) has the switch **Show on the taskbar when Plan2Code needs me**, on by default; off clears the dot and stops flashes. It is saved as `taskbarSignal` in the app's own `~/.plan2code/app.json`. ## Layout diff --git a/plan2code-app/RELEASE-CHECKLIST.md b/plan2code-app/RELEASE-CHECKLIST.md index d3aaa59..8c15cdf 100644 --- a/plan2code-app/RELEASE-CHECKLIST.md +++ b/plan2code-app/RELEASE-CHECKLIST.md @@ -117,7 +117,7 @@ Do each of Claude Code, Devin and Codex for a few minutes: - [ ] Each **Install page** link opens the right page in the default browser (Claude Code, Devin, Codex) - [ ] Install an agent (or add a custom one), press **Check again**: it appears and Start turns on without restarting the app - [ ] With only one agent installed and nothing remembered, the launch card starts on that agent, not Claude Code -- [ ] Windows: the taskbar button shows a green dot when it is your move and a red dot when Plan2Code needs attention, and no dot while the agent is busy or after it ends +- [ ] Windows: the taskbar button shows a green dot when it is your move and a red dot when Plan2Code needs attention, a green dot on a finished screen that still offers a button (back to the dashboard, a review), and no dot while the agent is busy, once a finished step has nothing left to press, or after the agent ends - [ ] Windows: with the window unfocused, the button gives one short burst of flashes when it becomes your move or needs attention (not again on a repeat) and stays lit until the window gets focus - [ ] macOS: the dock shows a red `!` badge when Plan2Code needs attention (no badge on your move), and bounces once when it becomes your move or needs attention while the app is in the background - [ ] Linux: where the desktop shows badges, a count of 1 appears on needs attention, and the window is marked as wanting attention while unfocused diff --git a/scripts/test-web-console-in-app.mjs b/scripts/test-web-console-in-app.mjs index 6faab67..fa88f6d 100644 --- a/scripts/test-web-console-in-app.mjs +++ b/scripts/test-web-console-in-app.mjs @@ -299,6 +299,27 @@ test("framed, the page tells the app its state once per change, never on a redra assert.deepEqual((await toApp(s, "attention")).at(-1), { plan2code: "attention", state: "plain" }); }); +test("framed, a finished screen with a button still to press is the person's move; one with nothing left is plain", async (t) => { + const browser = await pages.browser(); + const last = async (s) => (await toApp(s, "attention")).at(-1)?.state; + // The finished screen that waits on a press once told the app plain, so the + // taskbar showed no dot while the person was needed. + // Both start busy, so the state read after the finish's line shows is the + // finish's own (the line and the message come from the same redraw). + const WORKING = { agent: { status: "working", activity: "Task 1 of 2" } }; + const offered = await openSession(browser, { t, workflow: "quick-task", payload: WORKING, env: { PLAN2CODE_IN_APP: "1" }, init: FAKE_APP_FRAME }); + await until(async () => (await last(offered)) === "busy", 5000); + offered.post({ finish: { headline: "Quick task done", command: "git add -A && git commit -m x -m y", dashboard: true } }); + await until(async () => (await offered.page.locator("#agent-text").textContent()).includes("Head back to the dashboard"), 5000); + assert.equal(await last(offered), "ready", "a finish offering the dashboard is the person's move"); + + const paused = await openSession(browser, { t, workflow: "implement", payload: WORKING, env: { PLAN2CODE_IN_APP: "1" }, init: FAKE_APP_FRAME }); + await until(async () => (await last(paused)) === "busy", 5000); + paused.post({ finish: { headline: "Paused at Phase 2", command: "/plan2code-3-implement specs/audit-export/overview.md" } }); + await until(async () => (await paused.page.locator("#agent-text").textContent()).startsWith("Paused"), 5000); + assert.equal(await last(paused), "plain", "a paused finish has nothing left to press"); +}); + test("the Desktop app group shows only in the app's frame, reflects the app's saved switch and tells the app when it changes", async (t) => { const browser = await pages.browser(); const plain = await openSession(browser, { t, workflow: "implement", payload: ASKING }); diff --git a/scripts/test-web-console-source.mjs b/scripts/test-web-console-source.mjs index 7ebeb87..0d7177b 100644 --- a/scripts/test-web-console-source.mjs +++ b/scripts/test-web-console-source.mjs @@ -32,15 +32,16 @@ import { joinedCss } from "./css-helpers.mjs"; test("favicon: the dot follows the status line -- busy, ready, attention, plain", () => { // Anything with the spinning ring is busy, even a finished screen opening the dashboard. assert.equal(faviconState({ mood: "work", spin: true }), "busy"); - assert.equal(faviconState({ mood: "work", spin: true, finished: true }), "busy"); + // Pointing is the person's move, a finished screen with a press on offer too. assert.equal(faviconState({ mood: "point" }), "ready"); - // A working mood without the ring is the stale line; adrift and gone need a look too. + // A working mood without the ring is the stale line; adrift (a finished + // screen's stranded press among them) and gone need a look too. assert.equal(faviconState({ mood: "work" }), "attention"); assert.equal(faviconState({ mood: "adrift" }), "attention"); assert.equal(faviconState({ mood: "gone" }), "attention"); assert.equal(faviconState({ mood: "happy" }), "plain"); - assert.equal(faviconState({ mood: "done", finished: true }), "plain"); - assert.equal(faviconState({ mood: "point", finished: true }), "plain"); + // All done or paused, nothing left to press. + assert.equal(faviconState({ mood: "done" }), "plain"); assert.equal(faviconState(), "plain"); }); @@ -420,3 +421,49 @@ test("getting started: the new help, status and finished-screen strings carry no const fresh = stuck.slice(0, stuck.indexOf("