Compare commits

..
5 Commits
36 changed files with 351 additions and 69 deletions

No files matched your search

@@ -45,7 +45,7 @@ One row per file of every game but Ghoul Rush (which has its own files: [core](.
| `public/activities/snake-music.js` | Snake's ten music tracks as data (no imports): `SNAKE_MUSIC`, `{ bpm, rush, voices, patterns, order }` each, named `snake<Place>` and listed in `MUSIC_TRACKS` in `snake.js`. A round deals them in a fresh order, one to each level, so a run hears a different track at every level and none twice. They were picked on the pages in `prototypes/music/snake` (rhythm-first folk and world tunes led by something plucked or reedy, mostly dark or modal), and their bars are not all sixteen steps: 6/8 is 12, 7/8 is 14, ten beats is 20, twelve beats is 24, each pattern a whole number of its bars; merged by `snake-sfx.js` |
| `public/activities/light-trails/1.mp3` to `5.mp3` | Light Trails' five background songs, named `trailsSong1` to `trailsSong5` under `songs` in `trails-sfx.js` and listed in `SERVABLE`; re-encoded for size with ffmpeg (80 kbps stereo MP3 at 44.1 kHz, loudness-normalized to -16 LUFS with `loudnorm`, metadata stripped), about 7.6 MB together, and copied into every skill with the rest of the console. The server leaves them out of its start-up cache warm |
| `public/activities/flock-dash/1.mp3` to `5.mp3` | Flock Dash's five background songs, named `flockSong1` to `flockSong5` under `songs` in `flock-sfx.js` and listed in `SERVABLE`; re-encoded for size with ffmpeg the way Light Trails' were (80 kbps stereo MP3 at 44.1 kHz, loudness-normalized to -16 LUFS with `loudnorm`, metadata stripped), about 6.4 MB together, and copied into every skill with the rest of the console. The server leaves them out of its start-up cache warm; `flock.js` deals all five in a fresh order each round with `dealMusic()`, plays each in full one after another and deals again after the last, never opening on the song that just ended |
| `public/screens/activities.js` | Activities: `#btn-activities` (the die right of the megaphone), `#activities-modal`, the one frame timer (`requestAnimationFrame`, swappable with `setTickSource()` for the page tests), the keys (arrows, W/A/S/D, space, P, Esc; stopped at the dialog so none reach the page behind; `CHEAT_CODE`, typed on a game's board, turns on endless lives through the game's `cheat(on)` until the round starts over, and `dropCheats()` turns it off on leaving for the picker or closing; `STAGE_CODE`, the same arrows then S, calls the game's `stageSelect()` where it has one, Ghoul Rush's practice stage select) and `pauseAll()`, which a new question, a finish, a hidden page, a window blur and a close all go through and which never resumes a game (it also sends a pointer game a cancel, dropping a drag). Canvas pointer events (down, move, up, cancel, with pointer capture) go to a game with `pointer()`, and key releases to a game with `release()`; a press on a paused board resumes without starting a drag. While paused, any game key or a board click resumes, except while a round is `held`: a question or finish that pauses a round on an open window holds it, the banner adds `#activities-unpause` (**Unpause game**) beside **Go to it**, and only that button plays on (`play()` refuses a held round), since a key or click already on its way used to dismiss the banner unread. Go to it, or closing the window any other way, lets the hold go, and a banner with nothing left to say drops it. Every start and play-on first counts down 3, 2, 1 (`COUNT_FROM`, 700 ms a number, `setCountdownMs()` for the page tests, which set 0 unless they test it): the game is already `running`, the frame timer just does not tick it, and game keys, overlay clicks and board presses wait, while P and Esc still pause. With two or more games listed the window opens on the picker (`view`: `"picker"` or `"game"`, `applyView()`): a picker of game rows in two columns (`drawPicker()`: an Order bar with **Recently played** and **A to Z**, saved in `activityOrder`, and the game count; one grid of `.activities-row` buttons from `orderGames()`, with never-picked games under a **Not played yet** heading that spans both columns; covers in `COVERS` drawn as SVG with `cv-*` token classes, since the page's policy refuses a style attribute) with each game's blurb, a best chip (thousands separators) and a **Last played** or **Paused at N** tag, arrows walking the rows and the course cards by position (`moveFocus()`: left and right through the list, up and down to the nearest button in the next line; an Order button keeps its arrows), and `#activities-back` (**All games**) back to it. One game at a time: `pick()` drops the last game from `games` when another is picked, and `openActivities()` goes straight back into a paused round. The last pick is kept as `lastActivity` and gets the focus; `lowerIsBetter` games keep the lowest round as the best; the header shows the current game's best (`paintTitle()`). `renderActivities()` in the render pass compares `myTurn()` and `finish()` with the last render and shows the banner with **Go to it**. Loads a game with `import()` when it is picked and keeps it until another is picked; `setActivityList()` lets a test list a stub second game, which brings up the picker |
| `public/screens/activities.js` | Activities: `#btn-activities` (the die, right of the text size control), `#activities-modal`, the one frame timer (`requestAnimationFrame`, swappable with `setTickSource()` for the page tests), the keys (arrows, W/A/S/D, space, P, Esc; stopped at the dialog so none reach the page behind; `CHEAT_CODE`, typed on a game's board, turns on endless lives through the game's `cheat(on)` until the round starts over, and `dropCheats()` turns it off on leaving for the picker or closing; `STAGE_CODE`, the same arrows then S, calls the game's `stageSelect()` where it has one, Ghoul Rush's practice stage select) and `pauseAll()`, which a new question, a finish, a hidden page, a window blur and a close all go through and which never resumes a game (it also sends a pointer game a cancel, dropping a drag). Canvas pointer events (down, move, up, cancel, with pointer capture) go to a game with `pointer()`, and key releases to a game with `release()`; a press on a paused board resumes without starting a drag. While paused, any game key or a board click resumes, except while a round is `held`: a question or finish that pauses a round on an open window holds it, the banner adds `#activities-unpause` (**Unpause game**) beside **Go to it**, and only that button plays on (`play()` refuses a held round), since a key or click already on its way used to dismiss the banner unread. Go to it, or closing the window any other way, lets the hold go, and a banner with nothing left to say drops it. Every start and play-on first counts down 3, 2, 1 (`COUNT_FROM`, 700 ms a number, `setCountdownMs()` for the page tests, which set 0 unless they test it): the game is already `running`, the frame timer just does not tick it, and game keys, overlay clicks and board presses wait, while P and Esc still pause. With two or more games listed the window opens on the picker (`view`: `"picker"` or `"game"`, `applyView()`): a picker of game rows in two columns (`drawPicker()`: an Order bar with **Recently played** and **A to Z**, saved in `activityOrder`, and the game count; one grid of `.activities-row` buttons from `orderGames()`, with never-picked games under a **Not played yet** heading that spans both columns; covers in `COVERS` drawn as SVG with `cv-*` token classes, since the page's policy refuses a style attribute) with each game's blurb, a best chip (thousands separators) and a **Last played** or **Paused at N** tag, arrows walking the rows and the course cards by position (`moveFocus()`: left and right through the list, up and down to the nearest button in the next line; an Order button keeps its arrows), and `#activities-back` (**All games**) back to it. One game at a time: `pick()` drops the last game from `games` when another is picked, and `openActivities()` goes straight back into a paused round. The last pick is kept as `lastActivity` and gets the focus; `lowerIsBetter` games keep the lowest round as the best; the header shows the current game's best (`paintTitle()`). `renderActivities()` in the render pass compares `myTurn()` and `finish()` with the last render and shows the banner with **Go to it**. Loads a game with `import()` when it is picked and keeps it until another is picked; `setActivityList()` lets a test list a stub second game, which brings up the picker |
| `public/styles/activities.css` | the Activities rules: the die in the top bar, the Notebook-sized dialog, the board and its state overlay, the your-turn banner in the highlight color, the picker and the notes |
**Building an Activities game:** the rules every game follows, so a new one plays like the rest.
@@ -4,7 +4,7 @@
Key design points:
- **First-run Welcome.** The first dashboard a person sees (after the wake-up finishes) opens `#welcome-modal`. Any close (button, Esc, backdrop) saves `looks.welcomeSeen: true` to `looks.json`, which survives "Reset this tab". The four columns teach Pick a card, Answer then Send, Watch the terminal (the in-app wording names the terminal panel) and Get help; the session meter's one-time tip lives in the meter popover (`looks.meterTipSeen`). `looks.skillLaunched` is set by the first skill launch from this machine (`launchSkill()`) and, like `welcomeSeen`, is never reset: until it is set the dashboard holds the role line and draws Learning "Not set up" at the bottom, and after it one quiet line offers the two optional extras. Help's first tab has a **Show the welcome again** link (`data-action="welcome"`). Logic: `maybeWelcome()` / `openWelcome()` in `screens/help-dialog.js`.
- **Top-bar icons.** `#btn-looks` (gear) opens `#looks-modal`, titled User Preferences (see User Preferences below). `#btn-feedback` (megaphone) is a plain link to `https://github.com/jparkerweb/plan2code/issues/new/choose`, backed by `.github/ISSUE_TEMPLATE/bug.yml` and `idea.yml` (`config.yml` sets `blank_issues_enabled: false`). `DEFAULT_ACCENT` in `palette.js` is `ocean`.
- **Top-bar icons.** `#btn-looks` (gear) opens `#looks-modal`, titled User Preferences (see User Preferences below). `#btn-feedback` (megaphone) is a plain link to `https://github.com/jparkerweb/plan2code/issues/new/choose`, backed by `.github/ISSUE_TEMPLATE/bug.yml` and `idea.yml` (`config.yml` sets `blank_issues_enabled: false`). `#text-size` (right of the megaphone, left of the die) is `[-]`, a size label and `[+]`: seven steps in `TEXT_SIZES` (`palette.js`, 80 to 150%), saved as `looks.textSize`, painted as `data-text-size` on `<html>` (the server writes it into the first paint too) and read by `tokens.css`, whose `--fs-*` steps multiply by `--text-scale`; the label returns to 100%, and a button at an end of the range is `aria-disabled`. `DEFAULT_ACCENT` in `palette.js` is `ocean`.
- **Version in Help.** `GET /version` reads `version.json` beside `server.mjs`, falling back to `../../version.json` for a run from `src/` (the `/version` route in `routes.mjs`). `renderHelpVersion()` in `screens/help-dialog.js` fills `#help-version`. `computeExpectedSkills()` in `install.js` injects the root `version.json` into every `references/web-console/`, so a version bump changes every skill.
- **User Preferences is four tabs in a side list.** Appearance (Theme, Card width, Highlight color, Role), Agents & models, System (Cleanup, and Desktop app inside the app only) and Sounds & activities (Sounds, Activities), a sideways strip below 720 px. The tabs are the static `<section class="prefs-panel">` panels in `#looks-modal`, each fieldset in exactly one (its `data-section`, listed in `PREFS_TABS`), wired by the shared `public/tabs.js` (`wireTabs()`, the same helper Help uses: `helpKeyTarget()` re-exports its `tabKeyTarget()`). `public/prefs.js` is the pure part: `PREFS_TABS`, `prefsOpenTab()` (the gear and the dashboard's Set up preferences both open Appearance; nothing is remembered between opens) and `prefsResetScope()` (Reset this tab, with an "Reset. Undo" mark for eight seconds, resets only the shown tab's looks keys, and is hidden on Agents & models and System). `screens/prefs-dialog.js` owns `openPrefs(tab)`, the one way in, the Saved mark and the unsaved prompt; `screens/looks.js` keeps the look and sound controls, which save to `looks.json` as they change; `screens/agents-view.js` mounts the Agents & models tab, a master-detail split over today's `models.json` and `agents.json` (formats unchanged) whose per-agent form has its own Save and Discard: Save sends the last saved list with only that form's draft swapped in, so another form's half-typed edit is never written. The split's components live under `screens/agents/` (data, list editor, summary, form); the mount owns all state and every fetch and hands them one `ctx`.
- **Models in User Preferences.** `GET` / `POST /models` in `routes.mjs` read the shipped `~/.plan2code/bin/models.json` and read/write the user's `~/.plan2code/models.json` (`SHIPPED_MODELS_FILE` / `USER_MODELS_FILE` in `files.mjs`), edited from each built-in agent's form on the Agents & models tab. `PLAN2CODE_MODELS_DIR` relocates both for tests. The launcher reads the same two files for its model menu.
+3 -13
View File
@@ -82,25 +82,15 @@ If `$CHANGELOG_VERSION` > `$RELEASE_VERSION`, compute:
- `title = "v$CHANGELOG_VERSION"` (plan2code keeps the `v` prefix in release titles)
- `notes` = the header line `# What's New 🎉`, one blank line, the **fixed header** below (with `$CHANGELOG_VERSION` filled in), one blank line, then the **highlights**, one blank line, then `$SECTION` verbatim (`$SECTION` already starts with the `## vX.Y.Z` heading). Build this as a real multi-line string with **actual newlines** — the `\n\n` shorthand shown elsewhere means "a blank line," never the literal two-character sequence `\` + `n`. Getting this wrong would run the header and the first CHANGELOG heading together with a stray `\n\n` in the published body.
**The fixed header** (the same on every release, so a visitor to the release page finds the install and update commands and the right file without reading the changelog):
**The fixed header** (the same on every release, so a visitor to the release page finds the install and update commands without reading the changelog):
````markdown
**Install:** `npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release`
**Update:** `plan2code update`
The installer downloads the right app for your system and puts it in place for you, so you only need the files below for a manual download.
| Your system | File |
| --- | --- |
| Windows (64-bit Intel or AMD) | `plan2code-app-$CHANGELOG_VERSION-windows-x64.exe` |
| macOS (Apple silicon) | `plan2code-app-$CHANGELOG_VERSION-macos-arm64` |
| macOS (Intel) | `plan2code-app-$CHANGELOG_VERSION-macos-x64` |
| Linux (64-bit Intel or AMD) | `plan2code-app-$CHANGELOG_VERSION-linux-x64` |
| Any system: check a download | `plan2code-app-$CHANGELOG_VERSION-SHA256SUMS.txt` |
The app files are not code-signed. See [the desktop app guide](https://github.com/jparkerweb/plan2code/blob/main/docs/desktop-app.md#the-app-is-not-code-signed) for what your system may ask and how to answer.
````
Do not add the manual-download file table, the installer paragraph or the "not code-signed" note to the notes: the maintainer does not want them in release bodies.
Check the install command against the README's "See it" line before publishing; if it has changed, the README wins.
**The highlights** (written fresh for each release, from `$SECTION`): a `### Highlights` heading and exactly three bullets, each one plain sentence about what a person can now do or no longer trips over (no file names, no internal terms). The full list follows below them. When `$SECTION` already opens with its own `### Highlights` block (the changelog format from 3.1.0 on), reuse those bullets as they are: add no second Highlights block.
+1 -1
View File
@@ -1 +1 @@
U0VOQwEFJpExmufZ7/oN72H5kVdq885u/hNYDc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OP7NijC8OzHvy03ahwLe0+Mgnjvq6xMYpjDnor+WaWLDBLgaVr5RYBdTlIYO/ZXl+NjB6cvxSAhq966q9YUCN4Uq09FG2GP+s3yCrDUVgbt1tG1Kqz6gpuu4pO7NrZfe18nJZVQgEvmBfpTnLVLT6QONR3yiv0L89HHM1xwmoWF4+c4/cSvCZ8Qq/Zt/PgRG30nFC2IUhXlXGaNnt20EXPyq+Y5nzJgRGQ4paJww73qZmLine truncated
+3 -8
View File
@@ -104,16 +104,11 @@
- About: plan2code-app/ui/theme-early.js
- Noted: 2026-11-17, implement-review
### The launcher's prompts each open a new readline on stdin, so a test piping several answers at once loses all but the first; drive a multi-prompt flow by writing each answer after a short delay.
### To drive several launcher prompts in scripts/test-launcher.mjs, use runAtTerminal(): each prompt opens a new readline on stdin, so piping all answers at once loses every one after the first.
- Kind: how-it-works
- About: src/launcher/plan2code.js
- Noted: 2026-11-15, implement-review
### To drive launcher prompts in scripts/test-launcher.mjs, use runAtTerminal(): it marks stdin as a terminal with a preload file and answers each prompt only once it shows on stdout.
- Kind: convention
- About: scripts/test-launcher.mjs
- About: src/launcher/plan2code.js, scripts/test-launcher.mjs
- Why: Each launcher prompt opens a new readline, so piping all answers at once loses every answer after the first.
- Noted: 2026-11-17, implement-review, checked 2026-11-28
- Noted: 2026-11-15, implement-review
### To run plan2code-app/ui/app.js in a page test, serve the ui folder over HTTP and stub window.__TAURI__, with platform_info answering { os }; from file:// the module never loads.
- Kind: how-it-works
+1 -1
View File
@@ -3,7 +3,7 @@
The small games behind the die in the web console's top bar. This is the full guide to each game and to the rules they share; the console guide has the short version. Back to [the web console guide](web-console.md#activities).
The **die** in the top bar, right of the megaphone, opens **Activities**: small
The **die** in the top bar, right of the text size buttons, opens **Activities**: small
games to play while you wait, say through a long build. Thirteen ship today,
**Snake**, **Mini golf**, **Light Trails**, **Bug Hunt**, **Sunset Drive**, **Stack Deploy**, **Bumper Ring**, **Rapids Run**, **Hot Potato**, **Crossing Rush**, **Bounce Road**, **Ghoul Rush** and **Flock Dash**. The window opens on a
**picker**: a row per game, in two columns on a wide window, with a small cover
+1
View File
@@ -169,6 +169,7 @@ origin.
| `POST /open-prototype` | `{ spec, name }`: opens one `.html` from `<spec>/prototypes/` in the person's default browser. 404 for any other name, 500 when no browser could start. |
| `GET /handoff?id=<id>` | *Read it all*: the handoff's `.md` from `~/.plan2code/handoffs/`, as `text/markdown` with `cache-control: no-store`. A dashboard only, and only an id its own scan listed: a used, unknown or malformed id is 404. |
| `POST /learning/pause` | Pause for me: `{ paused: boolean }` (origin-checked; anything else is 400 `bad-request`, and 409 `not-on` unless Learning is On or Paused for you). Writes the personal pause on this machine only (`pause.json` under `~/.plan2code/learning/<key>/`), the server's only write for Learning, and repaints the row with no agent. |
| `POST /learning/tidy-quiet` | Tidy-up quiet: an empty JSON object (origin-checked; 409 `not-on` unless Learning is On). Stores a fingerprint of the saved lessons in `tidy-quiet.json` beside `pause.json`, so `scan.learning.nearCap` stays false until a lesson file changes. Sent by the banner's Not now and by a Tidy up that proposed nothing; repaints with no agent. |
| `GET /learning/state` | The Learning row's state worked out now, `{ state, pausedSince, waiting, oldestDays, nearCap }` (`{}` when the project's settings file is from a format it cannot read), with `cache-control: no-store`. |
| `GET /learning/lessons` | Open the lessons, read only: `{ files: [{ name, title, text }], follows: { <lesson id>: { count, last } } }` (follows from this machine's `follows.ndjson`, for the reader's "Followed N times" line) from the project's lessons (`.plan2code/lessons/`, saved with the repository), `general.md` first, then the other `.md` files in name order (plain files only, at most 100 of 512 KB each), with `cache-control: no-store`. |
| `GET /workspace` | The Workspace dialog's list: folders, `missing`, `remote` and the agent's folder `issues`. `?check=1` re-checks every folder on disk first. |
+1 -1
View File
@@ -40,7 +40,7 @@ Optional local browser UI (`src/web-console/`, zero dependencies, detached `node
One agent list and one lookup rule serve the launcher, the console and the app: `src/launcher/agents.json` (the built-ins and starter templates with per-OS install data) and `src/web-console/agent-lookup.mjs` (`loadAgentList()` and `findAgent()`, both copied by `install.js` into `~/.plan2code/bin/`); the app carries a Rust twin held to the same cases by `scripts/fixtures/agent-lookup-cases.json`.
**Learning** (lessons about a codebase, kept with it): the dashboard draws a Learning row (Not set up, Off, On or Paused for you, with a Pause for me switch and a More menu) and, while lessons are waiting, a banner with Review (plus a Tidy up nudge from the scan's `nearCap`; More, Tidy up lessons sends the `tidy` action, which writes `tidy` waiting items the same card applies), both from the scan's `learning` field (`public/screens/learning-row.js`, `public/styles/learning.css`); skills ask for approval through the `lessons` card kind. Before that card, every waiting lesson is graded by a separate check, a fresh read-only helper where the agent has one, else a labeled second pass by the same agent (`src/shared-references/lesson-check.md`; `lessons.mjs check-input` prepares, the checker judges, `check-record` stores), and the card shows each Doubt or Fail with its reason; follows ("Following a lesson") are counted on this machine only, in `follows.ndjson`, for the lessons reader. The server's only write for it is the personal pause, on this machine only (`POST /learning/pause`, under `~/.plan2code/learning/`); every change to the project's Learning files (`.plan2code/settings.json` and `.plan2code/lessons/`) goes through the `lessons.mjs` skill script, which shares one core with the scan, `src/web-console/learning.mjs`.
**Learning** (lessons about a codebase, kept with it): the dashboard draws a Learning row (Not set up, Off, On or Paused for you, with a Pause for me switch and a More menu) and, while lessons are waiting, a banner with Review (plus a Tidy up nudge from the scan's `nearCap`; More, Tidy up lessons sends the `tidy` action, which writes `tidy` waiting items the same card applies), both from the scan's `learning` field (`public/screens/learning-row.js`, `public/styles/learning.css`); skills ask for approval through the `lessons` card kind. Before that card, every waiting lesson is graded by a separate check, a fresh read-only helper where the agent has one, else a labeled second pass by the same agent (`src/shared-references/lesson-check.md`; `lessons.mjs check-input` prepares, the checker judges, `check-record` stores), and the card shows each Doubt or Fail with its reason; follows ("Following a lesson") are counted on this machine only, in `follows.ndjson`, for the lessons reader. The server's only writes for it are the personal pause (`POST /learning/pause`) and the tidy-up quiet (`POST /learning/tidy-quiet`: a Tidy up that proposed nothing, or the banner's Not now, hides the nudge until the saved lessons change), both on this machine only, under `~/.plan2code/learning/`; every change to the project's Learning files (`.plan2code/settings.json` and `.plan2code/lessons/`) goes through the `lessons.mjs` skill script, which shares one core with the scan, `src/web-console/learning.mjs`.
Building or changing an Activities game: follow the game rules in [Activities](./.agents-docs/AGENTS-architecture-activities.md) ("Building an Activities game": lives in the solid lives pill, the endless-lives code (`cheat(on)`) in every game with lives, banners placed away from the player and see-through over what matters, pausing left to the window).
Details: [Web console server and contract](./.agents-docs/AGENTS-architecture-console.md), [page](./.agents-docs/AGENTS-architecture-console-page.md), [design points](./.agents-docs/AGENTS-architecture-console-design.md), [Activities](./.agents-docs/AGENTS-architecture-activities.md) (and the Ghoul Rush and Bounce Road files it links) [.readme/web-console.md](./.readme/web-console.md) (the user guide), [.readme/activities.md](./.readme/activities.md) and [.readme/web-console-internals.md](./.readme/web-console-internals.md) (routes, security, driving it by hand, refreshing screenshots)
Why the agent-facing console docs are shaped as they are (the card, pointers, refusals): [Web Console Contract](./.agents-docs/AGENTS-web-console-contract.md); it never ships.
+15
View File
@@ -4,6 +4,21 @@ All notable changes to Plan2Code will be documented in this file.
<!-- Format from 3.1.0 on: `## vX.Y.Z (YYYY-MM-DD)` with the date from version.json; a minor release opens with a three-bullet `### Highlights`; sections run Added, Changed, Fixed; game changes sit under one Activities line; tooling and test lines go under "For contributors". Older headings have no date and are not backfilled. -->
## v3.2.1 (2026-11-29)
### ✨ Added
- **Web console**: text size buttons in the top bar, between the megaphone and the die: [-], the current size and [+] scale all the console's text in seven steps from 80% to 150%, the size returns to 100% when you click it, your choice is kept with your other looks, and Back to default on the Appearance tab resets it.
- **Learning**: the Tidy up banner has a Not now button that hides it until your saved lessons change (remembered on this machine only).
### 🔧 Changed
- **Git**: committing from the board takes one card, the commit subject and a choice of Commit only or Commit and push, answered in one send; choosing push is the yes, so the Commit this? and Push confirms are gone.
### 🐛 Fixed
- **Learning**: the Tidy up banner stays hidden once a Tidy up finds nothing to do, until your saved lessons change; before, it came straight back and Tidy up only said there was nothing to tidy.
## v3.2.0 (2026-11-29)
### Highlights
+1 -1
View File
@@ -13,7 +13,7 @@
Plan2Code is a spec-driven workflow for AI coding agents. You work through it on a page in your browser: the dashboard lists every step as a card, and each step's questions, progress and sign-offs arrive on that same page while your agent does the work. An approved plan becomes phase documents, and the agent builds to them one phase at a time.
Version 3.2.0 · Apache 2.0 · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com)
Version 3.2.1 · Apache 2.0 · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com)
---
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code",
"version": "3.2.0",
"version": "3.2.1",
"private": true,
"license": "Apache-2.0",
"engines": {
+2 -2
View File
@@ -957,7 +957,7 @@ dependencies = [
[[package]]
name = "fake-agent"
version = "3.2.0"
version = "3.2.1"
dependencies = [
"serde_json",
"terminal_size",
@@ -2647,7 +2647,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
[[package]]
name = "plan2code-app"
version = "3.2.0"
version = "3.2.1"
dependencies = [
"chrono",
"libc",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "fake-agent"
version = "3.2.0"
version = "3.2.1"
description = "A stand-in agent program for the Plan2Code app's tests"
edition = "2021"
publish = false
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "plan2code-app",
"version": "3.2.0",
"version": "3.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "plan2code-app",
"version": "3.2.0",
"version": "3.2.1",
"dependencies": {
"@tauri-apps/api": "2.12.4",
"@xterm/addon-fit": "0.11.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code-app",
"version": "3.2.0",
"version": "3.2.1",
"private": true,
"description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.",
"scripts": {
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "plan2code-app"
version = "3.2.0"
version = "3.2.1"
description = "Plan2Code desktop app"
edition = "2021"
publish = false
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Plan2Code",
"version": "3.2.0",
"version": "3.2.1",
"identifier": "com.plan2code.desktop",
"build": {
"frontendDist": "../ui",
+30
View File
@@ -119,6 +119,36 @@ test("scan.learning.nearCap: true at 22 general lessons or 30 in an area, false
assert.deepEqual(listing(full), before, "the scan writes nothing");
});
test("scan.learning.nearCap stays false once a tidy-up found nothing, until the saved lessons change", async (t) => {
const dir = project({ ...SETTINGS("on"), ".plan2code/lessons/general.md": lessonFile("General", 23) });
assert.equal(learningScan(dir).nearCap, true);
const s = dashboard(t, dir);
const res = await s.post("/learning/tidy-quiet", {});
assert.equal(res.status, 200);
const body = await res.json();
assert.equal(body.ok, true);
assert.equal(body.learning.nearCap, false, "the answer carries the patched scan");
assert.equal(readState(s.session).scan.learning.nearCap, false, "the page repaints from the patched scan");
assert.equal(learningScan(dir).nearCap, false, "a later scan agrees");
assert.ok(fs.existsSync(path.join(storeDir(dir), "tidy-quiet.json")), "it lives in the learning store on this machine");
// The lessons change (a merge, a new lesson): the nudge may come back.
fs.writeFileSync(path.join(dir, ".plan2code", "lessons", "general.md"), lessonFile("General", 24));
assert.equal(learningScan(dir).nearCap, true);
});
test("POST /learning/tidy-quiet is 409 when the project is not on and writes nothing into the project", async (t) => {
for (const files of [{}, SETTINGS("off")]) {
const s = dashboard(t, project(files));
const res = await s.post("/learning/tidy-quiet", {});
assert.equal(res.status, 409);
assert.deepEqual(await res.json(), { error: "not-on" });
}
const dir = project({ ...SETTINGS("on"), ".plan2code/lessons/general.md": lessonFile("General", 23) });
const before = listing(dir);
await dashboard(t, dir).post("/learning/tidy-quiet", {});
assert.deepEqual(listing(dir), before);
});
test("a failure in Learning's core never fails the scan", () => {
const boom = () => {
throw new Error("the core broke");
+2 -1
View File
@@ -170,7 +170,8 @@ test("the die sits right of the megaphone and opens on the picker, a ledger row
await pastTheIntro(s);
await iconUsable(s, "the dashboard");
const next = await s.page.evaluate(() => document.getElementById("btn-feedback").nextElementSibling?.id);
assert.equal(next, "btn-activities");
assert.equal(next, "text-size", "the text size control sits between the megaphone and the die");
assert.equal(await s.page.evaluate(() => document.getElementById("text-size").nextElementSibling?.id), "btn-activities");
await openPicker(s);
// Snake's seeded best makes it the one played row; the rest sit under Not played yet, A to Z.
assert.deepEqual(await cardTitles(s), ["Snake", "Bounce Road", "Bug Hunt", "Bumper Ring", "Crossing Rush", "Flock Dash", "Ghoul Rush", "Hot Potato", "Light Trails", "Mini golf", "Rapids Run", "Stack Deploy", "Sunset Drive"]);
@@ -282,6 +282,17 @@ test("the banner nudges a tidy-up when lessons are near their limit, and only th
assert.equal(await below.main.locator(".learn-banner").count(), 0, "no banner below the line");
});
test("Not now hides the tidy-up nudge at once and it stays hidden for the same lessons", async (t) => {
const full = await dashboard(t, { ...PROJECT("on"), ".plan2code/lessons/general.md": lessonFile("General", 22) });
const banner = full.main.locator(".learn-banner");
await banner.waitFor();
await banner.getByRole("button", { name: "Not now" }).click();
await until(async () => (await full.main.locator(".learn-banner").count()) === 0, 5000);
const state = await full.s.page.evaluate(() => fetch("/learning/state").then((r) => r.json()));
assert.equal(state.nearCap, false, "the server remembers it");
assert.equal(await full.main.locator(".learn-banner").count(), 0, "still hidden after the repaint");
});
test("a launch from a dashboard showing lessons waiting carries fromBanner", async (t) => {
const { s, main } = await dashboard(t, PROJECT("on"), (p) =>
writeWaiting(p, { id: "20261113-120000-eeeeee", type: "lesson", text: "Waits.", noted: new Date().toISOString() })
+53
View File
@@ -85,6 +85,59 @@ test("the violet highlight and dark theme chosen in preferences stick across a r
assert.deepEqual(await firstPaintAttrs(s), { theme: null, accent: null }, "the first paint still carries the old looks");
});
// The top bar's text size buttons: seven steps, saved with the looks, in the first paint.
const bodySize = (s) => s.page.evaluate(() => getComputedStyle(document.body).fontSize);
const sizeLabel = (s) => s.page.locator("#btn-text-size").innerText();
const savedTextSize = (s) => s.page.evaluate(async () => ((await (await fetch("/looks")).json()).looks || {}).textSize);
test("the text size buttons step the console's type up and down between the megaphone and the die, stop at the ends, and the label returns to 100%", async (t) => {
noSavedLooks(t);
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
const order = await s.page.evaluate(() => [...document.getElementById("btn-feedback").parentElement.children].map((n) => n.id));
assert.deepEqual(order.slice(order.indexOf("btn-feedback"), order.indexOf("btn-feedback") + 3), ["btn-feedback", "text-size", "btn-activities"], "the control sits between the megaphone and the die");
assert.equal(await sizeLabel(s), "100%");
assert.equal(await root(s, "data-text-size"), null, "the default size leaves the page unmarked");
assert.equal(await bodySize(s), "15px");
await s.page.click("#btn-text-larger");
assert.equal(await sizeLabel(s), "110%");
assert.equal(await root(s, "data-text-size"), "110");
assert.equal(await s.page.locator("#btn-text-size").getAttribute("aria-label"), "Text size 110%, back to 100%", "a screen reader hears the size");
assert.equal(await bodySize(s), "16.5px");
await s.page.waitForFunction(async () => ((await (await fetch("/looks")).json()).looks || {}).textSize === 110);
// The first paint carries it, and so does a reload.
const html = await (await s.context.request.get(s.url)).text();
assert.match(html.match(/<html\b[^>]*>/i)?.[0] ?? `no html tag in: ${html.slice(0, 200)}`, /data-text-size="110"/, "the first paint carries the saved size");
await s.page.reload({ waitUntil: "domcontentloaded" });
await drawn(s.page);
assert.equal(await sizeLabel(s), "110%");
assert.equal(await bodySize(s), "16.5px");
// The label puts it back.
await s.page.click("#btn-text-size");
assert.equal(await sizeLabel(s), "100%");
assert.equal(await root(s, "data-text-size"), null);
assert.equal(await bodySize(s), "15px");
// Largest and smallest: the button at the end is spent, not wrapped.
for (let i = 0; i < 6; i++) if (await s.page.locator("#btn-text-larger").isEnabled()) await s.page.click("#btn-text-larger");
assert.equal(await sizeLabel(s), "150%");
assert.equal(await s.page.locator("#btn-text-larger").getAttribute("aria-disabled"), "true");
await s.page.click("#btn-text-size");
for (let i = 0; i < 6; i++) if ((await s.page.locator("#btn-text-smaller").getAttribute("aria-disabled")) !== "true") await s.page.click("#btn-text-smaller");
assert.equal(await sizeLabel(s), "80%");
assert.equal(await bodySize(s), "12px");
await s.page.waitForFunction(async () => ((await (await fetch("/looks")).json()).looks || {}).textSize === 80);
// Back to default in Preferences returns it too.
await s.page.click("#btn-looks");
await s.page.click("#looks-reset");
await s.page.waitForFunction(() => !document.documentElement.hasAttribute("data-text-size"));
assert.equal(await sizeLabel(s), "100%");
assert.equal(await savedTextSize(s) ?? 100, 100);
});
// The Agents & models tab: a roster of agent cards, the picked agent's form in
// a drawer over it (Models & strengths and Launch tabs), and the Add agent
// chooser, where the starter templates are an opt-in.
+1 -1
View File
@@ -869,7 +869,7 @@ test("prefs: the dialog opens on the tab asked for, else Appearance", () => {
});
test("prefs: Back to default resets Appearance or Sounds & activities only, and nothing on the other two", () => {
assert.deepEqual(prefsResetScope("appearance"), ["theme", "width", "accent", "role", "skipIntro"]);
assert.deepEqual(prefsResetScope("appearance"), ["theme", "width", "textSize", "accent", "role", "skipIntro"]);
const sounds = prefsResetScope("sounds");
assert.deepEqual(sounds, ["sound", ...Object.keys(SOUND_EVENTS).map(soundKey), ...PICKABLE_SOUNDS.map(soundFileKey), "hideActivities", "activitySounds", "gameMusic"]);
for (const key of [...prefsResetScope("appearance"), ...sounds]) {
+1 -1
View File
@@ -189,7 +189,7 @@ test("shape: no page module sets a style attribute from script", () => {
// no routes of its own: its buttons are sends (`__git`), through /submit.
const ROUTE_ORDER = [
"/health", "/s/", "/handover", "/", "SERVABLE", "/overview", "/agents-doc", "/prototypes", "/prototype", "/handoff", "/version", "/state", "/events", "/draft",
"/looks", "/looks", "/subagents", "/learning/pause", "/learning/state", "/learning/lessons", "/pr-host", "/models", "/models", "/agents", "/agents", "/agents/test", "/agents/use-path", "/cleanup", "/upload",
"/looks", "/looks", "/subagents", "/learning/pause", "/learning/tidy-quiet", "/learning/state", "/learning/lessons", "/pr-host", "/models", "/models", "/agents", "/agents", "/agents/test", "/agents/use-path", "/cleanup", "/upload",
"/notepad", "/notepad/text", "/notepad/image", "/notepad/thumb", "/notepad/image/delete", "/notepad/tab",
"/notepad/tab/rename", "/notepad/tab/delete", "/notepad/tab/order", "/notepad/tab/last", "/notepad/tab/sent", "/notepad/images/",
"/attachments/", "/shots/", "/uploads/", "/submit", "/open-link", "/open-prototype", "/chat", "/chat/decision", "/workspace",
+3 -3
View File
@@ -68,7 +68,7 @@ On a non-zero exit, save git's stderr to the session folder, run `classify-error
## Actions
- **refresh, pull, switch, create** run on the click when the plan says `ask: false` (a clean tree, a fast-forward).
- **push, publish, delete, cleanup** always ask first, with the plan's `confirm`.
- **push, publish, delete, cleanup** always ask first, with the plan's `confirm`, except a push picked in the commit's own card (Commit flow step 7).
- **switch** with changes: **Switch and bring them** runs the switch; **Commit first** runs the Commit flow over the changed files, then the switch; **Cancel** does nothing but the `git-result` line. A pull's `dirty` card works the same way, with the pull in place of the switch.
- **create** with `then: "commit"` creates the branch, then continues the Commit flow on it with the action's `files` (and `ignore`, as for commit).
- **commit** commits only the paths in `files`. With `ignore[]`, first propose those `.gitignore` lines as a doc plus a `review` card (approve / change), write them on approve, and add `.gitignore` to the commit.
@@ -96,9 +96,9 @@ In the terminal the same stops are asked in prose, with the diff printed.
2. **Nothing to commit.** If `push` is not null, go to 7. Otherwise say the tree is clean and everything is pushed (or that there is no remote), and stop.
3. **Branch.** On the board, skip this: the Save step's **Start a branch and commit** already offered it, and its answer arrives as `create` with `then: "commit"`. In the terminal, when `onDefault` (or `detached`) and `hasCommits`, offer one drafted branch name `<type>/<short-description>` (types: feature, fix, chore, docs, refactor, test; `feature/export-csv`). Run any name the person types through `branch-check`, then `plan create`. Skipping is always fine (on a detached HEAD, warn that commits there are easy to lose). When `defaultBranch` is null say why there is no offer.
4. **Read the changes.** `git diff`, `git diff --cached` and the untracked files (an `untracked` path ending in `/` is a folder: list its files with `git ls-files -o --exclude-standard -- <folder>` and stage them by name). If the person staged some files, work from that staged set and leave the rest alone (say what was left). On the board, only the paths the action named, or every changed file on a hand-off. Decide whether the work is one concern or several.
5. **Message.** One concern: draft a subject, or use the argument and skip approval; ask **Yes** / **Edit** / **No**. Several: always suggest whole-file groups, each with a subject, naming any file that mixes concerns and which group took it; ask **Approve** / **Change it** / **One commit instead** (asked even when the subject came as the argument). Name the `sensitive` and `large` files you are leaving out.
5. **Message.** One concern: draft a subject, or use the argument and skip approval; ask **Yes** / **Edit** / **No**, with **Yes and push** beside Yes when a push is possible (on the console, the subject and **Commit only** / **Commit and push** go in ONE post, notes/git.md). Several: always suggest whole-file groups, each with a subject, naming any file that mixes concerns and which group took it; ask **Approve** / **Change it** / **One commit instead** (asked even when the subject came as the argument). Name the `sensitive` and `large` files you are leaving out.
6. **Commit.** For each group in order: with more than one group, run `git reset -q` first so only that group is staged; then run `commit-msg.mjs --subject "<s>" --files <a> --files <b>` (`--files` once per path) and its `command` (or `add`, then `commit`). Finish with `git log --oneline -<n>`. On the console post `run: { "event": "git-commits", "id": "<first short hash>", "commits": <n> }` with the `reread` and a `git-result` line naming the hashes with `op: "commit"`, so the board lights Push.
7. **Push.** In the terminal, stop after committing with a one-line push hint and no push prompt. `commit and push` (or a push the person asks for) runs `plan push` / `plan publish` and asks its `confirm`. A rejected push: report it, suggest Pull, run nothing more.
7. **Push.** In the terminal, stop after committing with a one-line push hint and no push prompt. `commit and push`, or **Commit and push** / **Yes and push** picked with the message, runs `plan push` / `plan publish` straight after the commit: that choice was the yes. A push asked for any other way runs the same plan and asks its `confirm`. A rejected push: report it, suggest Pull, run nothing more.
## Terminal
+46 -1
View File
@@ -126,6 +126,49 @@ export function writePause(cwd, paused, now) {
return { paused: true, since };
}
/* ------------------------------------------------------- the tidy-up quiet */
/**
* A short fingerprint of the project's saved lessons (every `.md` file's name
* and text under `.plan2code/lessons/`, in name order). It changes when a
* lesson is added, merged, reworded or retired, and only then. Reads only; a
* missing folder or an unreadable file counts as empty.
*/
export function lessonsFingerprint(cwd = process.cwd()) {
const dir = path.join(worktreeOf(cwd), ".plan2code", "lessons");
const hash = crypto.createHash("sha1");
let names = [];
try {
names = fs.readdirSync(dir).filter((n) => n.endsWith(".md")).sort();
} catch {}
for (const name of names) {
let text = "";
try {
text = fs.readFileSync(path.join(dir, name), "utf8");
} catch {}
hash.update(`${name}\0${text}\0`);
}
return hash.digest("hex");
}
/** The lessons a tidy-up already looked over (or the person waved off), or null. */
export function readTidyQuiet(cwd) {
const data = readJson(path.join(storeDir(cwd), "tidy-quiet.json"));
if (!data || typeof data !== "object" || data.format !== FORMAT || typeof data.fingerprint !== "string") return null;
return data.fingerprint;
}
/**
* Remember that the lessons as they are now need no tidy-up nudge: a tidy-up
* proposed nothing, or the person pressed Not now. `now` pins the clock.
*/
export function writeTidyQuiet(cwd, now) {
const fingerprint = lessonsFingerprint(cwd);
ensureDir(storeDir(cwd));
writeJsonAtomic(path.join(storeDir(cwd), "tidy-quiet.json"), { format: FORMAT, fingerprint, at: toDate(now).toISOString() });
return fingerprint;
}
/* ------------------------------------------------------------ follow counts */
/** One line per "Following a lesson" moment, on this machine only. */
@@ -330,6 +373,8 @@ export function learningScan(cwd = process.cwd(), { now, read = learningState }
pausedSince: s.pausedSince || null,
waiting: Number.isInteger(waiting.count) ? waiting.count : 0,
oldestDays: Number.isInteger(waiting.oldestDays) ? waiting.oldestDays : 0,
nearCap: s.state === "on" && lessonsNearCap(cwd),
// Crowded, and not already looked over: a tidy-up that proposed nothing (or
// a Not now) quiets the nudge until the saved lessons change.
nearCap: s.state === "on" && lessonsNearCap(cwd) && readTidyQuiet(cwd) !== lessonsFingerprint(cwd),
};
}
+4 -4
View File
@@ -18,7 +18,7 @@ A click arrives as one session action per send, and the board locks until your n
| `commit` | `files[]`, `ignore[]` (folders for `.gitignore`). `files[]` may be empty when `ignore[]` is not (held-back offer): add the paths to `.gitignore` and commit only `.gitignore`. |
| `pr-host` | `host`, `kind` (already saved by `POST /pr-host`) |
**After an action**, ONE post with `--wait`:
**After an action**, ONE post with `--wait` and `"settle":true` (an answered card left open is delivered again):
```jsonc
{"reread":true,"items":[{"id":"git-result","kind":"notice","op":"push","title":"Pushed 2 commits to origin/feature/x","body":"a1b2c3d, e4f5a6b. [Open pull request](https://github.com/...)"}],"board":{"describe":"export-csv-button"}}
@@ -43,9 +43,9 @@ An `auth` failure: a `notice` saying the tool never handles logins, with `next`.
| Commit step | On the page |
| --- | --- |
| One commit | `text` card, `placeholder` the drafted subject, `pattern` capping it at 100 characters, then `confirm` "Commit this?" with files in `consequences` and `files:[{"path","state"}]` (modified, new, deleted, renamed). No card when the subject was the argument. |
| A split | Doc `commits` (each group's subject and files, files mixing concerns) plus `review` with verdicts `approve`, `change`, `single` ("One commit instead"). Asked even with a subject argument. |
| Push | Not asked after a board commit (the board lights Push). `commit and push` or a Push click asks `plan push` / `plan publish`'s `confirm`. |
| One commit | Two cards in ONE post, one send: a `text` "Commit subject" (`placeholder` the drafted subject, `pattern` capping it at 100 characters; changed files in `body`, risky ones named) and a `choice` "Commit or push?": `1` **Commit only**, `2` **Commit and push** (recommended with an `upstream` or remote), `allowOther:false`, its `detail` naming where the push goes. No "Commit this?" confirm. A subject argument: the choice alone. |
| A split | Doc `commits` (each group's subject and files, files mixing concerns) plus `review` with verdicts `approve`, `change`, `single` ("One commit instead"), and the same Commit only / Commit and push `choice` beside it in the same post. Asked even with a subject argument. |
| Push | After **Commit and push** (or `commit and push`): run `plan push` / `plan publish` at once, no second `confirm`; the choice was the yes. Any other push click asks the plan's `confirm`. |
| `git init` | `confirm` naming folder and first branch (`init-check`'s `branch`, `danger:false`), `consequences` its `commands`. Run those, not a bare `git init`. |
| `.gitignore` | The proposed file, or a `commit`'s `ignore[]` lines, as a doc plus `review`. |
+17
View File
@@ -207,6 +207,17 @@
<path class="mg-line" d="M7 14.5l1.2 5h2.4l-.9-3.8M17.5 9.5a4 4 0 0 1 0 5M20 7a7.5 7.5 0 0 1 0 10" />
</svg>
</a>
<!-- Text size: [-], the size (a click returns to 100%), [+]. Saved with
the looks; the page's type tokens scale from it (tokens.css). -->
<div class="text-size" id="text-size" role="group" aria-label="Text size">
<button type="button" class="icon-btn" id="btn-text-smaller" title="Smaller text" aria-label="Smaller text">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 12h12" /></svg>
</button>
<button type="button" class="text-size-label" id="btn-text-size" title="Back to 100%" aria-label="Text size, back to 100%">100%</button>
<button type="button" class="icon-btn" id="btn-text-larger" title="Larger text" aria-label="Larger text">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 12h12M12 6v12" /></svg>
</button>
</div>
<!-- Activities: small games for a long wait. Opens a dialog that pauses
the moment Plan2Code needs the person; nothing in it reaches the agent. -->
<button type="button" class="icon-btn" id="btn-activities" title="Activities" aria-label="Activities">
@@ -1542,6 +1553,12 @@
The <strong>megaphone</strong> button opens Plan2Code's
GitHub issues, where you can report a bug or suggest an idea.
</li>
<li>
The <strong>[-]</strong> and <strong>[+]</strong> buttons make the
whole page's text smaller or larger, in seven steps from 80% to 150%;
the size between them (click it) returns to 100%. Your choice is kept, and
Back to default on the Appearance tab resets it.
</li>
<li>
The <strong>die</strong> beside it opens <strong>Activities</strong>,
small games to play while you wait. See "Activities".
+19 -1
View File
@@ -4,7 +4,7 @@
// `looks` is a live binding: every file reads the current object, and only
// this file replaces it.
import { DEFAULT_ACCENT, soundPrefs, soundFilePrefs, DEFAULT_CARD_WIDTH, ACCENTS, accentId, cardWidth, soundKey, soundFileKey } from "./palette.js";
import { DEFAULT_ACCENT, soundPrefs, soundFilePrefs, DEFAULT_CARD_WIDTH, DEFAULT_TEXT_SIZE, TEXT_SIZES, ACCENTS, accentId, cardWidth, textSize, soundKey, soundFileKey } from "./palette.js";
import { normalizeRole, ROLE_NOT_SET } from "./starters.js";
import { bootData, hooks } from "./state.js";
import { el } from "./render.js";
@@ -32,6 +32,8 @@ export const DEFAULT_LOOKS = {
// Which sound file each pickable cue plays (soundFileQuestion: "sound-03").
...soundFilePrefs(null),
width: DEFAULT_CARD_WIDTH,
// The top bar's text size, in percent (palette.js TEXT_SIZES).
textSize: DEFAULT_TEXT_SIZE,
hideUnavailable: true,
// Skip the wake-up intro: never play the dashboard's first-open wake-up (Planny asleep), off by default.
skipIntro: false,
@@ -77,6 +79,7 @@ export function adoptLooks(saved) {
Object.assign(looks, soundFilePrefs(looks));
if (typeof looks.hideUnavailable !== "boolean") looks.hideUnavailable = DEFAULT_LOOKS.hideUnavailable;
looks.width = cardWidth(looks.width);
looks.textSize = textSize(looks.textSize);
if (typeof looks.skipIntro !== "boolean") looks.skipIntro = DEFAULT_LOOKS.skipIntro;
if (typeof looks.skillLaunched !== "boolean") looks.skillLaunched = DEFAULT_LOOKS.skillLaunched;
if (typeof looks.meterTipSeen !== "boolean") looks.meterTipSeen = DEFAULT_LOOKS.meterTipSeen;
@@ -190,6 +193,18 @@ const systemDark = () => matchMedia("(prefers-color-scheme: dark)").matches;
const effectiveTheme = () => (looks.theme === "system" ? (systemDark() ? "dark" : "light") : looks.theme);
// The top bar's text size control: the label says the size, and a button at an end of the range is spent.
function paintTextSize() {
const at = TEXT_SIZES.indexOf(looks.textSize);
const label = $("btn-text-size");
if (!label) return;
label.textContent = looks.textSize + "%";
// The accessible name replaces the visible text, so it carries the size too.
label.setAttribute("aria-label", `Text size ${looks.textSize}%, back to 100%`);
$("btn-text-smaller").setAttribute("aria-disabled", String(at <= 0));
$("btn-text-larger").setAttribute("aria-disabled", String(at >= TEXT_SIZES.length - 1));
}
export function applyLooks() {
const root = document.documentElement;
// The desktop app's shell wears this page's theme and highlight: the resolved
@@ -208,6 +223,9 @@ export function applyLooks() {
// Before the accent's early return, so a default accent never skips it.
if (looks.width === DEFAULT_CARD_WIDTH) root.removeAttribute("data-width");
else root.dataset.width = looks.width;
if (looks.textSize === DEFAULT_TEXT_SIZE) root.removeAttribute("data-text-size");
else root.dataset.textSize = String(looks.textSize);
paintTextSize();
// The default lives in the stylesheet, where it is written once per theme.
// Clearing the override is how it gets its own values back.
+11
View File
@@ -249,6 +249,17 @@ export function cardWidth(value) {
return typeof value === "string" && Object.hasOwn(CARD_WIDTHS, value) ? value : DEFAULT_CARD_WIDTH;
}
// The text size steps, in percent, for the top bar's [-] and [+]. Here for the
// same reason the card widths are: the page validates a saved `looks.textSize`
// with textSize(), and the server paints the first-load `data-text-size`.
export const TEXT_SIZES = [80, 90, 100, 110, 120, 135, 150];
export const DEFAULT_TEXT_SIZE = 100;
export function textSize(value) {
return TEXT_SIZES.includes(value) ? value : DEFAULT_TEXT_SIZE;
}
// The sound files a person can give a cue, sound-01 to sound-19, served from
// /sounds/<name>.mp3 (static.mjs).
export const SOUND_FILES = Array.from({ length: 19 }, (_, i) => `sound-${String(i + 1).padStart(2, "0")}`);
+1 -1
View File
@@ -25,7 +25,7 @@ export function prefsOpenTab(asked) {
// The looks keys Back to default resets on a tab, or null where it has
// nothing to reset (and is hidden).
export function prefsResetScope(tab) {
if (tab === "appearance") return ["theme", "width", "accent", "role", "skipIntro"];
if (tab === "appearance") return ["theme", "width", "textSize", "accent", "role", "skipIntro"];
if (tab === "sounds") return ["sound", ...Object.keys(SOUND_EVENTS).map(soundKey), ...PICKABLE_SOUNDS.map(soundFileKey), "hideActivities", "activitySounds", "gameMusic"];
return null;
}
@@ -16,6 +16,7 @@ import {
} from "../selectors.js";
import { whenTitle, whenWords } from "../labels.js";
import { hooks, page, redraw, saveNow } from "../state.js";
import { postJson } from "../net.js";
import { el, approvalTip, mdInto, releasesLink, copyButton, lightDismiss, icon, SVG_NS } from "../render.js";
import { needsRoleNudge, ROLE_NOT_SET } from "../starters.js";
import { looks, saveLooks } from "../looks.js";
@@ -1483,6 +1484,15 @@ function learningBanner(sc) {
if (why) b.title = why;
b.addEventListener("click", () => sendLearning(what));
r.appendChild(b);
if (what === "tidy") {
// Not now needs no agent: the server remembers it, on this machine only,
// and the nudge stays hidden until the saved lessons change.
const later = el("button", "btn sm", "Not now");
later.type = "button";
later.title = "Hide this until your lessons change.";
later.addEventListener("click", () => quietTidyNudge());
r.appendChild(later);
}
banner.appendChild(r);
};
if (text) row(text, "Review", "review", true);
@@ -1490,6 +1500,17 @@ function learningBanner(sc) {
return banner;
}
// Hide the tidy-up nudge until the saved lessons change (POST /learning/tidy-quiet;
// the server pushes the patched scan, so the banner redraws without it). Used by
// Not now and by a Tidy up that came back with nothing to propose. A failure is
// quiet: the nudge simply stays, as it did before.
async function quietTidyNudge() {
try {
await postJson("/learning/tidy-quiet", {});
} catch {}
redraw();
}
// The agent finishing with nothing to show ends the wait early: a Review whose
// card never came (the banner was stale) says so at once instead of spinning
// to the limit, and a saved choice stops when the agent is back to waiting.
@@ -1514,6 +1535,9 @@ function watchLearningBusy(busy) {
clearInterval(timer);
page.learningBusy = null;
if (busy.what === "review" || busy.what === "tidy") {
// A tidy-up with nothing to propose is an answer: remember it, so the
// nudge does not come straight back for the same lessons.
if (busy.what === "tidy") quietTidyNudge();
const none = hooks.banner(busy.what === "tidy" ? "Nothing to tidy up right now." : "No lessons are waiting any more.", "info");
setTimeout(() => hooks.clearBanner(none), 4000);
}
+14 -1
View File
@@ -5,7 +5,7 @@ import { adoptLooks, applyLooks, loadLooks, looks, renderSwatches, saveLooks, sy
import { dropHeldSound, previewSound, releaseHeldSound, sound, soundOn } from "../sound.js";
import { hushTones, tone, unlockTones } from "../tones.js";
import { hushMusic } from "../music.js";
import { SOUND_EVENTS, soundFileKey, soundKey } from "../palette.js";
import { DEFAULT_TEXT_SIZE, SOUND_EVENTS, TEXT_SIZES, soundFileKey, soundKey } from "../palette.js";
import { ROLES, ROLE_NOT_SET, ROLE_NOT_SET_LABEL, needsRoleNudge, normalizeRole } from "../starters.js";
import { isDashboard } from "../selectors.js";
import { el } from "../render.js";
@@ -63,6 +63,19 @@ export function wireLooks() {
hooks.markSaved(fieldsetOf(radio), saveLooks());
});
}
// The top bar's text size: one step each way, the label back to 100%.
const stepText = (by) => {
const at = TEXT_SIZES.indexOf(looks.textSize) + by;
if (at < 0 || at >= TEXT_SIZES.length) return;
looks.textSize = TEXT_SIZES[at];
saveLooks();
};
$("btn-text-smaller").addEventListener("click", () => stepText(-1));
$("btn-text-larger").addEventListener("click", () => stepText(1));
$("btn-text-size").addEventListener("click", () => {
looks.textSize = DEFAULT_TEXT_SIZE;
saveLooks();
});
for (const radio of document.querySelectorAll('input[name="looks-width"]')) {
radio.addEventListener("change", () => {
looks.width = radio.value;
+22
View File
@@ -28,6 +28,28 @@
.icon-btn:hover svg .ab-dot, .icon-btn:hover svg .dc-pip { fill: var(--accent); stroke: none; }
a.icon-btn { box-sizing: border-box; text-decoration: none; }
/* The text size control: [-] size [+], one group in the tools. The label is the
reset, so it reads as text and gets the same hover as an icon. */
.text-size { display: flex; align-items: center; gap: 0; }
.text-size-label {
appearance: none;
min-width: 44px;
height: 36px;
padding: 0 4px;
border: 1px solid transparent;
border-radius: var(--radius-md);
background: transparent;
color: var(--ink-2);
font: 600 var(--fs-xs)/1 var(--sans);
font-variant-numeric: tabular-nums;
cursor: pointer;
}
.text-size-label:hover { background: var(--panel-2); border-color: var(--rule); color: var(--accent); }
/* An end of the range: dimmed, not disabled, so Playwright and keyboards still reach it. */
.text-size .icon-btn[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.text-size .icon-btn[aria-disabled="true"]:hover { background: transparent; border-color: transparent; }
.text-size .icon-btn[aria-disabled="true"]:hover svg * { stroke: var(--ink-2); }
/* A link in a dialog (the update modal's release, Help's version) keeps the
accent once visited: the browser's purple is unreadable on the dark theme. */
.modal a:not(.btn), .modal a:not(.btn):visited { color: var(--accent); }
+19 -11
View File
@@ -76,17 +76,19 @@
/* The column's width: the card, the pager and the documents. */
--card-width: 880px;
/* Type: text steps, h1 to h4, one poster size; weights 400, 600, 700 only. */
--fs-2xs: 11px;
--fs-xs: 12px;
--fs-sm: 13px;
--fs-md: 14px;
--fs-base: 15px;
--fs-lg: 17px;
--fs-h4: 16px;
--fs-h3: 18px;
--fs-h2: 21px;
--fs-h1: 25px;
--fs-poster: 38px;
--fs-2xs: calc(11px * var(--text-scale));
--fs-xs: calc(12px * var(--text-scale));
--fs-sm: calc(13px * var(--text-scale));
--fs-md: calc(14px * var(--text-scale));
--fs-base: calc(15px * var(--text-scale));
--fs-lg: calc(17px * var(--text-scale));
--fs-h4: calc(16px * var(--text-scale));
--fs-h3: calc(18px * var(--text-scale));
--fs-h2: calc(21px * var(--text-scale));
--fs-h1: calc(25px * var(--text-scale));
--fs-poster: calc(38px * var(--text-scale));
/* The top bar's text size: 1 until [data-text-size] says otherwise (rules below). */
--text-scale: 1;
--lh-tight: 1.25;
--lh-ui: 1.4;
--lh-body: 1.55;
@@ -101,6 +103,12 @@
:root[data-width="narrow"] { --card-width: 720px; }
:root[data-width="wide"] { --card-width: 1080px; }
:root[data-width="ultrawide"] { --card-width: 1440px; }
:root[data-text-size="80"] { --text-scale: 0.8; }
:root[data-text-size="90"] { --text-scale: 0.9; }
:root[data-text-size="110"] { --text-scale: 1.1; }
:root[data-text-size="120"] { --text-scale: 1.2; }
:root[data-text-size="135"] { --text-scale: 1.35; }
:root[data-text-size="150"] { --text-scale: 1.5; }
/* Dark is written twice on purpose. The first copy follows the system unless
light was chosen; the second is the explicit ask. Without the `:not()` a
+34 -6
View File
@@ -50,10 +50,10 @@ import {
import { DOC_TYPES, MAX_ATTACHMENTS, MAX_DOC_BYTES, docExt, workflowLabel, workflowTitle } from "./public/answers.js";
import { CHAT_LIMIT, CHAT_MAX_CHARS } from "./public/chat.js";
import { cleanSetting, offered } from "./public/subagents.js";
import { DEFAULT_ACCENT, DEFAULT_CARD_WIDTH, accentId, cardWidth } from "./public/palette.js";
import { DEFAULT_ACCENT, DEFAULT_CARD_WIDTH, DEFAULT_TEXT_SIZE, accentId, cardWidth, textSize } from "./public/palette.js";
import { SERVABLE, TYPES, asset } from "./static.mjs";
import { handoffsDir, isHandoffId } from "./handoffs.mjs";
import { followCounts, learningScan, learningState, writePause } from "./learning.mjs";
import { followCounts, learningScan, learningState, writePause, writeTidyQuiet } from "./learning.mjs";
import { linkToOpen, openFile, openLink } from "./open-link.mjs";
import {
NotepadError,
@@ -100,6 +100,7 @@ const ROUTES = [
{ path: "/looks", method: "POST", origin: true, run: looksPost },
{ path: "/subagents", method: "POST", origin: true, run: subagentsPost },
{ path: "/learning/pause", method: "POST", origin: true, run: learningPause },
{ path: "/learning/tidy-quiet", method: "POST", origin: true, run: learningTidyQuiet },
{ path: "/learning/state", method: "GET", run: learningStateGet },
{ path: "/learning/lessons", method: "GET", run: learningLessons },
{ path: "/pr-host", method: "POST", origin: true, run: prHost },
@@ -370,6 +371,10 @@ function renderIndex(ctx) {
if (looks && cardWidth(looks.width) !== DEFAULT_CARD_WIDTH) {
htmlAttrs += ` data-width="${cardWidth(looks.width)}"`;
}
// Likewise the text size: a fixed list of whole numbers, nothing to escape.
if (looks && textSize(looks.textSize) !== DEFAULT_TEXT_SIZE) {
htmlAttrs += ` data-text-size="${textSize(looks.textSize)}"`;
}
const title = (state && state.title) || "Session";
const workflow = state && state.workflow;
const json = JSON.stringify(boot).replace(/</g, "\\u003c");
@@ -656,17 +661,40 @@ function subagentsPost(req, res, ctx) {
// store), never inside the project. It needs no agent: the dashboard's
// scan.learning is patched in place and pushed, so the row repaints at once.
function learningPause(req, res, ctx) {
return learningWrite(req, res, ctx, {
valid: (body) => typeof body.paused === "boolean",
states: ["on", "paused"],
write: (worktree, body) => writePause(worktree, body.paused),
event: (body) => ({ type: "learning-pause", paused: body.paused }),
});
}
// Learning's tidy-up quiet (learning.mjs): a Tidy up that proposed nothing, or
// the banner's Not now, hides the tidy-up nudge until the saved lessons change.
// Machine-local like the pause, and only while Learning is on.
function learningTidyQuiet(req, res, ctx) {
return learningWrite(req, res, ctx, {
valid: () => true,
states: ["on"],
write: (worktree) => writeTidyQuiet(worktree),
event: () => ({ type: "learning-tidy-quiet" }),
});
}
// The shared body of the Learning routes that write on this machine: check the
// body and the state, write, patch the dashboard's scan in place and push it.
function learningWrite(req, res, ctx, { valid, states, write, event }) {
return readBody(req, res, (err, body) => {
if (err) return json(res, err.tooBig ? 413 : 400, { error: err.tooBig ? "too large" : "body must be JSON" });
if (!body || typeof body !== "object" || typeof body.paused !== "boolean") return json(res, 400, { error: "bad-request" });
if (!body || typeof body !== "object" || !valid(body)) return json(res, 400, { error: "bad-request" });
const worktree = ctx.worktree() || ctx.project;
let learning;
let written = null;
let agentWrote = false;
try {
const current = learningState(worktree, undefined, { prune: false });
if (current.state !== "on" && current.state !== "paused") return json(res, 409, { error: "not-on" });
writePause(worktree, body.paused);
if (!states.includes(current.state)) return json(res, 409, { error: "not-on" });
write(worktree, body);
learning = learningScan(worktree);
written = updateState(ctx.dir, (fresh) => {
if (!fresh || !fresh.scan || typeof fresh.scan !== "object") return null;
@@ -696,7 +724,7 @@ function learningPause(req, res, ctx) {
} catch {}
}
}
noteEvent(ctx.dir, { type: "learning-pause", paused: body.paused });
noteEvent(ctx.dir, event(body));
ctx.pushState();
return json(res, 200, { ok: true, learning });
});
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "Plan2Code",
"version": "3.2.0",
"version": "3.2.1",
"description": "A structured workflow of six steps (Pathfinder, Plan, Document, Implement, Review, Finalize) for AI-assisted software development",
"keywords": [
"ai",
@@ -17,6 +17,6 @@
"url": "https://github.com/jparkerweb/plan2code"
},
"homepage": "https://github.com/jparkerweb/plan2code",
"releaseDate": "2026-11-28",
"releaseDate": "2026-11-29",
"mode": "utility"
}