mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 20:45:33 -08:00
Remove the legacy plan2code-loop CLI
AI Assisted
This commit is contained in:
1 parent
d7abcd2ac6
commit
c8d12a3d99
89 files changed
+449
-3189
No files matched your search
@@ -80,7 +80,7 @@ Every note in an item's `thread` gets a reply: `{"id":"p4","thread":[{"who":"age
|
||||
- more than three open required questions at once (optional cards and notices do not count)
|
||||
- internal vocabulary in a title (grill, frontier, fog, HITL, AFK, durable, `Locked:`, `Blocked by:`, `State:`)
|
||||
- more than one recommended option on a question
|
||||
- loop completion markers (`TASK_COMPLETE`, `PHASE_COMPLETE` and the rest)
|
||||
- loop completion markers, reserved so agent text can never fake a done signal (`TASK_COMPLETE`, `PHASE_COMPLETE` and the rest)
|
||||
- a bare Requirements, Feasibility, Integration or Risk followed by a number (hyphenate or reword)
|
||||
- a doc `version` that goes back (leave `version` out)
|
||||
- a finish `command` with `<` or `>` in it
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
// session state ~/.plan2code/console/sessions/<sid>/
|
||||
// the request, the human's draft, the result, the event log.
|
||||
// Deliberately NOT under specs/: that keeps the console clear of
|
||||
// the metrics confidence scraper and the loop's completion-marker
|
||||
// parser, and it survives a `git clean`.
|
||||
// the metrics confidence scraper and completion-marker parsers,
|
||||
// and it survives a `git clean`.
|
||||
//
|
||||
// Node built-ins only. No build step.
|
||||
|
||||
|
||||
@@ -130,11 +130,14 @@ function dropStaleSubmissions(currentItems, before, patchList) {
|
||||
// A whole new question under an answered card's id is not a typo fix: the
|
||||
// card would stay answered and nothing would be left for the person, who
|
||||
// sees a dead page. Refuse it so the agent picks a new id on the spot.
|
||||
// A change of kind is not this case: the merge below reopens it as a new
|
||||
// question on its own, so nothing stays answered.
|
||||
if (
|
||||
prev &&
|
||||
(prev.status === "answered" || prev.status === "skipped") &&
|
||||
!("status" in entry) &&
|
||||
!("answer" in entry) &&
|
||||
(!("kind" in entry) || entry.kind === prev.kind) &&
|
||||
"title" in entry &&
|
||||
entry.title !== prev.title &&
|
||||
(("body" in entry && entry.body !== prev.body) ||
|
||||
@@ -583,7 +586,7 @@ export function applyPatch(state, patch) {
|
||||
}
|
||||
if (settle !== undefined) next.items = settleItems(next.items || [], settle, patch.items, state.collected);
|
||||
// A question put to the person over a standing ending means the work went
|
||||
// on past it: the finish card would grey the form out, and the person has
|
||||
// on past it: the finish card would gray the form out, and the person has
|
||||
// no way to answer. The ending comes down unless this patch posts its own.
|
||||
if (next.finish && !Object.hasOwn(patch, "finish") && asksSomething(patch.items, state.items)) {
|
||||
delete next.finish;
|
||||
@@ -660,9 +663,10 @@ const JARGON = [
|
||||
/\bState:\s/,
|
||||
];
|
||||
|
||||
// The loop parses these out of agent output; pathfinder forbids them under specs/.
|
||||
// The other copy is LOOP_TOKENS in src/skill-scripts/common.mjs: the console is
|
||||
// not a skill script and cannot import it, so keep the two in step.
|
||||
// Completion markers refused outright, so agent text can never fake a done
|
||||
// signal; pathfinder forbids them under specs/. The other copy is LOOP_TOKENS
|
||||
// in src/skill-scripts/common.mjs: the console is not a skill script and
|
||||
// cannot import it, so keep the two in step.
|
||||
const FORBIDDEN_TOKENS =
|
||||
/\b(TASK_COMPLETE|PHASE_COMPLETE|ALL_TASKS_COMPLETE|IMPLEMENTATION_COMPLETE|SPEC_COMPLETE|WORK_COMPLETE)\b/;
|
||||
|
||||
@@ -679,7 +683,7 @@ export function proseProblems(prose, subject = "text") {
|
||||
const marker = prose.match(FORBIDDEN_TOKENS);
|
||||
if (marker) {
|
||||
problems.push(
|
||||
rule("", subject, `contains a loop completion marker (${marker[0]}); the loop scans for these. Reword it`, marker[0].toLowerCase().replaceAll("_", " ")),
|
||||
rule("", subject, `contains a loop completion marker (${marker[0]}); these are reserved. Reword it`, marker[0].toLowerCase().replaceAll("_", " ")),
|
||||
);
|
||||
}
|
||||
const bait = prose.match(METRICS_BAIT);
|
||||
|
||||
@@ -254,13 +254,20 @@ export function armsArt(d) {
|
||||
ctx.translate(s.x, y);
|
||||
const heading = Math.atan2(-s.vy, s.vx);
|
||||
if (s.arm === "stake") {
|
||||
// A streak behind it, then the iron, its point leading.
|
||||
// A glow and a streak behind it, then a big iron stake, its point leading,
|
||||
// so it never reads as an ordinary bolt.
|
||||
ctx.rotate(heading);
|
||||
ctx.strokeStyle = "rgba(190, 210, 230, 0.4)";
|
||||
ctx.lineWidth = 0.6;
|
||||
line(ctx, -5, 0, -1.2, 0);
|
||||
ctx.scale(1.25, 1.25);
|
||||
stakeShape(ctx, "#d4e0ec");
|
||||
ctx.fillStyle = "rgba(190, 220, 255, 0.22)";
|
||||
circle(ctx, 0, 0, 3.6);
|
||||
ctx.fill();
|
||||
ctx.strokeStyle = "rgba(190, 210, 230, 0.5)";
|
||||
ctx.lineWidth = 1.5;
|
||||
line(ctx, -11, 0, -3.6, 0);
|
||||
ctx.scale(3.2, 3.2);
|
||||
stakeShape(ctx, "#e4eef8");
|
||||
ctx.strokeStyle = "#3a4654";
|
||||
ctx.lineWidth = 0.07;
|
||||
ctx.stroke();
|
||||
} else if (s.arm === "sickle") {
|
||||
ctx.rotate(s.spin);
|
||||
ctx.scale(1.45, 1.45);
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
import { ARM_POP_MS, POWERS, STAGE_ARMS, addArm } from "./ghoul-powers.js";
|
||||
import { stepPans, usePans } from "./ghoul-pans.js";
|
||||
import { stepFlareFly, stepRoadFire, useFlare } from "./ghoul-flare.js";
|
||||
import { FLARE_VX, FLARE_VY, stepFlareFly, stepRoadFire, useFlare } from "./ghoul-flare.js";
|
||||
import { stepBoom, stepMuzzle, stepRocket, useRockets } from "./ghoul-rockets.js";
|
||||
|
||||
const freeze = Object.freeze;
|
||||
@@ -77,8 +77,8 @@ export const BLAST_DAMAGE = 20;
|
||||
export const DYN_BOSS_DMG = 8;
|
||||
// The Iron Stake: pierces a whole line, chest high.
|
||||
export const STAKE_SPEED = 96;
|
||||
export const STAKE_DMG = 4;
|
||||
export const STAKE_BOSS = 4;
|
||||
export const STAKE_DMG = 12;
|
||||
export const STAKE_BOSS = 8;
|
||||
// The Bottle Rocket: three at once, ahead, up and behind (ghoul-rockets.js).
|
||||
export * from "./ghoul-rockets.js";
|
||||
// The Hedge Sickle: SICKLE_OUT out and back, SICKLE_DMG a pass.
|
||||
@@ -271,18 +271,51 @@ function armShot(round, k, arm, speed, over) {
|
||||
round.shots.push({ arm, x: at.x, y: at.y, vx: Math.cos(aim) * speed * you.face, vy: Math.sin(aim) * speed, gone: 0, t: 0, spin: 0, ...over });
|
||||
}
|
||||
|
||||
// Aimed lobs (Dynamite, the Road Flare): the first monster ahead in view, or, when others
|
||||
// stand within LOB_GROUP of it, the middle of that group, so one blast or fire
|
||||
// catches as many as it can. The sideways speed is solved so the throw lands there
|
||||
// (clamped to LOB_MIN_VX..LOB_MAX_VX); with nothing ahead it is the old fixed throw.
|
||||
export const LOB_GROUP = 9;
|
||||
const LOB_MIN_VX = 6;
|
||||
const LOB_MAX_VX = 70;
|
||||
|
||||
// `also` names kinds that count though they cannot be shot (the buried hands the salt is for).
|
||||
export function lobTarget(round, k, also = []) {
|
||||
const you = round.you;
|
||||
const lo = round.camX;
|
||||
const hi = round.camX + k.FIELD_W;
|
||||
const ahead = round.monsters
|
||||
.filter((m) => !m.dead && (k.solid(m) || k.stone(m) || also.includes(m.kind)) && (m.x - you.x) * you.face > 1 && m.x >= lo && m.x <= hi)
|
||||
.sort((a, b) => Math.abs(a.x - you.x) - Math.abs(b.x - you.x));
|
||||
if (!ahead.length) return null;
|
||||
const first = ahead[0];
|
||||
const group = ahead.filter((m) => Math.abs(m.x - first.x) <= LOB_GROUP);
|
||||
return group.reduce((sum, m) => sum + m.x, 0) / group.length;
|
||||
}
|
||||
|
||||
export function lobVx(round, k, vy, fixed, also) {
|
||||
const tx = lobTarget(round, k, also);
|
||||
if (tx === null) return round.you.face * fixed;
|
||||
const at = hand(round, k);
|
||||
const dy = k.groundAt(round.spec, tx) - at.y;
|
||||
const disc = vy * vy + 2 * k.BONE_G * dy;
|
||||
const t = disc > 0 ? (vy + Math.sqrt(disc)) / k.BONE_G : (2 * vy) / k.BONE_G;
|
||||
const vx = Math.min(LOB_MAX_VX, Math.max(LOB_MIN_VX, Math.abs(tx - at.x) / t));
|
||||
return round.you.face * vx;
|
||||
}
|
||||
|
||||
function lobStick(round, k) {
|
||||
const you = round.you;
|
||||
const at = hand(round, k);
|
||||
round.hazards.push({ kind: "stick", x: at.x, y: at.y, vx: you.face * DYN_VX, vy: DYN_VY, fuse: DYN_FUSE_MS, max: DYN_FUSE_MS, spin: 0, rest: false, w: 0.8, h: 0.8, live: 0, cause: "dynamite" });
|
||||
round.hazards.push({ kind: "stick", x: at.x, y: at.y, vx: lobVx(round, k, DYN_VY, DYN_VX), vy: DYN_VY, fuse: DYN_FUSE_MS, max: DYN_FUSE_MS, spin: 0, rest: false, w: 0.8, h: 0.8, live: 0, cause: "dynamite" });
|
||||
// The Mine's art plays Dynamite's own sound from this one.
|
||||
round.events.push({ type: "dynThrow", x: at.x, y: at.y, face: you.face });
|
||||
}
|
||||
|
||||
function lobPod(round, k, pay) {
|
||||
function lobPod(round, k, pay, aimed = false) {
|
||||
const you = round.you;
|
||||
const at = hand(round, k);
|
||||
round.hazards.push({ kind: "armPod", pay, x: at.x, y: at.y, vx: you.face * POD_VX, vy: POD_VY, spin: 0, w: 0.8, h: 0.8, live: 0, cause: "" });
|
||||
round.hazards.push({ kind: "armPod", pay, x: at.x, y: at.y, vx: aimed ? lobVx(round, k, POD_VY, POD_VX, ["hands"]) : you.face * POD_VX, vy: POD_VY, spin: 0, w: 0.8, h: 0.8, live: 0, cause: "" });
|
||||
}
|
||||
|
||||
function lobPie(round, k) {
|
||||
@@ -305,10 +338,10 @@ const USES = freeze({
|
||||
const you = round.you;
|
||||
round.hazards.push({ kind: "armRing", x: you.x, y: you.y + k.HIT_H / 2, r: 0, life: RING_MS, max: RING_MS, hit: [], hitPipe: [], hitBoss: false, w: 1, h: 1, live: 0, cause: "" });
|
||||
},
|
||||
salt: (round, k) => lobPod(round, k, "salt"),
|
||||
flash: (round, k) => lobPod(round, k, "flash"),
|
||||
salt: (round, k) => lobPod(round, k, "salt", true),
|
||||
flash: (round, k) => lobPod(round, k, "flash", true),
|
||||
pie: lobPie,
|
||||
flare: useFlare,
|
||||
flare: (round, k) => useFlare(round, k, lobVx(round, k, FLARE_VY, FLARE_VX)),
|
||||
trap: (round) => {
|
||||
const you = round.you;
|
||||
// Five at once, TRAP_GAP apart: two behind, one at his feet, two ahead.
|
||||
|
||||
@@ -278,7 +278,7 @@ function record(round, tw, ms) {
|
||||
tw.seq++;
|
||||
}
|
||||
|
||||
// Mirror You's bolts in flight: cancelling yours, or striking you.
|
||||
// Mirror You's bolts in flight: canceling yours, or striking you.
|
||||
function stepBolts(round, tw, ms, k) {
|
||||
const you = round.you;
|
||||
const dt = ms / 1000;
|
||||
|
||||
@@ -26,7 +26,7 @@ const PIPS = Object.freeze([
|
||||
|
||||
// The panel the big die rolls on, and the die in it.
|
||||
const PANEL_W = 44;
|
||||
const PANEL_H = 34;
|
||||
const PANEL_H = 40;
|
||||
const DIE_SIZE = 15;
|
||||
// Candidate spots for the panel's middle, tried in order: the field's middle
|
||||
// first, then to either side; a row high on the field and one low.
|
||||
@@ -108,7 +108,7 @@ export function diceArt(d) {
|
||||
ctx.strokeStyle = lucky ? GOLD : "rgba(255, 255, 255, 0.35)";
|
||||
ctx.lineWidth = lucky ? 0.6 : 0.3;
|
||||
ctx.stroke();
|
||||
const at = y - 3;
|
||||
const at = y - 6;
|
||||
let face;
|
||||
let size = DIE_SIZE;
|
||||
let angle = 0;
|
||||
@@ -141,7 +141,12 @@ export function diceArt(d) {
|
||||
text = r.heart ? `A ${r.face} on your last heart: +1 heart!` : wasted ? `A ${r.face}, and no lives left` : DICE_FACES[r.face].line;
|
||||
color = lucky ? GOLD : DICE_FACES[r.face].gift && !wasted ? "#ffffff" : DANGER;
|
||||
}
|
||||
label(ctx, text, x, y + 12, 2.7, color, "center", PANEL_W - 3);
|
||||
label(ctx, text, x, y + 9.5, 2.7, color, "center", PANEL_W - 3);
|
||||
// After the roll, what is left in hand (the roll has already taken its die).
|
||||
if (r.landed) {
|
||||
const n = v.round.dice;
|
||||
label(ctx, `You have ${n} Lucky ${n === 1 ? "Die" : "Dice"} left!`, x, y + 15, 2.3, "#8fd8ff", "center", PANEL_W - 3);
|
||||
}
|
||||
}
|
||||
|
||||
// What each step of the roll looks and sounds like (house tones for now);
|
||||
|
||||
@@ -35,7 +35,7 @@ export const DICE_FACES = Object.freeze({
|
||||
5: Object.freeze({ revive: true, give: Object.freeze(["life"]), line: "Back to life, +1 heart!", word: "+1 heart!" }),
|
||||
6: Object.freeze({ revive: true, give: Object.freeze(["life", "garlic"]), line: "Back to life, +1 heart + Garlic!", word: "+1 heart + Garlic!" }),
|
||||
});
|
||||
export const ROLL_MS = 1900;
|
||||
export const ROLL_MS = 3200;
|
||||
export const TUMBLE_MS = 600;
|
||||
// The clock a saved time-up gets back.
|
||||
export const SAVED_TIME_MS = 15000;
|
||||
|
||||
@@ -37,10 +37,11 @@ export const FLARE_SHOW_MS = 300;
|
||||
const inBox = (m, x0, x1, y0, y1) => m.x + m.w / 2 >= x0 && m.x - m.w / 2 <= x1 && m.y + m.h >= y0 && m.y <= y1;
|
||||
|
||||
// The throw: from his hand, ahead.
|
||||
export function useFlare(round, k) {
|
||||
// `vx` is the signed sideways speed (ghoul-arms.js aims it at the monsters ahead).
|
||||
export function useFlare(round, k, vx = round.you.face * FLARE_VX) {
|
||||
const you = round.you;
|
||||
const at = { x: you.x + you.face * 1.8, y: you.y + k.shotY(you) };
|
||||
round.hazards.push({ kind: "armRoadFlare", x: at.x, y: at.y, vx: you.face * FLARE_VX, vy: FLARE_VY, spin: 0, rest: false, t: 0, w: 0.8, h: 0.8, live: 0, cause: "" });
|
||||
round.hazards.push({ kind: "armRoadFlare", x: at.x, y: at.y, vx, vy: FLARE_VY, spin: 0, rest: false, t: 0, w: 0.8, h: 0.8, live: 0, cause: "" });
|
||||
round.events.push({ type: "flareThrow", x: at.x, y: at.y, face: you.face });
|
||||
}
|
||||
|
||||
|
||||
@@ -686,7 +686,7 @@ export function frozenWorld(d) {
|
||||
ctx.fillRect(x0, fy, w, 0.62);
|
||||
ctx.fillStyle = "rgba(255, 255, 255, 0.85)";
|
||||
ctx.fillRect(x0 + 0.2, fy + 0.06, w - 0.4, 0.14);
|
||||
// A green-grey tint as it weakens, and hairlines that lengthen with the weight on it.
|
||||
// A green-gray tint as it weakens, and hairlines that lengthen with the weight on it.
|
||||
ctx.fillStyle = rgba("#2a5a70", 0.2 + 0.4 * prog);
|
||||
ctx.fillRect(x0, fy + 0.62, w, 0.5);
|
||||
const lines = Math.ceil(prog * 7);
|
||||
|
||||
@@ -292,7 +292,7 @@ export function graveyardArt(d) {
|
||||
}
|
||||
}
|
||||
|
||||
// Grasping hands: under the dirt a trembling mound; then two grey arms
|
||||
// Grasping hands: under the dirt a trembling mound; then two gray arms
|
||||
// burst up and claw at the air, and sink again.
|
||||
function hands(ctx, v, m, x, y, t, flash) {
|
||||
if (m.act === "lurk" || m.act === "creep") return mound(ctx, x, y, t, m.act === "creep");
|
||||
@@ -429,7 +429,7 @@ export function graveyardArt(d) {
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
}
|
||||
// A long grey face under the hat, a grin of teeth.
|
||||
// A long gray face under the hat, a grin of teeth.
|
||||
ctx.fillStyle = flash ? FLASH : "#8a8e80";
|
||||
ellipse(ctx, d * 0.35, -4.4, 0.8, 0.85);
|
||||
ctx.fill();
|
||||
|
||||
@@ -428,7 +428,7 @@ export function groundsArt(d) {
|
||||
}
|
||||
}
|
||||
|
||||
// A long party table under a cloth gone grey, set for guests who never
|
||||
// A long party table under a cloth gone gray, set for guests who never
|
||||
// left: plates, a tipped glass, candle stubs and a cake gone to mold.
|
||||
function partyTable(ctx, x, fy, n) {
|
||||
const w = 11;
|
||||
@@ -840,7 +840,7 @@ export function groundsArt(d) {
|
||||
|
||||
// A shelf in the room's own terms, its top surface at screen y `y`: a
|
||||
// hanging block of hedge in the maze, an ivy-grown stone ledge in the
|
||||
// topiary garden, a table under a grey cloth or a shingled roof in the
|
||||
// topiary garden, a table under a gray cloth or a shingled roof in the
|
||||
// gazebo, a weathered plank on posts in the yard.
|
||||
function shelf(ctx, v, look, a, b, y) {
|
||||
const { spec, g } = v;
|
||||
@@ -916,7 +916,7 @@ export function groundsArt(d) {
|
||||
ellipse(ctx, lx, y + 5.4, 0.9, 1.1);
|
||||
ctx.fill();
|
||||
} else if (look.scene === "gazebo") {
|
||||
// A table: a grey cloth with a scalloped hem over dark legs.
|
||||
// A table: a gray cloth with a scalloped hem over dark legs.
|
||||
ctx.fillStyle = "#12100c";
|
||||
for (const s of [a + 1.2, b - 1.8]) ctx.fillRect(s, y + 1, 0.6, Math.max(1, fy - y - 1));
|
||||
ctx.fillStyle = "#c8c3ae";
|
||||
|
||||
@@ -192,7 +192,7 @@ export function mineArt(d) {
|
||||
ctx.fill();
|
||||
}
|
||||
|
||||
// A knocker imp: a wiry, hunched mine goblin, green-grey, with great ears swept
|
||||
// A knocker imp: a wiry, hunched mine goblin, green-gray, with great ears swept
|
||||
// back, a hooked nose, a grin and big amber eyes, a tiny pick in his fist. Running
|
||||
// (skitter, flee) his legs blur and he leans into it; with the stolen spark he
|
||||
// cups it in both hands, giggling; the decoy paces with the Tommyknocker's lantern
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
export const FROZEN_SFX = {
|
||||
tones: {
|
||||
// Frozen Lake picks, by ear (prototypes/sounds/ghoul-rush/frozen.html).
|
||||
// Under-Ice Hand: A grey hand that trails you under the ice, cracks thin ice open beneath you, or bursts up through the floor to grab.
|
||||
// Under-Ice Hand: A gray hand that trails you under the ice, cracks thin ice open beneath you, or bursts up through the floor to grab.
|
||||
// Slides in: Scrabbling fingernails.
|
||||
ghoulIceHandAppear: {
|
||||
layers: [
|
||||
|
||||
@@ -10,7 +10,7 @@ export const GRAVEYARD_SFX = {
|
||||
tones: {
|
||||
// The Graveyard's monsters and Mother Mourning, picked the same way
|
||||
// (prototypes/sounds/ghoul-rush/graveyard.html).
|
||||
// Grasping Hands: Grey arms that burst up out of the dirt and grab.
|
||||
// Grasping Hands: Gray arms that burst up out of the dirt and grab.
|
||||
// Stirs under the dirt: Low earth rumble.
|
||||
ghoulHandsAppear: {
|
||||
layers: [
|
||||
|
||||
@@ -402,7 +402,7 @@ export function villageArt(d) {
|
||||
/* --------------------------------------------------------- hanged man */
|
||||
|
||||
// A hanged man: a rope from the beam to a noose, the neck bent, the head
|
||||
// lolling, grey shirt and trousers, bare feet turning, arms limp; he swings on
|
||||
// lolling, gray shirt and trousers, bare feet turning, arms limp; he swings on
|
||||
// his rope, creaks before he drops, flings his arms up as he falls, bounces at the
|
||||
// rope's end and kicks as he is hauled up.
|
||||
function hanged(ctx, v, m, x, y, t, flash) {
|
||||
@@ -533,7 +533,7 @@ export function villageArt(d) {
|
||||
}
|
||||
}
|
||||
|
||||
// A ghoul in a window: gaunt grey, nightshirt, long black hair, a mouth full of
|
||||
// A ghoul in a window: gaunt gray, nightshirt, long black hair, a mouth full of
|
||||
// needles, eyes burning; when it lunges its neck and arms stretch out from the
|
||||
// window to where it reaches, hands clawed and grasping.
|
||||
function shutter(ctx, v, m, x, y, t, flash) {
|
||||
@@ -657,7 +657,7 @@ export function villageArt(d) {
|
||||
|
||||
/* ----------------------------------------------------------- moonhound */
|
||||
|
||||
// A moonhound: a gaunt wolfhound, ribs and spine showing, long legs, silver-grey
|
||||
// A moonhound: a gaunt wolfhound, ribs and spine showing, long legs, silver-gray
|
||||
// coat; trotting, coiled with its hackles up, stretched in its leap, panting after
|
||||
// it, or cowering from Wolfsbane (ears flat, tail between its legs, low). Grown,
|
||||
// it is half again as big with a mane that glows.
|
||||
|
||||
@@ -509,6 +509,7 @@ export const CLEAR_MS = 1200;
|
||||
// press takes one.
|
||||
export const OFFER_N = 2;
|
||||
export const PICK_HOLD_MS = 700;
|
||||
export const BANNER_STRETCH = 2;
|
||||
export const DOOR_REACH = 2.5;
|
||||
|
||||
// A banner fades to BANNER_SEE_THROUGH over BANNER_FADE_MS while something
|
||||
@@ -2441,7 +2442,9 @@ function create({ canvas, tone = () => {}, hum = () => {}, music = () => {}, onS
|
||||
// once that phase has passed; a full queue makes room for a more
|
||||
// important one (`rank`: "New best!") by dropping the least important one
|
||||
// waiting, and otherwise drops the newcomer.
|
||||
// Every banner is up BANNER_STRETCH times as long as its caller asks, so the words can be read.
|
||||
const banner = (title, sub, color, ms = 1800, { phase = "", rank = 0 } = {}) => {
|
||||
ms *= BANNER_STRETCH;
|
||||
if (fx.banners.some((b) => b.title === title)) return null;
|
||||
if (fx.banners.length >= 3) {
|
||||
let low = -1;
|
||||
@@ -2760,6 +2763,10 @@ function create({ canvas, tone = () => {}, hum = () => {}, music = () => {}, onS
|
||||
get state() {
|
||||
return state;
|
||||
},
|
||||
// The lost end screen animates, so the window keeps ticking it.
|
||||
get animating() {
|
||||
return state === "over" && !round.won;
|
||||
},
|
||||
// For the tests only: the window never reads it.
|
||||
get round() {
|
||||
return round;
|
||||
|
||||
@@ -334,6 +334,109 @@
|
||||
<aside class="aside" id="aside" aria-label="Notes and discussion"></aside>
|
||||
</div>
|
||||
|
||||
<!-- One small glyph per dashboard card, drawn before the card's title
|
||||
(dashboard.js) and beside it in Help's card list (help-dialog.js).
|
||||
A hidden sheet of <symbol>s in the same stroke style as help-icons:
|
||||
.dash-card-icon and .help-card-icon supply size and ink. -->
|
||||
<svg class="card-icons" aria-hidden="true" focusable="false">
|
||||
<!-- Set up this project: a map pin, "put this project on the map". -->
|
||||
<symbol id="ci-init" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M20 10c0 5-5.5 10.2-7.4 11.8a1 1 0 0 1-1.2 0C9.5 20.2 4 15 4 10a8 8 0 0 1 16 0z" />
|
||||
<circle cx="12" cy="10" r="2.8" />
|
||||
</symbol>
|
||||
<!-- Refresh AGENTS.md: circular refresh arrow. -->
|
||||
<symbol id="ci-init-update" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M21 12a9 9 0 1 1-9-9c2.5 0 4.9 1 6.7 2.7L21 8" />
|
||||
<path d="M21 3v5h-5" />
|
||||
</symbol>
|
||||
<!-- Pathfinder: a compass. -->
|
||||
<symbol id="ci-pathfinder" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="12" cy="12" r="9.2" />
|
||||
<path d="M16.2 7.8l-2.1 6.3-6.3 2.1 2.1-6.3z" />
|
||||
</symbol>
|
||||
<!-- Plan: a folded map. -->
|
||||
<symbol id="ci-plan" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M9 4 3 6v14l6-2 6 2 6-2V4l-6 2z" />
|
||||
<path d="M9 4v14" />
|
||||
<path d="M15 6v14" />
|
||||
</symbol>
|
||||
<!-- Revise the plan: a pencil. -->
|
||||
<symbol id="ci-revise-plan" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5z" />
|
||||
<path d="m15 5 4 4" />
|
||||
</symbol>
|
||||
<!-- Document: a document with a check. -->
|
||||
<symbol id="ci-document" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z" />
|
||||
<path d="M14 2v4a2 2 0 0 0 2 2h4" />
|
||||
<path d="m9 15 2 2 4-4" />
|
||||
</symbol>
|
||||
<!-- Implement: code brackets. -->
|
||||
<symbol id="ci-implement" viewBox="0 0 24 24" fill="none">
|
||||
<path d="m16 18 6-6-6-6" />
|
||||
<path d="m8 6-6 6 6 6" />
|
||||
</symbol>
|
||||
<!-- Implementation Loop: repeat arrows. -->
|
||||
<symbol id="ci-loop" viewBox="0 0 24 24" fill="none">
|
||||
<path d="m17 2.5 4 4-4 4" />
|
||||
<path d="M3 11V9a4 4 0 0 1 4-4h14" />
|
||||
<path d="m7 21.5-4-4 4-4" />
|
||||
<path d="M21 13v2a4 4 0 0 1-4 4H3" />
|
||||
</symbol>
|
||||
<!-- Finalize: a finish flag. -->
|
||||
<symbol id="ci-finalize" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V4s-1 1-4 1-5-2-8-2-4 1-4 1z" />
|
||||
<path d="M4 21v-6" />
|
||||
</symbol>
|
||||
<!-- Quick task: a bolt. -->
|
||||
<symbol id="ci-quick-task" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M13 3 4.5 14h7.5l-1.5 7L19 10h-7.5z" />
|
||||
</symbol>
|
||||
<!-- Review: a magnifier. -->
|
||||
<symbol id="ci-review" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="7.5" />
|
||||
<path d="m20.5 20.5-4.6-4.6" />
|
||||
</symbol>
|
||||
<!-- Codebase X-ray: a scan frame with its scan line. -->
|
||||
<symbol id="ci-xray" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M3 7V5a2 2 0 0 1 2-2h2" />
|
||||
<path d="M17 3h2a2 2 0 0 1 2 2v2" />
|
||||
<path d="M21 17v2a2 2 0 0 1-2 2h-2" />
|
||||
<path d="M7 21H5a2 2 0 0 1-2-2v-2" />
|
||||
<path d="M7 12h10" />
|
||||
</symbol>
|
||||
<!-- Diagnose a bug: a bug. -->
|
||||
<symbol id="ci-diagnose" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M12 20a6 6 0 0 0 6-6v-2.5a6 6 0 0 0-12 0V14a6 6 0 0 0 6 6z" />
|
||||
<path d="m9.5 6.5-2-3" />
|
||||
<path d="m14.5 6.5 2-3" />
|
||||
<path d="M12 11v6" />
|
||||
<path d="M6.5 13h-3" />
|
||||
<path d="M20.5 13h-3" />
|
||||
<path d="m6 17.5-2.5 1.5" />
|
||||
<path d="m18 17.5 2.5 1.5" />
|
||||
</symbol>
|
||||
<!-- Changelog: a version tag. -->
|
||||
<symbol id="ci-changelog" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M3 4a1 1 0 0 1 1-1h7.6a2 2 0 0 1 1.4.6l7.4 7.4a2 2 0 0 1 0 2.8l-5.6 5.6a2 2 0 0 1-2.8 0L4.6 12a2 2 0 0 1-.6-1.4z" />
|
||||
<path d="M7.5 7.5h.01" />
|
||||
</symbol>
|
||||
<!-- Git: a branch. -->
|
||||
<symbol id="ci-git" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="6" cy="6" r="2.5" />
|
||||
<circle cx="6" cy="18" r="2.5" />
|
||||
<circle cx="18" cy="6" r="2.5" />
|
||||
<path d="M6 8.5v7" />
|
||||
<path d="M18 8.5a9 9 0 0 1-9 7" />
|
||||
</symbol>
|
||||
<!-- Handoff: a package. -->
|
||||
<symbol id="ci-handoff" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" />
|
||||
<path d="m3.3 7 8.7 5 8.7-5" />
|
||||
<path d="M12 21.5V12" />
|
||||
</symbol>
|
||||
</svg>
|
||||
|
||||
<!-- Planny acting out each skill while it starts up and while it works.
|
||||
Inert until app.js clones one onto the starting or waiting screen
|
||||
(startStage), so it costs nothing on any other screen. Classes only,
|
||||
|
||||
@@ -580,13 +580,29 @@ function startLoop() {
|
||||
if (g.state !== "running") {
|
||||
hushTones();
|
||||
looping = false;
|
||||
return paintOverlay();
|
||||
paintOverlay();
|
||||
return overLoop(g, mine);
|
||||
}
|
||||
tickSource(frame);
|
||||
};
|
||||
tickSource(frame);
|
||||
}
|
||||
|
||||
// A game whose end screen moves (`animating`: Ghoul Rush's "G A M E - O V E R")
|
||||
// keeps being ticked and painted, with no countdown, until the screen is left.
|
||||
function overLoop(g, mine) {
|
||||
if (!g.animating) return;
|
||||
let last = null;
|
||||
const frame = (now) => {
|
||||
if (mine !== gen || looping || !$("activities-modal").open || g !== game() || g.state === "running" || !g.animating) return;
|
||||
const t = typeof now === "number" ? now : performance.now();
|
||||
if (last !== null) g.tick(Math.min(Math.max(0, t - last), MAX_FRAME_MS));
|
||||
last = t;
|
||||
tickSource(frame);
|
||||
};
|
||||
tickSource(frame);
|
||||
}
|
||||
|
||||
// After anything the person does: the timer follows the game's state.
|
||||
function follow() {
|
||||
const g = game();
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
loopDriving,
|
||||
} from "../selectors.js";
|
||||
import { hooks, page, redraw, saveNow } from "../state.js";
|
||||
import { el, approvalTip, mdInto, releasesLink, copyButton, lightDismiss } from "../render.js";
|
||||
import { el, approvalTip, mdInto, releasesLink, copyButton, lightDismiss, SVG_NS } from "../render.js";
|
||||
import { needsRoleNudge, ROLE_NOT_SET } from "../starters.js";
|
||||
import { looks, saveLooks } from "../looks.js";
|
||||
import { RED_BANNER, RED_BANNER_IN_APP } from "../meter.js";
|
||||
@@ -688,7 +688,18 @@ function dashCard(entry, menu) {
|
||||
head.appendChild(el("span", "dash-chip", entry.chip));
|
||||
if (presentation.recommended) head.appendChild(el("span", "pill suggested", "Suggested"));
|
||||
b.appendChild(head);
|
||||
b.appendChild(el("span", "dash-card-title", entry.title));
|
||||
const title = el("span", "dash-card-title");
|
||||
if (entry.icon) {
|
||||
const svg = document.createElementNS(SVG_NS, "svg");
|
||||
svg.setAttribute("class", "dash-card-icon");
|
||||
svg.setAttribute("aria-hidden", "true");
|
||||
const use = document.createElementNS(SVG_NS, "use");
|
||||
use.setAttribute("href", "#ci-" + entry.icon);
|
||||
svg.appendChild(use);
|
||||
title.appendChild(svg);
|
||||
}
|
||||
title.appendChild(document.createTextNode(entry.title));
|
||||
b.appendChild(title);
|
||||
b.appendChild(el("span", "dash-card-blurb", entry.blurb));
|
||||
if (presentation.detail) b.appendChild(el("span", "dash-card-detail", presentation.detail));
|
||||
if (!presentation.on && presentation.reason) b.appendChild(el("span", "dash-card-off", presentation.reason));
|
||||
|
||||
@@ -254,7 +254,17 @@ function buildHelp() {
|
||||
const list = el("ul");
|
||||
for (const e of SKILL_CATALOG.filter((x) => x.group === g.id)) {
|
||||
const li = el("li");
|
||||
li.appendChild(el("strong", null, e.title + "."));
|
||||
const strong = el("strong", null, e.title + ".");
|
||||
if (e.icon) {
|
||||
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||
svg.setAttribute("class", "help-card-icon");
|
||||
svg.setAttribute("aria-hidden", "true");
|
||||
const use = document.createElementNS("http://www.w3.org/2000/svg", "use");
|
||||
use.setAttribute("href", "#ci-" + e.icon);
|
||||
svg.appendChild(use);
|
||||
strong.prepend(svg);
|
||||
}
|
||||
li.appendChild(strong);
|
||||
li.appendChild(document.createTextNode(" " + (e.help || e.blurb)));
|
||||
list.appendChild(li);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
// card the dashboard card (group, chip, title, blurb, about, and
|
||||
// `spec: true` when it takes the picked spec), or null; an
|
||||
// optional `help` is Help's line for the card when it differs
|
||||
// from `blurb`
|
||||
// from `blurb`, and `icon` names the `ci-*` symbol in
|
||||
// index.html's card-icons sheet drawn before the title
|
||||
// appOnly the entry is a card the desktop app alone offers (the
|
||||
// Implementation Loop): no workflow, no installed skill, and no
|
||||
// list derived from the workflows (WORKFLOWS, the meter, the
|
||||
@@ -82,6 +83,7 @@ export const SKILLS = Object.freeze([
|
||||
group: "setup",
|
||||
chip: "Set up",
|
||||
title: "Set up this project",
|
||||
icon: "init",
|
||||
blurb: "Reads your project and writes AGENTS.md, the guide every later step works from.",
|
||||
about:
|
||||
"Plan2Code reads the whole project: how it is organized, how it runs, and where the sharp edges are. Then it writes AGENTS.md, the guide every later step steers by. It asks a few questions as it goes, so nothing important gets guessed. Run this once per project, or again when the project has moved on.",
|
||||
@@ -102,6 +104,7 @@ export const SKILLS = Object.freeze([
|
||||
group: "setup",
|
||||
chip: "Set up",
|
||||
title: "Refresh AGENTS.md",
|
||||
icon: "init-update",
|
||||
blurb: "Brings AGENTS.md and its notes up to date with what the project has learned lately.",
|
||||
about:
|
||||
"The project moved on since AGENTS.md was written: new commands, new habits, new gotchas. This re-reads the project, asks what changed, and folds it into AGENTS.md and the notes beside it. Cheaper than a fresh setup, and whatever is still right is kept.",
|
||||
@@ -127,6 +130,7 @@ export const SKILLS = Object.freeze([
|
||||
chip: "Step 0",
|
||||
spec: true,
|
||||
title: "Pathfinder",
|
||||
icon: "pathfinder",
|
||||
blurb: "A foggy idea becomes a clear list of decisions, settled one question at a time.",
|
||||
about:
|
||||
"You have a rough idea and a lot of unknowns. Pathfinder asks one question at a time: who it is for, what it must do, what could go wrong. Each answer is written down in a spec folder. It ends with a list of decisions clear enough to plan from, and nothing gets built yet.",
|
||||
@@ -152,6 +156,7 @@ export const SKILLS = Object.freeze([
|
||||
chip: "Step 1",
|
||||
spec: true,
|
||||
title: "Plan",
|
||||
icon: "plan",
|
||||
blurb: "Requirements, technical design and your approval: the shape of what gets built.",
|
||||
about:
|
||||
"Turns what you bring into a real plan: a finished Pathfinder map, a folder of design notes, or just the idea in your head. You get requirements, a technical design, a phase-by-phase breakdown, and a final version to approve before anything is built. This is where 'what are we building' becomes 'how it gets built'.",
|
||||
@@ -173,6 +178,7 @@ export const SKILLS = Object.freeze([
|
||||
chip: "Step 1b",
|
||||
spec: true,
|
||||
title: "Revise the plan",
|
||||
icon: "revise-plan",
|
||||
blurb: "Requirements changed mid-build? Adjust the plan without starting over.",
|
||||
about:
|
||||
"Requirements moved mid-build: a feature added, a rule dropped, a deadline pulled in. This adjusts the existing spec for the change, shows you what it affects, and only rewrites what actually has to move. The approved plan stays the plan.",
|
||||
@@ -199,6 +205,7 @@ export const SKILLS = Object.freeze([
|
||||
chip: "Step 2",
|
||||
spec: true,
|
||||
title: "Document",
|
||||
icon: "document",
|
||||
blurb: "The plan becomes a checklist of small tasks, grouped into phases, that a developer can just do.",
|
||||
about:
|
||||
"Writes the plan as numbered phase files. Each phase is a checklist of tasks small enough to just do, with the details a builder needs right there. This is the file the build step works from, and the thing a later session can pick up cold.",
|
||||
@@ -221,6 +228,7 @@ export const SKILLS = Object.freeze([
|
||||
chip: "Step 3",
|
||||
spec: true,
|
||||
title: "Implement",
|
||||
icon: "implement",
|
||||
blurb: "Builds the next phase, task by task, then reviews it, with your sign-off at the end.",
|
||||
about:
|
||||
"Builds the next phase of the spec. Tasks get checked off one by one, with progress and the occasional decision landing on this page as it goes. With Review ticked, a fresh pass then hunts for problems in exactly what changed and you pick what gets fixed. It ends with a report of what was built and a sign-off card you approve before the phase counts as done.",
|
||||
@@ -261,6 +269,7 @@ export const SKILLS = Object.freeze([
|
||||
chip: "Step 3",
|
||||
spec: true,
|
||||
title: "Implementation Loop",
|
||||
icon: "loop",
|
||||
blurb: "Build every remaining phase unattended, one fresh agent per phase.",
|
||||
about:
|
||||
"Builds every remaining phase of the spec without you at the keyboard. Each phase gets a fresh agent that builds it and reviews it. The app checks the result against the spec, runs your quick check, commits, and moves on. It stops at the first phase that goes wrong and tells you why. Desktop app only.",
|
||||
@@ -282,6 +291,7 @@ export const SKILLS = Object.freeze([
|
||||
chip: "Step 4",
|
||||
spec: true,
|
||||
title: "Finalize",
|
||||
icon: "finalize",
|
||||
blurb: "Checks the work, writes the summary, files the specs away and suggests the commit message.",
|
||||
about:
|
||||
"The closer. Checks every task against the spec, makes sure the build actually works, writes the summary into overview.md, updates the project docs, and suggests the commit message. Run it when the feature is done. It leaves the project tidy behind it.",
|
||||
@@ -302,6 +312,7 @@ export const SKILLS = Object.freeze([
|
||||
group: "extra",
|
||||
chip: "Utility",
|
||||
title: "Quick task",
|
||||
icon: "quick-task",
|
||||
blurb: "Too small for the full process? A quick plan, then it just builds it.",
|
||||
about:
|
||||
"A fix, a tweak, a small feature. Not worth a spec folder. Describe it, confirm the one-line plan, and it builds it right there, with a report at the end. The fast lane for work the full process would over-plan.",
|
||||
@@ -322,6 +333,7 @@ export const SKILLS = Object.freeze([
|
||||
group: "extra",
|
||||
chip: "Utility",
|
||||
title: "Review",
|
||||
icon: "review",
|
||||
blurb: "A second opinion on the changes. Problems ranked, and you pick what gets fixed.",
|
||||
about:
|
||||
"A fresh-eyes pass over what changed: bugs, gaps, and the things the builder was too close to see. Problems come back ranked with a suggestion each, you pick which ones get fixed, and it fixes them.",
|
||||
@@ -335,13 +347,14 @@ export const SKILLS = Object.freeze([
|
||||
pose: "xray",
|
||||
builds: false, phased: false, metered: true, templates: false,
|
||||
weight: 1, started: "X-ray started", ran: "X-ray run", resume: null,
|
||||
subagents: null,
|
||||
subagents: "Use helpers for the reading both modes lean on: explain mode's area files and history leads, and rough-spots mode's top candidates, one helper per area or candidate. Keep the judgment, the citations, the ranking, the pick and every question with you. Lookups at light strength, low effort.",
|
||||
states: "any",
|
||||
greyed: null,
|
||||
card: {
|
||||
group: "extra",
|
||||
chip: "Utility",
|
||||
title: "Codebase X-ray",
|
||||
icon: "xray",
|
||||
blurb: "Explain how and why an area works, or find the rough spots worth fixing.",
|
||||
about:
|
||||
"Two ways into code you did not write. Explain an area: how it works, step by step, and why it is that way, citing the files and the commits and pull requests behind it. Or find the rough spots: files that always change together, thin layers, tangled boundaries and busy code with no tests, ranked with a concrete example each. You tick the ones worth fixing and they become a brief for Pathfinder or Plan. It never changes code.",
|
||||
@@ -355,13 +368,14 @@ export const SKILLS = Object.freeze([
|
||||
pose: "diagnose",
|
||||
builds: false, phased: false, metered: true, templates: false,
|
||||
weight: 1, started: "Diagnose started", ran: "Diagnose run", resume: null,
|
||||
subagents: "Use helpers for the reading both modes lean on: explain mode's area files and history leads, and rough-spots mode's top candidates, one helper per area or candidate. Keep the judgment, the citations, the ranking, the pick and every question with you. Lookups at light strength, low effort.",
|
||||
subagents: "Use helpers for side lookups while you narrow: the code path a suspect change touches, a suspect function's callers, and the docs behind the failing behavior. Keep the reproduction, any bisect, the cause judgment and every question with you. Lookups at light strength, low effort.",
|
||||
states: "any",
|
||||
greyed: null,
|
||||
card: {
|
||||
group: "extra",
|
||||
chip: "Utility",
|
||||
title: "Diagnose a bug",
|
||||
icon: "diagnose",
|
||||
blurb: "Find a bug's cause and write it up, without fixing it.",
|
||||
help: "Finds a bug's cause and writes it up without fixing it, ready to hand to Quick Task or Plan.",
|
||||
about:
|
||||
@@ -376,13 +390,14 @@ export const SKILLS = Object.freeze([
|
||||
pose: "changelog",
|
||||
builds: false, phased: false, metered: true, templates: false,
|
||||
weight: 1, started: "Changelog started", ran: "Changelog run", resume: null,
|
||||
subagents: "Use helpers for side lookups while you narrow: the code path a suspect change touches, a suspect function's callers, and the docs behind the failing behavior. Keep the reproduction, any bisect, the cause judgment and every question with you. Lookups at light strength, low effort.",
|
||||
subagents: null,
|
||||
states: "any",
|
||||
greyed: null,
|
||||
card: {
|
||||
group: "extra",
|
||||
chip: "Utility",
|
||||
title: "Changelog",
|
||||
icon: "changelog",
|
||||
blurb: "Checks the CHANGELOG version against the main branch and suggests entries for what is new.",
|
||||
about:
|
||||
"Works out the right version from the default branch, then compares your branch with the latest CHANGELOG entry and suggests the entries it is missing. You edit them before anything is written, it keeps package.json in step, and it offers to commit the result in Git. If the newest version is not released or on another branch yet, it adds to that entry instead of starting a new one.",
|
||||
@@ -403,6 +418,7 @@ export const SKILLS = Object.freeze([
|
||||
group: "extra",
|
||||
chip: "Utility",
|
||||
title: "Git",
|
||||
icon: "git",
|
||||
blurb: "Branches, pull, push and commits on one board that stays open while you work.",
|
||||
help: "Branches, pull, push and commits on one board, asking before anything leaves your machine. See \"The git board\".",
|
||||
about:
|
||||
@@ -424,6 +440,7 @@ export const SKILLS = Object.freeze([
|
||||
group: "extra",
|
||||
chip: "Utility",
|
||||
title: "Handoff",
|
||||
icon: "handoff",
|
||||
blurb: "Pack the current session into a document a fresh session can pick up cold.",
|
||||
about:
|
||||
"Writes down everything a new session would need, as a single document: what was decided, what is done, what is left. Use it when a conversation got long, a machine changed, or tomorrow-you deserves the context today-you has.",
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
attribute's own display. */
|
||||
#btn-activities[hidden] { display: none; }
|
||||
|
||||
/* The dialog: Notebook-sized, with the board taking whatever height the
|
||||
title, the banner, the picker, the note and the actions leave. */
|
||||
/* The dialog: as large as the viewport allows, a slim edge all round so it
|
||||
still reads as a window, with the board taking whatever height the title,
|
||||
the banner, the picker, the note and the actions leave. */
|
||||
.modal.activities {
|
||||
width: min(1200px, 90vw);
|
||||
height: min(900px, 85vh);
|
||||
width: calc(100vw - 32px);
|
||||
height: calc(100vh - 32px);
|
||||
max-width: none;
|
||||
max-height: none;
|
||||
flex-direction: column;
|
||||
@@ -184,11 +185,20 @@
|
||||
padding: 4px 2px 8px;
|
||||
}
|
||||
.activities-picker[hidden] { display: none; }
|
||||
/* Cards keep one width and wrap, and each row (a short last one too) sits in
|
||||
the middle, so a wide window is filled evenly and no corner is left bare. */
|
||||
.activities-cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 16px;
|
||||
--card-w: 250px;
|
||||
--gap: 16px;
|
||||
/* At most six across: the width of six cards and the gaps between them. */
|
||||
max-width: calc(6 * var(--card-w) + 5 * var(--gap));
|
||||
margin-inline: auto;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: var(--gap);
|
||||
}
|
||||
.activities-cards > .activities-card { flex: 0 0 var(--card-w); max-width: 100%; }
|
||||
.activities-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
@@ -215,7 +225,7 @@
|
||||
/* A course dashboard: three across where it fits, so all six courses show
|
||||
at once. A course card's art is a hole drawn on a 4:3 canvas, cropped to a
|
||||
wide strip through its middle, where the play is. */
|
||||
.activities-courses { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
|
||||
.activities-courses { --card-w: 290px; }
|
||||
.activities-cover canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
|
||||
/* The covers' token colors (screens/activities.js names them), so a cover
|
||||
follows the theme and the highlight like the boards do. */
|
||||
|
||||
@@ -215,7 +215,21 @@
|
||||
}
|
||||
.dash-card.is-suggested .dash-chip { color: var(--accent); border-color: var(--accent-line); }
|
||||
|
||||
.dash-card-title { font-size: 15px; font-weight: 650; }
|
||||
/* The card icon sheet: present for <use href>, never drawn itself. */
|
||||
.card-icons { position: absolute; width: 0; height: 0; overflow: hidden; }
|
||||
|
||||
.dash-card-title { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 650; }
|
||||
.dash-card-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
flex: none;
|
||||
fill: none;
|
||||
stroke: currentColor;
|
||||
stroke-width: 1.8;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
.dash-card.is-suggested .dash-card-icon { stroke: var(--accent); }
|
||||
.dash-card-blurb { font-size: 13px; color: var(--ink-2); flex: 1; }
|
||||
.dash-card-detail { font-size: 12px; color: var(--accent); }
|
||||
|
||||
|
||||
@@ -119,6 +119,20 @@
|
||||
/* The icon sheet: present for <use href>, never drawn itself. */
|
||||
.help-icons { position: absolute; width: 0; height: 0; overflow: hidden; }
|
||||
|
||||
/* The card icons in the dashboard topic's card list: the same glyphs the
|
||||
cards wear, a touch quieter. */
|
||||
.help-card-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 5px;
|
||||
vertical-align: -2px;
|
||||
fill: none;
|
||||
stroke: var(--ink-2);
|
||||
stroke-width: 1.8;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
|
||||
/* The diagrams. Colors only from variables, so each drawing follows the
|
||||
theme and the chosen highlight without a line of script. */
|
||||
.help-figure { margin: 4px 0 16px; }
|
||||
|
||||
Reference in new issue
Block a user