Show a small spinner left of the web console's Questions and Ask tab names while Plan2Code is on it: Questions spins from Send until the answers are picked up, Ask while a picked-up question has no answer yet, and neither turns once the agent goes quiet or offline

This commit is contained in:
jparkerweb committed 2026-10-04 20:14:53 -07:00
1 parent fb71a02756
commit f968aeded8
43 files changed
+337 -126

No files matched your search

+8 -5
View File
@@ -1096,6 +1096,14 @@ h1 {
.ask-disabled-note.is-limit, .ask-disabled-note.is-waiting { color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--rule); }
.ask-disabled-note.is-offline { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn); }
/* Waiting on Plan2Code (an Ask answer, or answers sent from Questions):
the tiny ring, left of the label. */
.view-tab .tab-spin {
display: inline-block;
margin-right: 6px;
vertical-align: -1px;
}
/* A reply landed while another tab was open. */
.view-tab .tab-dot {
display: inline-block;
@@ -3144,11 +3152,6 @@ a.icon-btn { box-sizing: border-box; text-decoration: none; }
0%, 15%, 75%, 100% { transform: scale(1); opacity: 0.16; }
45% { transform: scale(0.7); opacity: 0.08; }
}
.pose .fz-halo { opacity: 0.25; animation: fz-halo 1.6s ease-in-out infinite; }
@keyframes fz-halo {
0%, 100% { transform: scale(1); opacity: 0.2; }
45% { transform: scale(1.3); opacity: 0.4; }
}
.pose .fz-tick { stroke: var(--accent-ink); }
.pose .fz-flag { transform-origin: 0% 50%; animation: fz-wave 1.2s ease-in-out infinite; }
@keyframes fz-wave {
+15 -2
View File
@@ -1825,8 +1825,11 @@ function renderBriefButton() {
function renderViews() {
const nav = $("views");
nav.replaceChildren();
// Sent and not yet picked up: the same ring as Ask, until Plan2Code moves on
// or goes quiet (a turning ring would pass a dead session for a slow one).
const sentBusy = pendingResult && !gone && !agentAdrift();
const tabs = [
{ id: "questions", label: isDashboard() ? "Dashboard" : "Questions", count: myTurn().length },
{ id: "questions", label: isDashboard() ? "Dashboard" : "Questions", count: myTurn().length, busy: sentBusy },
];
// Built in rather than posted: present exactly while the spec in view has
// an overview.md. A tab that vanishes under the person sends them home.
@@ -1835,11 +1838,21 @@ function renderViews() {
else if (view === "overview") view = "questions";
for (const d of docs()) tabs.push({ id: "doc:" + d.id, label: d.title || "Document", count: 0 });
// Always last, on every workflow and after a finish: the Quick question chat.
tabs.push({ id: "ask", label: "Ask", count: 0, dot: chatDot });
// The ring left of "Ask" shows exactly when the conversation's own ring does:
// a question the agent picked up and has not answered yet.
const ask = askState();
const askBusy = ask.view.rows.some((r) => r.working) && ask.send.state !== "offline" && !agentAdrift();
tabs.push({ id: "ask", label: "Ask", count: 0, dot: chatDot, busy: askBusy });
for (const t of tabs) {
const b = el("button", "view-tab", t.label);
b.type = "button";
if (t.busy) {
const spin = el("span", "spinner tiny tab-spin");
spin.setAttribute("aria-hidden", "true");
b.prepend(spin);
b.title = t.id === "ask" ? "Plan2Code is working on an answer" : "Sent. Waiting for Plan2Code";
}
b.setAttribute("aria-current", String(view === t.id || (t.id === "questions" && view === "end")));
if (t.count) {
const c = el("span", "tab-count", String(t.count));
+1 -2
View File
@@ -405,7 +405,7 @@
</svg>
<!-- 4 Finalize: hopping for joy, both arms up, beside the checkmark
flag, confetti drifting down and his star glowing. -->
flag, confetti drifting down. -->
<svg class="pose pose-finalize" data-pose="finalize" viewBox="0 4 240 216" aria-hidden="true" focusable="false">
<ellipse class="shadow fz-shadow" cx="120" cy="198" rx="34" ry="5" />
<g class="fz-hop">
@@ -415,7 +415,6 @@
<rect class="sh" x="80" y="72" width="80" height="108" rx="16" />
<path class="ln" d="M80 116 L60 90" /><circle class="fl" cx="60" cy="90" r="5.5" />
<path class="ln" d="M160 116 L180 90" /><circle class="fl" cx="180" cy="90" r="5.5" />
<circle class="ac fz-halo" cx="120" cy="98" r="23" />
<path class="ey blink" d="M120 84 L123.64 92.98 L133.31 93.67 L125.9 99.92 L128.23 109.33 L120 104.2 L111.77 109.33 L114.1 99.92 L106.69 93.67 L116.36 92.98 Z" />
<path class="ey" d="M106 118 Q120 134 134 118 Z" />
</g>