mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 04:45:33 -08:00
Add Back to the dashboard to the footer of a finished session
AI Assisted
This commit is contained in:
1 parent
4ca53ccf3a
commit
120c259d9c
4 files changed
+47
-1
No files matched your search
@@ -10,6 +10,7 @@ All notable changes to Plan2Code will be documented in this file.
|
||||
- **web console**: the agent setup page's middle pane now scrolls, so the agent options below the fold (the rest of the list and the templates) can be reached. The list used to be cut off with no scrollbar.
|
||||
- **web console**: the **Install page** link on the agent setup page now opens in your default browser inside the desktop app. It did nothing there, because the page was not told it was running in the app.
|
||||
- **web console**: a note you have sent now shows a small spinner in front of "Sent, waiting for Plan2Code" in the Notes panel, so it is clear Plan2Code is still working on it. The spinner hides when the agent has gone quiet, so a dead session is not mistaken for a slow one.
|
||||
- **web console**: a finished session now has a **Back to the dashboard** button in the footer, beside the disabled Send, so the way home is always in reach. It used to sit far down the finish card, which left the top bar's New Session as the only visible way out.
|
||||
|
||||
### 🔧 Changed
|
||||
|
||||
|
||||
@@ -94,6 +94,37 @@ test("the finished screen shows the next command with --web, copies it, turns Se
|
||||
);
|
||||
});
|
||||
|
||||
// A finish card is long: the way home must not hide below its fold. The footer
|
||||
// carries the same button while the dashboard is on offer and the server is
|
||||
// there, and not on a pause or a finish that never offered it.
|
||||
test("the footer offers Back to the dashboard on a finish that offers it, and not on a pause or a finish without it", async (t) => {
|
||||
const browser = await suite.browser();
|
||||
const s = await openSession(browser, { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
const home = s.page.locator("#btn-dashboard");
|
||||
assert.equal(await home.isHidden(), true, "no way home before the session finishes");
|
||||
s.post({ settle: true, finish: { headline: "The plan is written", body: "Done.", command: "/plan2code-2-document", dashboard: true } });
|
||||
await s.page.locator("#main").getByRole("heading", { name: "The plan is written" }).waitFor();
|
||||
await home.waitFor({ state: "visible" });
|
||||
await home.click();
|
||||
const got = collect(s);
|
||||
assert.deepEqual(
|
||||
got.actions.map(({ i, type }) => ({ i, type })),
|
||||
[{ i: "__dashboard", type: "dashboard" }]
|
||||
);
|
||||
await s.page.getByRole("button", { name: "Opening the dashboard…" }).first().waitFor();
|
||||
assert.equal(await home.isDisabled(), true, "one press locks the button");
|
||||
|
||||
const plain = await openSession(browser, { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
plain.post({ settle: true, finish: { headline: "Nothing else to do", body: "Done." } });
|
||||
await plain.page.locator("#main").getByRole("heading", { name: "Nothing else to do" }).waitFor();
|
||||
assert.equal(await plain.page.locator("#btn-dashboard").isHidden(), true, "no dashboard on offer, no button");
|
||||
|
||||
const paused = await openSession(browser, { t, workflow: "implement", payload: { agent: { status: "working", activity: "Task 1 of 1" } } });
|
||||
paused.post({ finish: { headline: "Paused at Phase 2", command: "/plan2code-3-implement specs/audit-export/overview.md" } });
|
||||
await paused.page.locator("#main").getByRole("heading", { name: "Paused at Phase 2" }).waitFor();
|
||||
assert.equal(await paused.page.locator("#btn-dashboard").isHidden(), true, "a pause has no dashboard button");
|
||||
});
|
||||
|
||||
// What a person sees break: no Continue here on a finish that names a skill, one
|
||||
// beside a git command or a pause, one at the red meter level, or a press that
|
||||
// reaches the agent as anything but the dashboard's own launch.
|
||||
|
||||
@@ -74,7 +74,7 @@ import { openHelpOn } from "./help-dialog.js";
|
||||
import { framed, linkLeavesPage, onAppMessage, startNewSession, tellApp } from "../app-bridge.js";
|
||||
import { continueButton } from "../continue-button.js";
|
||||
import { askOfflineFlipped, askState, declineOpen, renderAside, renderAsk, renderSubagents, renderSubagentsButton } from "./ask.js";
|
||||
import { renderHandoff, renderLoopEnd, renderHomeButton, renderStopButton, renderStopControls, renderStopping, stopInProgress, stopWarning } from "./ending.js";
|
||||
import { renderHandoff, renderLoopEnd, renderHomeButton, renderStopButton, renderStopControls, renderStopping, renderFooterDashboard, stopInProgress, stopWarning } from "./ending.js";
|
||||
import { renderNotepadButton } from "./notepad.js";
|
||||
import { renderActivities } from "./activities.js";
|
||||
import { renderSetup, setupMoved } from "./setup.js";
|
||||
@@ -1871,6 +1871,7 @@ export function renderFooter() {
|
||||
}
|
||||
$("btn-clear").hidden = !(n || notes.length || held);
|
||||
if (foot) foot.hidden = false;
|
||||
renderFooterDashboard();
|
||||
renderWhere();
|
||||
if (foot) foot.hidden = foot.classList.contains("is-dash") && $("footer-where").hidden;
|
||||
}
|
||||
|
||||
@@ -974,8 +974,21 @@ function closeStopping() {
|
||||
setStoppingDone(false);
|
||||
}
|
||||
|
||||
// The way back to the dashboard in the footer of a finished screen, where the
|
||||
// finish card's own button may sit below the fold. Same offer, same press.
|
||||
export function renderFooterDashboard() {
|
||||
const b = $("btn-dashboard");
|
||||
const fin = page.S && finish();
|
||||
b.hidden = !(fin && dashboardLive(fin) && !page.gone);
|
||||
if (b.hidden) return;
|
||||
const { asked, disabled } = afterFinishButton(page.local.afterBuild, "dashboard", page.pendingResult);
|
||||
b.disabled = disabled;
|
||||
b.textContent = asked ? "Opening the dashboard…" : "Back to the dashboard";
|
||||
}
|
||||
|
||||
// The top bar's way home and Stop, wired once at start-up.
|
||||
export function wireEnding() {
|
||||
$("btn-dashboard").addEventListener("click", () => sendAfterBuild("dashboard"));
|
||||
$("btn-home").addEventListener("click", openHomeConfirm);
|
||||
$("home-cancel").addEventListener("click", () => $("home-modal").close());
|
||||
$("home-go").addEventListener("click", goHome);
|
||||
|
||||
Reference in new issue
Block a user