// Plan2Code Web Console - the hop rule. // // Which hops from one workflow to another start the new skill on a clean // page. One rule, called by both sides that act on it: the server // (cmd-open.mjs blanks the stored session and drops the staged draft) and the // page (screens/core.js drops what it kept for the last skill: the question // on screen, the open tab, anything staged against its item ids). No imports // and no DOM access: nothing runs at load. // True when a hop from workflow `from` to workflow `to` starts clean: // - a launch from the dashboard menu gets a clean page, not the last // skill's questions and tabs under its own name; // - going back to the dashboard clears the last skill; // - Git counts as a launch from anywhere: Commit it now on a finished // screen and Changelog's "Commit this now?" both stand in for its // dashboard card, and a finish left behind would keep the page on the old // ending above the new board. // A skill run inline from another (a quick task's review) never switches // workflow, so it keeps the page; nor does a resume into the same workflow. export function startsClean(from, to) { if (typeof from !== "string" || typeof to !== "string" || !from || !to || from === to) return false; return from === "dashboard" || to === "dashboard" || to === "git"; }