mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 04:45:33 -08:00
Style Skip this one as a small accent button and outline confirm and recap yes buttons
AI Assisted
This commit is contained in:
1 parent
2ab57d9a7e
commit
765e374584
3 files changed
+27
-4
No files matched your search
+2
-1
@@ -33,7 +33,8 @@ All notable changes to Plan2Code will be documented in this file.
|
||||
- **handoff**: every handoff now lives in `~/.plan2code/handoffs/` (a Markdown file plus a small `.json` beside it), owned by the web console, and handoffs older than 30 days are swept when the console opens. The Handoff skill writes there with no folder or `.gitignore` question, and Cleanup never lists the folder. Handoffs written to the OS temp folder or a `handoffs/` folder before this change are not listed.
|
||||
- **dashboard**: a **Bug fixed** spec has a visible **Delete** that needs one confirm, and its chip no longer repeats the "bug fixed" line.
|
||||
- **web console**: the review sign-off card lists **Approve this phase** before **Show me it working**, with the approve button outlined in the accent colour.
|
||||
- **web console**: a sign-off's **yes** button (Quick Task's **Build it**, Finalize's **Archive it**) is outlined in your highlight colour too, like **Approve**.
|
||||
- **web console**: a sign-off's **yes** button (Quick Task's **Build it**, Finalize's **Archive it**) is outlined in your highlight colour too, like **Approve**. So is the yes of a yes/no question (such as Plan's **Write the plan**) and a recap's **Yes, that is right**, except on a question marked dangerous, whose yes stays red.
|
||||
- **web console**: **Skip this one** (and **Do not skip**) on an optional question is a small button in your highlight colour, like a comment box's **No changes**, instead of an underlined link.
|
||||
- **init**, **init-update**: the *Keeping this file current* section they write into `AGENTS.md` gains three rules: a rule broken twice becomes an automated check, a new Failure log line first looks for one on the same topic to sharpen instead, and the log holds 17 entries at most (over the cap, merge entries that share a cause, then drop the lowest-value ones). Init update offers the missing rules to an existing section and tidies the log on every run, showing each merge and removal for a yes before it writes.
|
||||
- **contributors**: this repo's `AGENTS.md` follows the same Failure log rules, and its three post-sync grep entries are merged into one.
|
||||
|
||||
|
||||
@@ -569,3 +569,17 @@ test("a redraw keeps the place of whatever scrolls: question card, finished scre
|
||||
assert.match(place, /scrollerKey\(inner\) === place\.key/, "a card comes back only while it shows the same thing");
|
||||
assert.match(place, /:scope > \.git-board/, "the git board keeps its own per-tab place");
|
||||
});
|
||||
|
||||
test("Skip this one is a small accent button, like a comment box's quick answer", () => {
|
||||
const app = fs.readFileSync(path.join(ROOT, "src", "web-console", "public", "app.js"), "utf8");
|
||||
assert.match(app, /const skip = el\("button", "btn tiny", skipped \? "Do not skip" : "Skip this one"\);/, "the skip button is btn tiny");
|
||||
assert.match(app, /quick = el\("button", "btn tiny"/, "the quick answer it matches is btn tiny");
|
||||
});
|
||||
|
||||
test("a confirm's yes and a recap's yes are outlined in the accent, a dangerous yes stays red", () => {
|
||||
const app = fs.readFileSync(path.join(ROOT, "src", "web-console", "public", "app.js"), "utf8");
|
||||
const confirm = app.slice(app.indexOf("function buildConfirm("), app.indexOf("row.appendChild(mk(noLabel"));
|
||||
assert.match(confirm, /\(yes && !danger && !on \? " is-approve" : ""\)/, "an unpicked, safe yes gets is-approve");
|
||||
assert.match(confirm, /\(danger && !on \? " danger" : ""\)/, "a dangerous yes stays red");
|
||||
assert.match(app, /const ok = el\("button", "btn" \+ \(okOn \? " primary" : " is-approve"\)/, "the recap's yes gets is-approve");
|
||||
});
|
||||
@@ -4586,7 +4586,9 @@ function renderCard(item) {
|
||||
|
||||
if (item.required === false && isOpen(item) && !flight && !finish()) {
|
||||
const skipped = Boolean(staged && staged.skipped);
|
||||
const skip = el("button", "linky", skipped ? "Do not skip" : "Skip this one");
|
||||
// A small accent chip, like a comment box's quick answer ("No changes"),
|
||||
// rather than an underlined link that reads as fine print.
|
||||
const skip = el("button", "btn tiny", skipped ? "Do not skip" : "Skip this one");
|
||||
skip.type = "button";
|
||||
skip.style.marginTop = "16px";
|
||||
skip.addEventListener("click", () => (skipped ? stage(item.id, null) : skipAndMoveOn(item.id)));
|
||||
@@ -5339,9 +5341,15 @@ function buildConfirm(card, item, staged) {
|
||||
const yesLabel = item.yesLabel || "Yes";
|
||||
const noLabel = item.noLabel || "No";
|
||||
|
||||
// An unpicked yes is outlined in the accent, like a review's approve, unless
|
||||
// the card is dangerous: then it stays red.
|
||||
const mk = (label, yes, danger) => {
|
||||
const on = staged && staged.yes === yes;
|
||||
const b = el("button", "btn" + (on ? " primary" : "") + (danger && !on ? " danger" : ""), label);
|
||||
const b = el(
|
||||
"button",
|
||||
"btn" + (on ? " primary" : "") + (danger && !on ? " danger" : "") + (yes && !danger && !on ? " is-approve" : ""),
|
||||
label
|
||||
);
|
||||
b.type = "button";
|
||||
b.addEventListener("click", () =>
|
||||
stage(item.id, withNote(item, on ? null : { type: "answer", kind: "confirm", yes }))
|
||||
@@ -5396,7 +5404,7 @@ function buildRecap(card, item, staged) {
|
||||
const okOn = staged && staged.ok === true;
|
||||
const fixOn = staged && staged.ok === false;
|
||||
|
||||
const ok = el("button", "btn" + (okOn ? " primary" : ""), item.yesLabel || "Yes, that is right");
|
||||
const ok = el("button", "btn" + (okOn ? " primary" : " is-approve"), item.yesLabel || "Yes, that is right");
|
||||
ok.type = "button";
|
||||
ok.addEventListener("click", () => stage(item.id, okOn ? null : { type: "answer", kind: "recap", ok: true }));
|
||||
|
||||
|
||||
Reference in new issue
Block a user