mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 04:45:33 -08:00
Carry the spec into the app's New Session and name it beside the meter
AI Assisted
This commit is contained in:
1 parent
7856618a4c
commit
7891c06642
14 files changed
+320
-6
No files matched your search
@@ -3,7 +3,7 @@
|
||||
// Plain functions over `page` (state.js) that more than one screen asks the
|
||||
// same question of, kept here so no screen has to import another to ask it.
|
||||
|
||||
import { page, redraw } from "./state.js";
|
||||
import { page, redraw, saveNow } from "./state.js";
|
||||
import { boardAwaiting } from "./git-board.js";
|
||||
import { defaultSpec, reviewOffer, dashboardOffer, submittedAwaiting, quietLimitMs } from "./answers.js";
|
||||
import { isAgentless } from "./skills.js";
|
||||
@@ -338,6 +338,26 @@ export async function loadOverview() {
|
||||
if (changed) redraw();
|
||||
}
|
||||
|
||||
// A New Session in the desktop app leaves the spec it was in for the fresh
|
||||
// dashboard (spec-carry.mjs). Asked once per page, before the picker is
|
||||
// touched; used only if the picker lists that spec, else the default stands.
|
||||
let specCarryAsked = false;
|
||||
export async function loadSpecCarry() {
|
||||
if (specCarryAsked || !isDashboard() || !scan() || page.local.specSel !== undefined) return;
|
||||
specCarryAsked = true;
|
||||
try {
|
||||
const res = await fetch("/spec-carry", { method: "POST", cache: "no-store" });
|
||||
const { spec } = res.status === 200 ? await res.json() : {};
|
||||
if (!spec || page.local.specSel !== undefined || !specList().some((s) => s.dir === spec)) return;
|
||||
page.local.specSel = spec;
|
||||
saveNow();
|
||||
redraw();
|
||||
loadOverview();
|
||||
} catch {
|
||||
/* no hint: the picker keeps its default */
|
||||
}
|
||||
}
|
||||
|
||||
// The Dashboard's AGENTS.md tab: its view id, and whether it is on now (the
|
||||
// dashboard, with an AGENTS.md the last read found).
|
||||
export const AGENTS_VIEW = "agents-md";
|
||||
|
||||
Reference in new issue
Block a user