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 -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>