Merge pull request #12 from jparkerweb/docs-git-board

Show the git board on the docs site, and fix a test that failed under a global core.autocrlf
This commit is contained in:
jparkerweb authored and GitHub committed 2026-10-14 20:57:33 -07:00
commit 80ae3decdd
11 files changed
+88 -8

No files matched your search

+1
View File
@@ -98,4 +98,5 @@ When you make a mistake, get corrected, or discover something about this codebas
- When a new first-run dialog is added to the web console, set its seen flag in `scripts/capture-screenshots.mjs`'s `looks.json` too: the Welcome dialog once covered the regenerated dashboard screenshots until `welcomeSeen: true` was added.
- After a sync, grep for the upstream brand word on its own too, not only the full product name: the rebrand map misses a bare brand word inside identifiers and fixtures (a `KEPT_<BRAND>_ENTRIES` constant, a `<brand>Dir` option, a `"<brand>"` test folder, an owner slug in a git remote URL), and v2.7.0's sync let all four through until the residual grep caught them.
- After a sync, grep for the upstream ticket key followed by anything, not only by digits: v2.8.0's git board fixtures built branch names as `` `feature/<KEY>-${11000 + i}-…` `` template literals, which a digits-only rewrite to `ABC-<n>` misses.
- Import `scripts/skill-script-helpers.mjs` in any test that builds git fixtures for a skill script or `git-repo.mjs`: it scrubs the whole test process's git config, so fixtures, imported modules and spawned scripts agree. Mixed configs broke `git plan switch` once (a global `core.autocrlf=true` checked fixtures out with CRLF the scrubbed script read as changed).
- Before deleting a test file that upstream split or removed, diff plan2code's copy against the rebranded upstream base and port the plan2code-only tests: v2.7.0's split of the web console suite would otherwise have dropped seven hardening tests (now in `scripts/test-web-console-hardening.mjs`).
+11
View File
@@ -2,6 +2,17 @@
All notable changes to Plan2Code will be documented in this file.
## v2.8.1
### 📚 Documentation
- **docs**: the docs site now shows the git board, with a light and dark screenshot under the pipeline's "Any time" cards: the Changes, Branches and Sync tabs, opening on the likely next step, the tab badges, the single block for a stopped rebase or merge, and asking before every push, publish or delete.
- **docs**: `scripts/capture-screenshots.mjs` gains a `git` shot. It builds a sample repository with a pushed feature branch and three changes to commit, so `node scripts/capture-screenshots.mjs --only git` regenerates the images.
### 🐛 Fixed
- **tests**: `npm test` no longer fails `git plan switch` on a machine with a global `core.autocrlf=true`. `scripts/skill-script-helpers.mjs` now strips back the git config for the whole test process, so test fixtures, imported modules and the scripts under test always use the same settings.
## v2.8.0
### 🔧 Changed
+11
View File
@@ -310,6 +310,17 @@ footer a { color: inherit; }
<div class="util"><span class="chip">Any time</span><h3>Changelog</h3><p>Picks the next version and drafts the entries, which you edit before Git commits them.</p></div>
<div class="util"><span class="chip">Any time</span><h3>Git</h3><p>A board for branches, pull, push and commits that opens on the likely next step.</p></div>
</div>
<div class="row" id="git-board">
<picture class="shot">
<source media="(prefers-color-scheme: dark)" srcset="screenshots/git-dark.webp">
<img src="screenshots/git-light.webp" width="2560" height="1600" loading="lazy" alt="The git board on feature/task-endpoints: the Changes tab, badged 3, opens on a Next step card reading Commit 3 files, above the three changed files ticked for the commit. Branches and Sync tabs and a Done with git button sit beside it.">
</picture>
<div>
<h3>The git board</h3>
<p>Three tabs, <strong>Changes</strong>, <strong>Branches</strong> and <strong>Sync</strong>, and it opens on the one holding your likely next step: commit, pull, push, publish, open a pull request or tidy up branches. That step is one main button. Each tab badges what is waiting on it, a stopped rebase or merge gets one block with every file marked, and nothing is pushed, published or deleted without asking. It never force-pushes.</p>
</div>
</div>
</div>
</section>
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code",
"version": "2.8.0",
"version": "2.8.1",
"private": true,
"bin": {
"plan2code-install": "./install.js"
+49 -5
View File
@@ -13,7 +13,7 @@
// The shots use the console's Ocean highlight rather than its default orange:
// it is the console's nearest to the Plan2Code blue the site and README use.
//
// Shots: dashboard, dashboard-utilities, question, doc, build, signoff, finish, ask.
// Shots: dashboard, dashboard-utilities, question, doc, build, signoff, finish, ask, git.
//
// Needs puppeteer-core (`npm i --no-save puppeteer-core`, never added to
// package.json) and a local Chrome or Edge. Writes nothing outside its temp
@@ -67,6 +67,9 @@ const SHOTS = {
signoff: { workflow: "implement", posts: ["signoff"] },
finish: { workflow: "implement", posts: ["signoff", "finish"] },
ask: { workflow: "plan", posts: ["question"], ask: "Where are tasks paged?" },
// The git board draws itself from a real repository, so this shot runs in
// its own git sample project; the post only hands the board back to you.
git: { workflow: "git", posts: ["git"], repo: true },
};
// On Windows the temp dir sits under the user's profile, and the page can
@@ -166,6 +169,46 @@ function makeSampleProject() {
return project;
}
function git(cwd, ...gitArgs) {
const r = spawnSync("git", gitArgs, { cwd, env: ENV, encoding: "utf8" });
if (r.status !== 0) throw new Error(`git ${gitArgs.join(" ")} failed: ${(r.stderr || "").trim()}`);
}
// The git shot's project: the same sample in a repository whose feature branch
// is pushed to a local bare "origin" and has three changes to commit, so the
// board opens on Changes with Commit as the next step. It sits in its own
// folder so the other shots never see a repository.
let GIT_PROJECT = null;
function makeGitProject() {
if (GIT_PROJECT) return GIT_PROJECT;
const parent = path.join(SCRATCH, "git");
fs.mkdirSync(parent, { recursive: true });
const origin = path.join(parent, "origin.git");
git(parent, "init", "--bare", "--initial-branch=main", origin);
const prev = SCRATCH;
SCRATCH = parent;
const project = makeSampleProject();
SCRATCH = prev;
const id = ["-c", "user.name=Sam Rivera", "-c", "user.email=sam@example.com", "-c", "commit.gpgsign=false"];
git(project, "init", "--initial-branch=main");
git(project, "remote", "add", "origin", origin);
git(project, "add", "-A");
git(project, ...id, "commit", "-m", "Scaffold the task API and its specs");
git(project, "push", "-u", "origin", "main");
git(project, "switch", "-c", "feature/task-endpoints");
fs.writeFileSync(path.join(project, "src", "tasks", "routes.js"), "// The /tasks routes.\nexport default async function routes(app) {}\n");
git(project, "add", "-A");
git(project, ...id, "commit", "-m", "Register the /tasks routes plugin");
git(project, "push", "-u", "origin", "feature/task-endpoints");
// A fetch stamps FETCH_HEAD, so the board says "Last refreshed" rather than "Never".
git(project, "fetch", "origin");
fs.appendFileSync(path.join(project, "src", "tasks", "paginate.js"), "\nexport const MAX_LIMIT = 50;\n");
fs.writeFileSync(path.join(project, "src", "tasks", "schema.js"), "// The Zod schema for a task.\nexport const taskSchema = {};\n");
fs.appendFileSync(path.join(project, "specs", "task-api", "phase-3.md"), "\n<!-- Task 3.1 in progress -->\n");
GIT_PROJECT = project;
return project;
}
function cli(cwd, ...cliArgs) {
const r = spawnSync(process.execPath, [CONSOLE_CLI, ...cliArgs], { cwd, env: ENV, encoding: "utf8" });
const line = (r.stdout || "").trim().split("\n").pop() || "";
@@ -194,7 +237,7 @@ function stage(project, shot) {
// (the dashboard's wake-up is the longest).
async function settle(page) {
await page.waitForNetworkIdle({ idleTime: 500, timeout: 15000 }).catch(() => {});
await page.waitForSelector(".dash-card, .card, .handoff, .ask-pane, .doc", { timeout: 15000 }).catch(() => {});
await page.waitForSelector(".dash-card, .card, .handoff, .ask-pane, .doc, .git-board", { timeout: 15000 }).catch(() => {});
await sleep(3500);
}
@@ -348,12 +391,13 @@ async function main() {
args: ["--no-first-run", "--no-default-browser-check", "--mute-audio"],
});
for (const name of names) {
const { sid, url } = stage(project, name);
const where = SHOTS[name].repo ? makeGitProject() : project;
const { sid, url } = stage(where, name);
try {
if (SHOTS[name].ask) await captureAsk(browser, project, sid, url, SHOTS[name].ask);
if (SHOTS[name].ask) await captureAsk(browser, where, sid, url, SHOTS[name].ask);
else await capture(browser, url, name, SHOTS[name]);
} finally {
cli(project, "stop", "--session", sid);
cli(where, "stop", "--session", sid);
}
}
} finally {
+1
View File
@@ -13,6 +13,7 @@ and dark WebP images in `docs/screenshots/`.
| `build.json` | A phase being built: the progress bar, the task list and the current task |
| `signoff.json` | The completion report and the sign-off card |
| `finish.json` | The finished screen after sign-off (posted after `signoff.json`) |
| `git.json` | The git board, handed back to you in a sample repository with three changes to commit (the script builds the repository) |
Refresh every image with `node scripts/capture-screenshots.mjs`, or one with
`--only <shot>`.
+5
View File
@@ -0,0 +1,5 @@
{
"reread": true,
"board": { "describe": "task-schema-and-paging" },
"agent": { "status": "waiting" }
}
+8 -1
View File
@@ -57,6 +57,13 @@ export function scrubbedEnv(extra = {}) {
return { ...e, GIT_CONFIG_NOSYSTEM: "1", GIT_CONFIG_GLOBAL: EMPTY_GITCONFIG, ...extra };
}
// Every git in a test process that imports this file runs under that same
// scrubbed config: fixture commands, the modules a test imports and the
// scripts it spawns. Mixed configs disagree: a global core.autocrlf=true once
// checked fixtures out with CRLF that the scrubbed scripts read as changed.
for (const k of AMBIENT_GIT_ENV) delete process.env[k];
Object.assign(process.env, { GIT_CONFIG_NOSYSTEM: "1", GIT_CONFIG_GLOBAL: EMPTY_GITCONFIG });
export function runScript(skill, script, args, { cwd, env } = {}) {
const r = spawnSync(process.execPath, [path.join(SKILLS, skill, "scripts", script), ...args], {
cwd: cwd || ROOT,
@@ -83,7 +90,7 @@ export function write(root, rel, content) {
export const read = (root, rel) => fs.readFileSync(path.join(root, rel), "utf8");
/** A git runner for `dir`. */
/** A git runner for `dir`, under the scrubbed config set beside `scrubbedEnv`. */
export const gitIn = (dir) => (...a) => execFileSync("git", a, { cwd: dir, stdio: "pipe", encoding: "utf8" });
export function gitInit(dir, branch = "main") {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Plan2Code",
"version": "2.8.0",
"version": "2.8.1",
"description": "A structured 4-step workflow methodology for AI-assisted software development",
"keywords": [
"ai",