mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-12-05 08:15:41 -08:00
Sync upstream v3.2.6: Loop checkboxes, Notes drag handle, US English replies, app update fetch (v3.2.6)
- Implement's and Review's confirm panes carry a Loop checkbox in place of the dashboard's loop cards; loop end-screen buttons show a spinner. - The stacked Notes panel gets a drag handle. - Every skill prompt and the console contracts say to reply in US English. - The desktop app offers Update to latest when the skills are newer, and plan2code update refetches an app that install.json does not record. - Devin Balanced maps to Sonnet 5.5 Medium.
This commit is contained in:
1 parent
9629961f36
commit
658c813428
70 files changed
+818
-242
No files matched your search
@@ -165,6 +165,24 @@ function closeGuideHeld() {
|
||||
// Which stop-screen button was pressed and is waiting on the app's answer, so a
|
||||
// second press cannot send the same request twice.
|
||||
let loopPressed = null;
|
||||
// The ending that press was made on, so a later ending never inherits it.
|
||||
let loopPressedKey = null;
|
||||
|
||||
/** The loop's end screen is gone (the loop runs again): its press is over. */
|
||||
export function forgetLoopEnd() {
|
||||
loopPressed = null;
|
||||
loopPressedKey = null;
|
||||
}
|
||||
|
||||
// What a pressed stop-screen button says while its request is under way, and
|
||||
// the line under it. The app's ok answer only means the request went out: the
|
||||
// agent still takes seconds to start in its terminal, so the button stays busy.
|
||||
const LOOP_BUSY = {
|
||||
resume: ["Continuing…", "Starting the loop again. This page updates when it is running."],
|
||||
fix: ["Opening…", "Opening a session on this phase. Watch the terminal; this page updates when it is ready."],
|
||||
finalize: ["Starting Finalize…", "Finalize is starting in the terminal. This can take a few seconds; this page updates when it is ready."],
|
||||
dashboard: ["Opening the dashboard…", "Leaving this screen. Your work stays as it is."],
|
||||
};
|
||||
|
||||
// The stop screen's Ask agent is up once the app answered a press of Ask a
|
||||
// question: from then on the button opens the Ask tab, so it can never ask the
|
||||
@@ -330,14 +348,30 @@ export function renderLoopEnd(end) {
|
||||
// takes files back out of the index.
|
||||
if (!finished && can.length) card.appendChild(el("p", "loop-end-safe", "Nothing is lost. Your work stays on disk."));
|
||||
|
||||
const mine = loopPressedKey === key ? loopPressed : null;
|
||||
const actions = el("div", "loop-end-actions");
|
||||
// A press waits for the app's answer, and then (an ok answer to anything but
|
||||
// Ask) for the page to move on; only an error frees the buttons again.
|
||||
const busyKey = LOOP_BUTTONS.map(([k, message]) => {
|
||||
const waiting = mine === message && !page.loopAction;
|
||||
const started = mine === message && k !== "ask" && page.loopAction && page.loopAction.ok && page.loopAction.kind === "loop-" + k + "-result";
|
||||
return waiting || started ? k : null;
|
||||
}).find(Boolean);
|
||||
for (const [k, message, label] of LOOP_BUTTONS) {
|
||||
if (!can.includes(k)) continue;
|
||||
const choice = el("div", "loop-end-choice" + (k === recommended ? " is-recommended" : ""));
|
||||
const asked = k === "ask" && askUp;
|
||||
const b = el("button", "btn" + (k === recommended ? " primary" : ""), asked ? "Open the Ask tab" : label);
|
||||
const busy = busyKey === k && LOOP_BUSY[k];
|
||||
const b = el("button", "btn" + (k === recommended ? " primary" : "") + (busy ? " is-busy" : ""), asked ? "Open the Ask tab" : busy ? "" : label);
|
||||
b.type = "button";
|
||||
b.disabled = page.gone || (!asked && loopPressed === message && !page.loopAction);
|
||||
if (busy) {
|
||||
const spin = el("span", "spinner tiny");
|
||||
spin.setAttribute("aria-hidden", "true");
|
||||
b.append(spin, document.createTextNode(busy[0]));
|
||||
b.setAttribute("aria-busy", "true");
|
||||
}
|
||||
// One press at a time: another button waits until this one's request fails.
|
||||
b.disabled = page.gone || (!asked && Boolean(busyKey) && (busyKey === k || (busyKey !== "ask" && k !== "ask")));
|
||||
b.addEventListener("click", () => {
|
||||
if (asked) {
|
||||
page.view = "ask";
|
||||
@@ -349,12 +383,15 @@ export function renderLoopEnd(end) {
|
||||
askUpFor = null;
|
||||
loopDetailsOpen = null;
|
||||
loopPressed = message;
|
||||
loopPressedKey = key;
|
||||
page.loopAction = null;
|
||||
tellApp(message);
|
||||
redraw();
|
||||
});
|
||||
choice.appendChild(b);
|
||||
choice.appendChild(el("p", "loop-end-hint", loopButtonLine(k, stoppedPhase, asked)));
|
||||
const hint = el("p", "loop-end-hint", busy ? busy[1] : loopButtonLine(k, stoppedPhase, asked));
|
||||
if (busy) hint.setAttribute("role", "status");
|
||||
choice.appendChild(hint);
|
||||
actions.appendChild(choice);
|
||||
}
|
||||
if (actions.childElementCount) card.appendChild(actions);
|
||||
|
||||
Reference in new issue
Block a user