Show Planny with a coffee on the New Session confirmation, with console-style buttons

AI Assisted
This commit is contained in:
jparkerweb committed 2026-10-25 12:51:21 -07:00
1 parent a4644d533b
commit 3155298fea
5 files changed
+116 -4

No files matched your search

+1
View File
@@ -28,6 +28,7 @@ All notable changes to Plan2Code will be documented in this file.
- **web console**: a plan's **Build order** card has a **Combine phases** button beside **No changes**. One click fills the box with a request to merge phases where possible while keeping each to a clear concern. It shows only in Plan and Revise plan, where the breakdown is phases.
- **web console**: Help now reads right in the desktop app throughout, not just in the topics fixed before: what this page is and how long it runs, the troubleshooting table and its diagram, scroll memory, drafts, the session meter's red advice, Ask's "no agent" line and Privacy's link and address notes all name the app's window, its terminal panel, **New Session** and **Reconnect the console** instead of a browser tab, a link or a new conversation. The status line's approval hint says "the terminal panel" there too. In a browser, Help is unchanged.
- **desktop app**: the top bar's buttons now look like the console's own: rounded, quiet until hovered, then in your highlight color from User Preferences (the app keeps it for the next launch), with **New Session** outlined in it as the likely next step.
- **desktop app**: the New Session confirmation shows Planny, drawn like the console's own (outlined shell, star eye, smile), holding a steaming cup of coffee, and its buttons use the console's style: **New Session** in your highlight colour, **Cancel** a plain button. The same highlight applies to the panel's other one-button prompts, such as **Retry** and **Reconnect the console**.
- **desktop app**: the top bar is rebuilt around two menus and one next step. The project shows as its folder name, with the full path and **Change project** in its menu; **New Session** always sits just left of the agent's menu, which carries a state dot, an amber **checks off** badge in place of the "Permission checks are off for ..." sentence, and **Change agent** once the agent has ended. The console's and the skills' messages share one slot at the right end that shows the most pressing step with its button (**Reconnect the console**, **Update skills**) and "+N more" for the rest, so the bar no longer overflows when several things go wrong at once. The repeated "Plan2Code" label, the full path, the "agent:" prefix and the long "Nothing starts until you press New Session" line are gone.
## v2.11.1
+1 -1
View File
@@ -93,7 +93,7 @@ Do each of Claude Code, Devin and Codex for a few minutes:
## Agent lifecycle
- [ ] Start, then **New Session**: it confirms once, with no claim about unsaved
- [ ] Start, then **New Session**: it confirms once, with Planny on a coffee break and no claim about unsaved
work, then a fresh agent starts on the same agent, model, effort and permission mode, and the
dashboard shows the pick-up chip with a brief that matches the session
- [ ] An agent that ends by itself leaves the app asking nothing until New Session or **Change agent**
+8 -2
View File
@@ -41,6 +41,7 @@ const nextStepBtn = document.getElementById('next-step-button');
const nextStepMoreEl = document.getElementById('next-step-more');
const frame = document.getElementById('console-frame');
const stateBox = document.getElementById('dashboard-state');
const statePlannyEl = document.getElementById('dashboard-state-planny');
const stateText = document.getElementById('dashboard-state-text');
const stateButton = document.getElementById('dashboard-state-button');
const stateCancelEl = document.getElementById('dashboard-state-cancel');
@@ -252,7 +253,8 @@ function confirmRestart(onYes) {
showState('The agent is restarting on a fresh context window. Please wait for the dashboard to load.');
onYes();
},
() => (frameReady ? hideState() : showState('No dashboard has loaded yet.'))
() => (frameReady ? hideState() : showState('No dashboard has loaded yet.')),
{ tired: true }
);
}
@@ -609,9 +611,13 @@ async function onNoHello() {
}
}
function showState(text, buttonLabel, onButton, onCancel) {
function showState(text, buttonLabel, onButton, onCancel, { tired = false } = {}) {
hideLaunchCard();
hideFirstRun();
// statePlannyEl is an <svg>: unlike HTMLElement, it does not reflect the
// `.hidden` property to the attribute, so toggling the property alone left
// `hidden` in the markup forever. The attribute itself always works.
statePlannyEl.toggleAttribute('hidden', !tired);
stateText.textContent = text;
stateButton.hidden = !buttonLabel;
stateButton.textContent = buttonLabel || '';
+65 -1
View File
@@ -88,6 +88,49 @@
#dashboard-state { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #1e1e1e; text-align: center; padding: 16px; box-sizing: border-box; }
#dashboard-state[hidden] { display: none; }
#dashboard-state-text { margin: 0; max-width: 60ch; overflow-wrap: anywhere; color: #bbb; }
#dashboard-state-planny[hidden] { display: none; }
/* Drawn and coloured like the console's own Planny (styles/planny.css):
an outlined shell, the star eye, a lip of a smile, round hands. */
#dashboard-state-planny { width: 104px; height: auto; overflow: visible; }
#dashboard-state-planny :is(.ps-shell, .ps-smile, .ps-arm path, .ps-mug, .ps-handle) {
fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
}
#dashboard-state-planny .ps-shell { fill: var(--panel-2); }
#dashboard-state-planny .ps-smile { stroke-width: 0.9; }
#dashboard-state-planny .ps-arm path { stroke-width: 1.2; }
#dashboard-state-planny :is(.ps-arm circle, .ps-foot) { fill: var(--ink-2); stroke: none; }
#dashboard-state-planny .ps-eye { fill: var(--ink); }
#dashboard-state-planny .ps-mug { fill: var(--panel-2); stroke-width: 1; }
#dashboard-state-planny .ps-handle { stroke-width: 0.9; }
#dashboard-state-planny .ps-coffee { fill: #9a6b47; }
#dashboard-state-planny .ps-steam path {
fill: none; stroke: var(--ink-3); stroke-width: 0.7; stroke-linecap: round;
animation: ps-steam 2.4s ease-in-out infinite; opacity: 0;
}
#dashboard-state-planny .ps-steam path:nth-child(2) { animation-delay: 0.8s; }
#dashboard-state-planny .ps-steam path:nth-child(3) { animation-delay: 1.6s; }
@keyframes ps-steam {
0% { opacity: 0; transform: translateY(1px); }
35% { opacity: 0.9; }
100% { opacity: 0; transform: translateY(-2.4px); }
}
@media (prefers-reduced-motion: reduce) {
#dashboard-state-planny .ps-steam path { animation: none; opacity: 0.8; }
}
/* The console's buttons (.btn, with .primary for the way forward): the
one action wears the highlight, Cancel is a plain button. */
#dashboard-state-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#dashboard-state-actions button {
appearance: none; font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.2;
padding: 7px 13px; border-radius: 8px; cursor: pointer;
border: 1px solid var(--rule-2); background: var(--panel); color: var(--ink);
transition: filter 0.12s, background 0.12s;
}
#dashboard-state-actions button:hover { background: var(--panel-2); }
#dashboard-state-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#dashboard-state-actions #dashboard-state-button { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#dashboard-state-actions #dashboard-state-button:hover { background: var(--accent); filter: brightness(1.08); }
#dashboard-state-actions button[hidden] { display: none; }
#launch-card {
position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
@@ -207,8 +250,29 @@
<main id="dashboard">
<iframe id="console-frame" title="Plan2Code console dashboard"></iframe>
<div id="dashboard-state" hidden>
<!-- Planny on a coffee break: shown only before a New Session press,
the one state here that is a question rather than a status. The
console's own Planny (shell, star eye, smile, feet, resting left
arm) with the right arm reaching out to a steaming mug. -->
<svg id="dashboard-state-planny" viewBox="0 7 29 23" aria-hidden="true" focusable="false" hidden>
<rect class="ps-foot" x="5.7" y="27.1" width="3.6" height="1.7" rx="0.85" />
<rect class="ps-foot" x="12.7" y="27.1" width="3.6" height="1.7" rx="0.85" />
<rect class="ps-shell" x="3" y="7" width="16" height="20" rx="3.2" />
<path class="ps-eye" d="M11 10.95 L11.79 12.91 L13.9 13.06 L12.28 14.42 L12.79 16.47 L11 15.35 L9.21 16.47 L9.72 14.42 L8.1 13.06 L10.21 12.91 Z" />
<path class="ps-smile" d="M8.3 18.4 Q11 21 13.7 18.4" />
<g class="ps-arm"><path d="M3 18 L1.3 21" /><circle cx="1.3" cy="21" r="0.85" /></g>
<g class="ps-steam">
<path d="M23 17.3 q-0.6 -0.9 0 -1.8 t0 -1.8" />
<path d="M24.4 17.1 q0.6 -0.9 0 -1.8 t0 -1.8" />
<path d="M25.8 17.3 q-0.6 -0.9 0 -1.8 t0 -1.8" />
</g>
<g class="ps-arm"><path d="M19 18 L21.6 20.6" /><circle cx="21.6" cy="20.6" r="0.85" /></g>
<path class="ps-handle" d="M26.7 19.6 h0.3 a1.15 1.15 0 0 1 0 2.3 h-0.3" />
<rect class="ps-mug" x="22.4" y="18.4" width="4.3" height="4.6" rx="0.8" />
<rect class="ps-coffee" x="23" y="19" width="3.1" height="0.8" rx="0.35" />
</svg>
<p id="dashboard-state-text"></p>
<span>
<span id="dashboard-state-actions">
<button id="dashboard-state-button" hidden></button>
<button id="dashboard-state-cancel" hidden>Cancel</button>
</span>
+41
View File
@@ -123,6 +123,19 @@ test("setProjectDir sets the OS window title through windowTitleFor, with a real
assert.ok(caps.permissions.includes("core:window:allow-set-title"), "the capability to call setTitle must be granted, or the call is silently refused at runtime");
});
test("app.js never sets statePlannyEl.hidden directly: SVGElement does not reflect that property to the attribute", () => {
assert.doesNotMatch(APP_JS, /statePlannyEl\.hidden\s*=/, "must use toggleAttribute, not the .hidden property, on an <svg>");
assert.match(APP_JS, /statePlannyEl\.toggleAttribute\('hidden', !tired\)/);
});
test("the Restart confirmation no longer claims unsaved work, and offers New Session with the tired Planny", () => {
const confirmRestart = APP_JS.slice(APP_JS.indexOf("function confirmRestart"), APP_JS.indexOf("function confirmRestart") + 600);
assert.doesNotMatch(confirmRestart, /not saved/, "not always true, so it is gone from this dialog specifically");
assert.match(confirmRestart, /'Restart the agent on a fresh context window\?',\s*\n\s*'New Session',/);
assert.match(confirmRestart, /\{ tired: true \}/, "the confirm dialog asks for the tired Planny");
assert.match(INDEX_HTML, /<svg id="dashboard-state-planny"[^>]*hidden>/, "the tired Planny starts hidden in the markup");
});
test("defaultRightFraction gives the terminal a roomy width when the window has space for it, down to the floor when it does not", () => {
const opts = { minFraction: 0.1, maxFraction: 0.6 };
// Plenty of room: the ideal 440px pane, well inside both the console's own
@@ -175,3 +188,31 @@ test("docked right and collapsed, the terminal panel's Expand button fits the st
}
});
test("toggling the tired Planny <svg>'s hidden attribute the way app.js does actually shows and hides it", async (t) => {
if (!findBrowser()) return t.skip("no Chrome or Edge installed");
const browser = await launchBrowser();
try {
const page = await browser.newPage({ viewport: { width: 700, height: 500 } });
page.on("pageerror", () => {});
await page.goto(pathToFileURL(INDEX_HTML_PATH).href);
// Setting the .hidden *property* on an <svg> does not reflect to the
// attribute the way it does on an HTMLElement; app.js uses
// toggleAttribute for exactly this reason. This exercises that real path.
const shown = await page.evaluate(() => {
document.getElementById("dashboard-state").hidden = false; // a plain div: the .hidden property works fine here
const el = document.getElementById("dashboard-state-planny");
el.toggleAttribute("hidden", false);
return { display: getComputedStyle(el).display, rect: el.getBoundingClientRect() };
});
assert.notEqual(shown.display, "none", "toggleAttribute(false) makes it visible");
assert.ok(shown.rect.width > 0 && shown.rect.height > 0, "it actually takes up space, not just display != none");
const hiddenAgain = await page.evaluate(() => {
const el = document.getElementById("dashboard-state-planny");
el.toggleAttribute("hidden", true);
return getComputedStyle(el).display;
});
assert.equal(hiddenAgain, "none", "toggleAttribute(true) hides it again");
} finally {
await browser.close();
}
});