mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 04:45:33 -08:00
Add Back to the dashboard to the loop's end screen
AI Assisted
This commit is contained in:
1 parent
c8d12a3d99
commit
26cb17f04a
10 files changed
+62
-7
No files matched your search
@@ -62,7 +62,7 @@ export function wireLoopMessages(store, redraw) {
|
||||
store.loopNotifyTest = { waiting: false, ok: data.ok === true, sent: data.sent === true, error: data.ok === true ? null : String(data.error || "The app could not send the test.") };
|
||||
redraw();
|
||||
});
|
||||
for (const kind of ["loop-resume-result", "loop-fix-result", "loop-finalize-result"]) {
|
||||
for (const kind of ["loop-resume-result", "loop-fix-result", "loop-finalize-result", "loop-dashboard-result"]) {
|
||||
onAppMessage(kind, (data) => {
|
||||
store.loopAction = { kind, ok: data.ok === true, error: data.ok === true ? null : String(data.error || "The app could not do that.") };
|
||||
redraw();
|
||||
|
||||
@@ -1225,6 +1225,17 @@ export function renderStatus() {
|
||||
return say("done", `All done. You can close this ${closeWord}.`);
|
||||
}
|
||||
if (page.gone) return say("gone", "Not connected. Your answers are saved.", "", false, true);
|
||||
// The loop's own end screen (the app's `loopEnd`) is no `finish()`: while it
|
||||
// still has presses on offer the move is theirs; with none, it is done.
|
||||
if (page.S.loopEnd) {
|
||||
const end = page.S.loopEnd;
|
||||
const moves = Array.isArray(end.can) ? end.can.length : 0;
|
||||
if (!moves) return say("done", "The loop is done.");
|
||||
return say(
|
||||
"point",
|
||||
end.kind === "finished" ? "Loop finished. Pick what happens next." : "The loop stopped. Pick what happens next."
|
||||
);
|
||||
}
|
||||
// On the way home: the request is sent, and the page stays this skill's
|
||||
// until the agent resumes the session as the dashboard.
|
||||
if (page.local.homeward && !isDashboard()) {
|
||||
|
||||
@@ -165,6 +165,7 @@ const LOOP_BUTTONS = [
|
||||
["resume", "loop-resume", "Resume the loop", "primary"],
|
||||
["fix", "loop-fix", "Fix it by hand", ""],
|
||||
["finalize", "loop-finalize", "Finalize", "primary"],
|
||||
["dashboard", "loop-dashboard", "Back to the dashboard", ""],
|
||||
];
|
||||
|
||||
function shortHash(h) {
|
||||
|
||||
Reference in new issue
Block a user