mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 20:51:19 -08:00
Restyle the web console and tidy its labels, Ask tab, cleanup and help
AI Assisted
This commit is contained in:
1 parent
710c751c2f
commit
e9679c47b9
103 files changed
+4054
-2273
No files matched your search
@@ -3,10 +3,10 @@
|
||||
|
||||
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 "Back to default". Help's first tab has a **Show the welcome again** link (`data-action="welcome"`). Logic: `maybeWelcome()` / `openWelcome()` in `screens/help-dialog.js`.
|
||||
- **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`.
|
||||
- **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()` (Back to default 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`.
|
||||
- **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.
|
||||
- **The wait is bounded.** `wait --seconds 240` exits `0` (answers), `10` (still waiting, `message: "Waiting on your answer in the web console"` to relay), `20` (server gone, resume it) or `30` (canceled). The agent loops. Nothing blocks for the whole time a person takes.
|
||||
- **A turn is one command, and the CLI does the bookkeeping.** Agent speed is model round trips and typed tokens, not the console (`bench-web-console.mjs --roundtrip`: Send→agent ~70 ms, post→page ~180 ms), so the CLI absorbs every step with one right answer: `consume()` marks the agent `working` when it hands over a submit (`markWorking()`), and `wait` hands the turn back (`markWaiting()`) when it starts with an open question, a finish, or on the dashboard or git board; `post --wait <N>` posts and waits in one process; `settle: true | [ids]` (`settleItems()` in `patches.mjs`) records the latest send's cards as answered from their `submitted`; a new or reopened question with no stated status sets `waiting` and waiting drops `quietMinutes` (`settleAgent()`); a doc whose content changed with no `version` moves up one (`mergeDocs()`); a chat reply with no `id` is `r<re>`; doc blocks with `file` (and `select: "tasks"`, doc-level `refresh: true`) are read from the worktree by `resolveDocFiles()` before the merge, refusing paths outside it; and a hop (`__launch`, `__dashboard`, `__commit`, `__pickup`) comes with `resume` (the exact `open --resume` command) and `skillFile` (`hopFor()`), a pick-up also with `handoffFile`. The wait loop's health check runs beside the 50 ms polling instead of blocking it, and is aborted on exit. `help <topic>` prints any contract file; `help topics` lists them. `token` defaults to the option key in the page's `tokenFor()`, and nothing reads `fallbackText`, so the contract no longer asks for either.
|
||||
@@ -53,15 +53,16 @@ Key design points:
|
||||
- **Back to the dashboard is the same kind of post-finish request.** A finish with `finish.dashboard: true` shows the button; a press arrives as `{ "i": "__dashboard", "type": "dashboard" }`, and the agent runs `open --resume <sid> --no-open --workflow dashboard` then posts `"finish": null` with a fresh `menu`. The agent waits ~10 minutes after the finish for it (alongside `__review` / `__done` on a quick task); after that the page swaps the button for the `/plan2code` command. `finish.command` is optional — without one the page shows the "All done" line — and `validate()` rejects a `<placeholder>` command and a non-boolean `dashboard`. The session-level actions are therefore `__brief`, `__stop`, `__launch`, `__review`, `__done` and `__dashboard`; a new post-finish button should copy this precedent.
|
||||
- **Continue here, Update CHANGELOG first and Ask prompt blocks.** Three small additions on the same pattern. **Continue here** is page-only: `continueOffer(fin)` (`public/answers.js`) reads `finish.command`, and when it starts with a Plan2Code skill (and the finish is not a pause) `screens/ending.js` draws a button beside the Next step block, hidden when the session meter is red; the press is the dashboard's own `{ "i": "__launch", ... }` through `sendAfterBuild("launch", offer)`, so the agent writes nothing new (`startsClean()` cleans the page for the hop, except out of Git and into Review; a same-skill next step keeps the workflow, so the agent posts `"finish": null`). **Update CHANGELOG first** is `finish.changelog: true`, accepted by `validate()` only on `quick-task` and `finalize` (a paused finish is exempt from that check and the page ignores the flag), and it belongs with `commit: true`; the press is `__changelog`, a `HOP_ACTIONS` entry in `cmd-post-wait.mjs` that resumes as `changelog`, whose "Commit this now?" yes carries on to Git. **Ask prompt blocks** are contract only (`console-chat.md` → Prompts to carry away): the page already draws a Copy button on every fenced block.
|
||||
- **`__dashboard` also arrives mid-workflow.** A left-pointing triangle (`#btn-home`, filled with `--accent`) sits left of Stop session on every non-dashboard page. Its state comes from the pure `homeButtonState()` in `answers.js`: hidden on the dashboard, on a finish and during a stop, and otherwise gated by the same `turnGate()` Stop now uses (the person's turn, unless the agent has gone adrift). The confirm (`#home-modal`) reuses `stopWarning()`, and the submit carries the staged answers plus `__dashboard`, with `HOME_REPLY`. With no finish on the page, the agent treats it as a stop that lands on the menu: it saves its place as for `__stop`, then resumes as the dashboard with `"finish": null` + `menu`, with no finish and no stop in between (console-stop.md → "Back to the dashboard, mid-workflow"; building.md for builds). `local.homeward` drives Planny's "Saving your place and opening the dashboard…" line until the through-the-dashboard reset clears it.
|
||||
- **Handoffs live outside every repo, in `~/.plan2code/handoffs/`, and the console owns them** (`handoffs.mjs`; the console ships in every skill, so the Stop flow, the Handoff skill and the dashboard all reach it through `console.mjs`). `handoff new --workflow <w> --skill <s> [--spec specs/<x>] [--title <t>] [--from-stop]` claims one for this checkout and prints `{ ok, id, path, meta }` (exit 2 bad usage, 3 a bad value). Off the dashboard the Stop modal offers **Stop with a handoff** (`#stop-handoff`, suggested) above **Just stop and save** (`#stop-go`); the first sends `__stop` with `handoff: true` and `STOP_HANDOFF_REPLY`, and `wait` adds `handoffSkill` (the built Handoff skill's `SKILL.md`, `handoffFor()`); console-stop.md gives the order (answers, save, `handoff new --from-stop`, write, paused finish naming the file, `stop`). On a dashboard, `cmdOpen()` adds `scan.handoffs` (`listHandoffs(worktree)`) and `scan.handoffsDir` after `scanProject()`, which stays handoff-free because `specs.mjs list` shares it. The picker draws them as dashed `.spec-chip.is-handoff` chips after the specs (`specSel = "handoff:<id>"`); a picked one replaces the skill cards with `renderHandoffPreview()`: **Pick it up here**, **Read it all** (`GET /handoff?id=`, served only for an id in the dashboard's own `state.scan.handoffs`), **Copy for a new conversation** (`handoffCopyText()`) and **Delete** (`openHandoffDelete()`, one step). Pick it up sends `{ "i": "__pickup", "type": "pickup", "handoff": <id> }`; `HOP_ACTIONS.pickup` (`pickupHop()`) reads the stored `.json` only, never the page, and falls back to Quick Task with `fallback: true` when the record, its skill or its spec is gone, or the Handoff skill wrote it (resuming that skill would only write another handoff); `markPickedUp()` stamps `usedAt` as the hop is printed, so the next scan drops the chip. Delete sends `__delete` with `handoff` in place of `spec`, and the agent runs `delete-handoff --handoff <id>` (`removeHandoff()`, exit 3 on a refusal, nothing touched). `open` sweeps handoffs untouched for 30 days (`staleHandoffs()`, the `.json`'s mtime, else the `.md`'s), picked up or not, and reports them in `swept.handoffs`; Cleanup never lists the folder (`KEPT_PLAN2CODE_ENTRIES`).
|
||||
- **Notebook: the person's, one per folder, in `~/.plan2code/notepads/`, in named tabs, and the agent's only when the person sends a tab.** `notepads.mjs` is the store's one owner (`PLAN2CODE_NOTEPADS_DIR` moves it for tests). The folder is the session's worktree, else its project (`notepadRoot()` in `routes.mjs`), keyed `<folder-name>-<12 hex>` by `notepadKey()` (the hash over `foldKey()`, so case-only path differences match on Windows and macOS, and two worktrees get two notepads). **Layout:** `meta.json` (`{ v: 2, folder, created }`), `tabs.json` (`{ v: 1, order: [id], last, tabs: { id: { name, created, sent? } } }`, the index and the only place order and the last tab live) and, per tab, `tabs/<id>/note.md` with `tabs/<id>/images/<uuid>.jpg` and `<uuid>.thumb.jpg`; a tab id is 12 hex. Every write takes the folder's `notepad.lock`; a read never creates a file, so only the person's edits age a notepad. A delete removes the tab from the index first, then its folder, and the next write sweeps away a tab folder the index no longer names (a delete that crashed half way). **Migration:** the first shape (`v: 1`, one `note.md` and `images/` at the top) reads as one virtual tab, Notes, with the fixed id `LEGACY_TAB_ID`, and a read writes nothing; the first write moves the files into `tabs/<LEGACY_TAB_ID>/` and writes `tabs.json` last, so a crash in the middle is finished by the next write and never loses a file. A `tabs.json` that does not hold up is set aside as `tabs.json.corrupt` and rebuilt from the tab folders. **Routes:** twelve, placed after `/upload` in `ROUTES` (the shape test pins the order): `GET /notepad[?tab=<id>]` (`{ tabs, last, tab: { id, text, savedAt, images } }`, with the tab's `text`, `savedAt` and `images` repeated at the top), `POST /notepad/text?tab=` (`{ text }`, 1 MB, 413 `too-long`), `POST /notepad/image?tab=` and `POST /notepad/thumb?id=<uuid>&tab=` (raw `image/jpeg` the page re-encoded with `reencode()`, 4 MB, 200 pictures per tab: 415 `not-jpeg`, 413 `too-large`, 409 `too-many`), `POST /notepad/image/delete?tab=` (`{ id }`), `POST /notepad/tab` (`{ name }`), `/notepad/tab/rename` (`{ id, name }`), `/notepad/tab/delete` (`{ id }`), `/notepad/tab/order` (`{ order }`, every id once) `/notepad/tab/last` (`{ id }`) and `/notepad/tab/sent` (`{ id, workflow, spec? }`, `markTabSent()`: sets `sent: { workflow, spec?, at }` on the tab, replacing an earlier one; `workflow` one of `pathfinder`, `plan`, `quick-task`, `revise-plan`, `spec` matching `^specs/[A-Za-z0-9._-]+$`, else 400 `bad-sent`), and `GET /notepad/images/<tab>/<uuid>[.thumb].jpg` (matched on the raw request line like `/uploads/`, served through `imagePath()`'s realpath containment, `no-store`). A text or picture request with no `?tab` means the last tab used (and makes Notes when there is none), so an unchanged client keeps working. The ten POSTs are origin-checked, and every refusal is a `NotepadError` turned into `{ error }` (`bad-name`, `duplicate-name`, `too-many-tabs`, `no-such-tab` beside the picture and text codes). None of them writes to the session folder or `events.ndjson`, and `console.mjs` and the `cmd-*.mjs` files never import `notepads.mjs` (a source test pins it; `sessions.mjs` loads it lazily for Cleanup only, listing and removing whole notepads), so nothing in a notepad reaches `state.json` or anything `wait` prints except a tab the person sends (see **Send to a skill**). **The editor, and the CSP.** CodeMirror 6 replaced OverType 2.6.1 after a spike (typing at 200 KB measured about 24 ms a key against about 99 ms, and real heading sizes): `public/vendor/codemirror.esm.js` is one minified file (about 500 KB) made by the dev-only `scripts/vendor-codemirror.mjs` from `scripts/vendor-codemirror-lock.json`, never installed in the repo, and loaded by a dynamic import only when the Notebook first opens. CodeMirror writes its rules as a `<style>` element, which `style-src 'self'` refuses, so the editor lives in the open shadow root of `.notepad-cm-host` where it adopts them as a constructed stylesheet, and its own look is `public/notepad-editor.css`, a `<link>` inside the root. Custom properties inherit across the boundary, so both themes work; page tests reach the editor with Playwright's CSS locators (they pierce open shadow roots) and read its text from `EditorView.findFromDOM()`, since lines the cursor is not on draw without their Markdown marks. CodeMirror's own rules win a tie in specificity (they are adopted after the linked sheet), so `notepad-editor.css` writes `div.cm-editor .cm-scroller` for the few it overrides. `scripts/test-web-console-page-notepad.mjs` fails on any `securitypolicyviolation` with the notepad open. **Upgrading CodeMirror:** change a version in `scripts/vendor-codemirror.mjs`, run `node scripts/vendor-codemirror.mjs --update-lock` (npm and network; it installs in a temp folder), update the sha256 in the files-table row, then run the two notepad test files. **Tabs on the page:** `screens/notepaLine truncated
|
||||
- **Handoffs live outside every repo, in `~/.plan2code/handoffs/`, and the console owns them** (`handoffs.mjs`; the console ships in every skill, so the Stop flow, the Handoff skill and the dashboard all reach it through `console.mjs`). `handoff new --workflow <w> --skill <s> [--spec specs/<x>] [--title <t>] [--from-stop]` claims one for this checkout and prints `{ ok, id, path, meta }` (exit 2 bad usage, 3 a bad value). Off the dashboard the Stop modal offers **Stop with a handoff** (`#stop-handoff`, suggested) above **Just stop and save** (`#stop-go`); the first sends `__stop` with `handoff: true` and `STOP_HANDOFF_REPLY`, and `wait` adds `handoffSkill` (the built Handoff skill's `SKILL.md`, `handoffFor()`); console-stop.md gives the order (answers, save, `handoff new --from-stop`, write, paused finish naming the file, `stop`). On a dashboard, `cmdOpen()` adds `scan.handoffs` (`listHandoffs(worktree)`) and `scan.handoffsDir` after `scanProject()`, which stays handoff-free because `specs.mjs list` shares it. The picker draws them as dashed `.spec-chip.is-handoff` chips after the specs (`specSel = "handoff:<id>"`); a picked one replaces the skill cards with `renderHandoffPreview()`: **Pick it up here**, **Read it all** (`GET /handoff?id=`, served only for an id in the dashboard's own `state.scan.handoffs`), **Copy for a new conversation** (`handoffCopyText()`) and **Delete** (`openHandoffDelete()`, one step). Pick it up sends `{ "i": "__pickup", "type": "pickup", "handoff": <id> }`; `HOP_ACTIONS.pickup` (`pickupHop()`) reads the stored `.json` only, never the page, and falls back to Quick task with `fallback: true` when the record, its skill or its spec is gone, or the Handoff skill wrote it (resuming that skill would only write another handoff); `markPickedUp()` stamps `usedAt` as the hop is printed, so the next scan drops the chip. Delete sends `__delete` with `handoff` in place of `spec`, and the agent runs `delete-handoff --handoff <id>` (`removeHandoff()`, exit 3 on a refusal, nothing touched). `open` sweeps handoffs untouched for 30 days (`staleHandoffs()`, the `.json`'s mtime, else the `.md`'s), picked up or not, and reports them in `swept.handoffs`; Cleanup never lists the folder (`KEPT_PLAN2CODE_ENTRIES`).
|
||||
- **Notebook: the person's, one per folder, in `~/.plan2code/notepads/`, in named tabs, and the agent's only when the person sends a tab.** `notepads.mjs` is the store's one owner (`PLAN2CODE_NOTEPADS_DIR` moves it for tests). The folder is the session's worktree, else its project (`notepadRoot()` in `routes.mjs`), keyed `<folder-name>-<12 hex>` by `notepadKey()` (the hash over `foldKey()`, so case-only path differences match on Windows and macOS, and two worktrees get two notepads). **Layout:** `meta.json` (`{ v: 2, folder, created }`), `tabs.json` (`{ v: 1, order: [id], last, tabs: { id: { name, created, sent? } } }`, the index and the only place order and the last tab live) and, per tab, `tabs/<id>/note.md` with `tabs/<id>/images/<uuid>.jpg` and `<uuid>.thumb.jpg`; a tab id is 12 hex. Every write takes the folder's `notepad.lock`; a read never creates a file, so only the person's edits age a notepad. A delete removes the tab from the index first, then its folder, and the next write sweeps away a tab folder the index no longer names (a delete that crashed half way). **Migration:** the first shape (`v: 1`, one `note.md` and `images/` at the top) reads as one virtual tab, Notes, with the fixed id `LEGACY_TAB_ID`, and a read writes nothing; the first write moves the files into `tabs/<LEGACY_TAB_ID>/` and writes `tabs.json` last, so a crash in the middle is finished by the next write and never loses a file. A `tabs.json` that does not hold up is set aside as `tabs.json.corrupt` and rebuilt from the tab folders. **Routes:** twelve, placed after `/upload` in `ROUTES` (the shape test pins the order): `GET /notepad[?tab=<id>]` (`{ tabs, last, tab: { id, text, savedAt, images } }`, with the tab's `text`, `savedAt` and `images` repeated at the top), `POST /notepad/text?tab=` (`{ text }`, 1 MB, 413 `too-long`), `POST /notepad/image?tab=` and `POST /notepad/thumb?id=<uuid>&tab=` (raw `image/jpeg` the page re-encoded with `reencode()`, 4 MB, 200 pictures per tab: 415 `not-jpeg`, 413 `too-large`, 409 `too-many`), `POST /notepad/image/delete?tab=` (`{ id }`), `POST /notepad/tab` (`{ name }`), `/notepad/tab/rename` (`{ id, name }`), `/notepad/tab/delete` (`{ id }`), `/notepad/tab/order` (`{ order }`, every id once) `/notepad/tab/last` (`{ id }`) and `/notepad/tab/sent` (`{ id, workflow, spec? }`, `markTabSent()`: sets `sent: { workflow, spec?, at }` on the tab, replacing an earlier one; `workflow` one of `pathfinder`, `plan`, `quick-task`, `revise-plan`, `spec` matching `^specs/[A-Za-z0-9._-]+$`, else 400 `bad-sent`), and `GET /notepad/images/<tab>/<uuid>[.thumb].jpg` (matched on the raw request line like `/uploads/`, served through `imagePath()`'s realpath containment, `no-store`). A text or picture request with no `?tab` means the last tab used (and makes Notes when there is none), so an unchanged client keeps working. The ten POSTs are origin-checked, and every refusal is a `NotepadError` turned into `{ error }` (`bad-name`, `duplicate-name`, `too-many-tabs`, `no-such-tab` beside the picture and text codes). None of them writes to the session folder or `events.ndjson`, and `console.mjs` and the `cmd-*.mjs` files never import `notepads.mjs` (a source test pins it; `sessions.mjs` loads it lazily for Cleanup only, listing and removing whole notepads), so nothing in a notepad reaches `state.json` or anything `wait` prints except a tab the person sends (see **Send to a skill**). **The editor, and the CSP.** CodeMirror 6 replaced OverType 2.6.1 after a spike (typing at 200 KB measured about 24 ms a key against about 99 ms, and real heading sizes): `public/vendor/codemirror.esm.js` is one minified file (about 500 KB) made by the dev-only `scripts/vendor-codemirror.mjs` from `scripts/vendor-codemirror-lock.json`, never installed in the repo, and loaded by a dynamic import only when the Notebook first opens. CodeMirror writes its rules as a `<style>` element, which `style-src 'self'` refuses, so the editor lives in the open shadow root of `.notepad-cm-host` where it adopts them as a constructed stylesheet, and its own look is `public/notepad-editor.css`, a `<link>` inside the root. Custom properties inherit across the boundary, so both themes work; page tests reach the editor with Playwright's CSS locators (they pierce open shadow roots) and read its text from `EditorView.findFromDOM()`, since lines the cursor is not on draw without their Markdown marks. CodeMirror's own rules win a tie in specificity (they are adopted after the linked sheet), so `notepad-editor.css` writes `div.cm-editor .cm-scroller` for the few it overrides. `scripts/test-web-console-page-notepad.mjs` fails on any `securitypolicyviolation` with the notepad open. **Upgrading CodeMirror:** change a version in `scripts/vendor-codemirror.mjs`, run `node scripts/vendor-codemirror.mjs --update-lock` (npm and network; it installs in a temp folder), update the sha256 in the files-table row, then run the two notepad test files. **Tabs on the page:** `screens/notepaLine truncated
|
||||
- **A Bug fixed spec deletes in one step.** Its chip shows a visible **Delete** (`.spec-chip-del-label`) instead of the hover ✕, `openDeleteConfirm()` gives it a fixed-bug warning and a **Delete it** button, and `deleteStep()` sends `__delete` on the first press, with no name to type. `chipDetail()` drops the scan's repeated "bug fixed" detail under the label.
|
||||
- **The Quick question chat is a second, append-only channel beside the card slot.** The page's **Ask** tab (always last, every workflow, still there after a finish) posts to `POST /chat` (a message, or `{ reset: true }` for New conversation) and `POST /chat/decision` (Approve / Decline on an edit the agent proposed). The server is the only writer of `<sid>/chat.ndjson` (one JSON line per `message` / `decision` / `reset`, each with a `seq`; `appendChat()` in `inbox.mjs`); `console.mjs` is the only writer of `<sid>/chat-cursor.json` (the last seq handed over, advanced only after printing) and of the agent's replies in `state.json` → `chat.replies` (merged by `id`, checked by `validateChat()`: real `re`, proposal paths outside the running `specs/<idea>/`). The server never writes chat into `state.json` — `post` read-modify-writes it under `withStateLock()` — and `stateFrame()` merges inbox and replies into the frame's `chat` block (`conversation`, `messages`, `typed`, `limit`, `offline`) in memory. `/chat` never checks `pendingResult()`, so neither channel can block the other. `wait` keeps its exit codes 0/10/20/30: exit 0 gains `chat` (or is `type: "chat"` with no actions), and the instant `console.mjs chat` answers 0/10/20 without touching `result.json`, which builds run after every task. Guards: 10 typed messages per conversation (`409 limit`), 4,000 characters (`400 too-long`), own uploads only, of the right kind (`400 image`, `400 file`), `409 offline` when `chatOffline()` says no agent is there, `409 stale` for an old conversation. A hop through the dashboard keeps the conversation: `switchWorkflow()` carries `chat.replies` across and the page keeps its Ask state, so only New conversation appends a `reset` after the opening one. A lone reset never ends a `wait` slice (`deliverableChat()`); it rides along with the next message.
|
||||
- **A loop stop leads with why and what to do next, in two places.** `evidence_markdown` in `loop_driver.rs` opens the report doc with a `> [!CAUTION]` box (the reason, then the stop line) and a `> [!TIP]` box (the advice); `render.js` draws a blockquote that opens with either marker as a colored `md-alert` and hides the marker. The stop card shows the same two as `.loop-why` and `.loop-advice` from `loopEnd.advice`. The advice is the failed phase's own `loopOutcome.nextStep` (one line, 300 characters, optional, only for a `failed` report that refused the phase), else `stop_advice()`'s words for the cause. `failed_words` puts the reason before the agent's summary, since a failed report's summary often reads like success.
|
||||
- **`validate()` in `patches.mjs` enforces four workflow rules mechanically**: max three open required questions, no internal vocabulary in a title, one recommended option, and no loop markers or metrics-scraper bait.
|
||||
- **The palette is written twice for dark, and that duplication is the mechanism.** `@media (prefers-color-scheme: dark) :root:not([data-theme="light"])` follows the system; `:root[data-theme="dark"]` is the explicit choice from the colors panel. Drop the `:not()` and a system-dark browser overrides someone who asked for light. A chosen accent is applied as an inline custom property on `:root` (CSSOM, which the CSP allows), and the default is applied by REMOVING that override so the stylesheet's own per-theme values win. The server's `data-looks-accent` stand-in only lasts until `applyLooks()` runs, which removes it first thing — left on, its rule would beat "Back to default".
|
||||
- **Help is in the page, built on first open.** The **?** button (`#btn-about`) opens `<dialog id="help-modal">`, which replaced the old "What this page is" About dialog. Its 22 panels and their icon sheet are hand-written HTML and SVG in `<template id="help-content">` in `index.html` (after `#start-poses`), cloned into `#help-panels` the first time **?** is pressed (except the dashboard topic's card list: `buildHelp()` fills its `.help-cards` from `SKILL_CATALOG` and `CATALOG_GROUPS` at that moment, in the dashboard's order), so first load builds nothing and Help still reads fully once the server is gone. `help.js` supplies the tab list and rules, `screens/help-dialog.js` the wiring (tab buttons, roving focus, `renderAbout()` for the live connection line on tab 1, `lightDismiss()`, and a Ctrl/⌘+Enter guard scoped to this dialog). SVG is styled by class and CSS variables only — a `style=` attribute is dropped by the CSP, and a test fails on one — and every number the prose quotes sits in a `data-fact` span a test checks against the constant it comes from.
|
||||
- **The palette is written twice for dark, and that duplication is the mechanism.** `@media (prefers-color-scheme: dark) :root:not([data-theme="light"])` follows the system; `:root[data-theme="dark"]` is the explicit choice from the colors panel. Drop the `:not()` and a system-dark browser overrides someone who asked for light. A chosen accent is applied as an inline custom property on `:root` (CSSOM, which the CSP allows), and the default is applied by REMOVING that override so the stylesheet's own per-theme values win. The server's `data-looks-accent` stand-in only lasts until `applyLooks()` runs, which removes it first thing — left on, its rule would beat "Reset this tab".
|
||||
- **Help is in the page, built on first open.** The **?** button (`#btn-about`) opens `<dialog id="help-modal">`, which replaced the old "What this page is" About dialog. Its 23 panels (in four groups, with a filter box above the tab list) and their icon sheet are hand-written HTML and SVG in `<template id="help-content">` in `index.html` (after `#start-poses`), cloned into `#help-panels` the first time **?** is pressed (except the dashboard topic's card list: `buildHelp()` fills its `.help-cards` from `SKILL_CATALOG` and `CATALOG_GROUPS` at that moment, in the dashboard's order), so first load builds nothing and Help still reads fully once the server is gone. `help.js` supplies the tab list and rules, `screens/help-dialog.js` the wiring (tab buttons, roving focus, `renderAbout()` for the live connection line on tab 1, `lightDismiss()`, and a Ctrl/⌘+Enter guard scoped to this dialog). SVG is styled by class and CSS variables only — a `style=` attribute is dropped by the CSP, and a test fails on one — and every number the prose quotes sits in a `data-fact` span a test checks against the constant it comes from.
|
||||
- **Stuck sessions are explained twice, in Help and on the status line.** `stuck` ("When something looks stuck") is the second tab in `HELP_TABS`; its panel opens with a `help-callout` ("Check this first": Plan2Code often waits for a permission in the terminal, which the page cannot see) and four You see / Likely cause / Do this rows before the diagram. The quiet and Not running status lines carry a "What to check" button (`openHelpOn("stuck")`) inside the existing `role="status"` element, so it exists only while the symptom shows. Every finished and paused screen gets a "Before you close this" panel from `renderCloseGuide()` in `renderHandoff()` (Safe to close, Start fresh, Carry on). Tests in `scripts/test-web-console-source.mjs` check the tab order, the callout and rows, and the `renderCloseGuide` call.
|
||||
- **Starting ticks are staged by the page, never answered by the server.** A `multi` row with `ticked: true` is seeded into the person's staged answer once (`seedStaged`, marked in `page.local.seeded`); an `answer` on the item would settle the card before anyone saw it, and a staged answer already flows through Send, drafts, the settled record and the reply words.
|
||||
- **Markdown is rendered to DOM nodes, never to an HTML string** (`public/render.js`), so agent-authored text that quotes a hostile source cannot execute. Only `marked.lexer()` is used.
|
||||
|
||||
Tests: `npm test` runs, in order, `validate-char-count.js`, `install.js --build-skills`, `parse-check.mjs`, `check-skill-table.mjs`, then one `node --test` over the skill-script tests (`test-skill-scripts.mjs`, `test-script-*.mjs`, `test-git-repo.mjs`), `test-launcher.mjs`, `test-getting-started.mjs` and the web console's `test-web-console-*.mjs`, so they run in parallel, one process each. The console tests are split by area (`-session`, `-lifecycle`, `-logic`, `-server`, `-chat`, `-chat-stress`, `-workspace`, `-subagents`, `-concurrency`, `-source`, `-shape`, `-git`, `-git-board`, `-qa`, `-speed`, `-hardening`, `-embed`, `-handoffs`, `-in-app`, `-loop`, `-notepad`, `-pointers`, `-skills`, `-spec-states`, `-state`, `-tones`), plus the `-page-*` browser suites and the per-game `-activities*` suites. Their shared setup is `scripts/web-console-test-helpers.mjs`: importing it gives the file its own console home (so `workspaces.json`, `subagents.json`, `looks.json` and sessions never collide across files) and registers the `stop --all` cleanup. `-session` and `-lifecycle` each run an ordered chain of tests on one session of their own; everything else opens a session per test. A new test goes in the file for its area, after the tests it depends on. The parse check exists because `node --check` parses a `.js` file as a CommonJS script and has already let a browser-fatal string literal through; it imports each shipped module as a real ES module instead. They live in `scripts/`, not `src/web-console/`, because everything under the latter ships into every skill.
|
||||
|
||||
@@ -27,7 +27,7 @@ One row per file under `src/web-console/public/` (the games and their sound are
|
||||
| `public/state.js` | the page's shared state (`page.S` the server's truth, `page.local` what is staged) and the `redraw()` / save hooks every screen calls; defines only |
|
||||
| `public/uploads.js` | pictures and documents attached to a note: chips, trays, re-encoding, upload, retry, and the page's shared full-screen picture preview (`openPicview`, the `#picview` dialog every thumbnail opens) |
|
||||
| `public/screens/ask.js` | the Ask chat, the Subagents tab, and attaching files to notes |
|
||||
| `public/screens/cards.js` | question cards: every kind (one builder per kind in `BUILDERS`), the pager, settled and in-flight records. The `lessons` kind's builder is `buildLessons()`: the approval card for noted lessons, one row per waiting item (`lessonRow()`) decided on its own with the words its type takes, the choices kept as a draft (`lessons-<id>`) until Send, or the first ask's three answers when the card carries `firstAsk`; on the dashboard it is drawn in the Lessons to review dialog (`renderLessonsDialog()` in `screens/learning-row.js`) |
|
||||
| `public/screens/cards.js` | question cards: every kind (one builder per kind in `BUILDERS`), the pager, settled and in-flight records. The `lessons` kind's builder is `buildLessons()`: the approval card for noted lessons, one row per waiting item (`lessonRow()`) decided on its own with the words its type takes, the choices kept as a draft (`lessons-<id>`) until Send, or the first ask's three answers when the card carries `firstAsk`; on the dashboard it is drawn in the Lessons to review dialog (`renderLessonsDialog()` in `screens/learning-row.js`). A `multi` option may carry `ticked: true` (the row starts ticked the first time the card shows, never on a `locked` row) and `tag` (1 to 16 characters, drawn as a neutral `.pill.tag` beside the label and read in the checkbox's accessible name after the `k: text`); on a card with a ticked row, unticking the last box (or pressing a lit preset off) stages `ks: []`, an answer that reads `none`, where other cards stage nothing. |
|
||||
| `public/screens/cleanup.js` | User Preferences' Cleanup section, on the System tab |
|
||||
| `public/screens/core.js` | the core every screen sits inside: connection, the render loop, the page chrome and Send; the only file that imports the screens, and only `app.js` imports it |
|
||||
| `public/screens/dashboard.js` | the dashboard: cards, the spec picker, handoff chips, delete, the first-open wake-up, and Learning's waiting banner (`learningBanner()`: the line from `learningBannerText()` and a **Review** button sending `__learning` `review`, last of the banners), which places Learning's row through `hooks.renderLearningRow` |
|
||||
@@ -46,7 +46,7 @@ One row per file under `src/web-console/public/` (the games and their sound are
|
||||
| `public/screens/agents/agents-strengths.js` | the strengths panel of an agent's form: `strengthsPanel(ctx, agentId, draft, { models, hasEffort })` returns the In the loop box (the model each of Thrifty, Balanced and Best resolves to, an effort select for Claude and Codex, Reset or a "default" tag) and `pills(id, label)`, the three toggle buttons each model row carries (one pressed per word; tapping the pick again clears it only where nothing ships for the word). Changed rows only are kept in `ctx.strengthDrafts` for the form's Save; `wordChip` is the colored word the cards use too |
|
||||
| `public/strengths.js` | the loop's strength rule, shared by the page and the server: `resolveStrengths` and `nextStrength`, held to `scripts/fixtures/strength-cases.json` (the Rust twin is in `models.rs`) |
|
||||
| `public/screens/setup.js` | the agent-less setup screen (`workflow === "setup"`, opened by `plan2code` or the app when no agent can run): the "No agent yet" headline, Planny's setup pose, the agent list from `mountAgentsView` in setup mode, Check again, and the "Starting <Label>..." pane after a Start send (`{i:"__start"}` via `/submit`). `setupMoved(url)` disarms the 2-minute no-page notice once the `move` event lands |
|
||||
| `public/screens/prefs-dialog.js` | User Preferences as a dialog: its four tabs (wired by `tabs.js` from `PREFS_TABS`), `openPrefs(tab)` (the one way in, loading Agents & models each time), the fading Saved mark beside a fieldset (`markSaved`), Back to default for the tab on screen, and `confirmUnsaved()`, the in-dialog Save / Discard / Keep editing prompt before Close, Esc, a backdrop click, a tab switch or picking another agent leaves an unsaved agent edit. Other screens reach it through `hooks` |
|
||||
| `public/screens/prefs-dialog.js` | User Preferences as a dialog: its four tabs (wired by `tabs.js` from `PREFS_TABS`), `openPrefs(tab)` (the one way in, loading Agents & models each time), the fading Saved mark beside a fieldset (`markSaved`), Reset this tab for the tab on screen, and `confirmUnsaved()`, the in-dialog Keep editing / Discard / Save prompt (focus on Keep editing) before Close, Esc, a backdrop click, a tab switch or picking another agent leaves an unsaved agent edit. Other screens reach it through `hooks` |
|
||||
| `public/screens/starting.js` | the launching, starting and waiting screens, with Planny's poses |
|
||||
| `public/screens/workspace.js` | the read-only Workspace of extra folders, and @mentions |
|
||||
| `public/styles/ask.css` | The Ask pane and its Quick question chat |
|
||||
@@ -66,9 +66,9 @@ One row per file under `src/web-console/public/` (the games and their sound are
|
||||
| `public/styles/responsive.css` | Print, then the narrow-window rules: last, so its overrides come after everything they override |
|
||||
| `public/styles/shell.css` | The page shell: banner, top bar and meter, layout, sidebar, aside, footer, waiting and arrival |
|
||||
| `public/styles/tokens.css` | Colors, type, sizes and the light and dark themes: the variables every other file reads |
|
||||
| `public/help.js` | the Help dialog's PURE rules: `HELP_TABS` (22 tabs: ids, order, labels, diagram flags; every tab uses the chosen highlight color; Implementation Loop sits right after Watching a build, The git board right after it, and Activities right after Ask a quick question), `helpTabFor()` (which tab opens, FR-8 order, first match wins: finished → Stopping and finishing, server gone or agent adrift → When something looks stuck, opened from the Workspace dialog → Your workspace, then Ask, the Subagents tab → Helpers (subagents), a red-meter dashboard → Session meter, dashboard, a doc or the Overview, a git session → The git board, a build, else What this page is) and `helpKeyTarget()` (roving arrow keys, Home, End, wrapping; a re-export of `tabs.js`'s `tabKeyTarget`). No module-scope DOM, so `node --test` covers it |
|
||||
| `public/help.js` | the Help dialog's PURE rules: `HELP_TABS` (23 tabs: ids, order, labels, diagram flags; `HELP_GROUPS` and `helpGroupStart()` name the four group headings, Start here, Working in a session, Tools and Reference, each a run of neighbors so grouping never moves a tab; every tab uses the chosen highlight color; Implementation Loop sits right after Watching a build, The git board right after it, and Activities right after Ask a quick question), `helpTabFor()` (which tab opens, FR-8 order, first match wins: finished → Stopping and finishing, server gone or agent adrift → When something looks stuck, opened from the Workspace dialog → Your workspace, then Ask, the Subagents tab → Subagents, a red-meter dashboard → Session meter, dashboard, a doc or the Overview, a git session → The git board, a build, else What this page is) and `helpKeyTarget()` (roving arrow keys, Home, End, wrapping; a re-export of `tabs.js`'s `tabKeyTarget`). No module-scope DOM, so `node --test` covers it |
|
||||
| `public/tabs.js` | the WAI-ARIA tabs shared by Help and User Preferences: `wireTabs()` (buttons and panel links, roving tabindex, automatic activation, `aria-orientation` switching at 720 px, an optional `beforeSelect` guard) and the pure `tabKeyTarget()` |
|
||||
| `public/prefs.js` | User Preferences' PURE rules: `PREFS_TABS` (Appearance, Agents & models, System, Sounds & activities, with hints and the sections each holds), `prefsOpenTab()` and `prefsResetScope()` (the looks keys Back to default resets per tab, or null) |
|
||||
| `public/prefs.js` | User Preferences' PURE rules: `PREFS_TABS` (Appearance, Agents & models, System, Sounds & activities, with hints and the sections each holds), `prefsOpenTab()` and `prefsResetScope()` (the looks keys Reset this tab resets per tab, or null) |
|
||||
| `public/git-board.js` | PURE, one import (`pr-url.js`): the git board's rules from a `state.git` snapshot: branch order and the Remote only fold at `REMOTE_FOLD` 50, whether a new branch name is free, which buttons show and are enabled, whether the board still waits on the agent (`boardAwaiting()`: from a click until the agent's next post, not just until `wait` collects it), the plain sentence each click sends as `reply`, the "Last refreshed" line, which files start ticked in the commit dialog, the pull-request link, and the current branch's page on its host (`boardBranchLink()`, null until the branch is pushed under its own name); the next step (ten rules, `nextStep()`), the tab that owns it, per-tab badges (`tabBadges()`), the busy mode and per-control gate (`busyMode()`, `controlAllowed()`), the tab to show (`pickTab()`), and the create-panel sources and clean-up groups. `app.js` only renders what it says |
|
||||
| `public/git-board-view.js` | No DOM access of its own: `drawGitBoard(ctx)` draws the tabbed board (header, whose branch name is a link to the branch on its host once pushed, tab strip with Done with git, the card slot, step strip, Changes / Branches / Sync) from the helpers it is handed (`el`, `md`, `copyButton`), every control through one gate; `screens/git-host.js` hosts it, and `scripts/test-web-console-git-board.mjs` drives it with a recording fake `el` |
|
||||
| `public/pr-url.js` | PURE, no imports: `prUrl()`, the "open a pull request" link for the GitHub, GitLab, Azure DevOps and Bitbucket shapes (`null` for an unknown kind, no web address, or a non-https result), and `branchUrl()`, the branch's own page on the same four hosts under the same rules. `git-repo.mjs` re-exports `prUrl()`, and the board's base picker rebuilds the link in the browser with the same code |
|
||||
@@ -77,7 +77,7 @@ One row per file under `src/web-console/public/` (the games and their sound are
|
||||
| `public/mentions.js` | PURE, no imports: the `@name` popover's logic — `mentionAt()` finds an `@partial` at the caret, `matchNames()` filters the workspace names, `applyMention()` splices a pick in and returns the new caret. Used by the Ask box, notes and text answers |
|
||||
| `public/favicon.js` | The tab icon's status bar. `faviconState({ mood, spin })` (PURE) maps the call `renderStatus()` makes for Planny's line to `busy` (the spinning ring), `ready` (`point`), `attention` (`adrift`, `gone`, or `work` without the ring — the stale line) or `plain` (`done`, `happy`); a finished screen gets no special case, so one still offering a press points and lights `ready` (the desktop app's taskbar dot follows), a stranded press is `attention`, and only all done or paused is `plain`; `faviconSvg()` is `FAVICON_BODY` (kept equal to `favicon.svg` by a test) plus a bar along the bottom edge in the `FAVICON_COLORS` color (busy dashed on a white strip, so the states differ by pattern; the rest solid); `setFavicon()` swaps both `<link rel=icon>` hrefs only on a change — the SVG as a data URL, the PNG link drawn through a canvas. Called from `say()` in `renderStatus()`, which runs every second |
|
||||
| `public/continue-button.js` | The one control that wakes a quiet agent. `continueButton(label, cls)` is a button asking the app for `agent-continue` (held off 4 s after a press); `reconnectOffer(cls)` is that button labeled **Reconnect to agent** under the app and, in a browser, a line telling the person to type `continue` in their terminal. Used by the status line (`screens/core.js`: the dashboard's quiet, launch-saved and way-home-saved lines), the Ask tab (`screens/ask.js`, left of Send while the red no-agent line shows) and the saved-and-waiting launch screen (`screens/starting.js`, app only; a browser reads the hint). |
|
||||
| `public/app-bridge.js` | The messages the page posts to the desktop app that frames it. `framed()` is true inside a frame; `tellApp(kind, extra)` posts `{ plan2code: kind }`, a named request with no free text: `looks` (the highlight's dark shades, from `applyLooks()`, for the app bar's buttons), `agent-continue` (the in-app **continue** button on the Not running line: the app types the keystrokes `continueKeys()` in `plan2code-app/ui/meter.js` names into the agent's terminal, `continue` and Enter, then under Claude Code its send-now chord ctrl+x ctrl+s, so a word queued behind a stuck turn is delivered), `terminal-open` (the in-app **terminal** button, shown in place of the word in every What to check line while the app's terminal panel is collapsed: the app presses the panel's own Collapse/View button, and only when collapsed; the app tells the page the panel's state with `terminal-state` `{ collapsed }` on the page's `console-ready` and on every change, heard through `onAppMessage` into `page.terminalCollapsed`), `new-session` (the meter popover's New Session: the app presses its own bar button, confirm and all) and `activities-full` (`{ on }`, an Activities game going in or out of full screen: the app lays the console's frame over its bar and terminal and puts the window in full screen, and out of it only if it put it there; `taskbarSwitch()` checks the boolean, and the window permissions are in `capabilities/default.json`). Nothing outside a frame |
|
||||
| `public/app-bridge.js` | The messages the page posts to the desktop app that frames it. `framed()` is true inside a frame; `tellApp(kind, extra)` posts `{ plan2code: kind }`, a named request with no free text: `looks` (from `applyLooks()`: the resolved `theme`, `"light"` or `"dark"`, and both highlight shade sets, `light` and `dark`, four `#rrggbb` each, plus `accent`, the dark set, for a shell that predates the theme; the app validates it with `looksFromMessage()` in `plan2code-app/ui/meter.js`, sets `data-theme` and the accent properties on its root, themes its terminal and the OS title bar, and keeps both for the next launch, which `ui/theme-early.js` paints before the first frame; the page also sends it again when the system theme flips under a System choice), `agent-continue` (the in-app **continue** button on the Not running line: the app types the keystrokes `continueKeys()` in `plan2code-app/ui/meter.js` names into the agent's terminal, `continue` and Enter, then under Claude Code its send-now chord ctrl+x ctrl+s, so a word queued behind a stuck turn is delivered), `terminal-open` (the in-app **terminal** button, shown in place of the word in every What to check line while the app's terminal panel is collapsed: the app presses the panel's own Collapse/View button, and only when collapsed; the app tells the page the panel's state with `terminal-state` `{ collapsed }` on the page's `console-ready` and on every change, heard through `onAppMessage` into `page.terminalCollapsed`), `new-session` (the meter popover's New Session: the app presses its own bar button, confirm and all) and `activities-full` (`{ on }`, an Activities game going in or out of full screen: the app lays the console's frame over its bar and terminal and puts the window in full screen, and out of it only if it put it there; `taskbarSwitch()` checks the boolean, and the window permissions are in `capabilities/default.json`). Nothing outside a frame |
|
||||
| `public/subagents.js` | PURE, no imports: the Subagents switch. `SUBAGENT_WORKFLOWS` / `offered()` (the opt-in table, one entry per non-null `subagents` field in `skills.js`, each with its default instruction), `cleanSetting()` (`{ on, instruction, max, strength }` or `{ error }`: `bad`, `too-long` past 2,000 characters, `max` outside 1-20, `strength` not one of `STRENGTHS`; `strength` is `balanced`, `thrifty`, `best` or `session`, missing reads as `balanced`, saved per project and skill in each `subagents.json` entry and sent as a `Helper strength:` line in the "on" block), `FRAME_LINES`, `blockFor(setting, told)` (the `Subagents:` lines and `subagents` field an agent is owed, given the session setting and its cursor; never says "off" to an agent not told "on"), `checkHelper()` / `checkHelpers()` (the `helpers` house rule) and the page's view rules `showSwitch()`, `switchLabel()`, `helperRows()`, `showTab()`, `CHECKIN_LINE`. Imported by the server, the `cmd-*.mjs` files, `patches.mjs`, `settings.mjs`, the page and the tests; in `SERVABLE` and preloaded |
|
||||
| `public/notepad.js` | PURE, no imports: the Notebook's rules. `SAVE_DEBOUNCE_MS` 800, `RETRY_STEPS_MS` (1 s up to 30 s), `NOTE_MAX_BYTES` / `NOTEPAD_MAX_IMAGES` / `TAB_NAME_MAX` / `NOTEPAD_MAX_TABS` / `IMAGE_ID_RE` / `TAB_ID_RE` (kept equal to `notepads.mjs` by a test), `noteBytes()`, the save-state reducer `nextSave(state, event)` from `SAVE_START` (states `idle`, `pending`, `saving`, `saved`, `failed`, `too-long`; it returns the timer to arm), `saveStatus()` (the status line's words), `unsaved()` (what `beforeunload` asks on), `keepsText()` (unsaved or too long: a reopen never replaces the editor's text then), `tabSwitch()` (whether leaving a tab must save it first), `NOT_LOADED`, `EDITOR_NOT_LOADED`, `errorSentence()` (one sentence per `/notepad` refusal, else a lost connection), the tab rules `cleanTabName()`, `nameTaken()`, `tabNameProblem()`, `moveTab()`, `dropTab()` and the two-confirm delete `nextDelete()` / `DELETE_STAGES`, and `step()` (wrapping through the pictures) |
|
||||
| `public/screens/notepad.js` | the Notebook: `#btn-notepad` in the top bar on every screen (disabled while the server is gone, `renderNotepadButton()` in the render pass), `#notepad-modal`, the one CodeMirror editor (made on first open by a dynamic import of `notepad-editor.js`), the page's view of the notepad as `{ tabs, activeId }`, the name form (New tab and Rename, never `window.prompt`), the in-modal two-step delete, and autosave through `nextSave()` to `POST /notepad/text?tab=<id>`, flushed on close, when the page is hidden and before a switch. The editor stays read-only until the first read lands, so nothing typed into an empty editor is saved over a note. **Every save and every picture is bound to the tab it was made in**: `saveTab` is fixed when the change is made, a picture entry carries its `tab`, and a switch waits for the save (`settled()`), stays put with "Not saved yet, so staying on this tab." when it cannot, and drops a deleted tab's unsaved text without sending it |
|
||||
@@ -87,7 +87,7 @@ One row per file under `src/web-console/public/` (the games and their sound are
|
||||
| `public/vendor/codemirror.esm.js` | CodeMirror 6 (state, view, language, commands, lang-markdown, MIT), bundled into one minified ES module by `scripts/vendor-codemirror.mjs` (sha256 `4ff96d58fc1a5497eb933426bd2d160d2fb0cf490de8bb9302c304096c71c1d4`, the six top-level versions in the script and the file's header comment, everything they pull in pinned by `scripts/vendor-codemirror-lock.json` and installed with `npm ci`, so the same lock gives the same bytes). Never edited by hand: change a version in the script and run `node scripts/vendor-codemirror.mjs --update-lock` (needs npm and network; the packages install in a temp folder, never in the repo), or without the flag to rebuild from the lock |
|
||||
| `public/styles/notepad.css` | the notebook's own rules: the top bar button, the dialog, the tab bar and its tools, the name form, the delete question, the empty state and the pictures. The editor's look is `notepad-editor.css`, inside its shadow root |
|
||||
| `public/chat.js` | the Quick question chat's PURE rules, shared by the server and the page: `CHAT_LIMIT` / `CHAT_MAX_CHARS` / `CHAT_MAX_ATTACHMENTS` (the combined image + document cap; `CHAT_MAX_IMAGES` is kept as an alias of it), `chatOffline()` (the server's `409 offline` guard), and the page's view model (`chatView`, `sendState`, `nextAbout`, `contextOptions`, `unreadDot` / `shouldChime`). Ask context is the `{ history, about }` model: `nextAbout()` records the last 3 places visited in `history` and sets `about` only when the person picks one from **+ Add context** (`contextOptions()` lists that history plus *This spec*); dropping it or a successful send clears it, so the page never attaches context on its own. Imports only `answers.js`, no module-scope DOM, so `node --test` covers it |
|
||||
| `public/starters.js` | PURE, no imports: the Role list (`ROLES`, `ROLE_NOT_SET`, `normalizeRole()`, `needsRoleNudge()`: the dashboard banner shows until `looks.json` carries any `role`), the 19 starter templates (Markdown `## heading` sections, shape pinned by a test) and their per-role orders (`TEMPLATES`, `TEMPLATE_ORDERS`, `templatesFor()`, `templateSwap()` for the replace prompt), and the Ask starter sets (`STARTER_SETS`, `STARTER_SET_FOR`, `startersFor()`). Imported by the page's looks and screens and by the tests; in `SERVABLE`, preloaded by `index.html` and parse-checked. The page owns the wording; a skill only flags its fresh-idea `text` card with `"templates": "idea"` |
|
||||
| `public/answers.js` | the page's PURE answer-shaping logic (what an answer reads as, what a placeholder offers, whether a send carries an answer at all). Kept out of the page's entry because `app.js` cannot be imported outside a browser, so anything left in it is untestable. The `scripts/test-web-console-*.mjs` tests import it directly. Learning's share: the `lessons` card's words and answer (`LESSON_KEEP_WORD`, `lessonEditField()`, `lessonLines()`, and `lessonsReply()`, which `tokenFor()` in `screens/core.js` uses: a line per decision plus one `Decisions:` line in the shape `lessons.mjs decide` takes), `LEARNING_ACTIONS` / `learningAction()` / `learningReply()` (the `__learning` send) and `learningBannerText()` (the waiting banner's line, or "" when no lesson is waiting or Learning is off or paused) |
|
||||
| `public/starters.js` | PURE, no imports: the Role list (`ROLES`, `ROLE_NOT_SET`, `normalizeRole()`, `needsRoleNudge()`: until `looks.json` carries any `role`, the dashboard shows the quiet "Two optional extras" line, held back until the first skill launch sets `looks.skillLaunched`), the 19 starter templates (Markdown `## heading` sections, shape pinned by a test) and their per-role orders (`TEMPLATES`, `TEMPLATE_ORDERS`, `templatesFor()`, `templateSwap()` for the replace prompt), and the Ask starter sets (`STARTER_SETS`, `STARTER_SET_FOR`, `startersFor()`). Imported by the page's looks and screens and by the tests; in `SERVABLE`, preloaded by `index.html` and parse-checked. The page owns the wording; a skill only flags its fresh-idea `text` card with `"templates": "idea"` |
|
||||
| `public/answers.js` | the page's PURE answer-shaping logic (what an answer reads as, what a placeholder offers, whether a send carries an answer at all). Kept out of the page's entry because `app.js` cannot be imported outside a browser, so anything left in it is untestable. The `scripts/test-web-console-*.mjs` tests import it directly. Learning's share: the `lessons` card's words and answer (`LESSON_KEEP_WORD`, `lessonEditField()`, `lessonLines()`, and `lessonsReply()`, which `tokenFor()` in `screens/core.js` uses: a line per decision plus one `Decisions:` line in the shape `lessons.mjs decide` takes), `LEARNING_ACTIONS` / `learningAction()` / `learningReply()` (the `__learning` send) and `learningBannerText()` (the waiting banner's line, or "" when no lesson is waiting or Learning is off or paused). `seedStaged(items, staged, seeded, sent)` stages a `multi` card's `ticked` rows once as if the person had ticked them (`page.local.seeded`, kept with the draft, remembers it so a cleared card is never re-ticked by a redraw or a reload); `startsTicked(item)` is the one test for such a card, shared by `answerLines` ("None ticked" for an empty `ks`), `tokenFor` in `core.js` (the reply says `none`, before any note) and `cards.js` (an emptied pick stays staged as `ks: []`). |
|
||||
| `public/labels.js` | `taskLabel()` / `activityLabel()`: rewrites a build's `Task 4.2 of 6` activity line to `Task 2 of 6` (only for `implement` / `implement-review`; a plan's `Task 2.1` is a real section number). A separate module for the same reason as `answers.js`: pure, so `node --test` can import it |
|
||||
| `public/boot.js` | `playWake()`: the dashboard's first-open wake-up. Self-contained (it owns its timers, the listeners that swallow input mid-run and the one measured glide transform; the page's `stir()` callback times the nudge between the click and the boot, which `screens/dashboard.js` fills with one snore; `skipEl` — the muted Skip button, and Escape — ends the run early with `onSkip` as the cue to silence queued sounds) and free of module-scope DOM access, so it can be imported by the tests and kept out of the screens' render paths; `GLIDE_AT_MS` / `DONE_AT_MS` are its timings |
|
||||
@@ -35,7 +35,7 @@ Anything a workflow step decides with one correct answer (parsing a spec's check
|
||||
| `git.mjs` (own) | git | `state`, `plan`, `branch-check`, `init-check`, `delete-check`, `cleanup-list`, `conflicts`, `pr-url`, `classify-error`: the repo snapshot, each action's exact command and confirm text (shared by the terminal and the board), branch-name, delete, cleanup and git init checks, a stopped rebase's conflicts, the pull-request link and git's errors sorted into kinds with a next step. Read-only: the agent runs every command it prints, and `guard()` refuses force push, hook skipping, amend, remote delete and blanket add |
|
||||
| `ui-prototype.mjs` (shared, with `ui-prototype-round.mjs`, `ui-prototype-page.mjs`, `ui-prototype-drafts.mjs`, `ui-prototype-block.mjs`) | ui-prototype, pathfinder, plan, revise-plan, quick-task (ride-along) | `sweep` (drafts older than 30 days), `new-round`, `assemble` (the page from `round.json`, the variant files and the shell in `references/ui-prototype-shell/`, images and fonts embedded; exit 4 `round-mismatch` when a drafts round's `round.json` names another `name` or `round` than its folder), `check` (the contract's rules, the three image rules `image-type`, `image-size` and `image-missing`, and the size ceiling), `open` (the default browser), `read-block` (a pasted choice block from stdin into fields) and `save` (the pair `specs/<spec>/prototypes/<name>.html` and `.md`, then that prototype's drafts removed). Writes only under `~/.plan2code/prototypes/<project key>/` and, on `save`, the spec's `prototypes/`; never writes project code, never opens a page outside the drafts or `specs/`, never fetches anything over the network. The helper modules are imported only by `ui-prototype.mjs` |
|
||||
| `lessons.mjs` | dashboard, pathfinder, plan, revise-plan, document, implement(-review), review, finalize, quick-task, xray, diagnose, pr-prep, test, dead-code, ui-prototype | Learning's one script. Every answer carries `state` (`not-set-up`, `off`, `on`, `paused`, `unknown`) and `active`, decided only by `learningState()` in the bundled `web-console/learning.mjs`, which it loads at run time through `consoleModule("learning.mjs")` (exit 3 `no-console` without it), so the dashboard and the skills never disagree. `state` (the state, since when Paused for you, the waiting count, whether AGENTS.md exists, whether on the default branch) / `switch on\|off` (the team switch) / `pause on\|off` (Paused for you, refused unless On) / `read` (the lessons for the named paths and the branch's changed files, `marked` when their About files changed since, with a `run` handle so a later read hands over only new areas) / `note` (a lesson, an area, a doubt or an AGENTS.md fix, checked, then held as waiting; nothing while Off or Paused for you; a secret exits 5) / `check` (the secret refusal and the email, handle and person-name flags; reads only) / `list` (the approval list of everything waiting, new failure log lines, the first-ask card) / `decide` (applies the person's choices, or `--first-ask yes\|no`; a test map row fix carries `row` on its list item and is reworded with `row` or with `after` as its one table line, read back by `rowFromLine()` in `test-map.mjs`, and every row is validated and secret-checked again at Apply) / `log-lines` (failure log lines added since Learning was first switched on) / `areas --suggest` (first areas from the test map) / `report` (lessons per area, the oldest, marked and gone ones) / `remove --confirm` (deletes every saved lesson). Writes only the project's `.plan2code/settings.json` and `.plan2code/lessons/<area>.md`, the pointer line and upkeep sentence in the project's `AGENTS.md`, its failure log lines (moved into lessons, marked `(kept in the log)`, or added on a first-ask no), accepted fixes to `AGENTS.md` or an `.agents-docs/` file, and, through the core, the pause and the waiting lessons on this machine only, in `~/.plan2code/learning/<repository key>/`. Never stages or commits |
|
||||
| `changes.mjs` | implement, implement-review, quick-task | The sign-off page's Changes tab. `start --session <folder>` snapshots the working tree (tracked, modified and new files, never ignored ones) into a git tree object through a temporary index and `git write-tree`, so the real index, HEAD, branches and working tree stay as they were, and writes the tree id to `<session>/changes-start.json`; a rerun replaces it. `diff --session <folder> [--cap 524288]` snapshots the tree now, compares it with the start tree and writes `<session>/changes.diff` (unified, `git diff --no-color -M` headers; over the cap it is cut at a file boundary with a notice, every file still named; a file that may hold a secret keeps its name and counts, its lines hidden; the counts of hidden and cut files travel as `# counts: <added> <removed> <path>` trailer lines (tab separated fields) that the page applies to files with no lines of their own), printing `{ ok, files, added, removed, truncated, hidden, file }`. Exit 3 for no repository, no snapshot or a snapshot git no longer has, 4 when git cannot snapshot. Work done before `start` never shows, and nothing has to be committed. The notes for Implement and Quick Task (`notes/implement.md`, `notes/quick-task.md`) say when to run each; the page draws the result as a `diff` doc block |
|
||||
| `changes.mjs` | implement, implement-review, quick-task | The sign-off page's Changes tab. `start --session <folder>` snapshots the working tree (tracked, modified and new files, never ignored ones) into a git tree object through a temporary index and `git write-tree`, so the real index, HEAD, branches and working tree stay as they were, and writes the tree id to `<session>/changes-start.json`; a rerun replaces it. `diff --session <folder> [--cap 524288]` snapshots the tree now, compares it with the start tree and writes `<session>/changes.diff` (unified, `git diff --no-color -M` headers; over the cap it is cut at a file boundary with a notice, every file still named; a file that may hold a secret keeps its name and counts, its lines hidden; the counts of hidden and cut files travel as `# counts: <added> <removed> <path>` trailer lines (tab separated fields) that the page applies to files with no lines of their own), printing `{ ok, files, added, removed, truncated, hidden, file }`. Exit 3 for no repository, no snapshot or a snapshot git no longer has, 4 when git cannot snapshot. Work done before `start` never shows, and nothing has to be committed. The notes for Implement and Quick task (`notes/implement.md`, `notes/quick-task.md`) say when to run each; the page draws the result as a `diff` doc block |
|
||||
|
||||
**Shared reference for `lessons.mjs`:** `src/shared-references/lessons.md` ships as `references/lessons.md` (through `additionalReferences`) to the same fifteen skills and the dashboard. It is the prose half of Learning: the fixed words (Learning, lesson, waiting; Not set up, Off, On, Paused for you), when a skill runs each command (Start, While working, End, unattended runs, Learning off), and that a failed call means one "Lessons could not be read this run." and carrying on without lessons.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
- **Version sync:** When adding a new version to `CHANGELOG.md`, run `npm run set-version -- <x.y.z>` (`node scripts/set-version.mjs`; with no version on a terminal it shows the current one and asks, Enter taking the next patch; the one writer of every carrier; it never edits the changelog), which updates `version.json` and `package.json` (root) to match. `README.md` (the `Version X.Y.Z` line near the top) also carries the version, and `version.json`'s `releaseDate` moves with it. `version.json` is copied into every skill that ships scripts (`skills/<skill>/scripts/version.json`) and into the shared console (`~/.plan2code/console/<version>/`, whose Help shows it), so after a bump run `npm run build:skills` or `npm test` (`--verify-skills`) fails. The installer displays the version from `version.json` in its header. All three files (`CHANGELOG.md`, `version.json`, `package.json`) must always show the same version number. The desktop app carries it too (under `plan2code-app/`: `package.json`, `package-lock.json` with two lines, `src-tauri/tauri.conf.json`, `src-tauri/Cargo.toml`, `fake-agent/Cargo.toml`, and `Cargo.lock`'s `plan2code-app` and `fake-agent` entries): `node scripts/check-versions.mjs [--tag vX.Y.Z]` compares those, `version.json`, `package.json`, `CHANGELOG.md` and README's line (twelve places in all), `npm test` runs it first on this tree, and the release workflow runs it before building.
|
||||
- **CHANGELOG ordering:** Entries in `CHANGELOG.md` must be in reverse-chronological order — newest version at the top, oldest at the bottom. New entries are always inserted immediately after the file header.
|
||||
- **CHANGELOG house format is not Keep a Changelog:** version headings are `## vX.Y.Z` — with a `v` prefix and **no date**. The release date is recorded only in `version.json`'s `releaseDate`. Category headings carry emoji: `### ✨ Added`, `### 🔧 Changed`, `### 🐛 Fixed`, `### 💥 Breaking`, `### 🗑️ Removed`, `### 📚 Documentation`. Older entries contain one-off variants (`🎁 Added`, `📦 Updated`, `📝 Documentation`, `🏎️ Improved`, `🧪 Testing`) — do not introduce new ones. The `.claude/skills/plan2code-changelog/` skill automates version selection and formatting; use it rather than hand-rolling an entry.
|
||||
- **CHANGELOG house format is not Keep a Changelog:** version headings are `## vX.Y.Z (YYYY-MM-DD)`, with a `v` prefix and the release date from `version.json`'s `releaseDate` (headings before 3.1.0 have no date and are not backfilled; `check-versions.mjs` reads the number only). A minor release opens with a three-bullet `### Highlights`, sections run Added, Changed, Fixed, game changes sit under one `Activities` line and tooling and test lines under `For contributors`. Category headings carry emoji: `### ✨ Added`, `### 🔧 Changed`, `### 🐛 Fixed`, `### 💥 Breaking`, `### 🗑️ Removed`, `### 📚 Documentation`. Older entries contain one-off variants (`🎁 Added`, `📦 Updated`, `📝 Documentation`, `🏎️ Improved`, `🧪 Testing`) — do not introduce new ones. The `.claude/skills/plan2code-changelog/` skill automates version selection and formatting; use it rather than hand-rolling an entry.
|
||||
- **PowerShell mangles the CHANGELOG emoji:** `Get-Content` / `Select-String` render the `###` heading emoji as `?` under the default Windows console encoding, so a heading audit done that way reports garbage. Read `CHANGELOG.md` with a file-read or grep tool instead.
|
||||
- **`.claude/skills/` is tracked:** a new repo-local skill only needs `git add` (see Architecture → Repo-Local Skills). A correction that is a workflow belongs there as a skill, linked from AGENTS.md, not as a Failure log line.
|
||||
- **Workflow file character limit:** All `src/plan2code-*.md` files (and the dashboard prompt `src/plan2code.md`) must be ≤ 20,000 characters (about 5k tokens, the usual Agent Skills guidance for a SKILL.md body). A husky pre-commit hook enforces this, and `plan2code-metrics` (`improver.ts`, `applier.ts`) applies the same number to proposed prompt edits, so change them together. History: 11,000 originally (headroom under Windsurf's old 12,000-char limit for platform-specific files, gone since 2.1.0's single-format build), 11,500 in 2.4.0, 20,000 in 2.4.1. The limit is now a prompt-size discipline only: the whole SKILL.md loads on every invocation while references load on demand, so situational detail still belongs in a reference file, and anything with one correct answer belongs in a script (see Skill scripts in the architecture doc).
|
||||
@@ -30,7 +30,7 @@
|
||||
- **Web console oversized bodies:** `readBody()` and `readRaw()` (the `POST /upload` reader) in `routes.mjs` drain the rest of the body past `MAX_BODY` instead of calling `req.destroy()`, so an oversized body gets a 413 rather than a connection reset, and memory still stays capped. A new body reader must drain the same way.
|
||||
- **Web console commands are tied to the directory `open` ran in:** `console.mjs` finds a running server through a handle file under a hash of the project directory (`handleFile(project, sid)` → `runtimeDirFor(project)` → `<RUNTIME_DIR>/<cwdHash(project)>/<sid>.json` in `sessions.mjs`, with `RUNTIME_DIR` = `os.tmpdir()/plan2code-console` (`-<uid>` on Linux and macOS, a 0700 folder with 0600 handles), or `$PLAN2CODE_CONSOLE_HOME/runtime`), and the project is the working directory of `open` / `open --resume`. Run `status`, `chat`, `wait` and `stop` from that same directory. From anywhere else `status` says `live: false`, `chat` / `wait` report `server-gone` (exit 20) and `stop` stops nothing, while the server is in fact still running. It is easy to mistake for a crash when a scratch session is opened from the repo and then driven from its session folder; check `server.log` and `events.ndjson` (a real exit writes an `exit` event or a stack) before chasing one.
|
||||
- **Windows temp paths in web console tests:** `os.tmpdir()` can be an 8.3 short path (`C:\Users\JUSTIN~1.PAR\...`), while `server.mjs` canonicalizes its session dir with `fs.realpathSync.native` to the long form. Any test comparing a server-returned path (e.g. an upload's `path`) against the test's `session` must pass the test side through `fs.realpathSync.native()` first, and compare case-insensitively on Windows.
|
||||
- **Web console assets:** `computeExpectedSkills()` copies references as `Buffer`s, so binary files are fine. Adding a `public/` file needs the three edits in Architecture → Web Console. The vendored `marked.esm.js` sha256 is in `.readme/web-console.md`.
|
||||
- **Web console assets:** `computeExpectedSkills()` copies references as `Buffer`s, so binary files are fine. Adding a `public/` file needs the three edits in Architecture → Web Console. The vendored `marked.esm.js` sha256 is in `.readme/web-console-internals.md`.
|
||||
- **The default highlight color lives in two places:** changing it means editing `DEFAULT_ACCENT` in `public/palette.js` and the light, system-dark and explicit-dark `--accent*` values in `public/styles/tokens.css`. No test ties them together.
|
||||
- **Reference file sizing guideline:** Files in `src/plan2code-*-references/` directories target ~100-200 lines each (soft guideline; evaluate splitting above 300). They are NOT subject to the 20,000 character limit. The pre-commit hook (`validate-char-count.js`) only checks `src/plan2code-*.md` flat files — subdirectory contents are automatically excluded.
|
||||
- **The splitting guideline has a hard ceiling — reference files cannot always be split:** each new reference costs the orchestrator a `Read references/<file>.md` line plus its fallback blockquote (~150-200 chars), which adds up across a prompt's 20,000-char budget. When a reference legitimately exceeds 300 lines (e.g. `plan2code-0-pathfinder-references/chart.md`), that is an accepted trade-off, not an oversight. Nested folders under `-references/` work: `references/` is the real path on every agent.
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
# General
|
||||
|
||||
### A document-level key handler that must ignore typing has to read e.composedPath(): the Markdown editors live in a shadow root, so e.target is their .md-host element, not the contenteditable inside.
|
||||
- Kind: how-it-works
|
||||
- About: src/web-console/public/md-field.js, src/web-console/public/screens/core.js
|
||||
- Noted: 2026-11-17, implement-review
|
||||
|
||||
### A new dialog wider than 440px needs max-width: none next to its width, sized like the Notebook dialog (min(1200px, 90vw)); the base .modal caps every dialog at 440px, so a width alone has no effect.
|
||||
- Kind: correction
|
||||
- About: src/web-console/public/styles/learning.css, src/web-console/public/styles/pieces.css
|
||||
@@ -11,17 +16,53 @@
|
||||
- About: scripts/test-web-console-shape.mjs, .agents-docs/AGENTS-architecture-console-page.md
|
||||
- Noted: 2026-11-14, implement-review
|
||||
|
||||
### A test run of node install.js with a temp HOME still writes the plan2code shims into the real npm global bin, because npm's prefix does not follow HOME; also set npm_config_prefix to a temp folder.
|
||||
- Kind: correction
|
||||
- About: install.js
|
||||
- Why: A piped --update test run repointed the real plan2code shims at a temp folder until they were fixed by hand.
|
||||
- Noted: 2026-11-17, implement-review
|
||||
|
||||
### Each recordInstalled() in install.js stamps the version being installed into install.json, so a failed update must restore the old one with setRecordVersion(), or a retry says Already on.
|
||||
- Kind: how-it-works
|
||||
- About: install.js
|
||||
- Noted: 2026-11-17, implement-review
|
||||
|
||||
### In a node:test file, start fixtures such as a test server in a root before hook, never with a top-level await after the first test(), which lets the runner run after hooks early
|
||||
- Kind: correction
|
||||
- About: scripts/test-script-deps.mjs
|
||||
- Why: test-script-deps.mjs awaited its server mid-file and 7 tests failed on Ubuntu and macOS CI only.
|
||||
- Noted: 2026-11-15, Failure log
|
||||
|
||||
### Playwright counts aria-disabled as disabled: a page test pressing an aria-disabled button (Stop session, Back) uses click({ force: true }) and reads .disabled via evaluate().
|
||||
- Kind: command
|
||||
- About: scripts/test-web-console-page-session.mjs
|
||||
- Noted: 2026-11-17, implement-review
|
||||
|
||||
### The Agents & models tab shows a model in two places, the cards (agents/agents-summary.js) and the strengths panel (agents/agents-strengths.js); check a models.json label change in both.
|
||||
- Kind: how-it-works
|
||||
- About: src/web-console/public/screens/agents
|
||||
- Noted: 2026-11-17, implement-review
|
||||
|
||||
### The app's webview data sits outside ~/.plan2code, in Tauri's app_local_data_dir() on Windows and Linux (%LOCALAPPDATA%/com.plan2code.desktop); appWebviewDirs() in install.js lists it per OS.
|
||||
- Kind: how-it-works
|
||||
- About: install.js
|
||||
- Noted: 2026-11-17, implement-review
|
||||
|
||||
### The desktop app's CSP allows no inline script, so anything that must run before the first paint (the saved theme and accent) goes in the classic head script ui/theme-early.js, not in app.js.
|
||||
- Kind: convention
|
||||
- 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.
|
||||
- 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
|
||||
- Noted: 2026-11-17, implement-review
|
||||
|
||||
### When a card in src/plan2code-deps.md changes (what it lists or asks), change the same card in src/web-console/notes/deps.md in the same edit: the console builds the card from the notes.
|
||||
- Kind: correction
|
||||
- About: src/plan2code-deps.md, src/web-console/notes/deps.md
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
// The shots use the console's Ocean highlight rather than its default orange:
|
||||
// it is the console's nearest to the Plan2Code blue the site and README use.
|
||||
//
|
||||
// Shots: dashboard, dashboard-plan, dashboard-utilities, question, doc, build, signoff, finish, ask, git.
|
||||
// Shots: dashboard, dashboard-plan, dashboard-utilities, question, doc, build, signoff, signoff-changes, finish, ask, git,
|
||||
// notebook, learning, lessons, deps, activities and prototypes.
|
||||
// --compare adds workspace, stop, delete, help, prefs and cleanup: screens the
|
||||
// docs never show, for checking a change by eye against a "before" set. Its
|
||||
// --out must be outside docs/screenshots/, so the set is never published.
|
||||
@@ -86,15 +87,50 @@ const SHOTS = {
|
||||
doc: { workflow: "plan", posts: ["doc"], tab: "What we've agreed" },
|
||||
build: { workflow: "implement", posts: ["build"], tab: "phase-3.md" },
|
||||
signoff: { workflow: "implement", posts: ["signoff"] },
|
||||
// The sign-off with its Changes tab open: the diff is a file in the session folder.
|
||||
"signoff-changes": { workflow: "implement", posts: ["signoff", "signoff-changes"], files: { "changes.diff": "changes.diff" }, tab: "Changes" },
|
||||
finish: { workflow: "implement", posts: ["signoff", "finish"] },
|
||||
ask: { workflow: "plan", posts: ["question"], ask: "Where are tasks paged?" },
|
||||
// The git board draws itself from a real repository, so this shot runs in
|
||||
// its own git sample project; the post only hands the board back to you.
|
||||
git: { workflow: "git", posts: ["git"], repo: true },
|
||||
// The dashboard of a project with Learning on and two lessons waiting: its
|
||||
// Learning row and the banner with Review.
|
||||
learning: {
|
||||
workflow: "dashboard",
|
||||
posts: ["dashboard"],
|
||||
project: "learning",
|
||||
// The Learning row sits last on the dashboard, below the fold: bring the
|
||||
// end of the page into view.
|
||||
open: async (page) => {
|
||||
await page.locator(".learn-row").first().waitFor({ timeout: 10000 });
|
||||
await page.evaluate(() => document.querySelector(".learn-row").scrollIntoView({ block: "end", behavior: "instant" }));
|
||||
await sleep(400);
|
||||
},
|
||||
},
|
||||
|
||||
// The card that offers the lessons noted during a phase, at the end of the run.
|
||||
lessons: { workflow: "implement", posts: ["lessons"], project: "learning" },
|
||||
// The Update dependencies report and its finish.
|
||||
deps: { workflow: "deps", posts: ["deps"] },
|
||||
// The Activities picker, opened over a build in progress.
|
||||
activities: {
|
||||
workflow: "implement",
|
||||
posts: ["build"],
|
||||
open: async (page) => {
|
||||
// Activities is off by default: switch it on for this page, then open it.
|
||||
await page.evaluate(() => { document.getElementById("btn-activities").hidden = false; });
|
||||
await page.click("#btn-activities");
|
||||
await page.waitForSelector("#activities-modal[open]", { timeout: 10000 });
|
||||
await page.waitForSelector("#activities-picker:not([hidden])", { timeout: 10000 });
|
||||
},
|
||||
},
|
||||
// A spec with two saved prototypes: the Prototypes tab lists them.
|
||||
prototypes: { workflow: "implement", posts: ["build", "prototypes"], project: "prototypes", tab: "Prototypes" },
|
||||
// The Notebook dialog over the plan question, with two named tabs: Call notes
|
||||
// (a heading, bullets and bold, shown live) and Ideas, with the first one
|
||||
// open. The store is the scratch folder's, never the real one.
|
||||
notepad: {
|
||||
notebook: {
|
||||
workflow: "plan",
|
||||
posts: ["question"],
|
||||
open: async (page) => {
|
||||
@@ -304,6 +340,41 @@ function makeFreshProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
// The Learning shots' project: the sample with Learning switched on and two
|
||||
// lessons waiting, noted through the same script the skills use, into the
|
||||
// throwaway Learning store.
|
||||
function makeLearningProject() {
|
||||
const project = path.join(SCRATCH, "learning", "task-api");
|
||||
fs.mkdirSync(path.join(project, ".plan2code"), { recursive: true });
|
||||
fs.cpSync(path.join(SCRATCH, "task-api"), project, { recursive: true });
|
||||
fs.writeFileSync(path.join(project, ".plan2code", "settings.json"), JSON.stringify({ format: 1, learning: "on" }, null, 2) + "\n");
|
||||
const note = (text, kind, about) =>
|
||||
spawnSync(
|
||||
process.execPath,
|
||||
[path.join(ROOT, "src", "skill-scripts", "lessons.mjs"), "note", "--type", "lesson", "--text", text, "--kind", kind, "--about", about, "--source", "said", "--skill", "implement"],
|
||||
{ cwd: project, env: ENV, encoding: "utf8" }
|
||||
);
|
||||
note("Every list endpoint pages with a cursor, never an offset.", "convention", "src/tasks");
|
||||
note("Run one test file with node --test test/tasks.test.js; npm test also starts the Postgres container.", "command", "test/tasks.test.js");
|
||||
return project;
|
||||
}
|
||||
|
||||
// The Prototypes shot's project: the sample spec with two saved prototype
|
||||
// choices, one a Markdown note and one an HTML page.
|
||||
function makePrototypesProject() {
|
||||
const project = path.join(SCRATCH, "prototypes", "task-api");
|
||||
fs.cpSync(path.join(SCRATCH, "task-api"), project, { recursive: true });
|
||||
const dir = path.join(project, "specs", "task-api", "prototypes");
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(dir, "task-list.md"),
|
||||
"# Task list prototype\n\n**Chosen:** Variant B, a compact list with the status as a colored dot.\n\n- Filters sit in one row above the list.\n- Each row shows the title, the assignee and the due date.\n- Empty state: \"No tasks yet. Add the first one.\"\n"
|
||||
);
|
||||
fs.writeFileSync(path.join(dir, "task-list.html"), "<!doctype html><title>Task list</title><h1>Task list</h1>\n");
|
||||
fs.writeFileSync(path.join(dir, "task-detail.md"), "# Task detail prototype\n\n**Chosen:** Variant A, a side panel over the list.\n");
|
||||
return project;
|
||||
}
|
||||
|
||||
// The Workspace shot's second folder, beside the sample project.
|
||||
function makeExtraFolder() {
|
||||
const dir = path.join(SCRATCH, "task-web");
|
||||
@@ -368,9 +439,12 @@ function post(project, sid, name) {
|
||||
}
|
||||
|
||||
// Opens a session for the shot and posts its payloads. Returns { sid, url }.
|
||||
// `files` are copied into the session folder first, the way a skill's own
|
||||
// script (changes.mjs) leaves a diff there.
|
||||
function stage(project, spec) {
|
||||
const r = cli(project, "open", "--workflow", spec.workflow, "--no-open");
|
||||
if (r.code !== 0 || !r.out || !r.out.url) throw new Error(`open failed (${r.code}): ${r.err.trim()}`);
|
||||
for (const [name, from] of Object.entries(spec.files || {})) fs.copyFileSync(path.join(PAYLOADS, from), path.join(r.out.session, name));
|
||||
for (const name of spec.posts) post(project, r.out.sid, name);
|
||||
return { sid: r.out.sid, url: r.out.url };
|
||||
}
|
||||
@@ -608,13 +682,22 @@ async function main() {
|
||||
// A saved role keeps the dashboard's "pick your role" banner out of shot,
|
||||
// and the Ocean highlight is the console's nearest to the Plan2Code blue
|
||||
// the landing page uses.
|
||||
fs.writeFileSync(path.join(HOME, "looks.json"), JSON.stringify({ looks: { role: "engineer", accent: "ocean", welcomeSeen: true } }));
|
||||
fs.writeFileSync(path.join(HOME, "looks.json"), JSON.stringify({ looks: { role: "engineer", accent: "ocean", welcomeSeen: true, skillLaunched: true, meterTipSeen: true } }));
|
||||
browser = await launchBrowser({
|
||||
...(typeof args.browser === "string" ? { executablePath: args.browser } : {}),
|
||||
args: ["--no-first-run", "--no-default-browser-check", "--mute-audio"],
|
||||
});
|
||||
for (const name of names) {
|
||||
const where = table[name].repo ? makeGitProject() : table[name].fresh ? makeFreshProject() : project;
|
||||
const spec = table[name];
|
||||
const where = spec.repo
|
||||
? makeGitProject()
|
||||
: spec.fresh
|
||||
? makeFreshProject()
|
||||
: spec.project === "learning"
|
||||
? makeLearningProject()
|
||||
: spec.project === "prototypes"
|
||||
? makePrototypesProject()
|
||||
: project;
|
||||
const { sid, url } = stage(where, table[name]);
|
||||
try {
|
||||
if (table[name].ask) await captureAsk(browser, where, sid, url, table[name].ask);
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
diff --git a/src/tasks/paginate.js b/src/tasks/paginate.js
|
||||
index 3f1a2b4..8c9d0e1 100644
|
||||
--- a/src/tasks/paginate.js
|
||||
+++ b/src/tasks/paginate.js
|
||||
@@ -1,7 +1,9 @@
|
||||
// Cursor paging for GET /tasks: up to 50 tasks a page, oldest first.
|
||||
-export function paginate(tasks, cursor, limit = 50) {
|
||||
+export const MAX_LIMIT = 50;
|
||||
+
|
||||
+export function paginate(tasks, cursor, limit = MAX_LIMIT) {
|
||||
const start = cursor ? tasks.findIndex((t) => t.id === cursor) + 1 : 0;
|
||||
- const page = tasks.slice(start, start + limit);
|
||||
+ const page = tasks.slice(start, start + Math.min(limit, MAX_LIMIT));
|
||||
return { tasks: page, nextCursor: page.length === limit ? page[page.length - 1].id : null };
|
||||
}
|
||||
diff --git a/src/tasks/routes.js b/src/tasks/routes.js
|
||||
new file mode 100644
|
||||
index 0000000..b7d5e22
|
||||
--- /dev/null
|
||||
+++ b/src/tasks/routes.js
|
||||
@@ -0,0 +1,14 @@
|
||||
+import { paginate } from "./paginate.js";
|
||||
+import { taskSchema } from "./schema.js";
|
||||
+
|
||||
+// The /tasks routes: list with paging and filters, create, update, delete.
|
||||
+export default async function routes(app) {
|
||||
+ app.get("/tasks", async (req) => {
|
||||
+ const { cursor, limit, status, assignee } = req.query;
|
||||
+ const all = await app.db.tasks.find({ status, assignee });
|
||||
+ return paginate(all, cursor, Number(limit) || undefined);
|
||||
+ });
|
||||
+
|
||||
+ app.post("/tasks", { schema: { body: taskSchema } }, async (req, reply) => {
|
||||
+ return reply.code(201).send(await app.db.tasks.insert(req.body));
|
||||
+ });
|
||||
+}
|
||||
diff --git a/src/tasks/schema.js b/src/tasks/schema.js
|
||||
new file mode 100644
|
||||
index 0000000..4d0e9a1
|
||||
--- /dev/null
|
||||
+++ b/src/tasks/schema.js
|
||||
@@ -0,0 +1,8 @@
|
||||
+// The Zod schema for a task.
|
||||
+export const taskSchema = {
|
||||
+ type: "object",
|
||||
+ required: ["title"],
|
||||
+ properties: {
|
||||
+ title: { type: "string", minLength: 1 },
|
||||
+ status: { enum: ["todo", "doing", "done"] },
|
||||
+ },
|
||||
+};
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"workflow": "deps",
|
||||
"title": "Update dependencies",
|
||||
"headline": { "stage": "Report", "cleared": 4, "total": 4, "confidence": "2 updates applied, 1 undone, 1 left alone." },
|
||||
"docs": [
|
||||
{
|
||||
"id": "report",
|
||||
"title": "Report",
|
||||
"blocks": [
|
||||
{
|
||||
"id": "report",
|
||||
"state": "settled",
|
||||
"md": "## What happened\n\n2 updates were applied and pass the tests. 1 update broke a test and was undone. 1 was left alone because it needs a newer Node.\n\n**Folder looked at:** `task-api` (npm, 4 updates).\n\n| Package | Change | Size | Outcome |\n| --- | --- | --- | --- |\n| `fastify` | 4.26.0 to 4.28.1 | small fix | Updated, tests pass |\n| `zod` | 3.22.4 to 3.23.8 | small fix | Updated, tests pass |\n| `pg` | 8.11.3 to 8.13.1 | new features | Undone: `test/db.test.js` failed after the update |\n| `pino` | 8.19.0 to 9.5.0 | big change | Not tried: needs Node 20, you declare 18 |\n\n**Still open:** no known security problems.\n\n**Changes already there before the run:** none.\n\nThe updates are not saved in git yet. The Git skill commits them."
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"finish": {
|
||||
"headline": "2 updates applied, 1 undone, 1 not tried",
|
||||
"body": "`fastify` and `zod` are updated and `npm test` passes. `pg` broke `test/db.test.js` and was put back. `pino` needs Node 20, so it was left alone.",
|
||||
"command": "/plan2code-git",
|
||||
"doc": "report",
|
||||
"dashboard": true
|
||||
},
|
||||
"agent": { "status": "waiting" }
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"title": "task-api: Phase 3",
|
||||
"headline": { "stage": "Phase 3: API endpoints", "cleared": 11, "total": 11 },
|
||||
"items": [
|
||||
{
|
||||
"id": "lessons",
|
||||
"kind": "lessons",
|
||||
"title": "Lessons to keep",
|
||||
"body": "Choose for each one. Nothing is kept unless you choose it, and anything you leave keeps waiting.",
|
||||
"opening": null,
|
||||
"rows": [
|
||||
{
|
||||
"id": "l1",
|
||||
"type": "lesson",
|
||||
"text": "Every list endpoint pages with a cursor, never an offset.",
|
||||
"why": "Offsets skip rows when tasks are created while a client is paging.",
|
||||
"origin": "You said this.",
|
||||
"note": "",
|
||||
"flags": [],
|
||||
"refused": null,
|
||||
"area": "General",
|
||||
"kind": "convention",
|
||||
"about": ["src/tasks"],
|
||||
"areas": ["General"],
|
||||
"choices": ["Keep", "Reword", "Drop"]
|
||||
},
|
||||
{
|
||||
"id": "l2",
|
||||
"type": "lesson",
|
||||
"text": "Run a single test file with node --test test/tasks.test.js; npm test also starts the Postgres container.",
|
||||
"why": "",
|
||||
"origin": "Found by reading the code.",
|
||||
"note": "",
|
||||
"flags": [],
|
||||
"refused": null,
|
||||
"area": "General",
|
||||
"kind": "command",
|
||||
"about": ["test/tasks.test.js"],
|
||||
"areas": ["General"],
|
||||
"choices": ["Keep", "Reword", "Drop"]
|
||||
},
|
||||
{
|
||||
"id": "l3",
|
||||
"type": "lesson",
|
||||
"text": "Every error goes through errorShape() in src/app.js, so 400, 404 and 409 answer in one shape.",
|
||||
"why": "",
|
||||
"origin": "Found by reading the code.",
|
||||
"note": "",
|
||||
"flags": [],
|
||||
"refused": null,
|
||||
"area": "General",
|
||||
"kind": "how-it-works",
|
||||
"about": ["src/app.js"],
|
||||
"areas": ["General"],
|
||||
"choices": ["Keep", "Reword", "Drop"]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"agent": { "status": "waiting" }
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"specDir":"specs/task-api"}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"docs": [
|
||||
{
|
||||
"id": "changes",
|
||||
"title": "Changes",
|
||||
"blocks": [
|
||||
{
|
||||
"id": "diff",
|
||||
"diff": "changes.diff"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export const BUDGETS = {
|
||||
"review.md": 1140, // raised by the lessons card line's bytes only
|
||||
"revise-plan.md": 1422, // raised by the UI prototype line's bytes only
|
||||
"test.md": 5540, // raised by the lessons card line's bytes only
|
||||
"ui-prototype.md": 4000,
|
||||
"ui-prototype.md": 4600,
|
||||
"xray.md": 2500,
|
||||
},
|
||||
// One printed line each, for a session with one choice card.
|
||||
|
||||
@@ -315,7 +315,7 @@ test("framed, a finished screen with a button still to press is the person's mov
|
||||
const paused = await openSession(browser, { t, workflow: "implement", payload: WORKING, env: { PLAN2CODE_IN_APP: "1" }, init: FAKE_APP_FRAME });
|
||||
await until(async () => (await last(paused)) === "busy", 5000);
|
||||
paused.post({ finish: { headline: "Paused at Phase 2", command: "/plan2code-3-implement specs/audit-export/overview.md" } });
|
||||
await until(async () => (await paused.page.locator("#agent-text").textContent()).startsWith("Paused"), 5000);
|
||||
await until(async () => (await paused.page.locator("#agent-text").textContent()).startsWith("Stopped"), 5000);
|
||||
assert.equal(await last(paused), "plain", "a paused finish has nothing left to press");
|
||||
});
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ import {
|
||||
noteAction,
|
||||
noteReplyLines,
|
||||
pruneStaged,
|
||||
seedStaged,
|
||||
suggestAction,
|
||||
suggestReplyLines,
|
||||
progressTotal,
|
||||
@@ -103,6 +104,7 @@ import {
|
||||
loopLessonsLine,
|
||||
} from "../src/web-console/public/answers.js";
|
||||
import { chatView } from "../src/web-console/public/chat.js";
|
||||
import { agoWords, whenTitle, whenWords } from "../src/web-console/public/labels.js";
|
||||
import { ACCENTS, DEFAULT_ACCENT, RETIRED_ACCENTS, accentId } from "../src/web-console/public/palette.js";
|
||||
import {
|
||||
needsRoleNudge,
|
||||
@@ -606,6 +608,51 @@ test("pruneStaged drops a multi pick the re-posted card now locks, and leaves a
|
||||
assert.deepEqual(out.staged.c1.k, "A", "only a multi draws locked rows");
|
||||
});
|
||||
|
||||
test("seedStaged stages a multi card's starting ticks once, in option order, never touching its inputs", () => {
|
||||
const multi = (id, options, extra = {}) => ({ id, kind: "multi", status: "open", options, ...extra });
|
||||
const items = [multi("m1", [{ k: "A", text: "a", ticked: true }, { k: "B", text: "b" }, { k: "C", text: "c", ticked: true }])];
|
||||
const staged = {};
|
||||
const seeded = {};
|
||||
const out = seedStaged(items, staged, seeded);
|
||||
assert.equal(out.changed, true);
|
||||
assert.deepEqual(out.staged.m1, { type: "answer", kind: "multi", ks: ["A", "C"] });
|
||||
assert.deepEqual(out.seeded, { m1: true });
|
||||
assert.deepEqual(staged, {});
|
||||
assert.deepEqual(seeded, {});
|
||||
|
||||
// Once: after the person clears it, the returned seeded mark keeps it cleared.
|
||||
const again = seedStaged(items, {}, out.seeded);
|
||||
assert.equal(again.changed, false);
|
||||
assert.deepEqual(again.staged, {});
|
||||
// Reopened with the same id: still seeded once.
|
||||
assert.equal(seedStaged([{ ...items[0], status: "reopened" }], {}, out.seeded).changed, false);
|
||||
assert.equal(seedStaged([{ ...items[0], status: "reopened" }], {}, {}).changed, true);
|
||||
|
||||
// Left alone: already staged, already sent, settled, a choice, no ticked row.
|
||||
const mine = { m1: { type: "answer", kind: "multi", ks: ["B"] } };
|
||||
assert.deepEqual(seedStaged(items, mine, {}).staged, mine);
|
||||
assert.equal(seedStaged(items, {}, {}, { m1: { at: 1 } }).changed, false);
|
||||
assert.equal(seedStaged([{ ...items[0], status: "answered" }], {}, {}).changed, false);
|
||||
assert.equal(seedStaged([{ ...items[0], kind: "choice" }], {}, {}).changed, false);
|
||||
assert.equal(seedStaged([multi("m2", [{ k: "A", text: "a" }, { k: "B", text: "b", ticked: false }])], {}, {}).changed, false);
|
||||
|
||||
// A locked row is never seeded, even if it says ticked.
|
||||
const locked = seedStaged([multi("m3", [{ k: "A", text: "a", ticked: true, locked: true }, { k: "B", text: "b", ticked: true }])], {}, {});
|
||||
assert.deepEqual(locked.staged.m3.ks, ["B"]);
|
||||
assert.equal(seedStaged([multi("m4", [{ k: "A", text: "a", ticked: true, locked: true }])], {}, {}).changed, false);
|
||||
});
|
||||
|
||||
test("answerLines says None ticked for an empty pick on a card that started ticked, and nothing new for other cards", () => {
|
||||
const item = { id: "m1", kind: "multi", options: [{ k: "A", text: "Colors", ticked: true }] };
|
||||
assert.deepEqual(answerLines(item, { type: "answer", kind: "multi", ks: [] }), ["None ticked"]);
|
||||
// A multi without starting ticks keeps its record as before, note-only picks included.
|
||||
const plain = { id: "m2", kind: "multi", options: [{ k: "A", text: "Colors" }] };
|
||||
assert.deepEqual(answerLines(plain, { type: "answer", kind: "multi", ks: [], text: "a note" }), []);
|
||||
assert.deepEqual(answerLines(item, { type: "answer", kind: "multi", ks: ["A"] }), ["A · Colors"]);
|
||||
assert.deepEqual(answerLines(item, { skipped: true, ks: [] }), ["Skipped"]);
|
||||
assert.deepEqual(answerLines({ id: "c1", kind: "choice", options: [] }, { ks: [] }), []);
|
||||
});
|
||||
|
||||
test("document helpers: the extension allow-list, the picker's accept, sizes, and the kind of an old entry", () => {
|
||||
assert.equal(MAX_ATTACHMENTS, 5);
|
||||
assert.equal(MAX_DOC_BYTES, 10 * 1024 * 1024);
|
||||
@@ -763,6 +810,7 @@ const contrast = (a, b) => {
|
||||
|
||||
test("every highlight color is readable in both themes", () => {
|
||||
const panel = { light: "#ffffff", dark: "#201d1a" };
|
||||
const page = { light: "#f6f3ee", dark: "#171513" };
|
||||
// Nineteen a row in the wide Preferences dialog, two rows at most.
|
||||
assert.ok(Object.keys(ACCENTS).length >= 32 && Object.keys(ACCENTS).length <= 38);
|
||||
assert.ok(ACCENTS[DEFAULT_ACCENT], "the default must be in the list");
|
||||
@@ -775,6 +823,7 @@ test("every highlight color is readable in both themes", () => {
|
||||
for (const c of a[theme]) assert.match(c, /^#[0-9a-f]{6}$/, `${id} ${theme}: ${c}`);
|
||||
assert.ok(contrast(ink, fill) >= 4.5, `${id} ${theme}: label on the fill is ${contrast(ink, fill).toFixed(2)}:1`);
|
||||
assert.ok(contrast(fill, soft) >= 4.5, `${id} ${theme}: badge text on the tint is ${contrast(fill, soft).toFixed(2)}:1`);
|
||||
assert.ok(contrast(fill, page[theme]) >= 4.5, `${id} ${theme}: accent text on the page is ${contrast(fill, page[theme]).toFixed(2)}:1`);
|
||||
assert.ok(contrast(line, panel[theme]) >= 1.8, `${id} ${theme}: border barely shows at ${contrast(line, panel[theme]).toFixed(2)}:1`);
|
||||
}
|
||||
}
|
||||
@@ -1720,6 +1769,21 @@ test("validate: a multi's pick-list fields are checked only when present, each r
|
||||
refused(notMulti, "counter:", "only a multi");
|
||||
// Every refusal carries the field done right, as the other rules do.
|
||||
for (const p of multi([opt("A", { group: "" })])) assert.match(p, /\{/);
|
||||
|
||||
// Starting ticks and row pills: accepted in shape, refused out of it.
|
||||
assert.deepEqual(multi([opt("A", { ticked: true, tag: "Keep" }), opt("B", { ticked: false, tag: "Free up" }), opt("C", { tag: "T".repeat(16) })]), []);
|
||||
assert.deepEqual(multi([opt("A", { ticked: true }), opt("B", { locked: true, ticked: false })]), []);
|
||||
refused(multi([opt("A", { ticked: "yes" })]), "options:", 'option "A"', '"ticked"', "true or false");
|
||||
refused(multi([opt("A", { ticked: true, locked: true })]), 'option "A"', "locked and ticked", 'Drop "ticked"');
|
||||
refused(multi([opt("A", { tag: "" })]), 'option "A"', '"tag"', "1 to 16");
|
||||
refused(multi([opt("A", { tag: " " })]), 'option "A"', '"tag"');
|
||||
refused(multi([opt("A", { tag: "T".repeat(17) })]), 'option "A"', '"tag"');
|
||||
refused(multi([opt("A", { tag: 5 })]), 'option "A"', '"tag"');
|
||||
for (const p of multi([opt("A", { ticked: "yes" })])) assert.match(p, /\{/);
|
||||
const onChoice = (extra) => validate({ items: [{ id: "picks", kind: "choice", title: "Pick one", status: "open", options: [opt("A", extra), opt("B")] }] });
|
||||
refused(onChoice({ ticked: true }), 'option "A"', '"ticked"', "only goes on a multi");
|
||||
refused(onChoice({ tag: "Keep" }), 'option "A"', '"tag"', "only goes on a multi");
|
||||
assert.deepEqual(onChoice({}), []);
|
||||
});
|
||||
|
||||
test("lessons answers: a line per decision, what was left waiting, and the decisions file's JSON", () => {
|
||||
@@ -1911,15 +1975,15 @@ test("meter: levels, ring, fold and tooltip wording", () => {
|
||||
);
|
||||
assert.equal(pointsFrom([{ kind: "folder-issue", id: "L1:api", name: "api", reason: "denied" }]), 0);
|
||||
|
||||
assert.equal(tooltipFor(1), "This session is fresh (1 point).");
|
||||
assert.equal(tooltipFor(1), "This conversation is fresh (1 point).");
|
||||
assert.match(tooltipFor(5), /getting long \(5 points\)/);
|
||||
assert.match(tooltipFor(10), /done a lot \(10 points\)/);
|
||||
assert.deepEqual(meterView([{ kind: "launch", id: "L1", workflow: "document" }]), {
|
||||
points: 2,
|
||||
level: "green",
|
||||
fraction: 2 / 15,
|
||||
words: "Session: fresh",
|
||||
tooltip: "This session is fresh (2 points).",
|
||||
words: "Conversation: fresh",
|
||||
tooltip: "This conversation is fresh (2 points).",
|
||||
items: [{ label: "Document started", points: 2 }],
|
||||
});
|
||||
});
|
||||
@@ -2850,3 +2914,26 @@ test("a refused patch leaves state.json byte for byte as it was", () => {
|
||||
cli(["stop", "--session", s.sid, "--force"]);
|
||||
}
|
||||
});
|
||||
|
||||
test("whenWords writes how long ago, then the short date and time, against a fixed now", () => {
|
||||
const now = Date.parse("2026-11-15T21:42:00Z");
|
||||
const at = (offsetMs) => new Date(now - offsetMs).toISOString();
|
||||
const H = 3_600_000;
|
||||
const stamp = (ms) => new Date(now - ms).toLocaleString(undefined, { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" });
|
||||
assert.equal(whenWords(at(6 * H), now), `6 h ago · ${stamp(6 * H)}`);
|
||||
assert.equal(whenWords(at(30_000), now).split(" · ")[0], "just now");
|
||||
assert.equal(whenWords(at(5 * 60_000), now).split(" · ")[0], "5 min ago");
|
||||
assert.equal(whenWords(at(26 * H), now).split(" · ")[0], "1 day ago");
|
||||
assert.equal(whenWords(at(5 * 24 * H), now).split(" · ")[0], "5 days ago");
|
||||
assert.equal(whenWords(at(42 * 24 * H), now).split(" · ")[0], "6 weeks ago");
|
||||
assert.equal(whenWords(at(120 * 24 * H), now).split(" · ")[0], "4 months ago");
|
||||
assert.equal(whenWords(at(800 * 24 * H), now).split(" · ")[0], "2 years ago");
|
||||
// A time ahead of the clock is just now, and nothing readable gives nothing.
|
||||
assert.equal(whenWords(at(-H), now).split(" · ")[0], "just now");
|
||||
for (const bad of ["", null, undefined, "not a date"]) assert.equal(whenWords(bad, now), "");
|
||||
// A different year names the year, and the full stamp is the title's.
|
||||
assert.match(whenWords(at(800 * 24 * H), now), /[0-9]{4}/);
|
||||
assert.equal(whenTitle(at(H)), new Date(now - H).toLocaleString());
|
||||
assert.equal(whenTitle("nope"), "");
|
||||
assert.equal(agoWords(59 * 60_000), "59 min ago");
|
||||
});
|
||||
@@ -1430,7 +1430,7 @@ test("page rules: dropTab puts a tab just before another, or at the end", () =>
|
||||
test("page rules: the tab codes have sentences of their own", () => {
|
||||
for (const code of ["bad-name", "duplicate-name", "too-many-tabs", "no-such-tab"]) assert.ok(rules.ERROR_CODES.includes(code), code);
|
||||
assert.equal(rules.errorSentence("duplicate-name"), "There is already a tab with that name.");
|
||||
assert.equal(rules.errorSentence("no-such-tab"), "That tab is no longer in this notepad.");
|
||||
assert.equal(rules.errorSentence("no-such-tab"), "That tab is no longer in this Notebook.");
|
||||
assert.match(rules.errorSentence("too-many-tabs"), new RegExp(String(NOTEPAD_MAX_TABS)));
|
||||
});
|
||||
|
||||
|
||||
@@ -1850,6 +1850,8 @@ test("a drag on the board reaches a pointer game, a question mid-drag cancels it
|
||||
await openActivities(s);
|
||||
await s.page.keyboard.press(" ");
|
||||
assert.equal(await overlay(s), "", "running");
|
||||
// The dialog's opening motion must be over before the canvas is measured, or the box moves under the press.
|
||||
await s.page.evaluate(() => Promise.all(document.getAnimations().filter((a) => a.effect && a.effect.getTiming().iterations !== Infinity).map((a) => a.finished.catch(() => {}))));
|
||||
const box = await s.page.locator("#activities-canvas").boundingBox();
|
||||
const at = (dx, dy) => [box.x + dx, box.y + dy];
|
||||
await s.page.mouse.move(...at(40, 40));
|
||||
|
||||
@@ -342,6 +342,46 @@ test("the Subagents dialog shows the saved strength, explains the picked one, go
|
||||
assert.match(await textOf(help), /One step lighter everywhere/);
|
||||
});
|
||||
|
||||
// An unsaved edit never leaves the dialog silently: Cancel, Esc or a click
|
||||
// outside ask first, in Preferences' order, with focus on Keep editing.
|
||||
test("the Subagents dialog asks before it drops an edit, in Preferences' order, and closes at once when nothing changed", async (t) => {
|
||||
const s = await openSession(await suite.browser(), {
|
||||
t,
|
||||
workflow: "implement",
|
||||
payload: { agent: { status: "working", activity: "Task 1 of 2" } },
|
||||
});
|
||||
const modal = s.page.locator("#subagents-modal");
|
||||
const ask = modal.locator("#subagents-unsaved");
|
||||
const open = async () => {
|
||||
await s.page.locator("#btn-subagents").click();
|
||||
await modal.waitFor();
|
||||
};
|
||||
|
||||
await open();
|
||||
await modal.getByRole("button", { name: "Cancel", exact: true }).click();
|
||||
await modal.waitFor({ state: "hidden" });
|
||||
|
||||
await open();
|
||||
await modal.locator('input[name="subagents-strength"][value="best"]').check();
|
||||
await modal.getByRole("button", { name: "Cancel", exact: true }).click();
|
||||
await ask.waitFor();
|
||||
assert.match(await textOf(ask), /Discard your changes?/);
|
||||
assert.deepEqual(await ask.getByRole("button").allTextContents(), ["Keep editing", "Discard", "Save"]);
|
||||
assert.equal(await s.page.evaluate(() => document.activeElement.id), "subagents-unsaved-keep", "focus starts on Keep editing");
|
||||
await ask.getByRole("button", { name: "Keep editing" }).click();
|
||||
await ask.waitFor({ state: "hidden" });
|
||||
assert.equal(await modal.evaluate((d) => d.open), true, "Keep editing leaves the dialog open");
|
||||
assert.equal(await modal.locator('input[name="subagents-strength"][value="best"]').isChecked(), true, "and the edit stays");
|
||||
|
||||
await s.page.keyboard.press("Escape");
|
||||
await ask.waitFor();
|
||||
await ask.getByRole("button", { name: "Discard" }).click();
|
||||
await modal.waitFor({ state: "hidden" });
|
||||
|
||||
await open();
|
||||
assert.equal(await modal.locator('input[name="subagents-strength"][value="balanced"]').isChecked(), true, "Discard dropped the edit");
|
||||
});
|
||||
|
||||
// What a person sees break: the strength a helper ran with missing from the
|
||||
// tab, or a stray line under a helper that reported none.
|
||||
test("the Subagents tab shows a reported helper's strength line and none for a helper without one", async (t) => {
|
||||
@@ -535,3 +575,27 @@ test("the Ask for suggestions chip stays away while the loop drives, even on a c
|
||||
await s.page.locator("#thread-c1").waitFor();
|
||||
assert.equal(await chipOf(s).count(), 0, "no chip while the loop drives");
|
||||
});
|
||||
|
||||
// The top bar names its tools: the gear says User Preferences, and the home and
|
||||
// Subagents buttons carry a text label beside the icon above the narrow
|
||||
// breakpoint. The Subagents button opens a dialog, so it is not a toggle.
|
||||
test("the top bar names User Preferences, Dashboard and Subagents, and Subagents opens a dialog instead of toggling", async (t) => {
|
||||
const s = await openSession(await suite.browser(), {
|
||||
t,
|
||||
workflow: "implement",
|
||||
payload: { agent: { status: "working", activity: "Task 1 of 2" } },
|
||||
});
|
||||
await s.page.setViewportSize({ width: 1200, height: 800 });
|
||||
const gear = s.page.locator("#btn-looks");
|
||||
assert.equal(await gear.getAttribute("title"), "User Preferences");
|
||||
assert.equal(await gear.getAttribute("aria-label"), "User Preferences");
|
||||
const subs = s.page.locator("#btn-subagents");
|
||||
await subs.waitFor();
|
||||
assert.match(await textOf(subs), /^Subagents: (on|off)$/, "a text label beside the icon");
|
||||
assert.equal(await subs.getAttribute("aria-haspopup"), "dialog");
|
||||
assert.equal(await subs.getAttribute("aria-pressed"), null, "not a toggle");
|
||||
assert.match((await subs.getAttribute("aria-label")) || "", /^Subagents: (on|off)$/, "the state is in the label");
|
||||
assert.match(await textOf(s.page.locator("#btn-home")), /^Dashboard$/, "the way home is named");
|
||||
await s.page.setViewportSize({ width: 600, height: 800 });
|
||||
await s.page.waitForFunction(() => getComputedStyle(document.querySelector("#btn-subagents .topbar-label")).display === "none");
|
||||
});
|
||||
@@ -11,7 +11,7 @@ import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { gitInit } from "./skill-script-helpers.mjs";
|
||||
import { pageSuite, openSession, tempProject, sendAndCollect, itemCard, scrollTopOf, scrollCard, stylesOf, styleOf , fillBox, boxValue, settled } from "./page-test-helpers.mjs";
|
||||
import { pageSuite, openSession, tempProject, sendAndCollect, drawn, itemCard, scrollTopOf, scrollCard, stylesOf, styleOf , fillBox, boxValue, settled } from "./page-test-helpers.mjs";
|
||||
|
||||
const suite = pageSuite(test);
|
||||
|
||||
@@ -992,3 +992,114 @@ test("a long pick list draws group headings, opens a row, holds a locked row and
|
||||
const got = await sendAndCollect(s);
|
||||
assert.deepEqual(answerTo(got, "deps").ks.sort(), ["C1", "S1"], "the locked row never reaches the agent");
|
||||
});
|
||||
|
||||
// A multi card that starts with ticks (`ticked`) and notes its rows with a pill (`tag`).
|
||||
const carry = (extra = {}) => ({
|
||||
id: "carry",
|
||||
kind: "multi",
|
||||
title: "Carry over",
|
||||
body: "What to keep from your app.",
|
||||
options: [
|
||||
{ k: "A", text: "Colors", ticked: true, tag: "Keep", detail: "You did not ask to change them." },
|
||||
{ k: "B", text: "Layout", tag: "Free up", detail: "You asked to rethink the table." },
|
||||
{ k: "C", text: "Fonts", ticked: true, tag: "Keep" },
|
||||
],
|
||||
...extra,
|
||||
});
|
||||
|
||||
test("a multi's ticked rows open ticked and ready to send, its tags draw as pills the checkbox names, and sending untouched sends the ticks", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan" });
|
||||
const card = await ask(s, carry());
|
||||
|
||||
assert.equal(await card.getByLabel("A: Colors").isChecked(), true);
|
||||
assert.equal(await card.getByLabel("B: Layout").isChecked(), false);
|
||||
assert.equal(await card.getByLabel("C: Fonts").isChecked(), true);
|
||||
assert.equal(await s.page.locator("#btn-send").isDisabled(), false, "ready to send without a click");
|
||||
|
||||
// The pill is text on the row and part of the checkbox's accessible name (the key prefix stays).
|
||||
assert.deepEqual(await card.locator(".pill.tag").allTextContents(), ["Keep", "Free up", "Keep"]);
|
||||
assert.equal(await card.getByLabel("A: Colors, Keep").count(), 1);
|
||||
assert.equal(await card.getByLabel("B: Layout, Free up").count(), 1);
|
||||
// The pill is the agent's note: ticking a row does not move it.
|
||||
await card.getByLabel("B: Layout").check();
|
||||
assert.deepEqual(await card.locator(".pill.tag").allTextContents(), ["Keep", "Free up", "Keep"]);
|
||||
await card.getByLabel("B: Layout").uncheck();
|
||||
|
||||
const got = await sendAndCollect(s);
|
||||
assert.deepEqual(answerTo(got, "carry"), { ks: ["A", "C"] });
|
||||
assert.equal(got.reply, "Carry over: A, C");
|
||||
});
|
||||
|
||||
test("unticking every starting tick is an answer that reads none, and a cleared card is never re-ticked by a redraw or a reload", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan" });
|
||||
const card = await ask(s, carry());
|
||||
|
||||
await card.getByLabel("A: Colors").uncheck();
|
||||
await card.getByLabel("C: Fonts").uncheck();
|
||||
await card.getByLabel("C: Fonts").waitFor();
|
||||
assert.equal(await s.page.locator("#btn-send").isDisabled(), false, "an empty pick on a card with starting ticks is still sendable");
|
||||
|
||||
// An agent post redraws the page: the card stays cleared.
|
||||
s.post({ title: "Carry over", agent: { status: "waiting" } });
|
||||
await settled(s.page, "#main");
|
||||
assert.equal(await card.getByLabel("A: Colors").isChecked(), false);
|
||||
assert.equal(await card.getByLabel("C: Fonts").isChecked(), false);
|
||||
|
||||
// So does a reload.
|
||||
await s.page.reload({ waitUntil: "domcontentloaded" });
|
||||
await drawn(s.page);
|
||||
const again = itemCard(s.page, "carry");
|
||||
await again.waitFor();
|
||||
await settled(s.page, "#main");
|
||||
assert.equal(await again.getByLabel("A: Colors").isChecked(), false, "a reload never re-ticks a cleared card");
|
||||
assert.equal(await again.getByLabel("C: Fonts").isChecked(), false);
|
||||
assert.equal(await s.page.locator("#btn-send").isDisabled(), false);
|
||||
|
||||
const got = await sendAndCollect(s);
|
||||
assert.deepEqual(answerTo(got, "carry"), { ks: [] });
|
||||
assert.match(got.reply, /none$/);
|
||||
});
|
||||
|
||||
test("clearing the note on a card with starting ticks keeps its empty pick, so the card stays sendable", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan" });
|
||||
const card = await ask(s, carry());
|
||||
await card.getByLabel("A: Colors").uncheck();
|
||||
await card.getByLabel("C: Fonts").uncheck();
|
||||
const box = card.locator(".md-host");
|
||||
await fillBox(box, "only the logo");
|
||||
await fillBox(box, "");
|
||||
await settled(s.page, "#main");
|
||||
assert.equal(await s.page.locator("#btn-send").isDisabled(), false, "the empty pick is still an answer");
|
||||
const got = await sendAndCollect(s);
|
||||
assert.deepEqual(answerTo(got, "carry"), { ks: [] });
|
||||
});
|
||||
|
||||
test("a card with starting ticks cleared and sent with a note still says none, then the note", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan" });
|
||||
const card = await ask(s, carry());
|
||||
await card.getByLabel("A: Colors").uncheck();
|
||||
await card.getByLabel("C: Fonts").uncheck();
|
||||
await fillBox(card.locator(".md-host"), "keep the logo");
|
||||
await settled(s.page, "#main");
|
||||
const got = await sendAndCollect(s);
|
||||
assert.deepEqual(answerTo(got, "carry"), { ks: [], text: "keep the logo" });
|
||||
assert.equal(got.reply, "Carry over: none; keep the logo", "the agent hears the cleared pick, not the note alone");
|
||||
});
|
||||
|
||||
test("a multi with no ticked row still opens empty, and unticking its last box stages nothing", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan" });
|
||||
const card = await ask(s, {
|
||||
id: "plain",
|
||||
kind: "multi",
|
||||
title: "Columns",
|
||||
body: "Which?",
|
||||
options: [opt("1", "Date"), opt("2", "User")],
|
||||
});
|
||||
assert.equal(await card.getByLabel("Date").isChecked(), false);
|
||||
assert.equal(await s.page.locator("#btn-send").isDisabled(), true, "nothing ticked, nothing to send");
|
||||
await card.getByLabel("Date").check();
|
||||
assert.equal(await s.page.locator("#btn-send").isDisabled(), false);
|
||||
await card.getByLabel("Date").uncheck();
|
||||
await settled(s.page, "#main");
|
||||
assert.equal(await s.page.locator("#btn-send").isDisabled(), true, "unticking the last box is no answer, as before");
|
||||
});
|
||||
@@ -126,12 +126,12 @@ async function toTheMenu(s) {
|
||||
return main;
|
||||
}
|
||||
|
||||
// Sets the picker's "Hide unavailable workflows" switch. Looks are kept per
|
||||
// Sets the picker's "Hide unavailable skills" switch. Looks are kept per
|
||||
// console home, so each test sets the one it needs rather than trusting the
|
||||
// default.
|
||||
async function hideUnavailable(main, on) {
|
||||
const box = main.getByRole("switch", { name: "Hide unavailable workflows" });
|
||||
if ((await box.isChecked()) !== on) await main.getByText("Hide unavailable workflows").click();
|
||||
const box = main.getByRole("switch", { name: "Hide unavailable skills" });
|
||||
if ((await box.isChecked()) !== on) await main.getByText("Hide unavailable skills").click();
|
||||
assert.equal(await box.isChecked(), on);
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ test("a handoff shows as a dashed Handoff chip even with no spec, and picking it
|
||||
assert.equal(await main.getByRole("button", { name, exact: true }).count(), 1, `the preview has ${name}`);
|
||||
}
|
||||
assert.equal(await lightOf(main, "/plan2code-1-plan").count(), 0, "the skill cards give way to the preview");
|
||||
assert.equal(await main.getByRole("switch", { name: "Hide unavailable workflows" }).count(), 0, "and so does their toggle");
|
||||
assert.equal(await main.getByRole("switch", { name: "Hide unavailable skills" }).count(), 0, "and so does their toggle");
|
||||
});
|
||||
|
||||
// What a person would see break: Pick it up here sends nothing, or sends more
|
||||
@@ -553,21 +553,21 @@ test("the update banner shows on the dashboard only, and its dismiss hides it",
|
||||
const build = await openSession(browser, { t, workflow: "implement", payload: { agent: { status: "working", activity: "Task 1 of 1" } } });
|
||||
const dash = await openSession(browser, { t, workflow: "dashboard", payload: MENU, project: tempProject(DRAFT_PROJECT) });
|
||||
const main = await toTheMenu(dash);
|
||||
const banner = main.getByRole("button", { name: /UPDATE AVAILABLE · v99\.0\.0/ });
|
||||
const banner = main.getByRole("button", { name: /Update available · v99\.0\.0/ });
|
||||
await banner.waitFor();
|
||||
// The build's server booted under the same record; a later frame has landed
|
||||
// on its page by the time this text shows, and it still has no banner.
|
||||
build.post({ agent: { status: "working", activity: "Task 1 of 1, one more look" } });
|
||||
await build.page.getByText("Task 1 of 1, one more look").first().waitFor();
|
||||
assert.equal(await build.page.getByText("UPDATE AVAILABLE").count(), 0, "a build's page has no banner");
|
||||
assert.equal(await build.page.getByText("Update available").count(), 0, "a build's page has no banner");
|
||||
|
||||
await main.getByRole("button", { name: "Dismiss until next time" }).click();
|
||||
await banner.waitFor({ state: "hidden" });
|
||||
});
|
||||
|
||||
// Under the desktop app (PLAN2CODE_IN_APP=1) the banner shows too: the app
|
||||
// cannot replace itself, so a new release is a terminal command there as well,
|
||||
// and the modal says to run it outside the app and reopen the app.
|
||||
// Under the desktop app (PLAN2CODE_IN_APP=1) the banner shows too: the modal
|
||||
// points at the bar's Update and restart first, and keeps the command as the
|
||||
// fallback, run outside the app, then the app reopened.
|
||||
test("under the app, the update banner shows and its steps are worded for the app", async (t) => {
|
||||
aNewerReleaseExists(t);
|
||||
const dash = await openSession(await suite.browser(), {
|
||||
@@ -578,9 +578,10 @@ test("under the app, the update banner shows and its steps are worded for the ap
|
||||
env: { PLAN2CODE_IN_APP: "1" },
|
||||
});
|
||||
const main = await toTheMenu(dash);
|
||||
await main.getByRole("button", { name: /UPDATE AVAILABLE · v99\.0\.0/ }).click();
|
||||
await main.getByRole("button", { name: /Update available · v99\.0\.0/ }).click();
|
||||
const modal = dash.page.locator("#update-modal");
|
||||
await modal.waitFor();
|
||||
await modal.locator("#update-step-run strong", { hasText: "Update and restart" }).waitFor();
|
||||
await modal.getByText("a terminal outside the app", { exact: false }).waitFor();
|
||||
await modal.getByText("close the app and open it again", { exact: false }).waitFor();
|
||||
assert.equal(await modal.locator("#update-command code").textContent(), "plan2code update");
|
||||
@@ -866,3 +867,58 @@ test("every group keeps one card width and leaves no card alone on a row, at eac
|
||||
assert.ok(settled, `at ${width}, ${want} across, every row holding two cards or more, all one width: ${JSON.stringify(rows)}`);
|
||||
}
|
||||
});
|
||||
|
||||
// First run: until a skill has been launched from this machine, the dashboard
|
||||
// offers one call to action. The role line is held and Learning "Not set up"
|
||||
// waits at the bottom; after the first launch the quiet line shows.
|
||||
function savedLooksFile(t, looks) {
|
||||
const file = path.join(HOME, "looks.json");
|
||||
fs.mkdirSync(HOME, { recursive: true });
|
||||
fs.writeFileSync(file, JSON.stringify({ looks }));
|
||||
t.after(() => fs.rmSync(file, { force: true }));
|
||||
}
|
||||
|
||||
test("before the first launch the dashboard holds the role line and draws Learning at the bottom", async (t) => {
|
||||
savedLooksFile(t, { welcomeSeen: true });
|
||||
const project = tempProject(DRAFT_PROJECT);
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "dashboard", payload: MENU, project });
|
||||
const main = await toTheMenu(s);
|
||||
assert.equal(await main.locator(".dash-extras").count(), 0, "no optional extras on the first dashboard");
|
||||
assert.equal(await main.locator(".dash-nudge").filter({ hasText: "role" }).count(), 0, "and no role banner");
|
||||
await main.locator(".learn-row.is-not-set-up").waitFor();
|
||||
assert.equal(await main.locator(".learn-row.is-top").count(), 0, "Learning Not set up is not at the top");
|
||||
assert.equal(await main.locator(".learn-row.is-bottom.is-not-set-up").count(), 1, "it sits at the bottom");
|
||||
assert.doesNotMatch(await main.locator(".learn-row .btn").first().getAttribute("class"), /primary/, "with a plain button");
|
||||
});
|
||||
|
||||
test("after the first launch one quiet line offers the role and Learning, and a launch sets the flag", async (t) => {
|
||||
savedLooksFile(t, { welcomeSeen: true });
|
||||
const project = tempProject(DRAFT_PROJECT);
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "dashboard", payload: MENU, project });
|
||||
const main = await toTheMenu(s);
|
||||
assert.equal(await main.locator(".dash-extras").count(), 0);
|
||||
const planCard = main.getByRole("button").filter({ has: s.page.locator("code", { hasText: /^\/plan2code-1-plan$/ }) });
|
||||
await planCard.click();
|
||||
await main.getByRole("button", { name: "Start Plan" }).click();
|
||||
assert.ok(
|
||||
await until(() => s.page.evaluate(async () => ((await (await fetch("/looks")).json()).looks || {}).skillLaunched === true)),
|
||||
"the first launch saved the flag"
|
||||
);
|
||||
// Back to default keeps it.
|
||||
const kept = await s.page.evaluate(async () => {
|
||||
const { resetLooks, looks } = await import("/looks.js");
|
||||
resetLooks();
|
||||
return (await import("/looks.js")).looks.skillLaunched;
|
||||
});
|
||||
assert.equal(kept, true, "Back to default never clears the flag");
|
||||
});
|
||||
|
||||
test("with the flag set the dashboard shows the quiet extras line", async (t) => {
|
||||
savedLooksFile(t, { welcomeSeen: true, skillLaunched: true });
|
||||
const project = tempProject(DRAFT_PROJECT);
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "dashboard", payload: MENU, project });
|
||||
const main = await toTheMenu(s);
|
||||
const line = main.locator(".dash-extras");
|
||||
await line.waitFor();
|
||||
assert.match(await textOf(line), /Two optional extras: set your role, switch on Learning\./);
|
||||
});
|
||||
@@ -220,7 +220,7 @@ test("the commit table keeps the person's ticks across an agent post, and a clic
|
||||
assert.equal(await tickBox(page, "notes.md").isChecked(), false, "an agent post put the tick back");
|
||||
assert.equal(await tickBox(page, "src/app.js").isChecked(), true);
|
||||
// Their click goes out with the one file. Then the agent commits it and a new file turns up.
|
||||
await page.locator(".git-panel-actions").getByRole("button", { name: "Commit 1 file" }).click();
|
||||
await stepButton(page, "Commit 1 file").click();
|
||||
assert.deepEqual(s.wait(10).actions[0].files, ["src/app.js"]);
|
||||
const g = gitInit(dir, "feature/x");
|
||||
g("add", "src/app.js");
|
||||
@@ -311,3 +311,32 @@ test("over the git board a note box grows with its text, and the no-repo note on
|
||||
await itemCard(bare.page, "y1").waitFor();
|
||||
assert.match(await textOf(aside), /asks above what to do/);
|
||||
});
|
||||
|
||||
// The three W25 leftovers, checked against the current build.
|
||||
test("the Changes tab offers one Commit N files, Send is gone with nothing to send, and Done with git sits outside the tablist", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "git", project: changesProject({ branch: "feature/x" }), payload: READY });
|
||||
const { page } = s;
|
||||
await page.getByRole("tablist").waitFor();
|
||||
await stepButton(page, "Commit 2 files").waitFor();
|
||||
// One Commit N files across the whole board, not one in the step and one in the table.
|
||||
assert.equal(await page.getByRole("button", { name: /^Commit \d+ files?$/ }).count(), 1, "one commit button on the Changes tab");
|
||||
assert.equal(await page.locator(".git-panel-actions").getByRole("button", { name: /^Commit \d+ files?$/ }).count(), 0, "the table carries no second one");
|
||||
// Unticking a file moves the one button's count.
|
||||
await tickBox(page, "notes.md").uncheck();
|
||||
await stepButton(page, "Commit 1 file").waitFor();
|
||||
|
||||
// No open card and nothing staged: the footer keeps its words, the Send button is not drawn.
|
||||
assert.equal(await page.locator("#btn-send").isHidden(), true, "no Send button on a board with nothing to send");
|
||||
assert.match((await page.locator("#footer-summary").innerText()).trim(), /Nothing to send yet/, "the status words stay");
|
||||
|
||||
// Done with git is beside the tablist, not one of its tabs, and at the right end of the row.
|
||||
const done = page.getByRole("button", { name: "Done with git" });
|
||||
assert.equal(await page.getByRole("tablist").getByRole("button", { name: "Done with git" }).count(), 0, "not inside the tablist");
|
||||
const [tabs, btn] = await Promise.all([page.getByRole("tablist").boundingBox(), done.boundingBox()]);
|
||||
assert.ok(btn.x >= tabs.x + tabs.width - 1, "to the right of the tabs");
|
||||
});
|
||||
|
||||
test("a card open on the board brings the Send button back", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "git", project: changesProject({ branch: "feature/x" }), payload: { ...READY, items: [confirmCard] } });
|
||||
await s.page.locator("#btn-send").waitFor({ state: "visible" });
|
||||
});
|
||||
@@ -11,7 +11,7 @@ import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { pageSuite, openSession, tempProject, textOf, drawn , fillBox} from "./page-test-helpers.mjs";
|
||||
import { pageSuite, openSession, tempProject, textOf, drawn, fillBox, itemCard, boxValue } from "./page-test-helpers.mjs";
|
||||
import { HOME, cli, until } from "./web-console-test-helpers.mjs";
|
||||
import { HELP_TABS } from "../src/web-console/public/help.js";
|
||||
import { CATALOG_GROUPS, SKILL_CATALOG } from "../src/web-console/public/answers.js";
|
||||
@@ -274,7 +274,7 @@ test("the update banner opens a modal with the exact update commands, and its di
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "dashboard", payload: { agent: { status: "waiting" } }, project: tempProject() });
|
||||
await toTheDashboard(s);
|
||||
const main = s.page.locator("#main");
|
||||
await main.getByRole("button", { name: /UPDATE AVAILABLE · v99\.0\.0/ }).click();
|
||||
await main.getByRole("button", { name: /Update available · v99\.0\.0/ }).click();
|
||||
|
||||
const modal = s.page.locator("#update-modal");
|
||||
await modal.waitFor();
|
||||
@@ -283,21 +283,27 @@ test("the update banner opens a modal with the exact update commands, and its di
|
||||
assert.equal(await releases.getAttribute("href"), RELEASES_URL);
|
||||
assert.equal(await releases.getAttribute("rel"), "noopener noreferrer");
|
||||
assert.equal(await textOf(s.page.locator("#update-command code")), "plan2code update");
|
||||
// Step 1 is one sentence and the command; the rest waits in a closed disclosure.
|
||||
const more = s.page.locator("#update-more");
|
||||
assert.equal(await more.evaluate((node) => node.open), false, "the extra help starts closed");
|
||||
assert.equal(await textOf(more.locator("summary")), "Command not found, or nothing happened?");
|
||||
await more.locator("summary").click();
|
||||
assert.equal(
|
||||
await textOf(s.page.locator("#update-fallback code")),
|
||||
"npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git"
|
||||
"npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release"
|
||||
);
|
||||
assert.match(await textOf(more), /git ls-remote https:\/\/github\.com\/jparkerweb\/plan2code\.git/);
|
||||
await s.page.locator("#update-done").click();
|
||||
await modal.waitFor({ state: "hidden" });
|
||||
|
||||
// The ×: gone now, remembered under this session's key, and still gone after a reload.
|
||||
await main.getByRole("button", { name: "Dismiss until next time" }).click();
|
||||
await main.getByRole("button", { name: /UPDATE AVAILABLE/ }).waitFor({ state: "hidden" });
|
||||
await main.getByRole("button", { name: /Update available/ }).waitFor({ state: "hidden" });
|
||||
assert.equal(await s.page.evaluate((k) => sessionStorage.getItem(k), "p2c-update-dismissed:" + s.sid), "99.0.0");
|
||||
await s.page.reload({ waitUntil: "domcontentloaded" });
|
||||
await drawn(s.page);
|
||||
await toTheDashboard(s);
|
||||
assert.equal(await main.getByRole("button", { name: /UPDATE AVAILABLE/ }).count(), 0, "the banner came back after a reload");
|
||||
assert.equal(await main.getByRole("button", { name: /Update available/ }).count(), 0, "the banner came back after a reload");
|
||||
});
|
||||
|
||||
// Under the app Help's update line names both notices, says the command runs
|
||||
@@ -389,7 +395,7 @@ test("under the app, Help's dashboard and Continue here explainers point at the
|
||||
});
|
||||
|
||||
// The Welcome dialog's own onboarding tip gave the same classic-only advice.
|
||||
test("under the app, the Welcome dialog's refresh tip names New Session, not a new conversation", async (t) => {
|
||||
test("under the app, the Welcome dialog's terminal tip names the terminal panel and teaches Send", async (t) => {
|
||||
savedLooks(t, null);
|
||||
const s = await openSession(await suite.browser(), {
|
||||
t,
|
||||
@@ -401,9 +407,9 @@ test("under the app, the Welcome dialog's refresh tip names New Session, not a n
|
||||
await toTheDashboard(s);
|
||||
const welcome = s.page.locator("#welcome-modal");
|
||||
await welcome.waitFor();
|
||||
const text = s.page.locator("#welcome-refresh-text");
|
||||
await text.getByText("press New Session at the top of the window", { exact: false }).waitFor();
|
||||
assert.equal(await text.getByText("new conversation", { exact: false }).count(), 0, "no classic-mode wording under the app");
|
||||
const text = s.page.locator("#welcome-terminal-text");
|
||||
await text.getByText("asking permission in the terminal panel", { exact: false }).waitFor();
|
||||
assert.match(await textOf(welcome), /Nothing leaves this page until you press Send to Plan2Code/, "the Welcome teaches Send");
|
||||
});
|
||||
|
||||
// The Troubleshooting tab's own "getting a new link" recovery flow is
|
||||
@@ -536,7 +542,9 @@ for (const inApp of [true, false]) {
|
||||
});
|
||||
const texts = await visibleHelpText(s);
|
||||
const hits = [];
|
||||
for (const [tab, text] of Object.entries(texts)) {
|
||||
for (const [tab, rawText] of Object.entries(texts)) {
|
||||
// "Reset this tab" is a button's name, not a mode's wording.
|
||||
const text = rawText.replace(/Reset this tab/g, "Reset");
|
||||
for (const re of inApp ? BROWSER_ONLY : APP_ONLY) {
|
||||
const hit = text.match(re);
|
||||
if (hit) hits.push(`${tab}: ...${text.slice(Math.max(0, hit.index - 50), hit.index + 50).replace(/\s+/g, " ")}...`);
|
||||
@@ -548,3 +556,86 @@ for (const inApp of [true, false]) {
|
||||
assert.match(all, inApp ? /terminal panel/ : /your terminal/);
|
||||
});
|
||||
}
|
||||
|
||||
test("? opens Help from the page, but not from a text box or behind a dialog", async (t) => {
|
||||
savedLooks(t, { welcomeSeen: true });
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
const box = itemCard(s.page, "q1").locator(".md-host, input[type=text], textarea").first();
|
||||
await box.waitFor();
|
||||
// From a text box the ? is a typed character, and Help stays shut.
|
||||
await fillBox(box, "why");
|
||||
await s.page.evaluate(() => document.querySelector("#main .md-host").field.focus());
|
||||
await s.page.keyboard.type("?");
|
||||
assert.equal(await helpModal(s).isVisible(), false, "typing ? in a box does not open Help");
|
||||
assert.match(await boxValue(box), /why\?/, "the ? was typed");
|
||||
// Behind a dialog it does nothing either.
|
||||
await s.page.click("#btn-looks");
|
||||
await s.page.locator("#looks-modal[open]").waitFor();
|
||||
await s.page.keyboard.press("?");
|
||||
assert.equal(await helpModal(s).isVisible(), false, "no Help behind another dialog");
|
||||
await s.page.keyboard.press("Escape");
|
||||
await s.page.locator("#looks-modal[open]").waitFor({ state: "detached" });
|
||||
// From the page itself it opens Help on the same topic the ? button would.
|
||||
await s.page.locator("#title").click();
|
||||
await s.page.keyboard.press("?");
|
||||
await helpModal(s).waitFor();
|
||||
const viaKey = await selectedTab(s).getAttribute("id");
|
||||
await s.page.keyboard.press("Escape");
|
||||
await helpModal(s).waitFor({ state: "hidden" });
|
||||
await s.page.click("#btn-about");
|
||||
await helpModal(s).waitFor();
|
||||
assert.equal(viaKey, await selectedTab(s).getAttribute("id"), "the key opens the topic the button opens");
|
||||
});
|
||||
|
||||
test("Help's topics sit under four group headings that the arrow keys skip, and the filter hides what does not match", async (t) => {
|
||||
savedLooks(t, { welcomeSeen: true });
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
await openHelp(s);
|
||||
const heads = s.page.locator("#help-tabs .help-tab-group");
|
||||
assert.deepEqual(await heads.allTextContents(), ["Start here", "Working in a session", "Tools", "Reference"]);
|
||||
assert.equal(await s.page.locator("#help-tabs .help-tab-group[tabindex]").count(), 0, "a heading is no tab stop");
|
||||
assert.equal(await s.page.locator("#help-tabs [role=tab]").count(), HELP_TABS.length, "only topics are tabs");
|
||||
// The arrow keys walk topics, never the headings: from "stuck" the next is "around".
|
||||
await tabButton(s, "stuck").click();
|
||||
await s.page.keyboard.press("ArrowDown");
|
||||
assert.equal(await focusedId(s), "help-tab-around");
|
||||
|
||||
// The filter: by label, and by words inside a panel; a heading with nothing left goes too.
|
||||
const filter = s.page.locator("#help-filter");
|
||||
await filter.fill("git board");
|
||||
const visible = async () => s.page.locator("#help-tabs [role=tab]:not([hidden])").evaluateAll((n) => n.map((b) => b.id.replace("help-tab-", "")));
|
||||
assert.ok((await visible()).includes("git"), "the git board topic stays");
|
||||
assert.ok(!(await visible()).includes("planny"), "an unrelated topic goes");
|
||||
// Arrow keys now walk only what is shown.
|
||||
const first = (await visible())[0];
|
||||
await tabButton(s, first).click();
|
||||
await s.page.keyboard.press("ArrowDown");
|
||||
assert.ok((await visible()).includes((await focusedId(s)).replace("help-tab-", "")), "focus stays on a shown topic");
|
||||
await filter.fill("zzzz-nothing");
|
||||
assert.equal(await s.page.locator("#help-filter-empty").isVisible(), true, "says nothing matches");
|
||||
assert.equal(await s.page.locator("#help-tabs .help-tab-group:not([hidden])").count(), 0, "a heading with no topic left goes too");
|
||||
await filter.fill("");
|
||||
assert.equal((await visible()).length, HELP_TABS.length, "cleared, every topic is back");
|
||||
assert.equal(await s.page.locator("#help-tabs .help-tab-group:not([hidden])").count(), 4);
|
||||
});
|
||||
|
||||
test("with a filter typed the topic list stays reachable by keyboard, and a closed Help forgets the filter", async (t) => {
|
||||
savedLooks(t, { welcomeSeen: true });
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
await openHelp(s);
|
||||
const filter = s.page.locator("#help-filter");
|
||||
// The selected topic (the first) is filtered away: some shown topic must still be a tab stop.
|
||||
await filter.fill("git board");
|
||||
assert.equal(await s.page.locator("#help-tabs [role=tab][tabindex='0']:not([hidden])").count(), 1, "one shown tab stop");
|
||||
await filter.press("ArrowDown");
|
||||
const focused = await focusedId(s);
|
||||
assert.match(focused, /^help-tab-/, "the down arrow steps into the topics");
|
||||
assert.equal(await s.page.locator("#" + focused).isHidden(), false, "a shown one");
|
||||
// Close with the filter still typed: the next open starts clean, on a shown topic.
|
||||
await s.page.keyboard.press("Escape");
|
||||
await helpModal(s).waitFor({ state: "hidden" });
|
||||
await openHelp(s);
|
||||
assert.equal(await filter.inputValue(), "", "the filter is cleared");
|
||||
assert.equal(await s.page.locator("#help-tabs [role=tab]:not([hidden])").count(), HELP_TABS.length, "every topic is back");
|
||||
assert.equal(await focusedId(s), "help-tab-" + HELP_TABS[0].id, "focus lands on the topic Help opened on");
|
||||
});
|
||||
@@ -65,14 +65,21 @@ for (const [state, pill] of [
|
||||
["not-set-up", "Not set up"],
|
||||
["off", "Off"],
|
||||
]) {
|
||||
test(`${state}: the row sits under the picker with its pill and Switch on`, async (t) => {
|
||||
test(`${state}: the row sits where its state puts it, with its pill and Switch on`, async (t) => {
|
||||
const { main } = await dashboard(t, PROJECT(state === "not-set-up" ? null : state));
|
||||
const row = main.locator("section.learn-row");
|
||||
await row.waitFor();
|
||||
const where = await placeOf(main);
|
||||
assert.equal(where.rows, 1);
|
||||
assert.equal(where.row, where.toggle + 1, "directly after the hide-unavailable toggle");
|
||||
assert.ok(where.row < where.firstGroup, "above the card groups");
|
||||
if (state === "not-set-up") {
|
||||
// A newcomer's first dashboard offers one call to action, so Not set up waits at the bottom.
|
||||
assert.ok(where.row > where.lastGroup, "after the card groups");
|
||||
assert.equal(where.row, where.tip - 1, "directly before the approval tip");
|
||||
assert.equal(await row.getByRole("button", { name: "Switch on" }).evaluate((b) => b.classList.contains("primary")), false, "a plain button");
|
||||
} else {
|
||||
assert.equal(where.row, where.toggle + 1, "directly after the hide-unavailable toggle");
|
||||
assert.ok(where.row < where.firstGroup, "above the card groups");
|
||||
}
|
||||
assert.equal((await row.locator(".learn-pill").textContent()).trim(), pill);
|
||||
assert.equal(await row.getByRole("button", { name: "Switch on" }).isEnabled(), true);
|
||||
if (state === "not-set-up") {
|
||||
|
||||
@@ -391,6 +391,22 @@ test("a note that cannot be read leaves the editor read-only, and nothing typed
|
||||
assert.equal(await shows(s, "The real note"), "The real note");
|
||||
});
|
||||
|
||||
test("a Notebook that cannot be read offers Try again, which reads it again and clears the line", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
saveNote(s.project, "The real note");
|
||||
await s.page.route("**/notepad", (route) => (route.request().method() === "GET" ? route.abort() : route.continue()));
|
||||
await s.page.click("#btn-notepad");
|
||||
await s.page.locator("#notepad-modal[open]").waitFor();
|
||||
const retry = s.page.locator("#notepad-retry");
|
||||
await retry.waitFor();
|
||||
assert.equal(await retry.innerText(), "Try again");
|
||||
await s.page.unroute("**/notepad");
|
||||
await retry.click();
|
||||
await retry.waitFor({ state: "hidden" });
|
||||
assert.equal(await shows(s, "The real note"), "The real note");
|
||||
assert.equal(await s.page.locator("#notepad-status").innerText(), "", "the read-failure line is gone");
|
||||
});
|
||||
|
||||
test("a note too long to save keeps its text when the notepad is closed and opened again", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
saveNote(s.project, "Saved earlier");
|
||||
@@ -914,7 +930,7 @@ const sendPicture = (s, kind, color) =>
|
||||
{ kind, fill: color },
|
||||
);
|
||||
|
||||
test("Add image, paste and drop each add a thumbnail whose files are on disk and which survives closing", async (t) => {
|
||||
test("Add picture, paste and drop each add a thumbnail whose files are on disk and which survives closing", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
await openNotepad(s);
|
||||
assert.equal(await thumbs(s).count(), 0);
|
||||
@@ -931,9 +947,9 @@ test("Add image, paste and drop each add a thumbnail whose files are on disk and
|
||||
assert.equal(await docText(s), "", "no picture landed in the text");
|
||||
|
||||
const alts = await s.page.locator("#notepad-strip img").evaluateAll((imgs) => imgs.map((i) => i.alt));
|
||||
assert.deepEqual(alts, ["Notebook image 1", "Notebook image 2", "Notebook image 3"]);
|
||||
assert.deepEqual(alts, ["Notebook picture 1", "Notebook picture 2", "Notebook picture 3"]);
|
||||
const xs = await s.page.locator("#notepad-strip .notepad-thumb-delete").evaluateAll((b) => b.map((x) => x.getAttribute("aria-label")));
|
||||
assert.deepEqual(xs, ["Delete image 1", "Delete image 2", "Delete image 3"]);
|
||||
assert.deepEqual(xs, ["Delete picture 1", "Delete picture 2", "Delete picture 3"]);
|
||||
|
||||
// Closed and opened again, the strip is drawn from the stored pictures,
|
||||
// oldest first, each from its stored thumbnail.
|
||||
@@ -972,7 +988,7 @@ test("the X asks first: Keep keeps the picture, Delete removes both its files",
|
||||
|
||||
await s.page.click("#notepad-strip li:nth-child(1) .notepad-thumb-delete");
|
||||
await s.page.locator(".notepad-ask").waitFor();
|
||||
assert.match(await s.page.locator(".notepad-ask").innerText(), /Delete this image\?/);
|
||||
assert.match(await s.page.locator(".notepad-ask").innerText(), /Delete this picture?\?/);
|
||||
assert.equal(await s.page.evaluate(() => document.activeElement.textContent), "Keep", "Keep has the focus");
|
||||
assert.deepEqual(filesOf(s, first), [true, true], "one click deleted nothing");
|
||||
// Enter on the focused button keeps it.
|
||||
@@ -986,7 +1002,7 @@ test("the X asks first: Keep keeps the picture, Delete removes both its files",
|
||||
await until(() => !filesOf(s, first).some(Boolean), 4000);
|
||||
await s.page.waitForFunction(() => document.querySelectorAll("#notepad-strip > li").length === 1);
|
||||
assert.deepEqual(stored(s).map((img) => img.id), [second]);
|
||||
assert.equal(await s.page.locator("#notepad-strip img").getAttribute("alt"), "Notebook image 1");
|
||||
assert.equal(await s.page.locator("#notepad-strip img").getAttribute("alt"), "Notebook picture 1");
|
||||
});
|
||||
|
||||
test("the preview opens at the clicked picture, steps and wraps, and Esc closes it before the Notebook", async (t) => {
|
||||
@@ -1103,7 +1119,7 @@ test("a delete that fails keeps the thumbnail and says why", async (t) => {
|
||||
await s.page.waitForFunction(() => !document.querySelector(".notepad-ask"));
|
||||
assert.equal(await thumbs(s).count(), 1);
|
||||
assert.deepEqual(filesOf(s, id), [true, true]);
|
||||
assert.equal(await s.page.evaluate(() => document.activeElement.getAttribute("aria-label")), "Delete image 1", "the focus is back on the X");
|
||||
assert.equal(await s.page.evaluate(() => document.activeElement.getAttribute("aria-label")), "Delete picture 1", "the focus is back on the X");
|
||||
});
|
||||
|
||||
/* ------------------------------------------------- Cleanup, phone, Help */
|
||||
@@ -1141,6 +1157,9 @@ test("User Preferences, Cleanup offers a month-old notepad by its folder and rem
|
||||
assert.ok((await list.locator(".cleanup-summary").innerText()).includes("1 old notebook"), "the summary counts it as a notepad");
|
||||
assert.equal(await list.locator(".cleanup-row").filter({ hasText: "notepads/" }).count(), 0, "the notepads folder is no stray");
|
||||
assert.equal(fs.existsSync(notepadFolder(s.project)), true, "a scan only looks");
|
||||
// A Notebook is your own writing, so it starts unticked: deleting it is a choice.
|
||||
assert.equal(await row.locator("input[type=checkbox]").isChecked(), false, "a Notebook starts unticked");
|
||||
await row.locator("input[type=checkbox]").check();
|
||||
|
||||
await s.page.click("#cleanup-delete");
|
||||
await s.page.waitForFunction(() => /^Deleted /.test(document.getElementById("cleanup-status").textContent));
|
||||
@@ -1163,6 +1182,7 @@ test("the notepad works at phone width: full screen, nothing wider than the wind
|
||||
await openNotepad(s);
|
||||
await addViaButton(s, "#c33");
|
||||
await noSideScroll("the notepad");
|
||||
await s.page.waitForFunction(() => document.getElementById("notepad-modal").getAnimations().length === 0);
|
||||
const modal = await box("#notepad-modal");
|
||||
assert.deepEqual([modal.x, modal.y, modal.width, modal.height], [0, 0, 390, 844], "the notepad fills the screen");
|
||||
const inner = await s.page.$eval("#notepad-modal", (m) => ({ sw: m.scrollWidth, cw: m.clientWidth }));
|
||||
@@ -1171,9 +1191,10 @@ test("the notepad works at phone width: full screen, nothing wider than the wind
|
||||
const x = await box(".notepad-thumb-delete");
|
||||
assert.ok(x.width >= 30 && x.height >= 30, "the X is big enough to tap");
|
||||
const strip = await box("#notepad-strip");
|
||||
assert.ok(strip.width > 300, "the pictures get the full width under Add image");
|
||||
assert.ok(strip.width > 300, "the pictures get the full width under Add picture");
|
||||
|
||||
await s.page.click(".attach-open");
|
||||
await s.page.waitForFunction(() => document.getElementById("picview").getAnimations().length === 0);
|
||||
await s.page.locator("#picview[open]").waitFor();
|
||||
await noSideScroll("the preview");
|
||||
const img = await box("#picview-img");
|
||||
|
||||
@@ -12,7 +12,7 @@ import path from "node:path";
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { pageSuite, openSession, textOf, drawn, styleOf, stylesOf } from "./page-test-helpers.mjs";
|
||||
import { HOME, MODELS_DIR, backdate } from "./web-console-test-helpers.mjs";
|
||||
import { HOME, MODELS_DIR, backdate, until } from "./web-console-test-helpers.mjs";
|
||||
import { formatBytes } from "../src/web-console/public/answers.js";
|
||||
|
||||
const suite = pageSuite(test);
|
||||
@@ -208,7 +208,8 @@ function seedShippedModels(t) {
|
||||
fs.writeFileSync(
|
||||
SHIPPED_FILE,
|
||||
JSON.stringify({
|
||||
claude: [{ id: "sonnet", label: "Sonnet" }, { id: "opus", label: "Opus" }],
|
||||
// Labels as models.json ships them: the description only, the id printed beside it.
|
||||
claude: [{ id: "sonnet", label: "latest Sonnet" }, { id: "opus", label: "latest Opus" }],
|
||||
devin: [{ id: "swe-2-medium", label: "SWE 2 Medium" }, { id: "swe-2-high", label: "SWE 2 High" }, { id: "claude-opus-5-5-medium", label: "Opus 5.5 Medium" }],
|
||||
codex: [],
|
||||
strengths: {
|
||||
@@ -243,9 +244,13 @@ test("Agents & models: Claude's panel shows the shipped rows as default, and onl
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
await openAgentsTab(s);
|
||||
// The card already shows what each strength uses.
|
||||
assert.match(await textOf(agentCard(s, "cli:claude").locator(".card-tiers")), /Thrifty\s+Sonnet · low[\s\S]*Best\s+Opus · medium/);
|
||||
// A card line names the model by its id; the description is its tooltip.
|
||||
assert.match(await textOf(agentCard(s, "cli:claude").locator(".card-tiers")), /Thrifty\s+sonnet · low[\s\S]*Best\s+opus · medium/);
|
||||
assert.equal(await agentCard(s, "cli:claude").locator(".card-tier span[title]").first().getAttribute("title"), "latest Sonnet");
|
||||
await openAgent(s, "Claude");
|
||||
assert.equal(await textOf(loopRow(s, "thrifty").locator(".strength-model")), "Sonnet");
|
||||
// The picked model reads as the model rows do: its description with the id beside it.
|
||||
assert.match(await textOf(loopRow(s, "thrifty").locator(".strength-model")), /^latest Sonnet\s+sonnet$/);
|
||||
assert.equal(await textOf(loopRow(s, "thrifty").locator(".strength-model code")), "sonnet");
|
||||
assert.equal(await loopRow(s, "thrifty").locator('select[data-field="effort"]').inputValue(), "low");
|
||||
assert.equal(await wordPill(s, "best", "opus").getAttribute("aria-pressed"), "true");
|
||||
assert.equal(await wordPill(s, "best", "sonnet").getAttribute("aria-pressed"), "false");
|
||||
@@ -268,7 +273,7 @@ test("Agents & models: Claude's panel shows the shipped rows as default, and onl
|
||||
assert.deepEqual(savedStrengths(), { claude: { thrifty: { model: "opus", effort: "low" } } }, "only the changed row is written");
|
||||
|
||||
await loopRow(s, "thrifty").locator(".strength-reset").click();
|
||||
assert.equal(await textOf(loopRow(s, "thrifty").locator(".strength-model")), "Sonnet", "Reset restores the shipped row");
|
||||
assert.match(await textOf(loopRow(s, "thrifty").locator(".strength-model")), /^latest Sonnet\s+sonnet$/, "Reset restores the shipped row");
|
||||
assert.equal(await textOf(loopRow(s, "thrifty").locator(".strength-default")), "default");
|
||||
await agentForm(s).locator(".prefs-unsaved-badge").waitFor();
|
||||
await formButton(s, "Save").click();
|
||||
@@ -556,7 +561,12 @@ test("Agents & models: an unsaved edit asks first on Close, a scrim click, Esc,
|
||||
await edit(`alpha-${name}-kept`);
|
||||
await leave();
|
||||
await unsavedPrompt(s).waitFor();
|
||||
assert.equal(await s.page.evaluate(() => document.activeElement?.id), "prefs-unsaved-save", `${name}: Save has focus`);
|
||||
assert.equal(await s.page.evaluate(() => document.activeElement?.id), "prefs-unsaved-keep", `${name}: Keep editing has focus`);
|
||||
assert.deepEqual(
|
||||
await unsavedPrompt(s).locator("button").allInnerTexts(),
|
||||
["Keep editing", "Discard", "Save"],
|
||||
`${name}: the Lessons prompt's order`,
|
||||
);
|
||||
await unsavedPrompt(s).getByRole("button", { name: "Keep editing" }).click();
|
||||
await unsavedPrompt(s).waitFor({ state: "hidden" });
|
||||
assert.equal(await modal.evaluate((d) => d.open), true, `${name}: the dialog stays open`);
|
||||
@@ -693,7 +703,7 @@ test("Cleanup scans the console home and lists an old session folder with its si
|
||||
const dir = path.join(HOME, "sessions", sid);
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
const state = path.join(dir, "state.json");
|
||||
fs.writeFileSync(state, "x".repeat(3000));
|
||||
fs.writeFileSync(state, JSON.stringify({ title: "shop", workflow: "pathfinder", pad: "x".repeat(3000) }));
|
||||
backdate(state);
|
||||
backdate(dir);
|
||||
t.after(() => fs.rmSync(dir, { recursive: true, force: true }));
|
||||
@@ -704,18 +714,42 @@ test("Cleanup scans the console home and lists an old session folder with its si
|
||||
assert.equal(await list.locator(".cleanup-row").count(), 0, "Cleanup lists things before a scan");
|
||||
assert.equal(await s.page.locator("#cleanup-delete").isHidden(), true, "Delete is offered before a scan");
|
||||
await s.page.click("#cleanup-scan");
|
||||
const row = list.locator(".cleanup-row").filter({ hasText: sid });
|
||||
const row = list.locator(".cleanup-row").filter({ hasText: "Pathfinder · shop" });
|
||||
await row.waitFor();
|
||||
assert.match(await textOf(row), new RegExp(`^Session ${sid}`));
|
||||
assert.match(await textOf(row), /^Pathfinder · shop · [0-9]+ (weeks|months) ago/, "a session is named by its skill, title and age, not its folder");
|
||||
assert.equal(await row.locator("input[type=checkbox]").isChecked(), true, "a session starts ticked");
|
||||
const size = await textOf(row.locator(".cleanup-size"));
|
||||
assert.match(size, /^\d/, "the row names a size");
|
||||
assert.ok(size === formatBytes(3000) || /^[\d.,]+\s*(kB|KB|MB|B)\b/.test(size), `the size reads as a size: ${size}`);
|
||||
assert.ok(size === formatBytes(3040) || /^[\d.,]+\s*(kB|KB|MB|B)\b/.test(size), `the size reads as a size: ${size}`);
|
||||
assert.match(await textOf(s.page.locator("#cleanup-delete")), /^Delete 1 item · /, "the button says what it will do");
|
||||
// Unticking everything leaves nothing to send.
|
||||
await row.locator("input[type=checkbox]").uncheck();
|
||||
assert.equal(await s.page.locator("#cleanup-delete").isDisabled(), true, "nothing ticked, nothing to delete");
|
||||
assert.match(await textOf(s.page.locator("#cleanup-delete")), /^Nothing ticked/);
|
||||
await row.locator("input[type=checkbox]").check();
|
||||
assert.match(await textOf(list.locator(".cleanup-summary")), /1 old session/);
|
||||
assert.match(await textOf(s.page.locator("#cleanup-status")), /^Found \d+ items?\./);
|
||||
assert.equal(await s.page.locator("#cleanup-delete").isVisible(), true, "Delete these is offered once something is found");
|
||||
// The scan only looks.
|
||||
assert.equal(fs.existsSync(dir), true, "a scan deleted the folder");
|
||||
|
||||
// While a delete is on its way, ticking a box never re-enables Delete.
|
||||
let release;
|
||||
const held = new Promise((r) => (release = r));
|
||||
await s.page.route("**/cleanup", async (route) => {
|
||||
if (!/"delete"/.test(route.request().postData() || "")) return route.continue();
|
||||
await held;
|
||||
return route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ ok: true, removed: [], failed: [], bytes: 0 }) });
|
||||
});
|
||||
await s.page.click("#cleanup-delete");
|
||||
await s.page.waitForFunction(() => /Deleting/.test(document.getElementById("cleanup-status").textContent));
|
||||
await row.locator("input[type=checkbox]").uncheck();
|
||||
await row.locator("input[type=checkbox]").check();
|
||||
assert.equal(await s.page.locator("#cleanup-delete").isDisabled(), true, "Delete stays off mid-request");
|
||||
release();
|
||||
await s.page.waitForFunction(() => /Nothing was deleted/.test(document.getElementById("cleanup-status").textContent));
|
||||
await s.page.unroute("**/cleanup");
|
||||
|
||||
// Closing preferences forgets the scan: a reopened dialog starts clean.
|
||||
await s.page.click("#looks-done");
|
||||
await s.page.click("#btn-looks");
|
||||
@@ -810,9 +844,9 @@ test("below 720 px the side list is a horizontal strip with no hints", async (t)
|
||||
await s.page.waitForFunction(() => document.getElementById("prefs-tabs").getAttribute("aria-orientation") === "vertical");
|
||||
});
|
||||
|
||||
test("Set up preferences on the dashboard opens on Appearance with agents and models loaded", async (t) => {
|
||||
test("Set your role on the dashboard opens on Appearance with agents and models loaded", async (t) => {
|
||||
fs.mkdirSync(HOME, { recursive: true });
|
||||
fs.writeFileSync(LOOKS_FILE, JSON.stringify({ looks: { welcomeSeen: true } }));
|
||||
fs.writeFileSync(LOOKS_FILE, JSON.stringify({ looks: { welcomeSeen: true, skillLaunched: true } }));
|
||||
t.after(() => fs.rmSync(LOOKS_FILE, { force: true }));
|
||||
const file = path.join(MODELS_DIR, "agents.json");
|
||||
fs.mkdirSync(MODELS_DIR, { recursive: true });
|
||||
@@ -826,7 +860,7 @@ test("Set up preferences on the dashboard opens on Appearance with agents and mo
|
||||
const skip = s.page.getByRole("button", { name: "Skip the intro" });
|
||||
await skip.click();
|
||||
await skip.waitFor({ state: "hidden" });
|
||||
await s.page.getByRole("button", { name: "Set up preferences" }).click();
|
||||
await s.page.getByRole("button", { name: "set your role" }).click();
|
||||
await s.page.locator("#looks-modal[open]").waitFor();
|
||||
assert.equal(await selectedTab(s), "prefs-tab-appearance");
|
||||
await s.page.click("#prefs-tab-agents");
|
||||
@@ -837,7 +871,7 @@ test("Set up preferences on the dashboard opens on Appearance with agents and mo
|
||||
assert.doesNotMatch(await s.page.locator("#agents-status").innerText(), /could not be loaded/);
|
||||
});
|
||||
|
||||
test("Back to default resets only the tab on screen, and is hidden on Agents & models and System", async (t) => {
|
||||
test("Reset this tab resets only the tab on screen, and is hidden on Agents & models and System", async (t) => {
|
||||
noSavedLooks(t);
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
await s.page.click("#btn-looks");
|
||||
@@ -1102,3 +1136,59 @@ test("the sound picker: Tab reaches Play from the select, and a row stacks insid
|
||||
assert.equal(fits.length, PICK_EVENTS.length, "every row is drawn");
|
||||
assert.equal(fits.every(Boolean), true, "no control spills out of the dialog at 600px");
|
||||
});
|
||||
|
||||
test("Cleanup's Delete sends only the ticked ids", async (t) => {
|
||||
noSavedLooks(t);
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
const made = ["20250801-101010-aaaaaa", "20250801-101010-bbbbbb"].map((sid) => {
|
||||
const dir = path.join(HOME, "sessions", sid);
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
fs.writeFileSync(path.join(dir, "state.json"), JSON.stringify({ title: sid.endsWith("aaaaaa") ? "first" : "second", workflow: "plan" }));
|
||||
backdate(path.join(dir, "state.json"));
|
||||
backdate(dir);
|
||||
t.after(() => fs.rmSync(dir, { recursive: true, force: true }));
|
||||
return sid;
|
||||
});
|
||||
const sent = [];
|
||||
await s.page.route("**/cleanup", async (route) => {
|
||||
const body = JSON.parse(route.request().postData() || "{}");
|
||||
if (body.delete) {
|
||||
sent.push(body.delete);
|
||||
return route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ ok: true, removed: body.delete, failed: [], refused: [], bytes: 10 }) });
|
||||
}
|
||||
return route.fallback();
|
||||
});
|
||||
await s.page.click("#btn-looks");
|
||||
await s.page.click("#prefs-tab-system");
|
||||
await s.page.click("#cleanup-scan");
|
||||
const first = s.page.locator("#cleanup-list .cleanup-row").filter({ hasText: "Plan · first" });
|
||||
await first.waitFor();
|
||||
await first.locator("input[type=checkbox]").uncheck();
|
||||
await s.page.click("#cleanup-delete");
|
||||
await until(() => sent.length === 1);
|
||||
assert.deepEqual(sent[0], ["session:" + made[1]], "only the ticked session is sent");
|
||||
});
|
||||
|
||||
test("Reset this tab shows Reset with an Undo that puts the tab back, and the dialog says what saves itself", async (t) => {
|
||||
noSavedLooks(t);
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
await s.page.click("#btn-looks");
|
||||
assert.match(await textOf(s.page.locator("#prefs-lead")), /^Changes save as you make them\. Agents have their own Save\.$/);
|
||||
assert.equal(await textOf(s.page.locator("#looks-reset")), "Reset this tab");
|
||||
assert.match(await textOf(s.page.locator("#looks-skip-intro + span")), /^Skip the wake-up intro$/);
|
||||
await s.page.locator('input[name="looks-theme"][value="dark"]').check();
|
||||
await swatch(s, "violet").click();
|
||||
await s.page.click("#looks-reset");
|
||||
await s.page.waitForFunction(() => !document.documentElement.hasAttribute("data-theme"));
|
||||
const mark = s.page.locator("#prefs-panel-appearance .prefs-saved.is-reset");
|
||||
await mark.waitFor();
|
||||
assert.match(await textOf(mark), /^Reset\. Undo$/);
|
||||
await mark.getByRole("button", { name: "Undo" }).click();
|
||||
await s.page.waitForFunction(() => document.documentElement.getAttribute("data-theme") === "dark");
|
||||
assert.equal(await swatch(s, "violet").getAttribute("aria-pressed"), "true", "the highlight is back too");
|
||||
assert.equal(await mark.count(), 0, "the Undo note is gone once used");
|
||||
await s.page.waitForFunction(async () => {
|
||||
const saved = (await (await fetch("/looks")).json()).looks || {};
|
||||
return saved.theme === "dark" && saved.accent === "violet";
|
||||
});
|
||||
});
|
||||
@@ -252,3 +252,82 @@ test("a tab deleted between Start and the box leaves the box empty, with a banne
|
||||
assert.equal(await boxValue(boxOf(s)), "");
|
||||
assert.equal(await readyPictures(s).count(), 0);
|
||||
});
|
||||
|
||||
// Clear needs no native confirm: it clears at once and offers Undo for ten
|
||||
// seconds, deleting the attachments' files on the server only when the window
|
||||
// closes.
|
||||
const CHOICE = {
|
||||
items: [{ id: "q1", kind: "text", title: "Name it", body: "A name." }],
|
||||
agent: { status: "waiting" },
|
||||
};
|
||||
|
||||
test("Clear clears at once with an Undo that restores it, and deletes attachments only once the window closes", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: CHOICE, clock: true });
|
||||
s.page.on("dialog", (d) => {
|
||||
assert.fail("Clear must not open a native dialog: " + d.message());
|
||||
});
|
||||
const deletes = [];
|
||||
await s.page.route("**/uploads/**", (route) => {
|
||||
if (route.request().method() === "DELETE") deletes.push(route.request().url());
|
||||
return route.fulfill({ status: 200, body: "{}" });
|
||||
});
|
||||
const box = itemCard(s.page, "q1").locator(".md-host, input[type=text]").first();
|
||||
await fillBox(box, "audit-export");
|
||||
// An attachment on that note, as the page holds it after an upload.
|
||||
await s.page.evaluate(async () => {
|
||||
const { page, saveNow, redraw } = await import("/state.js");
|
||||
page.local.images.q1 = [{ key: "k1", id: "abc123", path: "uploads/abc123.png", name: "shot.png" }];
|
||||
saveNow();
|
||||
redraw();
|
||||
});
|
||||
const clear = s.page.locator("#btn-clear");
|
||||
await clear.waitFor();
|
||||
await clear.click();
|
||||
const banner = s.page.locator("#banner");
|
||||
await banner.getByText(/^Cleared/).waitFor();
|
||||
assert.equal(await boxValue(itemCard(s.page, "q1").locator(".md-host, input[type=text]").first()), "", "the box is empty at once");
|
||||
assert.equal(deletes.length, 0, "nothing deleted on the server yet");
|
||||
// Undo puts the text and the picture back, and the file is never deleted.
|
||||
await banner.getByRole("button", { name: "Undo" }).click();
|
||||
assert.equal(await boxValue(itemCard(s.page, "q1").locator(".md-host, input[type=text]").first()), "audit-export", "undo restores the answer");
|
||||
assert.equal(await s.page.evaluate(async () => (await import("/state.js")).page.local.images.q1?.length), 1, "and the picture");
|
||||
await s.page.clock.fastForward(12_000);
|
||||
assert.equal(deletes.length, 0, "an undone clear deletes nothing");
|
||||
|
||||
// Clear again and let the window close: the file goes.
|
||||
await clear.click();
|
||||
await banner.getByText(/^Cleared/).waitFor();
|
||||
await s.page.clock.fastForward(11_000);
|
||||
await until(() => deletes.length === 1);
|
||||
assert.match(deletes[0], /abc123/);
|
||||
await banner.waitFor({ state: "hidden" });
|
||||
});
|
||||
|
||||
test("Clear while a picture is uploading: Undo brings it back finished, not stuck uploading", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: CHOICE });
|
||||
let release;
|
||||
const gate = new Promise((r) => (release = r));
|
||||
await s.page.route("**/upload", async (route) => {
|
||||
await gate;
|
||||
await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ ok: true, id: "up1", path: "uploads/up1.jpg", name: "p.jpg", size: 5, kind: "image" }) });
|
||||
});
|
||||
await s.page.route("**/uploads/**", (route) => route.fulfill({ status: 200, body: "{}" }));
|
||||
await itemCard(s.page, "q1").waitFor();
|
||||
await s.page.evaluate(async () => {
|
||||
const c = document.createElement("canvas");
|
||||
c.width = c.height = 8;
|
||||
c.getContext("2d").fillRect(0, 0, 8, 8);
|
||||
const blob = await new Promise((r) => c.toBlob(r, "image/png"));
|
||||
const { attachFiles } = await import("/uploads.js");
|
||||
attachFiles("q1", [new File([blob], "p.png", { type: "image/png" })]);
|
||||
});
|
||||
await until(() => s.page.evaluate(async () => ((await import("/state.js")).page.local.images.q1 || []).some((i) => i.status === "uploading")));
|
||||
await s.page.locator("#btn-clear").click();
|
||||
const banner = s.page.locator("#banner");
|
||||
await banner.getByText(/^Cleared/).waitFor();
|
||||
release();
|
||||
await s.page.waitForTimeout(300);
|
||||
await banner.getByRole("button", { name: "Undo" }).click();
|
||||
const back = await s.page.evaluate(async () => ((await import("/state.js")).page.local.images.q1 || []).map((i) => ({ status: i.status, id: i.id })));
|
||||
assert.deepEqual(back, [{ status: "ready", id: "up1" }], "the upload finished into the set-aside picture, and Undo restored it");
|
||||
});
|
||||
@@ -12,7 +12,7 @@ import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { pageSuite, openSession, itemCard, drawn, textOf, tempProject , fillBox, boxValue, sendAsk, styleOf } from "./page-test-helpers.mjs";
|
||||
import { cli, until } from "./web-console-test-helpers.mjs";
|
||||
import { cli, until, HOME } from "./web-console-test-helpers.mjs";
|
||||
import { STOP_HANDOFF_REPLY, HOME_REPLY } from "../src/web-console/public/answers.js";
|
||||
import { CHAT_OFFLINE_TEXT } from "../src/web-console/public/chat.js";
|
||||
// How long the page waits without contact before it calls itself offline:
|
||||
@@ -23,7 +23,7 @@ const suite = pageSuite(test);
|
||||
|
||||
|
||||
// The banner the page raises when it loses its server mid-session.
|
||||
const LOST_CONTACT = /Lost contact with Plan2Code\. Nothing you have typed is lost\./;
|
||||
const LOST_CONTACT = /Not connected right now. Nothing you have typed is lost./;
|
||||
|
||||
// A plan session on the person's turn, the way an agent opens one: one text
|
||||
// question and the agent listening.
|
||||
@@ -233,7 +233,7 @@ test("Continue here shows beside a skill's next step while the meter is not red
|
||||
assert.equal(got.reply, "Start Implement (/plan2code-3-implement) for specs/audit-export, right here in this session.");
|
||||
// The hop's resume is the dashboard's: the skill's workflow and the spec.
|
||||
assert.match(got.resume, /--workflow implement --spec specs\/audit-export$/);
|
||||
await main.getByRole("button", { name: "Starting the next step…" }).waitFor();
|
||||
await main.getByRole("button", { name: "Starting the next skill…" }).waitFor();
|
||||
assert.equal(await main.getByRole("button", { name: "Back to the dashboard" }).isDisabled(), true, "one press locks the other buttons");
|
||||
|
||||
// No skill to continue into: a git command, or a pause.
|
||||
@@ -685,7 +685,7 @@ test("Stop session, confirmed, sends __stop with no handoff", async (t) => {
|
||||
assert.deepEqual(stop, { i: "__stop", type: "stop" });
|
||||
});
|
||||
|
||||
test("Stop with a handoff sends __stop with handoff, and the paused finish and stop that follow end on the paused screen, not an error", async (t) => {
|
||||
test("Stop with a handoff sends __stop with handoff, and the paused finish and stop that follow end on the stopped screen, not an error", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
await s.page.click("#btn-stop");
|
||||
const handoff = s.page.locator("#stop-handoff");
|
||||
@@ -716,8 +716,8 @@ test("Stop with a handoff sends __stop with handoff, and the paused finish and s
|
||||
!LOST_CONTACT.test(await s.page.locator("#banner").innerText()) &&
|
||||
!(await s.page.locator("#planny").getAttribute("class")).includes("is-gone");
|
||||
assert.ok(await holds(settled, GONE_AFTER_MS + 3000), "the page raised a lost-contact state after a paused finish");
|
||||
assert.match(await main.innerText(), /Session paused/i);
|
||||
assert.match(await textOf(s.page.locator("#agent-text")), /^Paused\./);
|
||||
assert.match(await main.innerText(), /Session stopped/i);
|
||||
assert.match(await textOf(s.page.locator("#agent-text")), /^Stopped./);
|
||||
assert.ok(await main.locator("code").filter({ hasText: /^\/plan2code-1-plan --web$/ }).count(), "the resume command is gone");
|
||||
});
|
||||
|
||||
@@ -759,7 +759,7 @@ test("a page that loses its server goes offline, and after a resume it shows the
|
||||
await s.page.waitForFunction(() => document.getElementById("planny").classList.contains("is-gone"), null, {
|
||||
timeout: GONE_AFTER_MS + 10000,
|
||||
});
|
||||
assert.match(await textOf(s.page.locator("#agent-text")), /^Not connected\. Your answers are saved\./);
|
||||
assert.match(await textOf(s.page.locator("#agent-text")), /^Not connected right now. Your answers are saved./);
|
||||
assert.match(await s.page.locator("#banner").innerText(), LOST_CONTACT);
|
||||
assert.equal(await s.page.locator("#btn-send").isDisabled(), true, "Send is on with no server");
|
||||
|
||||
@@ -832,7 +832,7 @@ test("the quiet, not running and not connected lines offer What to check, openin
|
||||
await s.page.clock.fastForward(GONE_AFTER_MS);
|
||||
await new Promise((r) => setTimeout(r, 250));
|
||||
}
|
||||
await lineSays(s, /^Not connected\. Your answers are saved\./);
|
||||
await lineSays(s, /^Not connected right now. Your answers are saved./);
|
||||
assert.equal(await whatToCheck(s).count(), 1, "the not connected line carries What to check");
|
||||
});
|
||||
|
||||
@@ -904,7 +904,7 @@ test("a Send that finds the server gone says so at once, with the reconnect help
|
||||
await s.page.click("#btn-send");
|
||||
await s.page.waitForFunction(() => document.getElementById("planny").classList.contains("is-gone"), null, { timeout: 3000 });
|
||||
assert.match(await s.page.locator("#banner").innerText(), LOST_CONTACT);
|
||||
assert.match(await textOf(statusLine(s)), /^Not connected\. Your answers are saved\./);
|
||||
assert.match(await textOf(statusLine(s)), /^Not connected right now. Your answers are saved./);
|
||||
assert.equal(await whatToCheck(s).count(), 1, "the not connected line carries What to check");
|
||||
});
|
||||
|
||||
@@ -1102,7 +1102,9 @@ test("Stop with a handoff sends its own reply line beside the stop, and a plain
|
||||
|
||||
// A finish that offers a review, a commit and the dashboard, on a build.
|
||||
const OFFERS = { headline: "Quick task done", command: "/plan2code-5-git", review: true, commit: true, dashboard: true };
|
||||
const closeGuide = (s) => s.page.getByRole("region", { name: "Before you close this" });
|
||||
// Folded into the closed "Closing or starting fresh" section, so the role query also reads what is hidden.
|
||||
const closeGuide = (s) => s.page.getByRole("region", { name: "Before you close this", includeHidden: true });
|
||||
const openFolded = (s) => s.page.evaluate(() => document.querySelectorAll(".handoff-more").forEach((d) => (d.open = true)));
|
||||
|
||||
// What a person sees break: "Safe to close" printed under "Review requested", or the review offer coming back after a reload.
|
||||
test("Before you close this shows while a review is on offer, goes while it is asked, and the asked offer stays locked after a reload", async (t) => {
|
||||
@@ -1212,7 +1214,7 @@ test("Before you close this goes while a commit or the dashboard is starting, an
|
||||
await gone.page.clock.fastForward(GONE_AFTER_MS);
|
||||
await new Promise((r) => setTimeout(r, 250));
|
||||
}
|
||||
await closeGuide(gone).waitFor();
|
||||
await closeGuide(gone).waitFor({ state: "attached" });
|
||||
});
|
||||
|
||||
// What a person sees break: a finished screen with no Before you close this,
|
||||
@@ -1231,6 +1233,7 @@ test("every finished shape shows Before you close this with its three rows, and
|
||||
await main.getByRole("heading", { name: headline }).waitFor();
|
||||
const guide = closeGuide(s);
|
||||
assert.equal(await guide.count(), 1, `${headline}: one guide`);
|
||||
await openFolded(s);
|
||||
assert.equal(await guide.locator("li").count(), 3, `${headline}: three rows`);
|
||||
const text = await textOf(guide);
|
||||
for (const label of ["Before you close this", "Safe to close", "Start fresh", "Carry on"]) assert.ok(text.includes(label), `${headline}: says "${label}"`);
|
||||
@@ -1264,6 +1267,7 @@ test("under the app, Before you close this points at New Session, and never at a
|
||||
s.post({ finish: { headline: "A skill next", command: "/plan2code-4-finalize" } });
|
||||
await main.getByRole("heading", { name: "A skill next" }).waitFor();
|
||||
const guide = closeGuide(s);
|
||||
await openFolded(s);
|
||||
const text = await textOf(guide);
|
||||
assert.ok(text.includes("Press New Session at the top of the window to start the agent fresh."), "Start fresh points at New Session");
|
||||
assert.ok(text.includes("Paste the command above into the terminal panel, or start from the dashboard with /plan2code."), "Carry on names the terminal panel");
|
||||
@@ -1323,7 +1327,7 @@ test("the top bar's back triangle asks first, then sends __dashboard with the ty
|
||||
await s.page.click("#btn-home");
|
||||
const modal = s.page.locator("#home-modal");
|
||||
await modal.waitFor();
|
||||
assert.match(await textOf(modal), /Leave this workflow\?/);
|
||||
assert.match(await textOf(modal), /Leave this skill?\?/);
|
||||
assert.match(await textOf(modal.locator("#home-blurb")), /The answer you have ready goes with it\./);
|
||||
await modal.locator("#home-cancel").click();
|
||||
await modal.waitFor({ state: "hidden" });
|
||||
@@ -1334,7 +1338,7 @@ test("the top bar's back triangle asks first, then sends __dashboard with the ty
|
||||
const got = collect(s);
|
||||
assert.deepEqual(got.actions.map(({ i, type }) => ({ i, type })), [{ i: "q1", type: "answer" }, { i: "__dashboard", type: "dashboard" }]);
|
||||
assert.ok(got.reply.includes("audit-export") && got.reply.endsWith(HOME_REPLY), `the reply carries the answer, then the home line: ${got.reply}`);
|
||||
await s.page.waitForFunction(() => document.getElementById("btn-home").disabled);
|
||||
await s.page.waitForFunction(() => document.getElementById("btn-home").getAttribute("aria-disabled") === "true");
|
||||
});
|
||||
|
||||
// What a person sees break: Commit it now, or Changelog's commit offer, hops
|
||||
@@ -1448,3 +1452,146 @@ test("under the app, Planny's finished line says to close the window, not the ta
|
||||
const line = await lineSays(s, /close this window/);
|
||||
assert.doesNotMatch(line, /close this tab/, "no classic-mode wording under the app");
|
||||
});
|
||||
|
||||
// The meter's one-time tip lives in its popover (it used to sit in the Welcome
|
||||
// dialog): the first time the pill leaves green, opened once, then never again.
|
||||
test("the meter popover shows a one-time tip the first time the pill turns yellow", async (t) => {
|
||||
const file = path.join(HOME, "looks.json");
|
||||
fs.mkdirSync(HOME, { recursive: true });
|
||||
fs.writeFileSync(file, JSON.stringify({ looks: { welcomeSeen: true } }));
|
||||
t.after(() => fs.rmSync(file, { force: true }));
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "implement", payload: { agent: { status: "working", activity: "Task 1 of 1" } } });
|
||||
const once = s.page.locator("#meter-once");
|
||||
assert.equal(await once.isHidden(), true, "nothing at green");
|
||||
// Six points: a fifteen-task phase, the yellow level.
|
||||
s.post({ run: { event: "implement-phase", id: "phase-1", tasks: 18 } });
|
||||
const pill = s.page.locator("#meter-pill[data-level='yellow']");
|
||||
await pill.waitFor();
|
||||
await pill.click();
|
||||
await once.waitFor();
|
||||
assert.match(await once.innerText(), /once the meter passes half/i);
|
||||
assert.ok(await until(() => s.page.evaluate(async () => ((await (await fetch("/looks")).json()).looks || {}).meterTipSeen === true)), "opening it with the tip showing saved the flag");
|
||||
// A redraw while the popover is open must not take the tip away mid-read.
|
||||
s.post({ agent: { activity: "Task 2 of 2" } });
|
||||
await s.page.getByText("Task 2 of 2").first().waitFor();
|
||||
assert.equal(await once.isVisible(), true, "the tip stays up through a redraw while its popover is open");
|
||||
await pill.click();
|
||||
await s.page.locator("#meter-pop").waitFor({ state: "hidden" });
|
||||
assert.equal(await once.isHidden(), true, "closing the popover retires the tip");
|
||||
await s.page.reload();
|
||||
const again = s.page.locator("#meter-pill[data-level='yellow']");
|
||||
await again.waitFor();
|
||||
await again.click();
|
||||
assert.equal(await s.page.locator("#meter-once").isHidden(), true, "the tip does not come back");
|
||||
});
|
||||
|
||||
// One primary per finish by a fixed rule (review, else commit, else Continue
|
||||
// here, else Back to the dashboard), and the quiet extras folded into one
|
||||
// closed section.
|
||||
test("every finish shape shows exactly one primary button by the fixed rule, and the extras fold away", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "quick-task", payload: { agent: { status: "working", activity: "Task 1 of 1" } } });
|
||||
const main = s.page.locator("#main");
|
||||
const primaries = () => main.locator("button.primary");
|
||||
const shapes = [
|
||||
["Everything on offer", { command: "/plan2code-5-git", review: true, commit: true, dashboard: true }, "Review it now"],
|
||||
["Commit and dashboard", { command: "/plan2code-5-git", commit: true, dashboard: true }, "Commit it now"],
|
||||
["A skill next", { command: "/plan2code-4-finalize", dashboard: true }, "Continue here"],
|
||||
["Only the dashboard", { dashboard: true }, "Back to the dashboard"],
|
||||
["Paused here", { command: "/plan2code-3-implement specs/x/overview.md" }, "Copy"],
|
||||
["Nothing left", {}, "Copy"],
|
||||
];
|
||||
for (const [headline, rest, primary] of shapes) {
|
||||
s.post({ finish: { headline, ...rest } });
|
||||
await main.getByRole("heading", { name: headline }).waitFor();
|
||||
assert.equal(await primaries().count(), 1, `${headline}: exactly one primary`);
|
||||
assert.match(await primaries().first().innerText(), new RegExp(primary), `${headline}: the primary is ${primary}`);
|
||||
}
|
||||
// The extras are one closed section, "Closing or starting fresh".
|
||||
s.post({ finish: { headline: "Folded", command: "/plan2code-4-finalize" } });
|
||||
await main.getByRole("heading", { name: "Folded" }).waitFor();
|
||||
const more = main.locator("details.handoff-more");
|
||||
assert.equal(await more.count(), 1, "one folded section");
|
||||
assert.equal(await more.evaluate((d) => d.open), false, "closed");
|
||||
assert.match(await textOf(more.locator("summary")), /Closing or starting fresh/);
|
||||
await more.locator("summary").click();
|
||||
await closeGuide(s).waitFor();
|
||||
});
|
||||
|
||||
// Stop and Back lock with aria-disabled while Plan2Code has the turn: a press
|
||||
// opens a small note saying why, and acts on nothing.
|
||||
test("Stop session and Back are aria-disabled mid-task, and a press explains instead of stopping", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "implement", payload: { agent: { status: "working", activity: "Task 1 of 3" } } });
|
||||
const stop = s.page.locator("#btn-stop");
|
||||
await stop.waitFor();
|
||||
assert.equal(await stop.getAttribute("aria-disabled"), "true", "locked");
|
||||
assert.equal(await stop.evaluate((n) => n.disabled), false, "but not disabled, so a press still lands");
|
||||
// Playwright reads aria-disabled as disabled, so the press is forced.
|
||||
await stop.click({ force: true });
|
||||
const pop = s.page.locator(".lock-pop");
|
||||
await pop.waitFor();
|
||||
assert.match(await textOf(pop), /Plan2Code is mid-task, so Stop unlocks at its next check-in. To interrupt it now, press Esc in the terminal./);
|
||||
// Wide enough to read and inside the window (right-anchoring once squeezed it to a strip).
|
||||
const box = await pop.boundingBox();
|
||||
const width = await s.page.evaluate(() => window.innerWidth);
|
||||
assert.ok(box.width > 250 && box.x >= 0 && box.x + box.width <= width, `the note is readable and on screen: ${JSON.stringify(box)}`);
|
||||
assert.equal(await s.page.locator("#stop-modal[open]").count(), 0, "no Stop dialog");
|
||||
await s.page.keyboard.press("Escape");
|
||||
await pop.waitFor({ state: "detached" });
|
||||
const home = s.page.locator("#btn-home");
|
||||
assert.equal(await home.getAttribute("aria-disabled"), "true", "Back is locked too");
|
||||
await home.click({ force: true });
|
||||
assert.match(await textOf(s.page.locator(".lock-pop")), /Back to the dashboard unlocks at its next check-in/);
|
||||
assert.equal(await s.page.locator("#home-modal[open]").count(), 0, "no Back dialog");
|
||||
// On the person's turn the lock lifts and Stop opens its dialog.
|
||||
s.post({ items: [{ id: "q1", kind: "text", title: "Name it", body: "A name." }], agent: { status: "waiting" } });
|
||||
await s.page.waitForFunction(() => !document.getElementById("btn-stop").hasAttribute("aria-disabled"));
|
||||
await stop.click();
|
||||
await s.page.locator("#stop-modal[open]").waitFor();
|
||||
await s.page.keyboard.press("Escape");
|
||||
await s.page.locator("#stop-modal[open]").waitFor({ state: "detached" });
|
||||
// Back already on its way home says so, never "mid-task, press Esc".
|
||||
await home.click();
|
||||
await s.page.locator("#home-modal[open]").waitFor();
|
||||
await s.page.click("#home-go");
|
||||
await s.page.waitForFunction(() => document.getElementById("btn-home").getAttribute("aria-disabled") === "true");
|
||||
await home.click({ force: true });
|
||||
const going = s.page.locator(".lock-pop");
|
||||
await going.waitFor();
|
||||
assert.match(await textOf(going), /^Opening the dashboard/);
|
||||
});
|
||||
|
||||
// A timed success never wipes a newer warning, and a warning can be dismissed.
|
||||
test("a timed banner clears only its own message, and a warn banner has a Dismiss button", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
|
||||
await itemCard(s.page, "q1").waitFor();
|
||||
const shown = await s.page.evaluate(async () => {
|
||||
const core = await import("/screens/core.js");
|
||||
const box = document.getElementById("banner");
|
||||
const ok = core.banner("Sent. Plan2Code is picking it up now.", "good");
|
||||
const warn = core.banner("That did not go through. Nothing was lost; try again.", "warn");
|
||||
core.clearBanner(ok); // the success's own timer fires late
|
||||
const kept = !box.hidden && box.textContent.includes("did not go through");
|
||||
core.clearBanner(warn);
|
||||
return { kept, goneAfter: box.hidden, tokensDiffer: ok !== warn };
|
||||
});
|
||||
assert.deepEqual(shown, { kept: true, goneAfter: true, tokensDiffer: true });
|
||||
await s.page.evaluate(async () => (await import("/screens/core.js")).banner("A refused send.", "warn"));
|
||||
const banner = s.page.locator("#banner");
|
||||
await banner.waitFor();
|
||||
await banner.getByRole("button", { name: "Dismiss" }).click();
|
||||
await banner.waitFor({ state: "hidden" });
|
||||
// Info and success banners are not dismissible: they go by themselves.
|
||||
await s.page.evaluate(async () => (await import("/screens/core.js")).banner("Sent.", "good"));
|
||||
assert.equal(await banner.getByRole("button", { name: "Dismiss" }).count(), 0, "no Dismiss on a success");
|
||||
});
|
||||
|
||||
// A finished session has nothing to send, ever: no dead Send button, and the
|
||||
// footer says why in words.
|
||||
test("a finished session draws no Send button and keeps the footer's words", async (t) => {
|
||||
const s = await openSession(await suite.browser(), { t, workflow: "quick-task", payload: { agent: { status: "working", activity: "Task 1 of 1" } } });
|
||||
assert.equal(await s.page.locator("#btn-send").isHidden(), false, "Send is drawn while the session runs");
|
||||
s.post({ finish: { headline: "Quick task done", command: "/plan2code-5-git" } });
|
||||
await s.page.locator("#main").getByRole("heading", { name: "Quick task done" }).waitFor();
|
||||
await s.page.locator("#btn-send").waitFor({ state: "hidden" });
|
||||
assert.match(await textOf(s.page.locator("#footer-summary")), /^All done\./);
|
||||
});
|
||||
@@ -165,7 +165,7 @@ test("the setup page renders found, outside and missing rows with their way forw
|
||||
assert.equal(await table(s).locator("button.split-row").count(), 5, "the four builtin rows and the template");
|
||||
// Nothing picked yet: the pane shows the empty text, and the row badges are
|
||||
// already drawn with each entry's state.
|
||||
assert.equal(await pane(s).locator(".split-empty").count(), 1, "the pane's empty text before a pick");
|
||||
assert.equal(await pane(s).locator(".empty").count(), 1, "the pane's empty text before a pick");
|
||||
assert.equal(await rowByKey(s, "found-one").locator(".prefs-badge.ok").count(), 1);
|
||||
assert.equal(await textOf(rowByKey(s, "found-one").locator(".prefs-badge")), "Found");
|
||||
assert.equal(await textOf(rowByKey(s, "outer").locator(".prefs-badge")), "Found outside PATH");
|
||||
|
||||
@@ -402,7 +402,7 @@ test("a typed line never starts a reply line of its own", () => {
|
||||
assert.deepEqual(noteReplyLines("Q", "one\ntwo", []), ["Note on Q: one\n two"]);
|
||||
});
|
||||
|
||||
test("an approved edit stops saying 'please wait' once the agent has answered it", () => {
|
||||
test("an approved edit stops saying 'Applying it' once the agent has answered it", () => {
|
||||
const frame = {
|
||||
conversation: 1,
|
||||
messages: [
|
||||
|
||||
@@ -26,12 +26,13 @@ function setup({ agent = { status: "waiting" }, items = [question()], ...S } = {
|
||||
|
||||
const working = (sinceMs, extra = {}) => ({ status: "working", since: ago(sinceMs), ...extra });
|
||||
|
||||
test("send state: a finished session is closed, and says paused when its headline does", () => {
|
||||
test("send state: a finished session is closed, and says stopped when its headline says paused", () => {
|
||||
setup({ finish: { headline: "Phase 3 is done" } });
|
||||
page.local.staged.q1 = { k: "A" };
|
||||
assert.deepEqual(sendState(), { disabled: true, why: "This session is finished.", short: "Session finished" });
|
||||
// A finished session has nothing to send, ever: the button is hidden and the words stay.
|
||||
assert.deepEqual(sendState(), { disabled: true, why: "This session is finished.", short: "Session finished", hide: true });
|
||||
setup({ finish: { headline: "Paused at Step 2" } });
|
||||
assert.deepEqual(sendState(), { disabled: true, why: "This session is paused.", short: "Session paused" });
|
||||
assert.deepEqual(sendState(), { disabled: true, why: "This session is stopped.", short: "Session stopped", hide: true });
|
||||
});
|
||||
|
||||
test("send state: a finish wins over a dropped connection", () => {
|
||||
@@ -184,3 +185,24 @@ test("suggest state: the chip follows Send, and waits while its own request does
|
||||
setup({ items: [replied] });
|
||||
assert.deepEqual(suggestState(replied), ready, "the agent's reply frees it");
|
||||
});
|
||||
|
||||
// One phrase for a page that lost the server (Help's "Not connected" state):
|
||||
// the constant is exported, the send button uses it, and every other place
|
||||
// that says it imports it instead of typing its own wording.
|
||||
test("the not-connected phrase is one exported constant and the sites use it", async () => {
|
||||
const { NOT_CONNECTED, NOT_CONNECTED_KEPT, notConnected } = await import("../src/web-console/public/labels.js");
|
||||
assert.equal(NOT_CONNECTED, "Not connected right now.");
|
||||
assert.equal(notConnected(), NOT_CONNECTED);
|
||||
assert.equal(notConnected(NOT_CONNECTED_KEPT), `${NOT_CONNECTED} ${NOT_CONNECTED_KEPT}`);
|
||||
setup();
|
||||
page.gone = true;
|
||||
assert.equal(sendState().why, NOT_CONNECTED);
|
||||
const fs = await import("node:fs");
|
||||
const root = new URL("../src/web-console/public/", import.meta.url);
|
||||
const sites = ["send-state.js", "notepad.js", "screens/core.js", "screens/cleanup.js", "screens/learning-row.js", "screens/ask.js", "screens/notepad.js", "screens/ending.js"];
|
||||
for (const file of sites) {
|
||||
const text = fs.readFileSync(new URL(file, root), "utf8");
|
||||
assert.match(text, /labels\.js"/, `${file} imports the constant`);
|
||||
assert.doesNotMatch(text, /["'`][^"'`\n]*(Lost contact with Plan2Code|Plan2Code is not reachable|Plan2Code is not answering)/, `${file} types no wording of its own`);
|
||||
}
|
||||
});
|
||||
@@ -81,7 +81,7 @@ test("the page carries its first state, title and badge, so the first paint need
|
||||
assert.equal((html.match(/<script\b/g) || []).length, 2, "the boot block and app.js, nothing else");
|
||||
// Written into the markup, escaped, with `$&` and `$'` left as typed.
|
||||
assert.ok(html.includes(`<h1 id="title">Lunch </script><script>alert(1)</script> $& $' app</h1>`));
|
||||
assert.ok(html.includes('<span class="badge" id="badge">Building</span>'));
|
||||
assert.ok(html.includes('<span class="pill is-accent is-caps badge" id="badge">Building</span>'));
|
||||
assert.ok(html.includes("Starting Implement"), "the static starting screen names the skill");
|
||||
assert.ok(html.includes('rel="modulepreload" href="/app.js"'));
|
||||
cli(["stop", "--session", res.json.sid, "--force"]);
|
||||
@@ -403,6 +403,8 @@ test("the scratch sweep removes old patches and helpers, never looks, the pointe
|
||||
}
|
||||
});
|
||||
|
||||
const SESSION_STATE = JSON.stringify({ title: "shop", workflow: "pathfinder" });
|
||||
|
||||
test("cleanup finds old sessions and strays in both folders, and keeps every protected name and this session", async () => {
|
||||
const plan2code = fs.mkdtempSync(path.join(os.tmpdir(), "p2c-cleanup-"));
|
||||
const consoleDir = path.join(plan2code, "console");
|
||||
@@ -420,7 +422,7 @@ test("cleanup finds old sessions and strays in both folders, and keeps every pro
|
||||
return p;
|
||||
};
|
||||
const session = (sid, stale) => {
|
||||
const state = put(path.join(consoleDir, "sessions", sid, "state.json"));
|
||||
const state = put(path.join(consoleDir, "sessions", sid, "state.json"), SESSION_STATE);
|
||||
if (stale) backdate(state);
|
||||
return path.dirname(state);
|
||||
};
|
||||
@@ -492,6 +494,12 @@ test("cleanup finds old sessions and strays in both folders, and keeps every pro
|
||||
for (const id of ["root:app", "root:app.json", "root:agents.json", "root:prototypes", "root:learning"]) assert.equal(items.some((i) => i.id === id), false, `${id} is never a stray`);
|
||||
assert.equal(STRAY_GRACE_MS, 60 * 60 * 1000);
|
||||
assert.equal(items.find((i) => i.id === "console:p1.json").bytes, 5);
|
||||
// A session row names itself by title, skill and when it was last touched, never by path.
|
||||
const row = items.find((i) => i.id === "session:20250801-101010-aaaaaa");
|
||||
assert.equal(row.title, "shop");
|
||||
assert.equal(row.workflow, "pathfinder");
|
||||
assert.ok(Number.isFinite(Date.parse(row.at)), "at is an ISO time");
|
||||
assert.equal(items.find((i) => i.id === "console:p1.json").title, undefined, "a stray carries no title");
|
||||
assert.equal(items.find((i) => i.id === "root:console-dev").kind, "folder");
|
||||
assert.equal(bytes, items.reduce((n, i) => n + i.bytes, 0));
|
||||
|
||||
@@ -506,7 +514,7 @@ test("cleanup finds old sessions and strays in both folders, and keeps every pro
|
||||
);
|
||||
assert.deepEqual(done.removed.sort(), ["console:p1.json", "root:console-dev", "session:20250801-101010-aaaaaa"]);
|
||||
assert.deepEqual(done.failed, []);
|
||||
assert.equal(done.bytes, 5 + 3 + 2);
|
||||
assert.equal(done.bytes, 5 + 3 + SESSION_STATE.length);
|
||||
assert.equal(fs.existsSync(old), false);
|
||||
assert.equal(fs.existsSync(path.join(plan2code, "console-dev")), false);
|
||||
assert.ok(fs.existsSync(path.join(plan2code, "notes.txt")), "not asked for, so not removed");
|
||||
|
||||
@@ -531,7 +531,7 @@ test("the page carries the way home: the triangle, its confirm, and the wiring",
|
||||
for (const id of ["home-modal", "home-blurb", "home-warn", "home-cancel", "home-go"]) {
|
||||
assert.ok(html.includes(`id="${id}"`), `index.html must carry #${id}`);
|
||||
}
|
||||
assert.ok(html.includes("Leave this workflow?"));
|
||||
assert.ok(html.includes("Leave this skill?"));
|
||||
assert.match(css, /\.home-btn path\s*\{\s*fill:\s*var\(--accent\)/, "the triangle is filled with the highlight color");
|
||||
});
|
||||
|
||||
@@ -889,7 +889,7 @@ test("looks: resetLooks(keys) changes only those keys, and the role is marked as
|
||||
assert.equal(looks.role, ROLE_NOT_SET, "cleared but marked as asked");
|
||||
assert.equal(looks.sound, false, "sounds untouched by Appearance");
|
||||
assert.equal(looks.hideActivities, false);
|
||||
assert.equal(looks.skipIntro, DEFAULT_LOOKS.skipIntro, "Appearance resets Always SKIP Intro");
|
||||
assert.equal(looks.skipIntro, DEFAULT_LOOKS.skipIntro, "Appearance resets Skip the wake-up intro");
|
||||
resetLooks(prefsResetScope("sounds"));
|
||||
assert.equal(looks.sound, true);
|
||||
assert.equal(looks.soundQuestion, true);
|
||||
|
||||
@@ -325,10 +325,14 @@ test("update banner: the modal is in the page, with the exact command and no inl
|
||||
assert.doesNotMatch(dialog[1], /<script/i);
|
||||
const panel = helpTemplate().match(/<section class="help-panel" data-tab="dashboard">([\s\S]*?)<\/section>/);
|
||||
assert.ok(panel, "the help has a dashboard topic");
|
||||
assert.match(panel[1], /UPDATE AVAILABLE/, "the dashboard topic explains the banner");
|
||||
assert.match(panel[1], /Update available/, "the dashboard topic explains the banner");
|
||||
assert.doesNotMatch(panel[1], /\sstyle=/);
|
||||
assert.doesNotMatch(panel[1], /<script/i);
|
||||
assert.ok(dash.includes('"npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git"'), "the dashboard copies the exact command");
|
||||
assert.ok(dash.includes('"npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release"'), "the dashboard copies the exact command");
|
||||
// One sentence and the command up front; the rest sits in a closed details element.
|
||||
assert.match(dialog[1], /<details class="update-more" id="update-more">\s*<summary>Command not found, or nothing happened\?<\/summary>/);
|
||||
assert.ok(dialog[1].indexOf("update-command") < dialog[1].indexOf("<details"), "the command comes before the disclosure");
|
||||
assert.ok(dialog[1].indexOf("git ls-remote") > dialog[1].indexOf("<details"), "the ls-remote note is inside the disclosure");
|
||||
});
|
||||
|
||||
test("update banner: built only on the dashboard, dismissed per session, and Help's version links to Releases", () => {
|
||||
@@ -366,7 +370,7 @@ test("help: the stuck tab is second, with a callout and four symptom rows before
|
||||
assert.equal(HELP_TABS[1].id, "stuck");
|
||||
const tpl = helpTemplate();
|
||||
const panel = tpl.match(/<section class="help-panel" data-tab="stuck">([\s\S]*?)<\/section>/)[1];
|
||||
assert.match(panel, /<div class="help-callout" role="note">/);
|
||||
assert.match(panel, /<div class="callout is-stage help-callout" role="note">/);
|
||||
assert.match(panel, /Check this first/);
|
||||
assert.match(panel, /look at your terminal/);
|
||||
assert.equal((panel.match(/class="help-row"/g) || []).length, 4, "four symptom rows");
|
||||
@@ -388,7 +392,7 @@ test("help: privacy names the handoffs folder and preferences says Cleanup never
|
||||
"the lead no longer says everything lives under the console folder"
|
||||
);
|
||||
const prefs = tpl.match(/<section class="help-panel" data-tab="prefs">([\s\S]*?)<\/section>/)[1];
|
||||
const cleanup = prefs.slice(prefs.indexOf("<strong>Cleanup</strong>"), prefs.indexOf("<strong>Back to default</strong>"));
|
||||
const cleanup = prefs.slice(prefs.indexOf("<strong>Cleanup</strong>"), prefs.indexOf("<strong>Reset this tab</strong>"));
|
||||
assert.match(cleanup, /handoffs/, "the Cleanup text names the handoffs folder");
|
||||
assert.match(cleanup, /never\s+offered/, "the Cleanup text says the handoffs folder is never offered for removal");
|
||||
});
|
||||
@@ -554,3 +558,15 @@ test("Diagnose's opening cards: only What is wrong is required", () => {
|
||||
const prompt = fs.readFileSync(path.join(ROOT, "src", "plan2code-diagnose.md"), "utf8");
|
||||
assert.match(prompt, /the last two `"required":false`/, "the prompt says the last two cards are optional");
|
||||
});
|
||||
|
||||
test("help: the four group headings split the topics in order, so grouping never moves a tab", async () => {
|
||||
const { HELP_GROUPS, helpGroupStart } = await import("../src/web-console/public/help.js");
|
||||
assert.deepEqual(HELP_GROUPS.map((g) => g.title), ["Start here", "Working in a session", "Tools", "Reference"]);
|
||||
const ids = HELP_TABS.map((t) => t.id);
|
||||
const at = HELP_GROUPS.map((g) => ids.indexOf(g.from));
|
||||
assert.equal(at[0], 0, "the first group starts at the first topic");
|
||||
assert.deepEqual(at, [...at].sort((a, b) => a - b), "groups run in the topics' own order");
|
||||
assert.ok(at.every((i) => i >= 0), "every group starts at a real topic");
|
||||
assert.equal(helpGroupStart("planny"), null, "a topic inside a group opens no heading");
|
||||
assert.equal(HELP_TABS.findIndex((t) => t.id === "stuck"), 1, "stuck stays second");
|
||||
});
|
||||
@@ -26,6 +26,7 @@ test("state: page starts as app.js always started it", () => {
|
||||
noteSend: null,
|
||||
noteSent: null,
|
||||
retract: {},
|
||||
seeded: {},
|
||||
chat: { draft: "", history: [], about: null, pending: [], lastSeenReplyId: null, images: [], conversation: null },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,31 +3,31 @@
|
||||
"claude": [
|
||||
{
|
||||
"id": "default",
|
||||
"label": "Default (your account setting)"
|
||||
"label": "your account setting"
|
||||
},
|
||||
{
|
||||
"id": "sonnet",
|
||||
"label": "Sonnet — latest Sonnet"
|
||||
"label": "latest Sonnet"
|
||||
},
|
||||
{
|
||||
"id": "opus",
|
||||
"label": "Opus — latest Opus"
|
||||
"label": "latest Opus"
|
||||
},
|
||||
{
|
||||
"id": "haiku",
|
||||
"label": "Haiku — latest Haiku"
|
||||
"label": "latest Haiku"
|
||||
},
|
||||
{
|
||||
"id": "opusplan",
|
||||
"label": "Opus Plan — Opus in plan mode, Sonnet otherwise"
|
||||
"label": "Opus in plan mode, Sonnet otherwise"
|
||||
},
|
||||
{
|
||||
"id": "fable",
|
||||
"label": "Fable, latest Fable"
|
||||
"label": "latest Fable"
|
||||
},
|
||||
{
|
||||
"id": "best",
|
||||
"label": "Best, same model as Opus"
|
||||
"label": "same model as Opus"
|
||||
}
|
||||
],
|
||||
"devin": [
|
||||
|
||||
@@ -65,7 +65,7 @@ A new round, narrower than the last.
|
||||
|
||||
For when nothing in the round was right.
|
||||
|
||||
1. **Show the brief first**, so it can be changed: the carry-over ticks, the direction and the "how different" level (Radical is worth suggesting when Balanced missed). Keep each as it was unless the person changes it. Images stay as they were read.
|
||||
1. **Show the brief first**, so it can be changed: the carry-over ticks, the direction and the "how different" level (Radical is worth suggesting when Balanced missed). Keep each as it was unless the person changes it: the carry card goes back up with new ids, each row `ticked` as the person last sent it and its `tag` and reason as they stood. Images stay as they were read.
|
||||
2. `new-round --project . --name <prototype>`: the next round number, same prototype.
|
||||
3. **No variant carries over.** Write new variants from new plans (the design reference), avoiding the structures the person just turned down.
|
||||
4. **The dials go back to the start**: `starts` as Step 3 would set them from the carry-over, not from the block. Extras may change to fit the new variants.
|
||||
|
||||
@@ -61,13 +61,13 @@ Read `./AGENTS.md` when it exists: its stack, its style files and its convention
|
||||
1. Run `sweep --project .` silently.
|
||||
2. **The request.** When nothing yet says what to prototype (no argument, no host handing it over), ask for it first, in one question (console: the request card in `notes/ui-prototype.md`). Images sent with the answer are Step 2's images.
|
||||
3. **The kind.** From the request: a **screen**, a **flow** (several screens of one journey, shown side by side, not linked) or a **terminal** screen. Ask only when it cannot be told.
|
||||
4. **What can be carried over.** Read source files only: stylesheets, theme and config files (a Tailwind or theme config, CSS custom properties, design files), and component files. For each of the five items (colors, fonts, spacing, components, layout) note what you found and where (`src/styles/theme.css`: accent #0f766e, gray #64748b), or "none found". Note the app's own font files when it ships some (at most 4, 2 MB together). A project with no screens yet skips the checklist: say you found no existing look and start fresh.
|
||||
4. **What can be carried over.** Read source files only: stylesheets, theme and config files (a Tailwind or theme config, CSS custom properties, design files), and component files. For each of the five items (colors, fonts, spacing, components, layout) note what you found and where (`src/styles/theme.css`: accent #0f766e, gray #64748b), or "none found". Note the app's own font files when it ships some (at most 4, 2 MB together). Then decide, from the request, for each found item whether it should stay the same in every variant (**Keep**) or be where each variant tries its own take (**Free up**), with one short reason tied to the request ("a new screen in your app", "you asked to rethink the table"). A "none found" item is never Keep; with no signal in the request, Keep. A new screen in an existing app keeps all; "rethink the layout" frees layout and components; "a fresh or bolder look" frees colors and fonts. A project with no screens yet skips the checklist: say you found no existing look and start fresh.
|
||||
|
||||
### Step 2: The starting screen
|
||||
|
||||
Ask one screen, answered together:
|
||||
|
||||
1. **Carry over from your app.** The five items, each with what was found, all ticked to start. An item not found shows unticked and marked "none found", so the person knows the variants invent it. Skipped for a project with no screens.
|
||||
1. **Carry over from your app.** The five items, each with what was found, its Keep or Free up suggestion and the reason, opening ticked as suggested (console: the card in `notes/ui-prototype.md`); unticking everything frees every item. An item not found shows unticked and marked "none found", so the person knows the variants invent it. Terminal: list the five items with their suggestion and reason, and say a plain "ok" keeps them. Skipped for a project with no screens.
|
||||
2. **How different should the variants be?** Subtle, **Balanced** (when left alone), Radical.
|
||||
3. **A direction** (optional): one box for anything all variants stay inside ("calmer colors, bigger type").
|
||||
4. **Images** (optional): attach them (console: the card's Attach file control; terminal: file paths in the reply).
|
||||
|
||||
@@ -10,13 +10,13 @@ Nothing yet says what to prototype: before Step 1, one `--wait` card (a Notebook
|
||||
|
||||
## Starting card
|
||||
|
||||
One `--wait` batch after Step 1. A card cannot open with its boxes ticked, so the carry-over card's preset ticks every found item in one press, and a Skip on it keeps everything found (all ticked is the default); leave the card out for a project with no screens:
|
||||
One `--wait` batch after Step 1. The carry card is required and opens ticked as suggested: each found option carries `tag` ("Keep" or "Free up"), `ticked: true` when Keep, and `detail` = what was found, then ` · ` and the reason; a "none found" option has neither. Presets: `Suggested` (the ticked keys; leave it out when no row is Keep) and `Everything found` (every found key, only when it differs from Suggested). A reply of `none` means free up everything found. Leave the card out for a project with no screens:
|
||||
|
||||
```jsonc
|
||||
{"title":"UI prototype","headline":{"stage":"Start","cleared":0,"total":3},"items":[{"id":"carry","kind":"multi","title":"Carry over","required":false,"body":"Ticked items look the same in every variant; unticked ones are where each variant tries its own take. Skip keeps everything found; tick only what should stay the same to free the rest. Attach screenshots or images in this card's note.","options":[{"k":"1","text":"Colors","detail":"src/styles/theme.css: accent #0f766e, gray #64748b"},{"k":"2","text":"Fonts","detail":"none found"}],"presets":[{"label":"Everything found","ks":["1"]}]},{"id":"spread","kind":"choice","title":"How different","allowOther":false,"body":"How far apart should the variants be?","options":[{"text":"Subtle","detail":"Same layout, different treatment"},{"text":"Balanced","detail":"One layout difference each","recommended":true},{"text":"Radical","detail":"Different layouts"}]},{"id":"direction","kind":"text","title":"Direction","required":false,"body":"Anything every variant should stay inside.","placeholder":"Calmer colors, bigger type, room around the totals."}]}
|
||||
{"title":"UI prototype","headline":{"stage":"Start","cleared":0,"total":3},"items":[{"id":"carry","kind":"multi","title":"Carry over","body":"Ticked items look the same in every variant; unticked ones are where each variant tries its own take. Untick everything to free them all. Attach screenshots or images in this card's note.","options":[{"k":"1","text":"Colors","tag":"Keep","ticked":true,"detail":"src/styles/theme.css: accent #0f766e · a new screen in your app"},{"k":"2","text":"Layout","tag":"Free up","detail":"src/App.tsx: sidebar and header · you asked to rethink the table"},{"k":"3","text":"Fonts","detail":"none found"}],"presets":[{"label":"Suggested","ks":["1"]},{"label":"Everything found","ks":["1","2"]}]},{"id":"spread","kind":"choice","title":"How different","allowOther":false,"body":"How far apart should the variants be?","options":[{"text":"Subtle","detail":"Same layout, different treatment"},{"text":"Balanced","detail":"One layout difference each","recommended":true},{"text":"Radical","detail":"Different layouts"}]},{"id":"direction","kind":"text","title":"Direction","required":false,"body":"Anything every variant should stay inside.","placeholder":"Calmer colors, bigger type, room around the totals."}]}
|
||||
```
|
||||
|
||||
A "none found" option is never in the preset. Attached files arrive as `Image:` and `File:` paths in `reply`: open each, then say per image, in your next post, whether it goes in the page or is a look to match (a `notice`, or the line in the paste card's `body`).
|
||||
A "none found" option is never in a preset. Attached files arrive as `Image:` and `File:` paths in `reply`: open each, then say per image, in your next post, whether it goes in the page or is a look to match (a `notice`, or the line in the paste card's `body`).
|
||||
|
||||
## The page
|
||||
|
||||
@@ -28,7 +28,7 @@ A `text` item, `--wait`, `"title":"Paste your choice"`, a new id per round (`pas
|
||||
|
||||
## Next steps
|
||||
|
||||
After the read-back, a `menu`, `--wait`: Save, Narrow from my pick, Fresh set, Done, each with a one-line `detail`; the read-back is its `body`. Fresh set's brief goes back up as the three starting cards with new ids (`carry-2`, `spread-2`, `direction-2`), each choice as it stood marked `recommended` or in the preset.
|
||||
After the read-back, a `menu`, `--wait`: Save, Narrow from my pick, Fresh set, Done, each with a one-line `detail`; the read-back is its `body`. Fresh set's brief goes back up as the three starting cards with new ids (`carry-2`, `spread-2`, `direction-2`), each choice as it stood: the carry card with `ticked` as last sent, the spread card marked `recommended`.
|
||||
|
||||
## Save questions
|
||||
|
||||
|
||||
@@ -993,10 +993,11 @@ export const MAX_OPEN_REQUIRED = 3;
|
||||
// The `more` body is markdown drawn under its row: kept short enough to read.
|
||||
export const MAX_MORE_BYTES = 4096;
|
||||
export const MAX_GROUP_CHARS = 40;
|
||||
export const MAX_TAG_CHARS = 16;
|
||||
|
||||
// A multi's optional pick-list fields: `group`, `more`, `batch` and `locked` on
|
||||
// options, and no preset naming a locked option (a preset only ticks what can
|
||||
// be picked).
|
||||
// A multi's optional pick-list fields: `group`, `more`, `batch`, `locked`,
|
||||
// `ticked` and `tag` on options, and no preset naming a locked option (a preset
|
||||
// only ticks what can be picked).
|
||||
function pickListProblems(item, at) {
|
||||
const problems = [];
|
||||
const locked = new Set();
|
||||
@@ -1016,6 +1017,14 @@ function pickListProblems(item, at) {
|
||||
problems.push(rule(at, "options", `${which} has a "locked" that is not true or false`, { text: "left-pad 1.0.0 to 2.0.0", locked: true }));
|
||||
}
|
||||
if (o.locked === true && typeof o.k === "string") locked.add(o.k);
|
||||
if (o.ticked != null && typeof o.ticked !== "boolean") {
|
||||
problems.push(rule(at, "options", `${which} has a "ticked" that is not true or false (true starts the row ticked)`, { text: "Colors", ticked: true }));
|
||||
} else if (o.ticked === true && o.locked === true) {
|
||||
problems.push(rule(at, "options", `${which} is locked and ticked; a locked option can never be picked. Drop "ticked"`, { text: "left-pad 1.0.0 to 2.0.0", locked: true }));
|
||||
}
|
||||
if (o.tag != null && (typeof o.tag !== "string" || !o.tag.trim() || o.tag.trim().length > MAX_TAG_CHARS)) {
|
||||
problems.push(rule(at, "options", `${which} has a "tag" that is not a string of 1 to ${MAX_TAG_CHARS} characters (the small pill beside the label)`, { text: "Colors", tag: "Keep" }));
|
||||
}
|
||||
}
|
||||
if (locked.size && Array.isArray(item.presets)) {
|
||||
for (const p of item.presets) {
|
||||
@@ -1101,6 +1110,13 @@ export function validate(state) {
|
||||
rule(at, "options", `option "${o.k}" needs "text" (the label) and optionally "detail". Options use "text"/"detail", not "label"/"desc"`, OPTION_RIGHT),
|
||||
);
|
||||
}
|
||||
if (item.kind === "choice" && isPlainObject(o)) {
|
||||
for (const field of ["ticked", "tag"]) {
|
||||
if (o[field] != null) {
|
||||
problems.push(rule(at, "options", `option "${o.k}" has "${field}", which only goes on a multi's options`, { kind: "multi" }));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// The long pick list's optional fields (group headings, rows that open,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
// No DOM, no `local`, no fetch. If a function in here needs any of those, it
|
||||
// belongs in app.js instead.
|
||||
|
||||
import { NOT_CONNECTED } from "./labels.js";
|
||||
import { FIXED_REASON, FLOW_SKILLS, SKILLS, labelFor, skillByName, skillFor } from "./skills.js";
|
||||
import { SPEC_STATES, stateFor } from "./spec-states.js";
|
||||
|
||||
@@ -165,6 +166,11 @@ export function answerLines(item, v) {
|
||||
if (v.skipped) out.push("Skipped");
|
||||
if (v.k) out.push(optionLabel(item, v.k));
|
||||
if (Array.isArray(v.ks)) for (const k of v.ks) out.push(optionLabel(item, k));
|
||||
// A card that opened ticked can be sent with nothing ticked: say so, so the
|
||||
// settled card is not blank. Other multis keep their record as it was.
|
||||
if (item && Array.isArray(v.ks) && v.ks.length === 0 && !v.skipped && startsTicked(item)) {
|
||||
out.push("None ticked");
|
||||
}
|
||||
if (typeof v.yes === "boolean") out.push(v.yes ? item.yesLabel || "Yes" : item.noLabel || "No");
|
||||
if (typeof v.ok === "boolean") {
|
||||
out.push(v.ok ? item.yesLabel || "Yes, that is right" : item.noLabel || "Not quite");
|
||||
@@ -527,7 +533,7 @@ export function turnGate({ gone = false, pendingResult = false, waiting = false
|
||||
export const HOME_REPLY = "Save my place and take me back to the dashboard, right here in this session.";
|
||||
|
||||
const HOME_TITLES = {
|
||||
gone: "Not connected right now.",
|
||||
gone: NOT_CONNECTED,
|
||||
pending: "Your last answers are still being picked up. You can leave once they have been.",
|
||||
waiting: "Plan2Code is working on your answers. You can leave once it replies.",
|
||||
};
|
||||
@@ -1067,7 +1073,7 @@ export function staleLaunchFeedback(title, adrift, inApp = false) {
|
||||
if (!adrift) return null;
|
||||
return {
|
||||
kicker: "Saved",
|
||||
title: `${title || "Your workflow"} is saved and waiting`,
|
||||
title: `${title || "Your skill"} is saved and waiting`,
|
||||
quip: "Plan2Code is not running right now.",
|
||||
hint: inApp
|
||||
? "Press Reconnect to agent below. Plan2Code will collect this launch and continue here."
|
||||
@@ -1242,6 +1248,46 @@ export function suggestReplyLines(title, text, attachments) {
|
||||
];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------- starting ticks */
|
||||
|
||||
/**
|
||||
* A multi with a row that starts ticked (`ticked: true`, never a locked one).
|
||||
* On such a card an empty pick is an answer ("none"), not
|
||||
* the absence of one, so the page stages it, the reply says it and the
|
||||
* settled card shows it. Every other card keeps today's behavior.
|
||||
*/
|
||||
export function startsTicked(item) {
|
||||
return Boolean(item) && item.kind === "multi" && (item.options || []).some((o) => o && o.ticked === true && o.locked !== true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stage the ticks a multi card asks to start with. A row with `ticked: true`
|
||||
* (never a locked one) starts ticked the first time the card shows: the pick
|
||||
* is staged exactly as if the person had made it, so Send, drafts, the settled
|
||||
* record and the reply words all work on it as they do on any other pick.
|
||||
* The page does it, not the server, because an `answer` on the item would
|
||||
* settle the card. A card is seeded once: `seeded` remembers it, so a card the
|
||||
* person cleared is never ticked again by a redraw or a reload. Cards already
|
||||
* staged, already sent or no longer open are left alone. Returns new objects,
|
||||
* never changing the inputs: `{ staged, seeded, changed }`.
|
||||
*/
|
||||
export function seedStaged(items, staged, seeded, sent = {}) {
|
||||
const outStaged = { ...(staged || {}) };
|
||||
const outSeeded = { ...(seeded || {}) };
|
||||
let changed = false;
|
||||
for (const item of items || []) {
|
||||
if (!item || !item.id || item.kind !== "multi" || !Array.isArray(item.options)) continue;
|
||||
if (item.status !== "open" && item.status !== "reopened") continue;
|
||||
if (outStaged[item.id] || outSeeded[item.id] || (sent && sent[item.id])) continue;
|
||||
const ks = item.options.filter((o) => o && o.ticked === true && o.locked !== true).map((o) => o.k);
|
||||
if (!ks.length) continue;
|
||||
outStaged[item.id] = { type: "answer", kind: "multi", ks };
|
||||
outSeeded[item.id] = true;
|
||||
changed = true;
|
||||
}
|
||||
return { staged: outStaged, seeded: outSeeded, changed };
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------- stale picks */
|
||||
|
||||
/**
|
||||
|
||||
@@ -96,6 +96,28 @@ export function agentFound(id) {
|
||||
tellApp("agent-found", { id });
|
||||
}
|
||||
|
||||
// The keys the desktop app's shell answers to (plan2code-app/ui/meter.js SHORTCUTS, held to the same
|
||||
// table by scripts/test-app-meter.mjs): Cmd on a Mac, Ctrl elsewhere. A key pressed here, inside the
|
||||
// frame, never reaches the shell's own listener, so the page forwards the id and nothing else.
|
||||
export const SHORTCUT_KEYS = Object.freeze([
|
||||
{ id: "toggle-terminal", key: "`", shift: false },
|
||||
{ id: "focus-console", key: "1", shift: false },
|
||||
{ id: "focus-terminal", key: "2", shift: false },
|
||||
{ id: "new-session", key: "n", shift: true },
|
||||
{ id: "change-project", key: "o", shift: false },
|
||||
{ id: "preferences", key: ",", shift: false },
|
||||
]);
|
||||
|
||||
/** The shortcut id a key press stands for, or null. `mac` picks Cmd over Ctrl. */
|
||||
export function shortcutIdFor(e, mac) {
|
||||
if (e.altKey) return null;
|
||||
const chord = mac ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey;
|
||||
if (!chord) return null;
|
||||
const key = String(e.key || "").toLowerCase();
|
||||
const hit = SHORTCUT_KEYS.find((s) => s.key === key && s.shift === Boolean(e.shiftKey));
|
||||
return hit ? hit.id : null;
|
||||
}
|
||||
|
||||
/** Post `message` to the frame's parent, as `{ plan2code: kind, ...extra }`; nothing outside a frame. */
|
||||
export function tellApp(kind, extra = {}) {
|
||||
if (!framed()) return;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
import { page, onRedraw, onSave, useHooks, bootData } from "./state.js";
|
||||
import {
|
||||
adopt, askSuggestions, banner, connect, fillSky, fitGrowBox, loadState, markSent, maybeWelcome, render, renderFooter,
|
||||
adopt, askSuggestions, banner, clearBanner, connect, fillSky, fitGrowBox, loadState, markSent, maybeWelcome, render, renderFooter,
|
||||
renderSidebar, renderWhere, save, startClock, startLooks, stagedPayload, syncWorkspaceScope,
|
||||
wakeHoldsChime, wireAsk, wireCards, wireChrome, wireCleanup, wireDashboard, wireDocs, wireEnding,
|
||||
wireActivities, wireLoopSetup, wireHelp, launchSkill, sendLearning, beginLearningSave, renderLearningRow, learningBlocked, openHelpOn, openLoopSetup, wireLooks, wireNotepad, wirePrefs, wireWorkspace,
|
||||
@@ -37,7 +37,7 @@ import { sound } from "./sound.js";
|
||||
// and the few calls a screen makes into another are handed to state.js first.
|
||||
onSave(save);
|
||||
useHooks({
|
||||
launchSkill, sendLearning, beginLearningSave, renderLearningRow, learningBlocked, openHelpOn, openLoopSetup, askSuggestions, banner, fitGrowBox, markSent, maybeWelcome, renderFooter, renderSidebar, renderWhere, stagedPayload, syncWorkspaceScope,
|
||||
launchSkill, sendLearning, beginLearningSave, renderLearningRow, learningBlocked, openHelpOn, openLoopSetup, askSuggestions, banner, clearBanner, fitGrowBox, markSent, maybeWelcome, renderFooter, renderSidebar, renderWhere, stagedPayload, syncWorkspaceScope,
|
||||
openPrefs, markSaved, confirmUnsaved, loadAgentsView, wireAgentsView, hasUnsaved, unsavedName, saveOpen, discardOpen, focusOpen,
|
||||
renderCard, send, refreshLessonsSend,
|
||||
});
|
||||
|
||||
@@ -13,9 +13,9 @@ export const CHAT_MAX_CHARS = 4000;
|
||||
export const CHAT_MAX_ATTACHMENTS = MAX_ATTACHMENTS;
|
||||
export const CHAT_MAX_IMAGES = CHAT_MAX_ATTACHMENTS;
|
||||
|
||||
export const CHAT_LIMIT_TEXT = "That's 10 questions in this conversation — start a new one to keep going.";
|
||||
export const CHAT_OFFLINE_TEXT = "No agent available — wait for one to become available (your terminal might be working on a task or waiting a permission approval)";
|
||||
export const CHAT_LAST_WAIT_TEXT = "That was the last question in this conversation — its answer will land here.";
|
||||
export const CHAT_LIMIT_TEXT = "That's 10 questions in this conversation: start a new one to keep going.";
|
||||
export const CHAT_OFFLINE_TEXT = "No agent is free right now. It may be mid-task or waiting on a permission approval in your terminal.";
|
||||
export const CHAT_LAST_WAIT_TEXT = "That was the last question in this conversation: its answer will land here.";
|
||||
export const CHAT_WAITING_TEXT = "Plan2Code will answer at its next check-in";
|
||||
export const CHAT_WORKING_TEXT = "Plan2Code is working on the answer…";
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export function continueButton(label = "continue", cls = "agent-key agent-key-bt
|
||||
* Null when there is nothing to offer.
|
||||
*/
|
||||
export function reconnectOffer(cls = "reconnect-offer") {
|
||||
if (page.inApp) return continueButton("Reconnect to agent", "btn small " + cls);
|
||||
if (page.inApp) return continueButton("Reconnect to agent", "btn sm " + cls);
|
||||
const note = el("p", cls + " help");
|
||||
note.appendChild(document.createTextNode("To wake the agent, type "));
|
||||
note.appendChild(el("strong", "agent-key", "continue"));
|
||||
|
||||
@@ -41,6 +41,7 @@ function renameLabel(f) {
|
||||
}
|
||||
|
||||
const STATUS_WORD = { added: "Added", deleted: "Deleted", renamed: "Renamed" };
|
||||
const STATUS_TONE = { added: "is-ok", deleted: "is-warn", renamed: "is-accent" };
|
||||
|
||||
function counts(f) {
|
||||
const box = el("span", "diff-counts");
|
||||
@@ -71,8 +72,8 @@ async function askAgain(button, status, reply) {
|
||||
});
|
||||
if (res.status === 409) throw Object.assign(new Error("pending"), { pending: true });
|
||||
if (!res.ok) throw new Error(String(res.status));
|
||||
hooks.banner("Asked for the changes again. The tab updates when they are read.", "good");
|
||||
setTimeout(() => hooks.banner(null), 5000);
|
||||
const again = hooks.banner("Asked for the changes again. The tab updates when they are read.", "good");
|
||||
setTimeout(() => hooks.clearBanner(again), 5000);
|
||||
page.pendingResult = true;
|
||||
redraw();
|
||||
} catch (err) {
|
||||
@@ -89,7 +90,7 @@ function stateBox(kind, message, buttonLabel, reply) {
|
||||
const box = el("div", "diff-state diff-" + kind);
|
||||
box.appendChild(el("p", "diff-state-msg", message));
|
||||
if (buttonLabel) {
|
||||
const btn = el("button", "btn small diff-again", buttonLabel);
|
||||
const btn = el("button", "btn sm diff-again", buttonLabel);
|
||||
btn.type = "button";
|
||||
const status = el("p", "diff-state-why");
|
||||
status.setAttribute("role", "status");
|
||||
@@ -167,7 +168,7 @@ function drawReady(b, result) {
|
||||
totals.appendChild(el("span", "diff-minus", `-${removed}`));
|
||||
view.appendChild(totals);
|
||||
if (result.tooLarge) {
|
||||
view.appendChild(el("p", "diff-notice", "This change is too large to show in full: every file is listed, but some show no lines."));
|
||||
view.appendChild(el("p", "callout is-stage diff-notice", "This change is too large to show in full: every file is listed, but some show no lines."));
|
||||
}
|
||||
|
||||
const cols = el("div", "diff-cols");
|
||||
@@ -182,7 +183,7 @@ function drawReady(b, result) {
|
||||
row.setAttribute("role", "option");
|
||||
const name = el("span", "diff-file-name");
|
||||
name.appendChild(el("strong", null, f.status === "renamed" ? renameLabel(f) : baseName(f.path)));
|
||||
if (STATUS_WORD[f.status]) name.appendChild(el("span", "diff-status diff-status-" + f.status, STATUS_WORD[f.status]));
|
||||
if (STATUS_WORD[f.status]) name.appendChild(el("span", "code-tag " + STATUS_TONE[f.status] + " diff-status diff-status-" + f.status, STATUS_WORD[f.status]));
|
||||
row.appendChild(name);
|
||||
const folder = folderOf(f.path);
|
||||
if (folder) row.appendChild(el("span", "diff-file-dir", folder));
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
import {
|
||||
BRANCH_TYPES,
|
||||
GIT_TABS,
|
||||
NOT_CONNECTED,
|
||||
PR_HOST_LABELS,
|
||||
boardActions,
|
||||
boardBranchLink,
|
||||
@@ -74,7 +75,7 @@ function copy(ctx, text, cls, codeEl) {
|
||||
}
|
||||
|
||||
// "Open pull request": a link while it can open, an inert look-alike while busy.
|
||||
function prLink(ctx, url, cls = "btn small primary") {
|
||||
function prLink(ctx, url, cls = "btn sm primary") {
|
||||
const label = "Open pull request";
|
||||
if (!controlAllowed(ctx.mode, "action")) {
|
||||
const span = ctx.h.el("span", `${cls} git-pr-open is-disabled`, label);
|
||||
@@ -109,7 +110,7 @@ export function drawGitBoard(ctx) {
|
||||
const cardSlot = h.el("div", "git-cards");
|
||||
if (git.error) {
|
||||
node.appendChild(cardSlot);
|
||||
const warn = h.el("div", "git-warn", git.error);
|
||||
const warn = h.el("div", "callout is-warn git-warn", git.error);
|
||||
warn.setAttribute("role", "alert");
|
||||
node.appendChild(warn);
|
||||
return { node, cardSlot };
|
||||
@@ -167,7 +168,7 @@ function header(ctx) {
|
||||
row.appendChild(
|
||||
h.el("span", "git-track", head.upstream && head.gone ? "remote copy deleted" : head.upstream ? `↑${head.ahead || 0} ↓${head.behind || 0}` : "not published")
|
||||
);
|
||||
if (remotes.length > 1 && cur && cur.upstreamRemote) row.appendChild(h.el("span", "badge", cur.upstreamRemote));
|
||||
if (remotes.length > 1 && cur && cur.upstreamRemote) row.appendChild(h.el("span", "pill is-accent is-caps badge", cur.upstreamRemote));
|
||||
}
|
||||
box.appendChild(row);
|
||||
|
||||
@@ -177,7 +178,7 @@ function header(ctx) {
|
||||
const cmd = "git remote add origin <url>";
|
||||
const code = h.el("code", "md-code", cmd);
|
||||
meta.appendChild(code);
|
||||
meta.appendChild(copy(ctx, cmd, "btn small", code));
|
||||
meta.appendChild(copy(ctx, cmd, "btn sm", code));
|
||||
} else meta.appendChild(h.el("span", "git-refreshed", refreshedLine(git, ctx.now)));
|
||||
if (ctx.mode === "running" && ctx.activity) meta.appendChild(activityLine(ctx, "span", ctx.activity));
|
||||
box.appendChild(meta);
|
||||
@@ -226,8 +227,8 @@ function tabStrip(ctx, active) {
|
||||
strip.appendChild(b);
|
||||
}
|
||||
bar.appendChild(strip);
|
||||
const done = control(ctx, "button", "btn small git-done", "Done with git", { role: "done", onClick: () => ctx.on.send("done") });
|
||||
if (ctx.mode === "offline") done.title = ctx.offlineReason === "pending" ? "Your last click is still being picked up." : "Not connected right now.";
|
||||
const done = control(ctx, "button", "btn sm git-done", "Done with git", { role: "done", onClick: () => ctx.on.send("done") });
|
||||
if (ctx.mode === "offline") done.title = ctx.offlineReason === "pending" ? "Your last click is still being picked up." : NOT_CONNECTED;
|
||||
bar.appendChild(done);
|
||||
return bar;
|
||||
}
|
||||
@@ -294,6 +295,13 @@ function stepLabel(ctx, s) {
|
||||
return `Commit ${plural(tablePicks(ctx).files.length, "file", "files")}`;
|
||||
}
|
||||
|
||||
// Whether the step strip over the Changes tab already carries a plain commit
|
||||
// button (the same one the commit table would draw).
|
||||
function stripCommits(ctx) {
|
||||
const p = ctx.step && ctx.step.primary;
|
||||
return Boolean(p && p.op === "commit" && ctx.step.tab === "changes");
|
||||
}
|
||||
|
||||
// The commit table's ticked files and .gitignore picks, checked against the snapshot.
|
||||
function tablePicks(ctx) {
|
||||
const ch = ctx.git.changes || {};
|
||||
@@ -310,7 +318,7 @@ function stepStrip(ctx, id) {
|
||||
if (id !== step.tab) {
|
||||
if (!p) return null;
|
||||
const where = GIT_TABS.find((t) => t.id === step.tab);
|
||||
return control(ctx, "button", "git-hint", `Next step is on ${where ? where.label : step.tab}: ${stepLabel(ctx, p)} →`, {
|
||||
return control(ctx, "button", "btn sm standby git-hint", `Next step is on ${where ? where.label : step.tab}: ${stepLabel(ctx, p)} →`, {
|
||||
role: "nav",
|
||||
onClick: () => ctx.on.pickTab(step.tab),
|
||||
});
|
||||
@@ -322,7 +330,7 @@ function stepStrip(ctx, id) {
|
||||
// much is not yours" rather than one loud suggestion to commit it all.
|
||||
if (ctx.notice && ctx.notice.op) {
|
||||
const duo = h.el("div", "git-duo");
|
||||
const landed = h.el("div", "git-landed");
|
||||
const landed = h.el("div", "callout is-ok git-landed");
|
||||
landed.setAttribute("role", "status");
|
||||
landed.appendChild(h.el("div", "git-step-kicker", "Just landed"));
|
||||
landed.appendChild(h.el("h3", "git-step-title", ctx.notice.title || ""));
|
||||
@@ -352,10 +360,10 @@ function stepStrip(ctx, id) {
|
||||
const acts = h.el("div", "git-step-actions");
|
||||
if (theirs) {
|
||||
acts.appendChild(stepButton(ctx, { ...theirs, label: "Commit other changes" }, "btn primary"));
|
||||
for (const s of step.secondary.slice(1)) acts.appendChild(stepButton(ctx, s, "btn small"));
|
||||
for (const s of step.secondary.slice(1)) acts.appendChild(stepButton(ctx, s, "btn sm"));
|
||||
} else {
|
||||
if (p) acts.appendChild(stepButton(ctx, p, "btn primary"));
|
||||
for (const s of step.secondary) acts.appendChild(stepButton(ctx, s, "btn small"));
|
||||
for (const s of step.secondary) acts.appendChild(stepButton(ctx, s, "btn sm"));
|
||||
}
|
||||
if (acts.children.length) left.appendChild(acts);
|
||||
duo.appendChild(left);
|
||||
@@ -381,7 +389,7 @@ function stepStrip(ctx, id) {
|
||||
const second = step.secondary[0];
|
||||
if (second) actions.appendChild(stepButton(ctx, second, "btn ghost"));
|
||||
} else {
|
||||
for (const s of step.secondary) actions.appendChild(stepButton(ctx, s, "btn small"));
|
||||
for (const s of step.secondary) actions.appendChild(stepButton(ctx, s, "btn sm"));
|
||||
}
|
||||
box.appendChild(actions);
|
||||
return box;
|
||||
@@ -392,7 +400,7 @@ function staleLine(ctx, text) {
|
||||
const line = ctx.h.el("p", "git-stale");
|
||||
const word = "Refresh?";
|
||||
line.appendChild(ctx.h.el("span", null, text.endsWith(word) ? text.slice(0, -word.length) : `${text} `));
|
||||
line.appendChild(control(ctx, "button", "btn small ghost git-stale-refresh", word, { onClick: () => ctx.on.send("refresh") }));
|
||||
line.appendChild(control(ctx, "button", "btn sm ghost git-stale-refresh", word, { onClick: () => ctx.on.send("refresh") }));
|
||||
return line;
|
||||
}
|
||||
|
||||
@@ -402,7 +410,7 @@ function panelFrame(ctx, title, { closable = true, disabled = false } = {}) {
|
||||
const p = ctx.h.el("section", "git-panel");
|
||||
const head = ctx.h.el("div", "git-panel-head");
|
||||
head.appendChild(ctx.h.el("h3", "git-panel-title", title));
|
||||
if (closable) head.appendChild(control(ctx, "button", "btn small ghost", "Close", { disabled, onClick: () => ctx.on.closePanel() }));
|
||||
if (closable) head.appendChild(control(ctx, "button", "btn sm ghost", "Close", { disabled, onClick: () => ctx.on.closePanel() }));
|
||||
p.appendChild(head);
|
||||
return p;
|
||||
}
|
||||
@@ -424,7 +432,7 @@ function changesBody(ctx) {
|
||||
const ch = git.changes || {};
|
||||
const any = list(ch.files).length || list(ch.untrackedDirs).length;
|
||||
if (!any) {
|
||||
body.appendChild(h.el("p", "git-empty", `No changes. Nothing to commit on ${(git.head || {}).branch || "this commit"}.`));
|
||||
body.appendChild(h.el("p", "empty", `No changes. Nothing to commit on ${(git.head || {}).branch || "this commit"}.`));
|
||||
return body;
|
||||
}
|
||||
body.appendChild(commitPanel(ctx, frozen));
|
||||
@@ -492,7 +500,7 @@ function commitPanel(ctx, frozen) {
|
||||
tr.appendChild(h.el("td", "git-path", f.path));
|
||||
const state = h.el("td", "git-state", f.state || "");
|
||||
if (f.risky) {
|
||||
state.appendChild(h.el("span", "badge git-badge is-held", "held back"));
|
||||
state.appendChild(h.el("span", "pill is-stage is-caps badge git-badge is-held", "held back"));
|
||||
state.appendChild(ignoreToggle(`git-ignore-f${i}`, f.path));
|
||||
}
|
||||
tr.appendChild(state);
|
||||
@@ -520,30 +528,33 @@ function commitPanel(ctx, frozen) {
|
||||
if (detached) {
|
||||
// No branch to commit on: the commit makes one, .gitignore-only picks included.
|
||||
actions.appendChild(
|
||||
control(ctx, "button", "btn small primary", "Create branch", {
|
||||
control(ctx, "button", "btn sm primary", "Create branch", {
|
||||
disabled: frozen || (!files.length && !ignore.length),
|
||||
onClick: () => on.openPanel("create", { commit: true, files, ignore }),
|
||||
})
|
||||
);
|
||||
} else if (!files.length && ignore.length) {
|
||||
// Only .gitignore picks: the commit takes .gitignore alone.
|
||||
actions.appendChild(control(ctx, "button", "btn small primary", `Add ${ignore.length} to .gitignore`, { disabled: frozen, onClick: send }));
|
||||
actions.appendChild(control(ctx, "button", "btn sm primary", `Add ${ignore.length} to .gitignore`, { disabled: frozen, onClick: send }));
|
||||
} else if (!first && head.branch && head.branch === git.defaultBranch) {
|
||||
actions.appendChild(h.el("p", "git-offer", `You're on ${head.branch}. Make a branch for this?`));
|
||||
actions.appendChild(
|
||||
control(ctx, "button", "btn small primary", "Create branch", {
|
||||
control(ctx, "button", "btn sm primary", "Create branch", {
|
||||
disabled: frozen || !files.length,
|
||||
onClick: () => on.openPanel("create", { commit: true, files, ignore }),
|
||||
})
|
||||
);
|
||||
actions.appendChild(control(ctx, "button", "btn small", `Commit on ${head.branch}`, { disabled: frozen || !files.length, onClick: send }));
|
||||
} else {
|
||||
actions.appendChild(control(ctx, "button", "btn sm", `Commit on ${head.branch}`, { disabled: frozen || !files.length, onClick: send }));
|
||||
} else if (!stripCommits(ctx)) {
|
||||
// The step above this table already offers this same "Commit N files" (its
|
||||
// count follows the ticks), so a second one here would be a duplicate; the
|
||||
// table keeps its own only when the step is somewhere else.
|
||||
actions.appendChild(
|
||||
control(ctx, "button", "btn small primary", `Commit ${plural(files.length, "file", "files")}`, { disabled: frozen || !files.length, onClick: send })
|
||||
control(ctx, "button", "btn sm primary", `Commit ${plural(files.length, "file", "files")}`, { disabled: frozen || !files.length, onClick: send })
|
||||
);
|
||||
}
|
||||
if (opened) actions.appendChild(control(ctx, "button", "btn small ghost", "Cancel", { disabled: frozen, onClick: () => on.closePanel() }));
|
||||
p.appendChild(actions);
|
||||
if (opened) actions.appendChild(control(ctx, "button", "btn sm ghost", "Cancel", { disabled: frozen, onClick: () => on.closePanel() }));
|
||||
if (actions.children.length) p.appendChild(actions);
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -556,7 +567,7 @@ function branchesBody(ctx) {
|
||||
if (frozen) body.appendChild(waitLine(ctx));
|
||||
|
||||
const tools = h.el("div", "git-tools");
|
||||
const search = control(ctx, "input", "git-search", null, {
|
||||
const search = control(ctx, "input", "is-compact git-search", null, {
|
||||
role: "nav",
|
||||
disabled: frozen,
|
||||
onInput: () => {
|
||||
@@ -572,7 +583,7 @@ function branchesBody(ctx) {
|
||||
tools.appendChild(search);
|
||||
// Not mid-operation, and not before the first commit, when there is nothing to branch from.
|
||||
const first = git.hasCommits === false;
|
||||
const nb = control(ctx, "button", "btn small", "New branch", {
|
||||
const nb = control(ctx, "button", "btn sm", "New branch", {
|
||||
disabled: frozen || first,
|
||||
title: first ? "Make the first commit, then you can branch from it." : frozen ? "Finish or abort what is in progress first." : undefined,
|
||||
onClick: () => on.openPanel("create"),
|
||||
@@ -588,7 +599,7 @@ function branchesBody(ctx) {
|
||||
else if (sweep) {
|
||||
const offer = h.el("p", "git-sweep-offer");
|
||||
offer.appendChild(h.el("span", null, `${plural(sweep, "branch", "branches")} merged or gone on the remote. `));
|
||||
offer.appendChild(control(ctx, "button", "btn small ghost", "Choose which to clean up…", { disabled: frozen, onClick: () => on.openPanel("cleanup") }));
|
||||
offer.appendChild(control(ctx, "button", "btn sm ghost", "Choose which to clean up…", { disabled: frozen, onClick: () => on.openPanel("cleanup") }));
|
||||
body.appendChild(offer);
|
||||
}
|
||||
|
||||
@@ -599,7 +610,7 @@ function branchesBody(ctx) {
|
||||
const { top, remoteOnly } = orderBranches(rows);
|
||||
const locals = filterBranches(top, board.query);
|
||||
if (locals.length) body.appendChild(branchTable(ctx, locals, frozen));
|
||||
else body.appendChild(h.el("p", "git-empty", board.query ? "No local branch matches." : "No local branches yet."));
|
||||
else body.appendChild(h.el("p", "empty", board.query ? "No local branch matches." : "No local branches yet."));
|
||||
|
||||
if (remoteOnly.length) {
|
||||
const fold = foldRemote(remoteOnly, { showAll: board.showAll, query: board.query });
|
||||
@@ -615,10 +626,10 @@ function branchesBody(ctx) {
|
||||
});
|
||||
det.appendChild(h.el("summary", null, `Remote only (${board.query ? fold.shown.length : remoteOnly.length})`));
|
||||
if (fold.shown.length) det.appendChild(branchTable(ctx, fold.shown, frozen));
|
||||
else det.appendChild(h.el("p", "git-empty", "No remote branch matches."));
|
||||
else det.appendChild(h.el("p", "empty", "No remote branch matches."));
|
||||
if (fold.hidden) {
|
||||
det.appendChild(
|
||||
control(ctx, "button", "btn small ghost", `Show all ${remoteOnly.length}`, {
|
||||
control(ctx, "button", "btn sm ghost", `Show all ${remoteOnly.length}`, {
|
||||
role: "nav",
|
||||
disabled: frozen,
|
||||
onClick: () => {
|
||||
@@ -647,12 +658,12 @@ function branchTable(ctx, rows, frozen) {
|
||||
const name = h.el("td", "git-cell-name");
|
||||
name.appendChild(h.el("span", "git-name", b.remote ? `${b.remote}/${b.name}` : b.name));
|
||||
const badges = [
|
||||
[b.current, "current", "is-current"],
|
||||
[b.default, "default", "is-default"],
|
||||
[b.merged, "Merged", "is-merged"],
|
||||
[b.gone, "Remote copy deleted", "is-gone"],
|
||||
[b.current, "current", "is-current is-accent"],
|
||||
[b.default, "default", "is-default is-accent"],
|
||||
[b.merged, "Merged", "is-merged is-ok"],
|
||||
[b.gone, "Remote copy deleted", "is-gone is-stage"],
|
||||
];
|
||||
for (const [shown, label, cls] of badges) if (shown) name.appendChild(h.el("span", `badge git-badge ${cls}`, label));
|
||||
for (const [shown, label, cls] of badges) if (shown) name.appendChild(h.el("span", `pill is-caps badge git-badge ${cls}`, label));
|
||||
tr.appendChild(name);
|
||||
|
||||
let track = "not published";
|
||||
@@ -671,9 +682,9 @@ function branchTable(ctx, rows, frozen) {
|
||||
const acts = h.el("td", "git-cell-actions");
|
||||
const branch = b.remote ? `${b.remote}/${b.name}` : b.name;
|
||||
// Mid-operation a row's Switch or Delete would ask for a second git op on top of the first.
|
||||
if (!b.current) acts.appendChild(control(ctx, "button", "btn small", "Switch", { disabled: frozen, onClick: () => on.send("switch", { branch }) }));
|
||||
if (!b.current) acts.appendChild(control(ctx, "button", "btn sm", "Switch", { disabled: frozen, onClick: () => on.send("switch", { branch }) }));
|
||||
if (!b.remote && !b.current && !b.default) {
|
||||
acts.appendChild(control(ctx, "button", "btn small danger", "Delete", { disabled: frozen, onClick: () => on.send("delete", { branch: b.name }) }));
|
||||
acts.appendChild(control(ctx, "button", "btn sm danger", "Delete", { disabled: frozen, onClick: () => on.send("delete", { branch: b.name }) }));
|
||||
}
|
||||
tr.appendChild(acts);
|
||||
tbody.appendChild(tr);
|
||||
@@ -714,7 +725,7 @@ function createPanel(ctx, frozen) {
|
||||
fromRow.appendChild(fromLabel);
|
||||
if (src.here && c.from !== src.here) {
|
||||
fromRow.appendChild(
|
||||
control(ctx, "button", "btn small ghost", `From ${src.here}`, {
|
||||
control(ctx, "button", "btn sm ghost", `From ${src.here}`, {
|
||||
disabled: frozen,
|
||||
onClick: () => {
|
||||
c.from = src.here;
|
||||
@@ -739,7 +750,7 @@ function createPanel(ctx, frozen) {
|
||||
type.value = c.type;
|
||||
typeLabel.appendChild(type);
|
||||
const descLabel = h.el("label", "git-field is-wide", "Short description ");
|
||||
const desc = control(ctx, "input", null, null, {
|
||||
const desc = control(ctx, "input", "is-compact", null, {
|
||||
disabled: frozen,
|
||||
onInput: () => {
|
||||
c.description = desc.value;
|
||||
@@ -754,7 +765,7 @@ function createPanel(ctx, frozen) {
|
||||
p.appendChild(parts);
|
||||
|
||||
const nameLabel = h.el("label", "git-field is-wide", "Branch name ");
|
||||
const name = control(ctx, "input", "git-new-name", null, {
|
||||
const name = control(ctx, "input", "is-compact git-new-name", null, {
|
||||
disabled: frozen,
|
||||
onInput: () => {
|
||||
c.name = name.value;
|
||||
@@ -771,7 +782,7 @@ function createPanel(ctx, frozen) {
|
||||
// The name mirrors the two fields until it is edited directly.
|
||||
const currentName = () => (c.name == null ? composeBranchName(c) : c.name);
|
||||
const actions = h.el("div", "git-panel-actions");
|
||||
const go = control(ctx, "button", "btn small primary", "Create", {
|
||||
const go = control(ctx, "button", "btn sm primary", "Create", {
|
||||
disabled: true,
|
||||
onClick: () => {
|
||||
const fields = { name: currentName(), from: c.from };
|
||||
@@ -781,7 +792,7 @@ function createPanel(ctx, frozen) {
|
||||
},
|
||||
});
|
||||
actions.appendChild(go);
|
||||
actions.appendChild(control(ctx, "button", "btn small ghost", "Cancel", { disabled: frozen, onClick: () => on.closePanel() }));
|
||||
actions.appendChild(control(ctx, "button", "btn sm ghost", "Cancel", { disabled: frozen, onClick: () => on.closePanel() }));
|
||||
p.appendChild(actions);
|
||||
|
||||
// Typing updates the name box, the status line and Create in place, never a redraw.
|
||||
@@ -807,7 +818,7 @@ function nameLine(ctx, line, st, frozen) {
|
||||
line.className = "git-name-status is-" + st.kind;
|
||||
const say = (text) => line.appendChild(h.el("span", null, text));
|
||||
const switchTo = (branch) =>
|
||||
line.appendChild(control(ctx, "button", "btn small", "Switch to it", { disabled: frozen, onClick: () => on.send("switch", { branch }) }));
|
||||
line.appendChild(control(ctx, "button", "btn sm", "Switch to it", { disabled: frozen, onClick: () => on.send("switch", { branch }) }));
|
||||
if (st.kind === "empty") say("Fill in the fields above, or type a name.");
|
||||
else if (st.kind === "invalid") say(st.reason);
|
||||
else if (st.kind === "free") say("That name is free.");
|
||||
@@ -855,12 +866,12 @@ function cleanupPanel(ctx, frozen) {
|
||||
const branches = [...sweep].filter((n) => known.has(n));
|
||||
const actions = h.el("div", "git-panel-actions");
|
||||
actions.appendChild(
|
||||
control(ctx, "button", "btn small danger", `Delete ${plural(branches.length, "branch", "branches")}`, {
|
||||
control(ctx, "button", "btn sm danger", `Delete ${plural(branches.length, "branch", "branches")}`, {
|
||||
disabled: frozen || !branches.length,
|
||||
onClick: () => on.send("cleanup", { branches }),
|
||||
})
|
||||
);
|
||||
actions.appendChild(control(ctx, "button", "btn small ghost", "Cancel", { disabled: frozen, onClick: () => on.closePanel() }));
|
||||
actions.appendChild(control(ctx, "button", "btn sm ghost", "Cancel", { disabled: frozen, onClick: () => on.closePanel() }));
|
||||
p.appendChild(actions);
|
||||
return p;
|
||||
}
|
||||
@@ -884,7 +895,7 @@ function syncBody(ctx) {
|
||||
const a = acts[key];
|
||||
if (!a.shown) continue;
|
||||
row.appendChild(
|
||||
control(ctx, "button", "btn small" + (key === primaryOp ? " primary" : ""), a.label, {
|
||||
control(ctx, "button", "btn sm" + (key === primaryOp ? " primary" : ""), a.label, {
|
||||
disabled: ctx.mode === "idle" && !a.enabled,
|
||||
title: a.title,
|
||||
onClick: () => runStep(ctx, { op: key }),
|
||||
@@ -902,7 +913,7 @@ function syncBody(ctx) {
|
||||
// Mid-operation: one block that is the step, its files and its two buttons.
|
||||
function opBlock(ctx) {
|
||||
const { git, h, on, step } = ctx;
|
||||
const box = h.el("div", "git-op git-step is-warn");
|
||||
const box = h.el("div", "callout is-stage git-op git-step");
|
||||
box.setAttribute("role", "alert");
|
||||
box.appendChild(h.el("div", "git-step-kicker", "Next step"));
|
||||
box.appendChild(h.el("h3", "git-op-title", `${OP_WORDS[git.inProgress] || "An operation"} is in progress`));
|
||||
@@ -961,13 +972,13 @@ function prBlock(ctx) {
|
||||
if (!link.host) return null;
|
||||
box.appendChild(h.el("span", "git-pr-ask", `Which host is ${link.host}?`));
|
||||
for (const [kind, label] of Object.entries(PR_HOST_LABELS)) {
|
||||
box.appendChild(control(ctx, "button", "btn small", label, { onClick: () => on.pickPrHost(link.host, kind) }));
|
||||
box.appendChild(control(ctx, "button", "btn sm", label, { onClick: () => on.pickPrHost(link.host, kind) }));
|
||||
}
|
||||
return box;
|
||||
}
|
||||
if (!link.url || !/^https:\/\//i.test(link.url)) return null;
|
||||
box.appendChild(prLink(ctx, link.url));
|
||||
box.appendChild(copy(ctx, link.url, "btn small"));
|
||||
box.appendChild(copy(ctx, link.url, "btn sm"));
|
||||
if (bases.length) {
|
||||
const label = h.el("label", "git-pr-base", "into ");
|
||||
const sel = control(ctx, "select", null, null, {
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
// this file.
|
||||
|
||||
import { prUrl, branchUrl } from "./pr-url.js";
|
||||
// Re-exported so the view, which imports only this file, says it the one way.
|
||||
export { NOT_CONNECTED } from "./labels.js";
|
||||
|
||||
export const BRANCH_TYPES = Object.freeze(["feature", "fix", "chore", "docs", "refactor", "test"]);
|
||||
export const REMOTE_FOLD = 50;
|
||||
|
||||
@@ -26,7 +26,7 @@ export const HELP_TABS = Object.freeze([
|
||||
tab("loop", "Implementation Loop", true),
|
||||
tab("git", "The git board", false),
|
||||
tab("deps", "Update dependencies", false),
|
||||
tab("subagents", "Helpers (subagents)", false),
|
||||
tab("subagents", "Subagents", false),
|
||||
tab("ask", "Ask a quick question", false),
|
||||
tab("activities", "Activities", false),
|
||||
tab("finishing", "Stopping and finishing", false),
|
||||
@@ -35,6 +35,22 @@ export const HELP_TABS = Object.freeze([
|
||||
tab("privacy", "Privacy and where things are saved", false),
|
||||
]);
|
||||
|
||||
// Four group headings over the same order: each group is a run of neighbors in
|
||||
// HELP_TABS, so grouping never moves a tab (the stuck topic stays second).
|
||||
// The headings are drawn by wireTabs() and are never tab stops.
|
||||
export const HELP_GROUPS = Object.freeze([
|
||||
Object.freeze({ title: "Start here", from: "about" }),
|
||||
Object.freeze({ title: "Working in a session", from: "workspace" }),
|
||||
Object.freeze({ title: "Tools", from: "dashboard" }),
|
||||
Object.freeze({ title: "Reference", from: "finishing" }),
|
||||
]);
|
||||
|
||||
// The heading a tab opens a new group under, or null when it continues one.
|
||||
export function helpGroupStart(id) {
|
||||
const group = HELP_GROUPS.find((g) => g.from === id);
|
||||
return group ? group.title : null;
|
||||
}
|
||||
|
||||
// Not labels.js's BUILD_WORKFLOWS: that one leaves out quick-task, which is a
|
||||
// build as far as the person watching it is concerned. Every build in skills.js.
|
||||
const HELP_BUILD_WORKFLOWS = new Set(SKILLS.filter((s) => isBuild(s.workflow)).map((s) => s.workflow));
|
||||
|
||||
+223
-166
@@ -110,7 +110,7 @@
|
||||
<header class="topbar">
|
||||
<div class="topbar-row">
|
||||
<div class="ident">
|
||||
<span class="badge" id="badge">Pathfinder</span>
|
||||
<span class="pill is-accent is-caps badge" id="badge">Pathfinder</span>
|
||||
<h1 id="title">Plan2Code Console</h1>
|
||||
<!-- The session meter: how much this console session has done. The
|
||||
ring fills with the points (full at 15); the color is the
|
||||
@@ -138,10 +138,12 @@
|
||||
stroke-dashoffset="100"
|
||||
/>
|
||||
</svg>
|
||||
<span id="meter-words">Session: fresh</span>
|
||||
<span id="meter-words">Conversation: fresh</span>
|
||||
</button>
|
||||
<div class="meter-pop" id="meter-pop" role="dialog" aria-label="Session meter" hidden>
|
||||
<p class="meter-tip" id="meter-tip"></p>
|
||||
<!-- Shown once, the first time the pill leaves green; looks.meterTipSeen. -->
|
||||
<p class="meter-once" id="meter-once" hidden></p>
|
||||
<ul class="meter-list" id="meter-list" aria-label="What the points are made of" hidden></ul>
|
||||
<div class="meter-fresh" id="meter-fresh" hidden></div>
|
||||
<button type="button" class="linky" id="meter-help">What is this?</button>
|
||||
@@ -160,62 +162,65 @@
|
||||
<div class="progress-fill" id="progress-fill"></div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="icon-btn"
|
||||
id="btn-looks"
|
||||
title="Colors, theme and sound"
|
||||
aria-label="Colors, theme and sound"
|
||||
>
|
||||
<!-- A gear: ring, hub and eight teeth. -->
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
||||
<path class="gr-teeth" d="M12 8h2.6M8 12v2.6M4 8H1.4M8 4V1.4M10.83 10.83l1.84 1.84M5.17 10.83l-1.84 1.84M5.17 5.17L3.33 3.33M10.83 5.17l1.84-1.84" />
|
||||
<circle cx="8" cy="8" r="4.2" class="gr-ring" />
|
||||
<circle cx="8" cy="8" r="1.6" class="gr-hub" />
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="icon-btn"
|
||||
id="btn-about"
|
||||
title="Help"
|
||||
aria-label="Help"
|
||||
>
|
||||
<!-- Drawn, not a "?" glyph, so it does not depend on a font. -->
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
||||
<circle cx="8" cy="8" r="7" class="ab-ring" />
|
||||
<path class="ab-mark" d="M6.1 6.05a1.95 1.95 0 1 1 2.4 1.9v1.25" />
|
||||
<circle cx="8" cy="11.7" r="0.85" class="ab-dot" />
|
||||
</svg>
|
||||
</button>
|
||||
<a
|
||||
class="icon-btn"
|
||||
id="btn-feedback"
|
||||
href="https://github.com/jparkerweb/plan2code/issues/new/choose"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
title="Report a bug or suggest an idea"
|
||||
aria-label="Report a bug or suggest an idea (opens GitHub in a new tab)"
|
||||
>
|
||||
<!-- A megaphone: horn, handle and two sound waves. -->
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
||||
<path class="mg-body" d="M1.8 6.2h2.8L10.4 3v10L4.6 9.8H1.8z" />
|
||||
<path class="mg-line" d="M4.6 9.8l.9 3.4h1.6l-.6-2.7M12.4 6.1a2.6 2.6 0 0 1 0 3.8M13.8 4.5a5 5 0 0 1 0 7" />
|
||||
</svg>
|
||||
</a>
|
||||
<!-- 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">
|
||||
<!-- A die: a rounded square and five pips. -->
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
||||
<rect class="dc-body" x="2" y="2" width="12" height="12" rx="2.6" />
|
||||
<circle class="dc-pip" cx="5.4" cy="5.4" r="1" />
|
||||
<circle class="dc-pip" cx="10.6" cy="5.4" r="1" />
|
||||
<circle class="dc-pip" cx="8" cy="8" r="1" />
|
||||
<circle class="dc-pip" cx="5.4" cy="10.6" r="1" />
|
||||
<circle class="dc-pip" cx="10.6" cy="10.6" r="1" />
|
||||
</svg>
|
||||
</button>
|
||||
<!-- The four tools, one group: the margin and gap live here, not on each button. -->
|
||||
<div class="topbar-tools">
|
||||
<button
|
||||
type="button"
|
||||
class="icon-btn"
|
||||
id="btn-looks"
|
||||
title="User Preferences"
|
||||
aria-label="User Preferences"
|
||||
>
|
||||
<!-- A gear: ring, hub and eight teeth. -->
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<path class="gr-teeth" d="M12 1v2M12 21v2M1 12h2M21 12h2M18.4 5.6l1.4-1.4M5.6 5.6L4.2 4.2M18.4 18.4l1.4 1.4M5.6 18.4l-1.4 1.4" />
|
||||
<circle cx="12" cy="12" r="6.5" class="gr-ring" />
|
||||
<circle cx="12" cy="12" r="2.5" class="gr-hub" />
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="icon-btn"
|
||||
id="btn-about"
|
||||
title="Help"
|
||||
aria-label="Help"
|
||||
>
|
||||
<!-- Drawn, not a "?" glyph, so it does not depend on a font. -->
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<circle cx="12" cy="12" r="10" class="ab-ring" />
|
||||
<path class="ab-mark" d="M9.2 9.2a2.9 2.9 0 1 1 4.2 2.6c-.9.5-1.4 1-1.4 2" />
|
||||
<circle cx="12" cy="17.3" r="0.9" class="ab-dot" />
|
||||
</svg>
|
||||
</button>
|
||||
<a
|
||||
class="icon-btn"
|
||||
id="btn-feedback"
|
||||
href="https://github.com/jparkerweb/plan2code/issues/new/choose"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
title="Report a bug or suggest an idea"
|
||||
aria-label="Report a bug or suggest an idea (opens GitHub in a new tab)"
|
||||
>
|
||||
<!-- A megaphone: horn, handle and two sound waves. -->
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<path class="mg-body" d="M3 9.5h4l7-4v13l-7-4H3z" />
|
||||
<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>
|
||||
<!-- 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">
|
||||
<!-- A die: a rounded square and five pips. -->
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<rect class="dc-body" x="3" y="3" width="18" height="18" rx="4" />
|
||||
<circle class="dc-pip" cx="8" cy="8" r="1.3" />
|
||||
<circle class="dc-pip" cx="16" cy="8" r="1.3" />
|
||||
<circle class="dc-pip" cx="12" cy="12" r="1.3" />
|
||||
<circle class="dc-pip" cx="8" cy="16" r="1.3" />
|
||||
<circle class="dc-pip" cx="16" cy="16" r="1.3" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="topbar-row second">
|
||||
<div class="row-left">
|
||||
@@ -223,39 +228,41 @@
|
||||
filled triangle in the highlight color, pointing the way home. -->
|
||||
<button
|
||||
type="button"
|
||||
class="btn ghost small home-btn"
|
||||
class="btn ghost sm home-btn"
|
||||
id="btn-home"
|
||||
title="Back to the dashboard"
|
||||
aria-label="Back to the dashboard"
|
||||
hidden
|
||||
>
|
||||
<svg viewBox="0 0 12 12" aria-hidden="true" focusable="false"><path d="M9.5 1.5v9L2 6z" /></svg>
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M18 4.5v15L5.5 12z" /></svg>
|
||||
<span class="topbar-label">Dashboard</span>
|
||||
</button>
|
||||
<button type="button" class="btn ghost small stop-btn" id="btn-stop">Stop session</button>
|
||||
<button type="button" class="btn ghost small brief-btn" id="btn-brief" hidden>
|
||||
<button type="button" class="btn ghost sm stop-btn" id="btn-stop">Stop session</button>
|
||||
<button type="button" class="btn ghost sm brief-btn" id="btn-brief" hidden>
|
||||
Write a brief
|
||||
</button>
|
||||
<!-- Subagents: opted-in skills only. Lit while helpers are on; a click
|
||||
opens the Subagents dialog and never toggles them itself. -->
|
||||
<button type="button" class="btn ghost small subagents-btn" id="btn-subagents" aria-pressed="false" hidden>
|
||||
<button type="button" class="btn ghost sm subagents-btn" id="btn-subagents" aria-haspopup="dialog" hidden>
|
||||
<!-- An orchestrator and its helpers: one larger node linked to three smaller ones. -->
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
||||
<path class="sa-link" d="M6.9 6.6L10.9 3.9M7.4 8h3.5M6.9 9.4l4 2.7" />
|
||||
<circle cx="4.6" cy="8" r="2.6" class="sa-hub" />
|
||||
<circle cx="12.4" cy="3" r="1.5" class="sa-node" />
|
||||
<circle cx="12.4" cy="8" r="1.5" class="sa-node" />
|
||||
<circle cx="12.4" cy="13" r="1.5" class="sa-node" />
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<path class="sa-link" d="M9.7 10.3l5.9-4.2M10 12h5.8M9.7 13.7l5.9 4.2" />
|
||||
<circle cx="6.5" cy="12" r="3.5" class="sa-hub" />
|
||||
<circle cx="18" cy="4.5" r="2.2" class="sa-node" />
|
||||
<circle cx="18" cy="12" r="2.2" class="sa-node" />
|
||||
<circle cx="18" cy="19.5" r="2.2" class="sa-node" />
|
||||
</svg>
|
||||
<span class="topbar-label" id="subagents-label">Subagents: off</span>
|
||||
</button>
|
||||
<!-- Notebook: every screen, never hidden. The person's private notes for this
|
||||
folder; a tab reaches the agent only through a send the person
|
||||
starts on the dashboard. -->
|
||||
<button type="button" class="btn ghost small notepad-btn" id="btn-notepad" title="Notebook" aria-label="Notebook">
|
||||
<button type="button" class="btn ghost sm notepad-btn" id="btn-notepad" title="Notebook" aria-label="Notebook">
|
||||
<!-- A pocket notebook: a closed cover with a spine line and an elastic band. -->
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
||||
<rect class="np-page" x="3.5" y="1.8" width="9" height="12.4" rx="1.3" />
|
||||
<path class="np-line" d="M10.2 1.8v12.4" />
|
||||
<rect class="np-band" x="9.4" y="6.5" width="1.6" height="3" rx=".5" />
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<rect class="np-page" x="5" y="2.5" width="14" height="19" rx="2" />
|
||||
<path class="np-line" d="M15 2.5v19" />
|
||||
<rect class="np-band" x="13.8" y="9.5" width="2.4" height="4.5" rx="0.8" />
|
||||
</svg>
|
||||
<span class="notepad-label">Notebook</span>
|
||||
</button>
|
||||
@@ -482,6 +489,33 @@
|
||||
<path d="m3.3 7 8.7 5 8.7-5" />
|
||||
<path d="M12 21.5V12" />
|
||||
</symbol>
|
||||
<!-- State marks and controls, drawn to the same standard (24 units, 1.8
|
||||
stroke, round caps) and used through <use> (render.js icon()): a
|
||||
check, an empty and a half and a filled circle, a grip and a close. -->
|
||||
<symbol id="ci-check" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M5 12.5l4.5 4.5L19 7.5" />
|
||||
</symbol>
|
||||
<symbol id="ci-circle" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="12" cy="12" r="7.5" />
|
||||
</symbol>
|
||||
<symbol id="ci-half" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="12" cy="12" r="7.5" />
|
||||
<path d="M12 4.5a7.5 7.5 0 0 1 0 15z" fill="currentColor" />
|
||||
</symbol>
|
||||
<symbol id="ci-dot" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="12" cy="12" r="5.5" fill="currentColor" />
|
||||
</symbol>
|
||||
<symbol id="ci-grip" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="9" cy="6" r="1.4" fill="currentColor" />
|
||||
<circle cx="15" cy="6" r="1.4" fill="currentColor" />
|
||||
<circle cx="9" cy="12" r="1.4" fill="currentColor" />
|
||||
<circle cx="15" cy="12" r="1.4" fill="currentColor" />
|
||||
<circle cx="9" cy="18" r="1.4" fill="currentColor" />
|
||||
<circle cx="15" cy="18" r="1.4" fill="currentColor" />
|
||||
</symbol>
|
||||
<symbol id="ci-close" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M6 6l12 12M18 6L6 18" />
|
||||
</symbol>
|
||||
</svg>
|
||||
|
||||
<!-- Planny acting out each skill while it starts up and while it works.
|
||||
@@ -1252,7 +1286,7 @@
|
||||
This page and <span data-app="Plan2Code in the terminal panel">Plan2Code in your terminal</span> are two programs, and either
|
||||
can stop without the other. Nothing you have typed is lost either way.
|
||||
</p>
|
||||
<div class="help-callout" role="note">
|
||||
<div class="callout is-stage help-callout" role="note">
|
||||
<svg class="help-callout-icon" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M12 3.5 22 20.5H2Z" />
|
||||
<path d="M12 10v5" />
|
||||
@@ -1589,8 +1623,8 @@
|
||||
on.
|
||||
</li>
|
||||
<li>
|
||||
Images go in the strip under the text. Paste one, drop one on the
|
||||
notebook or press <strong>Add image</strong>. Click a picture to see
|
||||
Pictures go in the strip under the text. Paste one, drop one on the
|
||||
notebook or press <strong>Add picture</strong>. Click a picture to see
|
||||
it full screen: the arrow keys step through them and
|
||||
<kbd>Esc</kbd> closes it. The <strong>×</strong> on a picture asks
|
||||
before it deletes it.
|
||||
@@ -1602,14 +1636,14 @@
|
||||
<li>
|
||||
It is private to this machine and never sent to Plan2Code.
|
||||
Private: the agent never reads your Notebook. A tab reaches it only
|
||||
when you start a workflow with it.
|
||||
when you start a skill with it.
|
||||
</li>
|
||||
<li>
|
||||
A lit card's confirm pane can offer <strong>Start with a note from
|
||||
your Notebook</strong>. On the dashboard, Pathfinder, Plan, Quick
|
||||
Task and UI Prototype offer it on Start fresh, Diagnose whenever
|
||||
it is lit, and Revise plan on a picked spec with no plan change
|
||||
waiting. A tab you started a workflow with wears a
|
||||
waiting. A tab you started a skill with wears a
|
||||
small <strong>sent</strong> badge.
|
||||
</li>
|
||||
<li>
|
||||
@@ -1893,8 +1927,8 @@
|
||||
while there is something to send.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Clear</strong> throws away everything you have not sent yet. It
|
||||
asks first.
|
||||
<strong>Clear</strong> throws away everything you have not sent yet, at
|
||||
once, and offers <strong>Undo</strong> for ten seconds.
|
||||
</li>
|
||||
</ul>
|
||||
<h4>Sending</h4>
|
||||
@@ -2110,17 +2144,18 @@
|
||||
</figure>
|
||||
<h4>Asking for your role</h4>
|
||||
<p>
|
||||
Until you pick a role, a one-line banner at the top asks for it, so the
|
||||
starter templates can be ordered for you.
|
||||
<strong>Set up preferences</strong> opens User Preferences;
|
||||
<strong>Not now</strong> puts the banner away. Either way it does not
|
||||
come back, and you can change your role any time from the swatch
|
||||
button.
|
||||
Your first dashboard offers only the cards. After you have started a
|
||||
skill, one quiet line at the top mentions two optional extras:
|
||||
<strong>set your role</strong>, so the starter templates can be
|
||||
ordered for you, and <strong>switch on Learning</strong>. Setting a
|
||||
role opens User Preferences; <strong>Not now</strong> puts the line
|
||||
away. Either way it does not come back, and you can change your role
|
||||
any time from the gear button.
|
||||
</p>
|
||||
<h4>When an update is out</h4>
|
||||
<p id="help-update-text">
|
||||
When a newer Plan2Code release is out, the dashboard shows
|
||||
<strong>UPDATE AVAILABLE</strong> at the top. Click it for the command
|
||||
<strong>Update available</strong> at the top. Click it for the command
|
||||
to run in your terminal, <code>plan2code update</code>; × hides it until the next
|
||||
<code>/plan2code</code>. The version at the bottom of Help links to
|
||||
the Releases page.
|
||||
@@ -2140,7 +2175,7 @@
|
||||
why.
|
||||
</p>
|
||||
<p>
|
||||
<strong>Hide unavailable workflows</strong>, under the picker, hides
|
||||
<strong>Hide unavailable skills</strong>, under the picker, hides
|
||||
them instead. It is on to begin with, and remembered on this machine.
|
||||
</p>
|
||||
<p>
|
||||
@@ -2307,16 +2342,16 @@
|
||||
<h4>The three colors</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>Green, "Session: fresh".</strong> Under
|
||||
<strong>Green, "Conversation: fresh".</strong> Under
|
||||
<span data-fact="meterYellow">5</span> points. Carry on.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Yellow, "Session: getting long".</strong> From
|
||||
<strong>Yellow, "Conversation: getting long".</strong> From
|
||||
<span data-fact="meterYellow">5</span> points. Fine for now; think
|
||||
about a fresh start after this step.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Red, "Session: time for a fresh start".</strong> From
|
||||
<strong>Red, "Conversation: time for a fresh one".</strong> From
|
||||
<span data-fact="meterRed">10</span> points. The dashboard also says so
|
||||
in a banner.
|
||||
</li>
|
||||
@@ -2489,7 +2524,7 @@
|
||||
or <strong>Match my session</strong>. A phase you leave untouched runs on
|
||||
the launch model. The one retry after a crash or a quiet agent (when retry
|
||||
is on) goes one step up (Match my session stays on the launch model),
|
||||
and the phase's helpers follow.
|
||||
and the phase's subagents follow.
|
||||
</p>
|
||||
<p>
|
||||
Click a dot in a phase's row to pick (the arrow keys move along a row);
|
||||
@@ -2497,7 +2532,7 @@
|
||||
</p>
|
||||
<h4>What is locked while it runs</h4>
|
||||
<p>
|
||||
Answers, sign-offs, launches, Workspace, Helpers and
|
||||
Answers, sign-offs, launches, Workspace, Subagents and
|
||||
<strong>Back</strong> are read-only, starting a new session is held
|
||||
back, and Ask is off, except for a question the loop is waiting on. Still
|
||||
open: Activities, Notebook, Help, Preferences, the docs and the code
|
||||
@@ -2739,22 +2774,22 @@
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<!-- Tab 16: Helpers (subagents) -->
|
||||
<!-- Tab 16: Subagents -->
|
||||
<section class="help-panel" data-tab="subagents">
|
||||
<h3>Helpers (subagents)</h3>
|
||||
<h3>Subagents</h3>
|
||||
<p>
|
||||
On most skills (all but the dashboard, Finalize, Changelog, Git and
|
||||
Handoff), Plan2Code
|
||||
can hand independent pieces of work to helpers (subagents) while it
|
||||
can hand independent pieces of work to subagents while it
|
||||
keeps the conversation with you. The <strong>Subagents</strong> button in the top bar, after
|
||||
Stop session, is lit while helpers are on.
|
||||
Stop session, is lit while subagents are on.
|
||||
</p>
|
||||
<h4>The switch</h4>
|
||||
<ul>
|
||||
<li>
|
||||
Clicking the button opens the <strong>Subagents</strong> dialog; it
|
||||
never switches helpers on or off by itself. Pick <strong>Use
|
||||
helpers</strong> or <strong>Work alone</strong>, edit the instruction
|
||||
never switches subagents on or off by itself. Pick <strong>Use
|
||||
subagents</strong> or <strong>Work alone</strong>, edit the instruction
|
||||
Plan2Code follows (<strong>Reset to default</strong> puts the
|
||||
shipped one back), and say how many may run at once.
|
||||
</li>
|
||||
@@ -2764,20 +2799,20 @@
|
||||
</li>
|
||||
<li>
|
||||
The change reaches Plan2Code at its next check-in, as a setting,
|
||||
not as something you typed. How many helpers it can really start is
|
||||
up to your agent; some have no helpers at all.
|
||||
not as something you typed. How many subagents it can really start is
|
||||
up to your agent; some have no subagents at all.
|
||||
</li>
|
||||
<li>The button only appears on skills that use helpers, and only when Plan2Code can pass the setting on.</li>
|
||||
<li>The button only appears on skills that use subagents, and only when Plan2Code can pass the setting on.</li>
|
||||
</ul>
|
||||
<h4>Helper strength</h4>
|
||||
<h4>Subagent strength</h4>
|
||||
<p>
|
||||
Under Helpers, the dialog also asks how strong the helpers should be.
|
||||
Under Subagents, the dialog also asks how strong the subagents should be.
|
||||
Like the rest of the dialog it is saved for this project and this
|
||||
skill, and it does nothing under <strong>Work alone</strong>.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>Balanced</strong> (the default): each helper gets the
|
||||
<strong>Balanced</strong> (the default): each subagent gets the
|
||||
strength its job needs: light for lookups, stronger for reviews and
|
||||
design work.
|
||||
</li>
|
||||
@@ -2790,36 +2825,36 @@
|
||||
everything except lookups.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Match my session</strong>: helpers run on whatever your
|
||||
<strong>Match my session</strong>: subagents run on whatever your
|
||||
session uses; nothing is set for them.
|
||||
</li>
|
||||
</ul>
|
||||
<h4>The Subagents tab</h4>
|
||||
<ul>
|
||||
<li>
|
||||
With the first helper, a <strong>Subagents</strong> tab appears before
|
||||
With the first subagent, a <strong>Subagents</strong> tab appears before
|
||||
Ask: one row each, with what it was asked, whether it is running, done
|
||||
or failed, and a one-line result at the end. The number on the tab is
|
||||
how many are still running.
|
||||
</li>
|
||||
<li>
|
||||
Helpers report through Plan2Code, so the rows change at its
|
||||
check-ins, not live. The page cannot stop a helper; ask Plan2Code
|
||||
Subagents report through Plan2Code, so the rows change at its
|
||||
check-ins, not live. The page cannot stop a subagent; ask Plan2Code
|
||||
on the Ask tab if one should stop.
|
||||
</li>
|
||||
<li>
|
||||
Under each helper, a line such as "Standard, medium effort" shows
|
||||
what that helper actually ran with. "Session model" means the agent
|
||||
Under each subagent, a line such as "Standard, medium effort" shows
|
||||
what that subagent actually ran with. "Session model" means the agent
|
||||
could not set a strength for it, so it ran on the session's own
|
||||
model. A helper that reported neither shows no line.
|
||||
model. A subagent that reported neither shows no line.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Working alone</strong> means your agent reported it has no
|
||||
way to start helpers here. If it starts one after all, the note
|
||||
goes away and the helper's row shows instead.
|
||||
way to start subagents here. If it starts one after all, the note
|
||||
goes away and the subagent's row shows instead.
|
||||
</li>
|
||||
<li>
|
||||
Pathfinder always uses helpers for its research questions, whatever
|
||||
Pathfinder always uses subagents for its research questions, whatever
|
||||
the switch says, and they show here too.
|
||||
</li>
|
||||
<li>The tab clears when you go back to the dashboard.</li>
|
||||
@@ -2919,7 +2954,7 @@
|
||||
<li class="for-app">
|
||||
"No agent is available right now" means the session has finished or
|
||||
Plan2Code has gone quiet. Check the terminal panel, or press
|
||||
<strong>New Session</strong> if the agent has ended, to ask.
|
||||
<strong>New Session</strong> if the agent has stopped, to ask.
|
||||
</li>
|
||||
</ul>
|
||||
<p>Either way, the conversation above stays readable.</p>
|
||||
@@ -3459,14 +3494,14 @@
|
||||
nothing to copy but the command that opens the dashboard.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Paused.</strong> You pressed <strong>Stop session</strong>.
|
||||
<strong>Stopped.</strong> You pressed <strong>Stop session</strong>.
|
||||
The screen names what was saved and gives the command that picks it
|
||||
up later. Nothing else is offered.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Paused means there is more to do and your place is kept. Finished means
|
||||
this step is over.
|
||||
Stopped means there is more to do and your place is kept. Finished means
|
||||
this skill is over.
|
||||
</p>
|
||||
<h4>Running the next command</h4>
|
||||
<p id="help-finishing-command-text">
|
||||
@@ -3526,6 +3561,10 @@
|
||||
<td><kbd>Ctrl</kbd>+<kbd>Enter</kbd> (<kbd>⌘</kbd>+<kbd>Enter</kbd> on a Mac)</td>
|
||||
<td>Send your answers (not while this Help is open). In the Ask box, send the question.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><kbd>?</kbd></td>
|
||||
<td>Open Help on the topic for where you are. It does nothing while you type in a box, an editor or a dialog, or play a game.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><kbd>Enter</kbd> in the Ask box</td>
|
||||
<td>Start a new line.</td>
|
||||
@@ -3561,8 +3600,8 @@
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>Appearance</strong>: Theme, Card width, Highlight color and
|
||||
Role.
|
||||
<strong>Appearance</strong>: Theme, Card width, Highlight color,
|
||||
Role and Intro.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Agents & models</strong>: the agents you can start and
|
||||
@@ -3709,7 +3748,8 @@
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
<strong>Back to default</strong> resets only the tab on screen:
|
||||
<strong>Reset this tab</strong> resets only the tab on screen, and offers
|
||||
Undo for a few seconds:
|
||||
Appearance's four settings (Role goes back to Not set), or every sound
|
||||
and the two Activities switches. Agents & models and System have
|
||||
nothing to reset, so it is not shown there. Your Activities best
|
||||
@@ -3879,6 +3919,7 @@
|
||||
|
||||
<dialog class="modal looks prefs" id="looks-modal" aria-labelledby="looks-title">
|
||||
<h2 id="looks-title">User Preferences</h2>
|
||||
<p class="prefs-lead" id="prefs-lead">Changes save as you make them. Agents have their own Save.</p>
|
||||
<div class="prefs-body">
|
||||
<div class="prefs-layout">
|
||||
<div id="prefs-tabs" class="prefs-tabs" role="tablist" aria-orientation="vertical" aria-label="Preference groups"></div>
|
||||
@@ -3920,7 +3961,7 @@
|
||||
</fieldset>
|
||||
<fieldset data-section="intro" class="modal-ranges">
|
||||
<legend>Intro</legend>
|
||||
<label><input type="checkbox" id="looks-skip-intro" /> <span>Always SKIP Intro</span></label>
|
||||
<label><input type="checkbox" id="looks-skip-intro" /> <span>Skip the wake-up intro</span></label>
|
||||
<p class="help">A newly opened dashboard starts with Planny asleep, waiting to be woken. Tick this to go straight to the dashboard every time.</p>
|
||||
</fieldset>
|
||||
</section>
|
||||
@@ -3928,7 +3969,7 @@
|
||||
<div class="prefs-agents" data-section="agents">
|
||||
<div class="roster-head">
|
||||
<p class="help" id="agents-intro" data-av="intro">Most people never need to change this. Plan2Code finds the agents installed on this machine and ships an up-to-date model list with every release. Open an agent to choose the models the loop uses for each strength.</p>
|
||||
<button type="button" class="btn small primary" id="agents-add" data-av="add">Add agent</button>
|
||||
<button type="button" class="btn sm primary" id="agents-add" data-av="add">Add agent</button>
|
||||
</div>
|
||||
<div class="roster" id="agents-table" data-av="table"></div>
|
||||
<span class="help" id="agents-status" data-av="status" role="status"></span>
|
||||
@@ -3942,11 +3983,15 @@
|
||||
<section class="prefs-panel" data-tab="system">
|
||||
<fieldset data-section="cleanup" class="modal-ranges">
|
||||
<legend>Cleanup</legend>
|
||||
<p class="help">Finds what Plan2Code doesn't need in your <code>~/.plan2code</code> folder: sessions nobody has opened for 30 days, and files or folders that ended up there by mistake. It also lists this project's <code>specs--completed/</code> folders nobody has touched for 30 days, and deletes one only when git tracks it, so git can restore it; one git does not track (the folder is usually gitignored) is kept, with the reason shown. You see the list before anything is deleted. Your preferences, saved folders, models, the launcher and this session always stay.</p>
|
||||
<p class="help">Finds sessions nobody has opened for 30 days, stray files in your <code>~/.plan2code</code> folder, Notebooks untouched for a month and this project's <code>specs--completed/</code> folders untouched for 30 days. You see the list and tick what to delete before anything goes.</p>
|
||||
<details class="cleanup-kept-note">
|
||||
<summary>What is kept</summary>
|
||||
<p class="help">Your preferences, saved folders, models, the launcher and this session always stay. A completed spec is deleted only when git tracks it, so git can restore it; one git does not track (the folder is usually gitignored) is kept, with the reason shown. A Notebook starts unticked, since it is your own writing.</p>
|
||||
</details>
|
||||
<div class="cleanup-list" id="cleanup-list" aria-label="What would be deleted"></div>
|
||||
<div class="models-actions">
|
||||
<button type="button" class="btn small" id="cleanup-scan">Find files to clean up</button>
|
||||
<button type="button" class="btn small danger" id="cleanup-delete" hidden>Delete these</button>
|
||||
<button type="button" class="btn sm" id="cleanup-scan">Find files to clean up</button>
|
||||
<button type="button" class="btn sm danger" id="cleanup-delete" hidden>Delete these</button>
|
||||
<span class="help" id="cleanup-status" role="status"></span>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -4022,7 +4067,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="btn ghost" id="looks-reset">Back to default</button>
|
||||
<button type="button" class="btn ghost" id="looks-reset">Reset this tab</button>
|
||||
<button type="button" class="btn primary" id="looks-done">Close</button>
|
||||
</div>
|
||||
</dialog>
|
||||
@@ -4034,22 +4079,22 @@
|
||||
<dialog class="modal looks subagents" id="subagents-modal" aria-labelledby="subagents-title">
|
||||
<h2 id="subagents-title">Subagents</h2>
|
||||
<p class="modal-blurb">
|
||||
Let Plan2Code hand independent work to helpers in this skill. Saved for this
|
||||
Let Plan2Code hand independent work to subagents in this skill. Saved for this
|
||||
project and this skill.
|
||||
</p>
|
||||
<!-- On a wide dialog the switch and the cap share a row, and the four
|
||||
strengths sit side by side, so the dialog stays short. -->
|
||||
<div class="subagents-top">
|
||||
<fieldset class="modal-ranges looks-row">
|
||||
<legend>Helpers</legend>
|
||||
<label><input type="radio" name="subagents-on" value="on" /> <span>Use helpers</span></label>
|
||||
<legend>Subagents</legend>
|
||||
<label><input type="radio" name="subagents-on" value="on" /> <span>Use subagents</span></label>
|
||||
<label><input type="radio" name="subagents-on" value="off" checked /> <span>Work alone</span></label>
|
||||
</fieldset>
|
||||
<fieldset class="modal-ranges">
|
||||
<legend>At most</legend>
|
||||
<label>
|
||||
<input type="number" id="subagents-max" min="1" max="20" step="1" aria-label="At most this many helpers at once" />
|
||||
<span>helpers at once</span>
|
||||
<input type="number" id="subagents-max" min="1" max="20" step="1" aria-label="At most this many subagents at once" />
|
||||
<span>subagents at once</span>
|
||||
</label>
|
||||
<p class="help">Advisory: your agent's own limit still applies.</p>
|
||||
</fieldset>
|
||||
@@ -4058,7 +4103,7 @@
|
||||
to: Thrifty light, Balanced standard, Best strongest, and the
|
||||
session's own model with no rank. -->
|
||||
<fieldset class="modal-ranges looks-row" id="subagents-strength-row">
|
||||
<legend>Helper strength</legend>
|
||||
<legend>Subagent strength</legend>
|
||||
<label><input type="radio" name="subagents-strength" value="thrifty" /> <span class="sa-badge lvl-1"><span class="sa-bars" aria-hidden="true"><i class="on"></i><i></i><i></i></span>Thrifty</span></label>
|
||||
<label><input type="radio" name="subagents-strength" value="balanced" checked /> <span class="sa-badge lvl-2"><span class="sa-bars" aria-hidden="true"><i class="on"></i><i class="on"></i><i></i></span>Balanced</span></label>
|
||||
<label><input type="radio" name="subagents-strength" value="best" /> <span class="sa-badge lvl-3"><span class="sa-bars" aria-hidden="true"><i class="on"></i><i class="on"></i><i class="on"></i></span>Best</span></label>
|
||||
@@ -4069,7 +4114,7 @@
|
||||
<legend>Instruction</legend>
|
||||
<div id="subagents-instruction"></div>
|
||||
<div class="models-actions">
|
||||
<button type="button" class="btn small ghost" id="subagents-default">Reset to default</button>
|
||||
<button type="button" class="btn sm ghost" id="subagents-default">Reset to default</button>
|
||||
<span class="help">Passed to the agent as written, at its next check-in.</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -4089,26 +4134,27 @@
|
||||
fills the editor on open. -->
|
||||
<dialog class="modal notepad" id="notepad-modal" aria-labelledby="notepad-title">
|
||||
<h2 id="notepad-title">Notebook</h2>
|
||||
<p class="modal-blurb">A private space to keep track of notes and uploaded images related to your in-progress work on this project. Saved on this machine. <strong class="private-note">Private</strong>: the agent never reads your Notebook. A tab reaches it only when you start a workflow with it.</p>
|
||||
<p class="modal-blurb">A private space to keep track of notes and uploaded pictures related to your in-progress work on this project. Saved on this machine. <strong class="private-note">Private</strong>: the agent never reads your Notebook. A tab reaches it only when you start a skill with it.</p>
|
||||
<div class="notepad-tabbar">
|
||||
<div class="notepad-tabs" id="notepad-tabs" role="tablist" aria-label="Notebook tabs"></div>
|
||||
<button type="button" class="btn small ghost notepad-tab-new" id="notepad-tab-new">+ New tab</button>
|
||||
<button type="button" class="btn sm ghost notepad-tab-new" id="notepad-tab-new">+ New tab</button>
|
||||
</div>
|
||||
<div class="notepad-empty" id="notepad-empty" hidden>
|
||||
<p>No tabs yet. Make one to start writing.</p>
|
||||
<button type="button" class="btn small primary" id="notepad-empty-new">+ New tab</button>
|
||||
<button type="button" class="btn sm primary" id="notepad-empty-new">+ New tab</button>
|
||||
</div>
|
||||
<div class="notepad-body" id="notepad-body">
|
||||
<div class="notepad-editor" id="notepad-editor"></div>
|
||||
<p class="help notepad-sent" id="notepad-sent" hidden></p>
|
||||
<div class="notepad-images" id="notepad-images">
|
||||
<button type="button" class="btn small ghost notepad-add" id="notepad-add">Add image</button>
|
||||
<button type="button" class="btn sm ghost notepad-add" id="notepad-add">Add picture</button>
|
||||
<input type="file" accept="image/*" multiple id="notepad-file" hidden />
|
||||
<ul class="notepad-strip" id="notepad-strip" role="list" aria-label="Notebook images"></ul>
|
||||
<ul class="notepad-strip" id="notepad-strip" role="list" aria-label="Notebook pictures"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-actions notepad-actions">
|
||||
<p class="help notepad-status" id="notepad-status" aria-live="polite"></p>
|
||||
<button type="button" class="btn sm ghost" id="notepad-retry" hidden>Try again</button>
|
||||
<button type="button" class="btn ghost" id="notepad-close">Close</button>
|
||||
</div>
|
||||
</dialog>
|
||||
@@ -4119,7 +4165,7 @@
|
||||
<dialog class="modal notepad-sub" id="notepad-name-dlg" aria-labelledby="notepad-name-label">
|
||||
<form class="notepad-name-form" id="notepad-name-form" novalidate>
|
||||
<h2 id="notepad-name-label">Name this tab</h2>
|
||||
<input type="text" id="notepad-name" autocomplete="off" spellcheck="false" aria-describedby="notepad-name-error notepad-name-count" />
|
||||
<input type="text" id="notepad-name" class="is-compact" autocomplete="off" spellcheck="false" aria-describedby="notepad-name-error notepad-name-count" />
|
||||
<p class="help notepad-name-count" id="notepad-name-count"></p>
|
||||
<p class="help notepad-name-error" id="notepad-name-error" aria-live="polite"></p>
|
||||
<div class="modal-actions">
|
||||
@@ -4146,7 +4192,7 @@
|
||||
<button type="button" class="picview-step is-next" id="picview-next" aria-label="Next image">›</button>
|
||||
<div class="picview-bar">
|
||||
<p class="picview-count" id="picview-count" aria-live="polite"></p>
|
||||
<button type="button" class="btn small picview-close" id="picview-close">Close</button>
|
||||
<button type="button" class="btn sm picview-close" id="picview-close">Close</button>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
@@ -4158,8 +4204,8 @@
|
||||
<p class="modal-blurb">Something to play while you wait. Private to this page, and it pauses whenever Plan2Code needs you.</p>
|
||||
<div class="activities-banner" id="activities-banner" role="status" hidden>
|
||||
<span class="activities-banner-text" id="activities-banner-text"></span>
|
||||
<button type="button" class="btn small" id="activities-unpause" hidden>Unpause game</button>
|
||||
<button type="button" class="btn small primary" id="activities-goto">Go to it</button>
|
||||
<button type="button" class="btn sm" id="activities-unpause" hidden>Unpause game</button>
|
||||
<button type="button" class="btn sm primary" id="activities-goto">Go to it</button>
|
||||
</div>
|
||||
<div class="activities-picker" id="activities-picker" hidden></div>
|
||||
<!-- The stage: the board, and in full screen the side panel beside it,
|
||||
@@ -4175,7 +4221,7 @@
|
||||
<p class="activities-rail-best" id="activities-rail-best"></p>
|
||||
<div class="activities-rail-score" id="activities-rail-score"></div>
|
||||
<p class="activities-rail-keys"><kbd>P</kbd> pauses · <kbd>R</kbd> restarts · <kbd>F</kbd> or <kbd>Esc</kbd> leaves full screen</p>
|
||||
<button type="button" class="btn small" id="activities-rail-exit">Exit full screen</button>
|
||||
<button type="button" class="btn sm" id="activities-rail-exit">Exit full screen</button>
|
||||
</aside>
|
||||
</div>
|
||||
<p class="activities-score" id="activities-score"></p>
|
||||
@@ -4223,10 +4269,10 @@
|
||||
title="Help on the workspace"
|
||||
aria-label="Help on the workspace"
|
||||
>
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
||||
<circle cx="8" cy="8" r="7" class="ab-ring" />
|
||||
<path class="ab-mark" d="M6.1 6.05a1.95 1.95 0 1 1 2.4 1.9v1.25" />
|
||||
<circle cx="8" cy="11.7" r="0.85" class="ab-dot" />
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<circle cx="12" cy="12" r="10" class="ab-ring" />
|
||||
<path class="ab-mark" d="M9.2 9.2a2.9 2.9 0 1 1 4.2 2.6c-.9.5-1.4 1-1.4 2" />
|
||||
<circle cx="12" cy="17.3" r="0.9" class="ab-dot" />
|
||||
</svg>
|
||||
</button>
|
||||
<button type="button" class="btn primary" id="workspace-done">Close</button>
|
||||
@@ -4238,7 +4284,11 @@
|
||||
<dialog class="modal help" id="help-modal" aria-labelledby="help-title">
|
||||
<h2 id="help-title">Help</h2>
|
||||
<div class="help-layout">
|
||||
<div id="help-tabs" class="help-tabs" role="tablist" aria-orientation="vertical" aria-label="Help topics"></div>
|
||||
<div class="help-side">
|
||||
<input type="search" class="help-filter" id="help-filter" placeholder="Filter topics" aria-label="Filter topics" autocomplete="off" />
|
||||
<p class="help-filter-empty" id="help-filter-empty" role="status" hidden>No topic matches.</p>
|
||||
<div id="help-tabs" class="help-tabs" role="tablist" aria-orientation="vertical" aria-label="Help topics"></div>
|
||||
</div>
|
||||
<div id="help-panels" class="help-panels"></div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
@@ -4268,28 +4318,28 @@
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="3.5" y="9" width="12" height="9" rx="1.6" transform="rotate(-12 9.5 13.5)" /><rect x="8.5" y="6" width="12" height="9" rx="1.6" /></svg>
|
||||
</span>
|
||||
<h3>Pick a card</h3>
|
||||
<p>Start with <strong>Suggested</strong>. Pathfinder for a foggy idea, Quick Task for something small.</p>
|
||||
<p>Start with <strong>Suggested</strong>.</p>
|
||||
</div>
|
||||
<div class="welcome-col">
|
||||
<span class="welcome-dot is-stage">
|
||||
<svg viewBox="0 0 20 20" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7" opacity="0.35" /><circle cx="10" cy="10" r="7" pathLength="100" stroke-dasharray="50 100" stroke-dashoffset="25" transform="rotate(-90 10 10)" /></svg>
|
||||
</span>
|
||||
<h3>Refresh at half way</h3>
|
||||
<p id="welcome-refresh-text">Once the session meter passes half, finish the step and start a new conversation.</p>
|
||||
<h3>Answer, then Send</h3>
|
||||
<p>Nothing leaves this page until you press <strong>Send to Plan2Code</strong>.</p>
|
||||
</div>
|
||||
<div class="welcome-col">
|
||||
<span class="welcome-dot is-bare">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="3.5" y="5" width="17" height="14" rx="2" /><path d="M7.5 10l3 2-3 2M12.5 14.5h4" /></svg>
|
||||
</span>
|
||||
<h3>Come back</h3>
|
||||
<p><code>/plan2code</code> in your agent, or <code>plan2code</code> in any folder.</p>
|
||||
<h3>Watch the terminal</h3>
|
||||
<p id="welcome-terminal-text">If the page goes quiet, your agent may be asking permission there.</p>
|
||||
</div>
|
||||
<div class="welcome-col">
|
||||
<span class="welcome-dot is-plain">
|
||||
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M12 8h2.6M8 12v2.6M4 8H1.4M8 4V1.4M10.83 10.83l1.84 1.84M5.17 10.83l-1.84 1.84M5.17 5.17L3.33 3.33M10.83 5.17l1.84-1.84" /><circle cx="8" cy="8" r="4.2" /><circle cx="8" cy="8" r="1.6" /></svg>
|
||||
</span>
|
||||
<h3>Get help</h3>
|
||||
<p><kbd>?</kbd> opens Help. The gear holds your role, theme and sounds.</p>
|
||||
<p>Press <kbd>?</kbd> or the <strong>?</strong> button for Help; the gear holds your preferences.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
@@ -4355,7 +4405,7 @@
|
||||
</dialog>
|
||||
|
||||
<dialog class="modal" id="home-modal" aria-labelledby="home-title">
|
||||
<h2 id="home-title">Leave this workflow?</h2>
|
||||
<h2 id="home-title">Leave this skill?</h2>
|
||||
<p class="modal-blurb" id="home-blurb"></p>
|
||||
<!-- The same warning Stop shows: going home saves the way a stop does,
|
||||
so it loses what a stop would lose. -->
|
||||
@@ -4403,7 +4453,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<!-- Opened from the dashboard's UPDATE AVAILABLE banner. The versions and
|
||||
<!-- Opened from the dashboard's Update available banner. The versions and
|
||||
the two copy rows are filled by app.js; the update itself runs in a
|
||||
terminal, never from this page. -->
|
||||
<dialog class="modal" id="update-modal" aria-labelledby="update-title">
|
||||
@@ -4413,13 +4463,20 @@
|
||||
<li>
|
||||
<span id="update-step-run">Run this in your terminal (not in this page or your agent):</span>
|
||||
<div class="update-command" id="update-command"></div>
|
||||
It updates everything that was installed (the skills, the <code>plan2code</code>
|
||||
command and any extras you added), with no menu. If the <code>plan2code</code>
|
||||
command is not installed, run this instead:
|
||||
<div class="update-command" id="update-fallback"></div>
|
||||
Back at your prompt with no output at all? npm
|
||||
could not reach the repository and hid the reason: run
|
||||
<code>git ls-remote https://github.com/jparkerweb/plan2code.git</code> to see it.
|
||||
<details class="update-more" id="update-more">
|
||||
<summary>Command not found, or nothing happened?</summary>
|
||||
<p>
|
||||
The command updates everything that was installed (the skills, the
|
||||
<code>plan2code</code> command and any extras you added), with no menu. If the
|
||||
<code>plan2code</code> command is not installed, run this instead:
|
||||
</p>
|
||||
<div class="update-command" id="update-fallback"></div>
|
||||
<p>
|
||||
Back at your prompt with no output at all? npm
|
||||
could not reach the repository and hid the reason: run
|
||||
<code>git ls-remote https://github.com/jparkerweb/plan2code.git</code> to see it.
|
||||
</p>
|
||||
</details>
|
||||
</li>
|
||||
<li id="update-step-restart">When it finishes, close this console and start <code>plan2code</code> again.</li>
|
||||
</ol>
|
||||
|
||||
@@ -12,6 +12,13 @@ import { SKILLS, isPhased } from "./skills.js";
|
||||
// from skills.js.
|
||||
export const BUILD_WORKFLOWS = new Set(SKILLS.filter((s) => isPhased(s.workflow)).map((s) => s.workflow));
|
||||
|
||||
// The one phrase for a page that has lost the server (Help's "Not connected"
|
||||
// state). A place may add its own tail. "Not running" and "gone quiet" are for
|
||||
// the agent only.
|
||||
export const NOT_CONNECTED = "Not connected right now.";
|
||||
export const NOT_CONNECTED_KEPT = "Your text is kept and saves when it is back.";
|
||||
export const notConnected = (tail) => (tail ? `${NOT_CONNECTED} ${tail}` : NOT_CONNECTED);
|
||||
|
||||
const PHASE_TASK = /^Task (\d+)\.(\d+) of (\d+)/;
|
||||
|
||||
export function taskLabel(text) {
|
||||
@@ -33,3 +40,44 @@ export function workingLine(agent, headline, workflow) {
|
||||
if (typeof agent.activity === "string" && agent.activity.trim()) return activityLabel(agent.activity.trim(), workflow);
|
||||
return typeof headline?.note === "string" ? headline.note.trim() : "";
|
||||
}
|
||||
|
||||
// One way to write a time: how long ago, then the short date and time, "6 h ago
|
||||
// · Nov 15, 3:42 PM". `now` is a parameter so a test can fix it. Nothing for an
|
||||
// unreadable time. The full stamp goes in a title (whenTitle).
|
||||
const MINUTE = 60_000;
|
||||
const HOUR = 60 * MINUTE;
|
||||
const DAY = 24 * HOUR;
|
||||
|
||||
export function agoWords(ms) {
|
||||
if (ms < MINUTE) return "just now";
|
||||
if (ms < HOUR) return `${Math.floor(ms / MINUTE)} min ago`;
|
||||
if (ms < DAY) return `${Math.floor(ms / HOUR)} h ago`;
|
||||
if (ms < 14 * DAY) {
|
||||
const days = Math.floor(ms / DAY);
|
||||
return `${days} ${days === 1 ? "day" : "days"} ago`;
|
||||
}
|
||||
if (ms < 60 * DAY) return `${Math.floor(ms / (7 * DAY))} weeks ago`;
|
||||
if (ms < 365 * DAY) return `${Math.floor(ms / (30 * DAY))} months ago`;
|
||||
const years = Math.floor(ms / (365 * DAY));
|
||||
return `${years} ${years === 1 ? "year" : "years"} ago`;
|
||||
}
|
||||
|
||||
export function whenWords(iso, now = Date.now()) {
|
||||
const at = new Date(iso);
|
||||
if (!iso || Number.isNaN(at.getTime())) return "";
|
||||
const shortStamp = at.toLocaleString(undefined, {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
...(at.getFullYear() === new Date(now).getFullYear() ? {} : { year: "numeric" }),
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
});
|
||||
// A time ahead of the clock (a skewed file date) reads as just now.
|
||||
return `${agoWords(Math.max(0, now - at.getTime()))} · ${shortStamp}`;
|
||||
}
|
||||
|
||||
/** The full stamp, for a title: the one place the whole date and time live. */
|
||||
export function whenTitle(iso) {
|
||||
const at = new Date(iso);
|
||||
return !iso || Number.isNaN(at.getTime()) ? "" : at.toLocaleString();
|
||||
}
|
||||
@@ -33,8 +33,14 @@ export const DEFAULT_LOOKS = {
|
||||
...soundFilePrefs(null),
|
||||
width: DEFAULT_CARD_WIDTH,
|
||||
hideUnavailable: true,
|
||||
// Always SKIP Intro: never play the dashboard's first-open wake-up (Planny asleep), off by default.
|
||||
// Skip the wake-up intro: never play the dashboard's first-open wake-up (Planny asleep), off by default.
|
||||
skipIntro: false,
|
||||
// First launch: set once a skill has been launched from this machine, and
|
||||
// never cleared (not by Back to default either). Until then the dashboard
|
||||
// holds the optional extras (the role banner, Learning at the top).
|
||||
skillLaunched: false,
|
||||
// The meter's one-time "what the colors mean" line: set once it has shown.
|
||||
meterTipSeen: false,
|
||||
// Activities: the top bar's die (hidden until someone turns on Show Activities), whether its games play sounds (under Play
|
||||
// sounds, which silences them too), the game last picked, and one best score
|
||||
// per listed game (activityBestSnake) or, for a game with courses, per
|
||||
@@ -72,6 +78,8 @@ export function adoptLooks(saved) {
|
||||
if (typeof looks.hideUnavailable !== "boolean") looks.hideUnavailable = DEFAULT_LOOKS.hideUnavailable;
|
||||
looks.width = cardWidth(looks.width);
|
||||
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;
|
||||
if (typeof looks.hideActivities !== "boolean") looks.hideActivities = DEFAULT_LOOKS.hideActivities;
|
||||
if (typeof looks.activitySounds !== "boolean") looks.activitySounds = DEFAULT_LOOKS.activitySounds;
|
||||
if (typeof looks.gameMusic !== "boolean") looks.gameMusic = DEFAULT_LOOKS.gameMusic;
|
||||
@@ -184,9 +192,10 @@ const effectiveTheme = () => (looks.theme === "system" ? (systemDark() ? "dark"
|
||||
|
||||
export function applyLooks() {
|
||||
const root = document.documentElement;
|
||||
// The desktop app's bar lights its buttons in the same highlight. That bar
|
||||
// is always dark, so it gets the dark shades whatever this page's theme is.
|
||||
tellApp("looks", { accent: ACCENTS[looks.accent].dark });
|
||||
// The desktop app's shell wears this page's theme and highlight: the resolved
|
||||
// theme and both shade sets, so a theme change restyles it at once. `accent`
|
||||
// stays the dark shades for an older shell.
|
||||
tellApp("looks", { accent: ACCENTS[looks.accent].dark, theme: effectiveTheme(), light: ACCENTS[looks.accent].light, dark: ACCENTS[looks.accent].dark });
|
||||
// The server's stand-in for the saved accent, which only has to last until
|
||||
// this runs. From here on the colors are set below, and a stale rule left
|
||||
// switched on would win over "Back to default".
|
||||
@@ -293,7 +302,7 @@ export function renderSwatches() {
|
||||
}
|
||||
|
||||
// "Back to default": every look returns to its default, but the role is
|
||||
// marked as asked, the welcome stays seen, and the Activities' best scores
|
||||
// marked as asked, the welcome stays seen, the first-launch and meter-tip flags stay, and the Activities' best scores
|
||||
// and last pick stay (only Reset best scores clears those), and so do the
|
||||
// played times and the picker's order (nothing clears those). Given `keys` (one
|
||||
// Preferences tab's, prefsResetScope() in prefs.js), only those change: the
|
||||
@@ -310,5 +319,5 @@ export function resetLooks(keys) {
|
||||
kept[memoKey(a.id)] = looks[memoKey(a.id)];
|
||||
kept[playedKey(a.id)] = looks[playedKey(a.id)];
|
||||
}
|
||||
looks = { ...DEFAULT_LOOKS, ...kept, role: ROLE_NOT_SET, welcomeSeen: looks.welcomeSeen };
|
||||
looks = { ...DEFAULT_LOOKS, ...kept, role: ROLE_NOT_SET, welcomeSeen: looks.welcomeSeen, skillLaunched: looks.skillLaunched, meterTipSeen: looks.meterTipSeen };
|
||||
}
|
||||
@@ -275,31 +275,31 @@ export function ringFraction(points) {
|
||||
}
|
||||
|
||||
export const WORDS = Object.freeze({
|
||||
green: "Session: fresh",
|
||||
yellow: "Session: getting long",
|
||||
red: "Session: time for a fresh start",
|
||||
green: "Conversation: fresh",
|
||||
yellow: "Conversation: getting long",
|
||||
red: "Conversation: time for a fresh one",
|
||||
});
|
||||
|
||||
export function tooltipFor(points) {
|
||||
const count = `${points} ${points === 1 ? "point" : "points"}`;
|
||||
switch (levelFor(points)) {
|
||||
case "green":
|
||||
return `This session is fresh (${count}).`;
|
||||
return `This conversation is fresh (${count}).`;
|
||||
case "yellow":
|
||||
return `This session is getting long (${count}). A fresh one will soon be sharper.`;
|
||||
return `This conversation is getting long (${count}). A fresh one will soon be sharper.`;
|
||||
default:
|
||||
return `This session has done a lot (${count}). The agent may start missing things.`;
|
||||
return `This conversation has done a lot (${count}). The agent may start missing things.`;
|
||||
}
|
||||
}
|
||||
|
||||
export const RED_BANNER =
|
||||
"This console session has done a lot. Starting a new console session will keep the agent sharp.";
|
||||
"This conversation has done a lot. Starting a new console session will keep the agent sharp.";
|
||||
|
||||
// The same advice, worded for the desktop app: there the app's own New
|
||||
// Session button already replaces the agent on a fresh context in one click,
|
||||
// so this never tells anyone to copy a command into a new conversation.
|
||||
export const RED_BANNER_IN_APP =
|
||||
"This console session has done a lot. Press New Session at the top of the window to start the agent fresh.";
|
||||
"This conversation has done a lot. Press New Session at the top of the window to start the agent fresh.";
|
||||
|
||||
// Everything the pill draws, from the ledger alone.
|
||||
export function meterView(entries) {
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
so the page's own CSS does not reach in: the console's tokens do, since custom
|
||||
properties inherit across the boundary, and one block covers both themes.
|
||||
Classes only: inline styles are refused too. */
|
||||
* { scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
|
||||
:host { display: block; height: 100%; }
|
||||
.notepad-cm { height: 100%; }
|
||||
.cm-editor { height: 100%; background: var(--panel); color: var(--ink); font-family: var(--sans); font-size: 15px; }
|
||||
.cm-editor { height: 100%; background: var(--panel); color: var(--ink); font-family: var(--sans); font-size: var(--fs-base); }
|
||||
div.cm-editor.cm-focused { outline: none; }
|
||||
div.cm-editor .cm-scroller { overflow: auto; line-height: 1.6; font-family: inherit; }
|
||||
div.cm-editor .cm-content { padding: 16px; caret-color: var(--accent); }
|
||||
@@ -34,7 +35,7 @@ div.cm-editor .cm-h2 { font-size: 1.45em; padding-top: 0.25em; }
|
||||
.cm-em { font-style: italic; }
|
||||
.cm-strike { text-decoration: line-through; color: var(--ink-3); }
|
||||
.cm-link { color: var(--accent); text-decoration: underline; }
|
||||
.cm-code { font-family: var(--mono); font-size: 0.92em; background: color-mix(in srgb, var(--rule) 70%, transparent); border-radius: 4px; padding: 0 3px; }
|
||||
.cm-code { font-family: var(--mono); font-size: 0.92em; background: color-mix(in srgb, var(--rule) 70%, transparent); border-radius: var(--radius-xs); padding: 0 3px; }
|
||||
.cm-codeblock { font-family: var(--mono); font-size: 0.92em; background: color-mix(in srgb, var(--rule) 55%, transparent); }
|
||||
.cm-fence { color: var(--ink-3); }
|
||||
div.cm-editor .cm-quote { color: var(--ink-2); border-left: 3px solid var(--accent-line); padding-left: 10px; }
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// notepad.js owns the rules for order.
|
||||
|
||||
import { dropTab } from "./notepad.js";
|
||||
import { el } from "./render.js";
|
||||
import { el, icon } from "./render.js";
|
||||
|
||||
const $ = (id) => document.getElementById(id);
|
||||
|
||||
@@ -88,7 +88,8 @@ export function createTabs({ onSwitch, onChange }) {
|
||||
});
|
||||
// The x is a button of its own beside the name, so the tab's text stays
|
||||
// its name and a double-click or a drag on the name never reaches it.
|
||||
const x = el("button", "notepad-tab-x", "×");
|
||||
const x = el("button", "notepad-tab-x");
|
||||
x.appendChild(icon("close"));
|
||||
x.type = "button";
|
||||
x.setAttribute("aria-label", "Delete " + tab.name);
|
||||
x.title = "Delete tab";
|
||||
@@ -102,7 +103,7 @@ export function createTabs({ onSwitch, onChange }) {
|
||||
// says it for a screen reader.
|
||||
if (tab.sent) {
|
||||
b.setAttribute("aria-label", tab.name + ", sent");
|
||||
const badge = el("span", "notepad-sent-badge", "sent");
|
||||
const badge = el("span", "pill is-accent notepad-sent-badge", "sent");
|
||||
badge.setAttribute("aria-hidden", "true");
|
||||
wrap.append(badge);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// import this file. The limits mirror notepads.mjs (a test keeps them equal),
|
||||
// copied rather than imported because the page cannot load server modules.
|
||||
|
||||
import { NOT_CONNECTED_KEPT, notConnected } from "./labels.js";
|
||||
|
||||
export const SAVE_DEBOUNCE_MS = 800;
|
||||
export const RETRY_STEPS_MS = Object.freeze([1000, 2000, 4000, 8000, 16000, 30000]);
|
||||
export const NOTE_MAX_BYTES = 1024 * 1024;
|
||||
@@ -134,23 +136,23 @@ const ERROR_SENTENCES = Object.freeze({
|
||||
"too-long": `This note is too long to save. Notes can be up to ${sizeWords(NOTE_MAX_BYTES)}.`,
|
||||
"not-jpeg": "That picture could not be added. Try a PNG, JPEG or a screenshot.",
|
||||
"too-large": "That picture is too large to add. Try a smaller one.",
|
||||
"too-many": `This notepad already holds ${NOTEPAD_MAX_IMAGES} pictures, the most it can keep. Delete one to add another.`,
|
||||
"not-found": "That picture is no longer in this notepad.",
|
||||
"too-many": `This Notebook already holds ${NOTEPAD_MAX_IMAGES} pictures, the most it can keep. Delete one to add another.`,
|
||||
"not-found": "That picture is no longer in this Notebook.",
|
||||
"bad-name": `A tab name needs 1 to ${TAB_NAME_MAX} characters, with no control characters.`,
|
||||
"bad-sent": "Plan2Code could not record where that tab was sent, so nothing was changed.",
|
||||
"duplicate-name": "There is already a tab with that name.",
|
||||
"too-many-tabs": `This notepad already has ${NOTEPAD_MAX_TABS} tabs, the most it can have. Delete one to add another.`,
|
||||
"no-such-tab": "That tab is no longer in this notepad.",
|
||||
"too-many-tabs": `This Notebook already has ${NOTEPAD_MAX_TABS} tabs, the most it can have. Delete one to add another.`,
|
||||
"no-such-tab": "That tab is no longer in this Notebook.",
|
||||
});
|
||||
|
||||
const LOST_CONTACT = "Lost contact with Plan2Code. Your text is kept here and will be saved once it's back.";
|
||||
const LOST_CONTACT = notConnected(NOT_CONNECTED_KEPT);
|
||||
|
||||
// The status line when the note could not be read on first open: the editor
|
||||
// stays read-only, since anything typed would be saved over the real note.
|
||||
export const NOT_LOADED = "Could not read the note. Close the notepad and open it again.";
|
||||
export const NOT_LOADED = "Could not read the note. Close the Notebook and open it again.";
|
||||
|
||||
// The status line when the editor itself could not be loaded.
|
||||
export const EDITOR_NOT_LOADED = "The editor could not be loaded. Close the notepad and open it again.";
|
||||
export const EDITOR_NOT_LOADED = "The editor could not be loaded. Close the Notebook and open it again.";
|
||||
|
||||
// One plain sentence for a server refusal; anything else (status 0, an
|
||||
// unknown code) is treated as a lost connection.
|
||||
|
||||
@@ -85,12 +85,12 @@ export const ACCENTS = {
|
||||
},
|
||||
lemon: {
|
||||
name: "Lemon",
|
||||
light: ["#7e7607", "#fcfbee", "#ffffff", "#c5bf67"],
|
||||
light: ["#787107", "#fcfbee", "#ffffff", "#c5bf67"],
|
||||
dark: ["#f0e442", "#32301b", "#14130b", "#767242"],
|
||||
},
|
||||
olive: {
|
||||
name: "Olive",
|
||||
light: ["#72742c", "#f8f8ed", "#ffffff", "#b8ba8c"],
|
||||
light: ["#70722b", "#f8f8ed", "#ffffff", "#b8ba8c"],
|
||||
dark: ["#b5b946", "#31321b", "#14140b", "#4f5037"],
|
||||
},
|
||||
lime: {
|
||||
@@ -115,7 +115,7 @@ export const ACCENTS = {
|
||||
},
|
||||
mint: {
|
||||
name: "Mint",
|
||||
light: ["#25805a", "#effaf6", "#ffffff", "#97c4b1"],
|
||||
light: ["#247e59", "#effaf6", "#ffffff", "#97c4b1"],
|
||||
dark: ["#8be4bf", "#1b3228", "#0b1410", "#427660"],
|
||||
},
|
||||
teal: {
|
||||
@@ -125,7 +125,7 @@ export const ACCENTS = {
|
||||
},
|
||||
aqua: {
|
||||
name: "Aqua",
|
||||
light: ["#177e82", "#eefbfc", "#ffffff", "#8dc6c8"],
|
||||
light: ["#167a7e", "#eefbfc", "#ffffff", "#8dc6c8"],
|
||||
dark: ["#84e8eb", "#1b3132", "#0b1414", "#427476"],
|
||||
},
|
||||
cyan: {
|
||||
|
||||
@@ -239,7 +239,7 @@ function blockInto(parent, tokens) {
|
||||
case "blockquote": {
|
||||
// A quote that opens with `[!CAUTION]` or `[!TIP]` is a colored alert box.
|
||||
const alert = alertKind(t.tokens);
|
||||
const q = el("blockquote", alert ? `md-quote md-alert md-alert-${alert}` : "md-quote");
|
||||
const q = el("blockquote", alert ? `md-quote md-alert md-alert-${alert} callout ${alert === "caution" ? "is-warn" : "is-info"}` : "md-quote");
|
||||
blockInto(q, t.tokens);
|
||||
parent.appendChild(q);
|
||||
break;
|
||||
@@ -422,7 +422,7 @@ function selectContents(node) {
|
||||
}
|
||||
|
||||
function copyButton(text, className, source) {
|
||||
const b = el("button", className || "btn small", "Copy");
|
||||
const b = el("button", className || "btn sm", "Copy");
|
||||
b.type = "button";
|
||||
b.addEventListener("click", () =>
|
||||
copyText(text, b, "Copy", () => {
|
||||
@@ -467,6 +467,34 @@ export function approvalTip() {
|
||||
|
||||
export const SVG_NS = "http://www.w3.org/2000/svg";
|
||||
|
||||
// One symbol from the icon sheet in index.html (`ci-<name>`), drawn at the
|
||||
// size of its text. Always aria-hidden: whatever it means is said by text.
|
||||
export function icon(name, className = "mark-icon") {
|
||||
const svg = document.createElementNS(SVG_NS, "svg");
|
||||
svg.setAttribute("class", className);
|
||||
svg.setAttribute("aria-hidden", "true");
|
||||
svg.setAttribute("focusable", "false");
|
||||
const use = document.createElementNS(SVG_NS, "use");
|
||||
use.setAttribute("href", "#ci-" + name);
|
||||
svg.appendChild(use);
|
||||
return svg;
|
||||
}
|
||||
|
||||
// Text only assistive tech reads ("ready to send" beside a mark).
|
||||
export function hiddenText(text) {
|
||||
return el("span", "sr-only", text);
|
||||
}
|
||||
|
||||
// A state mark: the symbol, hidden from assistive tech, and its meaning as
|
||||
// hidden text. The title stays for the pointer.
|
||||
export function stateMark(className, name, label) {
|
||||
const mark = el("span", className);
|
||||
mark.title = label;
|
||||
mark.appendChild(icon(name));
|
||||
mark.appendChild(hiddenText(label));
|
||||
return mark;
|
||||
}
|
||||
|
||||
// A time of day for a chat message; empty when the stamp does not parse.
|
||||
export function shortTime(iso) {
|
||||
try {
|
||||
|
||||
@@ -75,7 +75,7 @@ export function mountAgentsView(container, opts = {}) {
|
||||
const split = el("div", "split");
|
||||
const list = el("div", "split-list");
|
||||
list.dataset.av = "table";
|
||||
const add = el("button", "btn small ghost split-add", "Add agent");
|
||||
const add = el("button", "btn sm ghost split-add", "Add agent");
|
||||
add.type = "button";
|
||||
add.dataset.av = "add";
|
||||
list.appendChild(add);
|
||||
@@ -199,7 +199,7 @@ export function mountAgentsView(container, opts = {}) {
|
||||
}
|
||||
|
||||
// Leaving a form for another row drops its draft, as closing it always did:
|
||||
// a dirty one asks first (the dialog's Save / Discard / Keep editing).
|
||||
// a dirty one asks first (the dialog's Keep editing / Discard / Save).
|
||||
async function leaveForm() {
|
||||
if (!ctx.openKey) return true;
|
||||
if (isDirty(ctx.saved, ctx.drafts, ctx.openKey, ctx.strengthDrafts) && !(await confirmUnsaved())) return false;
|
||||
|
||||
@@ -38,7 +38,7 @@ function agentInput(ctx, agent, key, label, placeholder, trim) {
|
||||
// The command's Test: where it would run from. Never saves.
|
||||
function agentTest(ctx, agent) {
|
||||
const wrap = el("div", "prefs-agents-test");
|
||||
const test = el("button", "btn small", "Test");
|
||||
const test = el("button", "btn sm", "Test");
|
||||
test.type = "button";
|
||||
const result = el("span", "help agent-test-result");
|
||||
result.setAttribute("role", "status");
|
||||
@@ -78,7 +78,7 @@ function modelRow(ctx, m, panel, onRemove) {
|
||||
row.appendChild(name);
|
||||
row.appendChild(panel ? panel.pills(m.id, m.label || m.id) : el("span"));
|
||||
if (onRemove) {
|
||||
const remove = el("button", "btn small ghost", "Remove");
|
||||
const remove = el("button", "btn sm ghost", "Remove");
|
||||
remove.type = "button";
|
||||
remove.setAttribute("aria-label", "Remove " + (m.label || m.id));
|
||||
remove.addEventListener("click", onRemove);
|
||||
@@ -101,7 +101,7 @@ function addModelRow(ctx, list, { nameRequired, taken }) {
|
||||
label.placeholder = nameRequired ? "Name shown in the menu" : "Name shown in the menu (optional)";
|
||||
label.setAttribute("aria-label", "Name shown in the menu");
|
||||
label.dataset.field = "models";
|
||||
const add = el("button", "btn small", "Add a model");
|
||||
const add = el("button", "btn sm", "Add a model");
|
||||
add.type = "button";
|
||||
const submit = () => {
|
||||
const value = id.value.trim();
|
||||
@@ -191,10 +191,10 @@ function modelsTab(ctx, key, draft) {
|
||||
function builtInLaunch(ctx, key) {
|
||||
const cli = cliOf(key);
|
||||
const entry = ctx.saved.builtins.find((b) => b.id === cli);
|
||||
const note = el("div", "note");
|
||||
const note = el("div", "callout is-info note");
|
||||
note.append(el("b", null, "Managed by Plan2Code. "), `The command and arguments for ${BUILT_IN[cli]} ship with the app and update with it. Only its models are yours to change.`);
|
||||
const list = el("dl", "kv");
|
||||
const state = el("span", "prefs-badge");
|
||||
const state = el("span", "pill is-neutral prefs-badge");
|
||||
const known = ctx.found.get(key);
|
||||
drawBadge(state, known ? known.state : "unknown");
|
||||
const command = el("dd");
|
||||
@@ -231,26 +231,26 @@ function addedLaunch(ctx, draft) {
|
||||
// confirm on the form itself (never the browser's confirm()).
|
||||
function formFoot(ctx, key) {
|
||||
const foot = el("div", "agent-foot prefs-agents-foot");
|
||||
const save = el("button", "btn small primary prefs-agents-save", "Save");
|
||||
const save = el("button", "btn sm primary prefs-agents-save", "Save");
|
||||
save.type = "button";
|
||||
save.addEventListener("click", () => ctx.save(key));
|
||||
const discard = el("button", "btn small ghost prefs-agents-discard", "Discard");
|
||||
const discard = el("button", "btn sm ghost prefs-agents-discard", "Discard");
|
||||
discard.type = "button";
|
||||
discard.addEventListener("click", () => ctx.discard());
|
||||
const badge = el("span", "prefs-unsaved-badge", "Unsaved");
|
||||
const badge = el("span", "pill is-warn prefs-unsaved-badge", "Unsaved");
|
||||
foot.append(save, discard, badge);
|
||||
if (ctx.formReplace) {
|
||||
const anyway = el("button", "btn small danger prefs-agents-replace", "Save anyway");
|
||||
const anyway = el("button", "btn sm danger prefs-agents-replace", "Save anyway");
|
||||
anyway.type = "button";
|
||||
anyway.addEventListener("click", () => ctx.save(key, { replace: true }));
|
||||
foot.append(anyway);
|
||||
}
|
||||
if (key.startsWith("agent:") && key !== "agent:new") {
|
||||
if (ctx.confirming) {
|
||||
const yes = el("button", "btn small danger", "Yes, delete");
|
||||
const yes = el("button", "btn sm danger", "Yes, delete");
|
||||
yes.type = "button";
|
||||
yes.addEventListener("click", () => ctx.deleteAgent(key));
|
||||
const keep = el("button", "btn small ghost", "Keep");
|
||||
const keep = el("button", "btn sm ghost", "Keep");
|
||||
keep.type = "button";
|
||||
keep.addEventListener("click", () => {
|
||||
ctx.confirming = false;
|
||||
@@ -258,7 +258,7 @@ function formFoot(ctx, key) {
|
||||
});
|
||||
foot.append(el("span", "help", "Delete this agent?"), yes, keep);
|
||||
} else {
|
||||
const del = el("button", "btn small ghost danger prefs-agents-delete", "Delete agent");
|
||||
const del = el("button", "btn sm ghost danger prefs-agents-delete", "Delete agent");
|
||||
del.type = "button";
|
||||
del.addEventListener("click", () => {
|
||||
ctx.confirming = true;
|
||||
@@ -323,11 +323,11 @@ export function drawForm(ctx) {
|
||||
if (isCli) title.append(el("span", null, BUILT_IN[cliOf(key)]), el("code", null, cliOf(key)));
|
||||
else {
|
||||
title.append(el("span", null, key === "agent:new" ? "New agent" : savedEntry(ctx.saved, key).name));
|
||||
if (key === "agent:new" && ctx.draftFrom) title.append(el("span", "tag", `From the ${ctx.draftFrom} template`));
|
||||
if (key === "agent:new" && ctx.draftFrom) title.append(el("span", "pill is-neutral tag", `From the ${ctx.draftFrom} template`));
|
||||
}
|
||||
head.appendChild(title);
|
||||
if (ctx.$("drawer")) {
|
||||
const close = el("button", "btn small ghost drawer-close", "Close");
|
||||
const close = el("button", "btn sm ghost drawer-close", "Close");
|
||||
close.type = "button";
|
||||
close.setAttribute("aria-label", "Close");
|
||||
close.addEventListener("click", () => ctx.closeDrawer());
|
||||
|
||||
@@ -16,7 +16,7 @@ export function listEditor({ list, kind = "text", field = kind === "models" ? "m
|
||||
box.replaceChildren();
|
||||
list.forEach((item, i) => {
|
||||
const row = el("div", kind === "models" ? "agent-row model" : "agent-row");
|
||||
const remove = el("button", "btn small ghost", "Remove");
|
||||
const remove = el("button", "btn sm ghost", "Remove");
|
||||
remove.type = "button";
|
||||
remove.addEventListener("click", () => {
|
||||
list.splice(i, 1);
|
||||
@@ -59,7 +59,7 @@ export function listEditor({ list, kind = "text", field = kind === "models" ? "m
|
||||
}
|
||||
box.appendChild(row);
|
||||
});
|
||||
const add = el("button", "btn small ghost", addLabel);
|
||||
const add = el("button", "btn sm ghost", addLabel);
|
||||
add.type = "button";
|
||||
add.addEventListener("click", () => {
|
||||
list.push(kind === "models" ? (optionalName ? { id: "" } : { id: "", label: "" }) : "");
|
||||
|
||||
@@ -59,6 +59,15 @@ export function strengthsPanel(ctx, agentId, draft, { models, hasEffort }) {
|
||||
const m = modelList().find((x) => x.id === id);
|
||||
return m ? m.label || m.id : id;
|
||||
};
|
||||
// The picked model as the model rows show it: the label (the description only,
|
||||
// "latest Sonnet") with its id under it, as the launcher prints them side by side.
|
||||
const modelName = (id) => {
|
||||
const label = labelOf(id);
|
||||
const span = el("span", "strength-model model-name");
|
||||
span.append(label);
|
||||
if (label !== id) span.append(el("code", null, id));
|
||||
return span;
|
||||
};
|
||||
|
||||
const box = el("div", "strength-body prefs-agents-strengths");
|
||||
const pillSets = [];
|
||||
@@ -100,7 +109,7 @@ export function strengthsPanel(ctx, agentId, draft, { models, hasEffort }) {
|
||||
label.append(wordChip(word), el("small", "help", HINTS[word]));
|
||||
row.appendChild(label);
|
||||
const pick = resolved[word];
|
||||
row.appendChild(el("span", pick ? "strength-model" : "strength-model none", pick ? labelOf(pick.model) : "not mapped"));
|
||||
row.appendChild(pick ? modelName(pick.model) : el("span", "strength-model none", "not mapped"));
|
||||
if (hasEffort) {
|
||||
const effort = el("select");
|
||||
effort.dataset.field = "effort";
|
||||
@@ -117,7 +126,7 @@ export function strengthsPanel(ctx, agentId, draft, { models, hasEffort }) {
|
||||
row.appendChild(effort);
|
||||
}
|
||||
if (Object.prototype.hasOwnProperty.call(user, word)) {
|
||||
const reset = el("button", "btn small ghost strength-reset", "Reset");
|
||||
const reset = el("button", "btn sm ghost strength-reset", "Reset");
|
||||
reset.type = "button";
|
||||
reset.dataset.field = "reset";
|
||||
reset.setAttribute("aria-label", `Reset ${WORDS[word]}`);
|
||||
|
||||
@@ -23,20 +23,21 @@ export const BADGES = {
|
||||
unknown: "Not checked",
|
||||
};
|
||||
|
||||
const TONE_OF = { ok: "is-ok", missing: "is-warn" };
|
||||
|
||||
export function drawBadge(badge, state) {
|
||||
badge.textContent = BADGES[state];
|
||||
badge.classList.remove("ok", "missing");
|
||||
if (state !== "unknown") badge.classList.add(state);
|
||||
badge.classList.remove("ok", "missing", "is-ok", "is-warn");
|
||||
if (state !== "unknown") badge.classList.add(state, TONE_OF[state]);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------- the prefs cards */
|
||||
|
||||
// A model's name without its gloss ("Sonnet, latest Sonnet" or "Opus plan: Opus in plan mode" is cut at the first separator), so a card line stays one line.
|
||||
const GLOSS = new RegExp(" " + String.fromCharCode(8212) + " |, |: ");
|
||||
const shortLabel = (label) => label.split(GLOSS)[0];
|
||||
|
||||
// The model each strength resolves to for one row, as [word, label, effort]
|
||||
// triples; empty while the strengths did not load.
|
||||
// The model each strength resolves to for one row, as [word, model, effort]
|
||||
// triples (model a { id, label } row, or null); empty while the strengths did
|
||||
// not load. A card line names the model by its id, the name the launcher's
|
||||
// menu, --model and the loop setup use; a label is the description only
|
||||
// ("latest Sonnet"), so it rides along as the line's tooltip.
|
||||
function strengthLines(ctx, row) {
|
||||
if (!ctx.modelsLoaded) return [];
|
||||
const isCli = row.key.startsWith("cli:");
|
||||
@@ -50,7 +51,7 @@ function strengthLines(ctx, row) {
|
||||
return STRENGTH_ORDER.map((word) => {
|
||||
const pick = resolved[word];
|
||||
const model = pick && row.models.find((m) => m.id === pick.model);
|
||||
return [word, model ? shortLabel(model.label || model.id) : null, pick && pick.effort];
|
||||
return [word, model || null, pick && pick.effort];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -66,10 +67,10 @@ function agentCard(ctx, row, check) {
|
||||
const top = el("span", "card-top");
|
||||
const who = el("span", "card-who");
|
||||
const name = el("span", "row-name", row.name);
|
||||
if (row.key.startsWith("agent:")) name.append(" ", el("span", "tag", "Custom"));
|
||||
if (row.key.startsWith("agent:")) name.append(" ", el("span", "pill is-neutral tag", "Custom"));
|
||||
who.append(name, el("code", null, row.command));
|
||||
top.appendChild(who);
|
||||
const badge = el("span", "prefs-badge");
|
||||
const badge = el("span", "pill is-neutral prefs-badge");
|
||||
const known = serverStateFor(ctx.saved, row);
|
||||
if (known) {
|
||||
ctx.found.set(row.key, { command: row.command, state: known });
|
||||
@@ -87,9 +88,14 @@ function agentCard(ctx, row, check) {
|
||||
const lines = strengthLines(ctx, row);
|
||||
if (lines.length) {
|
||||
const tiers = el("span", "card-tiers");
|
||||
for (const [word, label, effort] of lines) {
|
||||
for (const [word, model, effort] of lines) {
|
||||
const line = el("span", "card-tier");
|
||||
line.append(wordChip(word), label ? el("span", null, effort ? `${label} · ${effort}` : label) : el("span", "muted", "not mapped"));
|
||||
let named = el("span", "muted", "not mapped");
|
||||
if (model) {
|
||||
named = el("span", null, effort ? `${model.id} · ${effort}` : model.id);
|
||||
if (model.label && model.label !== model.id) named.title = model.label;
|
||||
}
|
||||
line.append(wordChip(word), named);
|
||||
tiers.appendChild(line);
|
||||
}
|
||||
r.appendChild(tiers);
|
||||
@@ -106,16 +112,16 @@ function agentCard(ctx, row, check) {
|
||||
// The badge a setup row's state gets: the glanceable half, with the pane
|
||||
// beside it saying what the state means and what can be done about it.
|
||||
function setupStateBadge(entry) {
|
||||
const badge = el("span", "prefs-badge");
|
||||
const badge = el("span", "pill is-neutral prefs-badge");
|
||||
if (entry.state === "found") {
|
||||
badge.textContent = "Found";
|
||||
badge.classList.add("ok");
|
||||
badge.classList.add("ok", "is-ok");
|
||||
} else if (entry.state === "outside") {
|
||||
badge.textContent = "Found outside PATH";
|
||||
badge.classList.add("missing");
|
||||
badge.classList.add("missing", "is-warn");
|
||||
} else if (entry.state === "missing") {
|
||||
badge.textContent = "Not found";
|
||||
badge.classList.add("missing");
|
||||
badge.classList.add("missing", "is-warn");
|
||||
} else {
|
||||
badge.textContent = "Not checked";
|
||||
}
|
||||
@@ -196,7 +202,7 @@ function setupStateArea(ctx, entry) {
|
||||
area.appendChild(line);
|
||||
// A session opened for one CLI only offers that one's Start.
|
||||
if (ctx.onStart && (!ctx.forCli() || entry.id === ctx.forCli())) {
|
||||
const start = el("button", "btn small primary", "Start with this agent");
|
||||
const start = el("button", "btn sm primary", "Start with this agent");
|
||||
start.type = "button";
|
||||
start.addEventListener("click", () => ctx.onStart(entry));
|
||||
area.appendChild(start);
|
||||
@@ -205,7 +211,7 @@ function setupStateArea(ctx, entry) {
|
||||
const line = el("p", "setup-agent-line");
|
||||
line.append(badge, ` Found at ${entry.path || ""}, but not on PATH`);
|
||||
area.appendChild(line);
|
||||
const use = el("button", "btn small", "Use it from here");
|
||||
const use = el("button", "btn sm", "Use it from here");
|
||||
use.type = "button";
|
||||
use.addEventListener("click", () => ctx.useFromHere(entry));
|
||||
area.appendChild(use);
|
||||
@@ -242,7 +248,7 @@ function templatePane(ctx, template) {
|
||||
head.appendChild(title);
|
||||
box.appendChild(head);
|
||||
if (template.note) box.appendChild(el("p", "help", template.note));
|
||||
const use = el("button", "btn small", "Use this template");
|
||||
const use = el("button", "btn sm", "Use this template");
|
||||
use.type = "button";
|
||||
use.addEventListener("click", () => {
|
||||
// Cloned: the form edits the draft in place, and saved.templates is
|
||||
@@ -274,7 +280,7 @@ export function drawSummaryPane(ctx) {
|
||||
head.appendChild(title);
|
||||
box.append(head, setupStateArea(ctx, entry));
|
||||
if (ctx.saved.agents.includes(entry)) {
|
||||
const edit = el("button", "btn small", "Edit");
|
||||
const edit = el("button", "btn sm", "Edit");
|
||||
edit.type = "button";
|
||||
edit.setAttribute("aria-label", "Edit " + (entry.name || entry.id));
|
||||
edit.addEventListener("click", () => ctx.pick("agent:" + entry.id));
|
||||
@@ -287,7 +293,7 @@ export function drawSummaryPane(ctx) {
|
||||
pane.appendChild(templatePane(ctx, template));
|
||||
return;
|
||||
}
|
||||
pane.appendChild(el("div", "split-empty", "Pick an agent on the left to see its state and the way forward."));
|
||||
pane.appendChild(el("div", "empty", "Pick an agent on the left to see its state and the way forward."));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------ the Add agent chooser */
|
||||
@@ -308,7 +314,7 @@ export function drawChooser(ctx) {
|
||||
const head = el("div", "chooser-head");
|
||||
const title = el("h3", null, "Add an agent");
|
||||
title.id = "agents-chooser-title";
|
||||
const close = el("button", "btn small ghost", "Cancel");
|
||||
const close = el("button", "btn sm ghost", "Cancel");
|
||||
close.type = "button";
|
||||
close.addEventListener("click", () => ctx.closeChooser());
|
||||
head.append(title, close);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Plan2Code Web Console - the Ask chat, the Subagents tab, and attaching files to notes.
|
||||
|
||||
import { NOT_CONNECTED } from "../labels.js";
|
||||
import { page, saveNow, redraw, freshChat, hooks, scrollMemory, setDraft } from "../state.js";
|
||||
import { chatAnswering, chatOffline, chatView, sendState as chatSendState, newestReplyId, CHAT_MAX_CHARS, nextAbout, CHAT_MAX_ATTACHMENTS, contextOptions } from "../chat.js";
|
||||
import { finish, activity, agentAdrift, isDashboard, selSpec, byId, isOpen, loopAskLocked, loopDriving } from "../selectors.js";
|
||||
import { el, md, isMac, lightDismiss, shortTime } from "../render.js";
|
||||
import { el, icon, md, isMac, lightDismiss, shortTime } from "../render.js";
|
||||
import { startersFor } from "../starters.js";
|
||||
import { looks } from "../looks.js";
|
||||
import { thumbs, uploadUrl, docChip, attachTray, CHAT_IMAGES, attachFiles, incomingFiles, deleteUrl, sentAttachments, noteImages, attachRow, openPicview, refocusThumb } from "../uploads.js";
|
||||
@@ -89,7 +90,7 @@ export function renderAsk(main, held = null) {
|
||||
const head = el("div", "ask-head");
|
||||
head.appendChild(el("h2", null, "Quick question"));
|
||||
head.appendChild(el("span", "ask-counter", v.counterText));
|
||||
const reset = el("button", "btn small ghost", "New conversation");
|
||||
const reset = el("button", "btn sm ghost", "New conversation");
|
||||
reset.type = "button";
|
||||
reset.disabled = ss.state === "offline" || chatResetting;
|
||||
reset.addEventListener("click", newConversation);
|
||||
@@ -183,7 +184,7 @@ function askStarters(ss) {
|
||||
const box = el("div", "ask-starters");
|
||||
box.appendChild(el("p", "ask-starters-lead", "Not sure what to ask? Try one of these:"));
|
||||
for (const starter of startersFor(page.S.workflow, looks.role, { hasContext: Boolean(page.local.chat.about) })) {
|
||||
const b = el("button", "ask-starter", starter.text);
|
||||
const b = el("button", "btn sm ask-starter", starter.text);
|
||||
b.type = "button";
|
||||
b.disabled = !ss.canType;
|
||||
b.addEventListener("click", () => {
|
||||
@@ -206,7 +207,7 @@ function askRow(r, ss, notes) {
|
||||
const working = r.decision === "approve" && !r.done;
|
||||
const line = el("p", working ? "ask-decision working" : "ask-decision");
|
||||
if (working) line.appendChild(el("span", "spinner tiny"));
|
||||
line.appendChild(document.createTextNode(r.decision !== "approve" ? "You declined the edit." : r.done ? "You approved the edit." : "You approved the edit, please wait..."));
|
||||
line.appendChild(document.createTextNode(r.decision !== "approve" ? "You declined the edit." : r.done ? "You approved the edit." : "You approved the edit. Applying it…"));
|
||||
row.appendChild(line);
|
||||
if (r.text) row.appendChild(el("p", "ask-text", r.text));
|
||||
return row;
|
||||
@@ -259,8 +260,8 @@ function askRow(r, ss, notes) {
|
||||
row.appendChild(tray);
|
||||
}
|
||||
if (r.pending && r.failed) {
|
||||
const fail = el("p", "ask-waiting ask-failed", "Not sent — retry");
|
||||
const retry = el("button", "btn tiny", "Retry");
|
||||
const fail = el("p", "ask-waiting ask-failed", "Not sent: retry");
|
||||
const retry = el("button", "btn xs soft", "Retry");
|
||||
retry.type = "button";
|
||||
retry.disabled = ss.state === "offline" || chatSending;
|
||||
retry.addEventListener("click", () => retryChat(r.tempId));
|
||||
@@ -285,7 +286,7 @@ function askRow(r, ss, notes) {
|
||||
}
|
||||
|
||||
function askProposal(r, ss, note) {
|
||||
const box = el("div", "ask-proposal");
|
||||
const box = el("div", "callout is-stage ask-proposal");
|
||||
box.appendChild(el("p", "note-kicker", "Proposed change"));
|
||||
box.appendChild(md(r.proposal.summary, "md"));
|
||||
const files = el("ul", "ask-proposal-files");
|
||||
@@ -303,13 +304,13 @@ function askProposal(r, ss, note) {
|
||||
}
|
||||
const busy = deciding.has(r.id) || ss.state === "offline";
|
||||
const row = el("div", "ask-proposal-actions");
|
||||
const approve = el("button", "btn small primary", "Approve");
|
||||
const approve = el("button", "btn sm primary", "Approve");
|
||||
approve.type = "button";
|
||||
approve.disabled = busy;
|
||||
approve.addEventListener("click", () => decideChat(r.id, "approve", ""));
|
||||
row.appendChild(approve);
|
||||
if (!declineOpen.has(r.id)) {
|
||||
const decline = el("button", "btn small ghost", "Decline");
|
||||
const decline = el("button", "btn sm ghost", "Decline");
|
||||
decline.type = "button";
|
||||
decline.disabled = busy;
|
||||
decline.addEventListener("click", () => {
|
||||
@@ -333,7 +334,7 @@ function askProposal(r, ss, note) {
|
||||
decideChat(r.id, "decline", input.value);
|
||||
});
|
||||
row.appendChild(input);
|
||||
const go = el("button", "btn small", "Send decline");
|
||||
const go = el("button", "btn sm", "Send decline");
|
||||
go.type = "button";
|
||||
go.disabled = busy;
|
||||
go.addEventListener("click", () => decideChat(r.id, "decline", declineOpen.get(r.id) || ""));
|
||||
@@ -352,7 +353,8 @@ function askComposer(ss) {
|
||||
if (about) {
|
||||
const chip = el("div", "ask-about-chip");
|
||||
chip.appendChild(el("span", null, "About: " + about.label));
|
||||
const x = el("button", "attach-remove", "×");
|
||||
const x = el("button", "attach-remove");
|
||||
x.appendChild(icon("close"));
|
||||
x.type = "button";
|
||||
x.setAttribute("aria-label", "Send without this");
|
||||
x.addEventListener("click", () => {
|
||||
@@ -376,7 +378,7 @@ function askComposer(ss) {
|
||||
comp.appendChild(ta.el);
|
||||
|
||||
const row = el("div", "ask-actions");
|
||||
const add = el("button", "btn small ghost", "+ Attach file");
|
||||
const add = el("button", "btn sm ghost", "+ Attach file");
|
||||
add.type = "button";
|
||||
add.setAttribute("aria-label", "Add files to this question");
|
||||
add.disabled = !ss.canType || page.local.chat.images.length >= CHAT_MAX_ATTACHMENTS;
|
||||
@@ -399,7 +401,7 @@ function askComposer(ss) {
|
||||
const counter = el("span", "ask-count");
|
||||
if (!ss.canType) {
|
||||
const cls = ss.state === "offline" ? "is-offline" : ss.state === "limit" ? "is-limit" : "is-waiting";
|
||||
row.appendChild(el("p", "ask-disabled-note " + cls, ss.text));
|
||||
row.appendChild(el("p", "ask-disabled-note " + cls + (ss.state === "offline" ? " callout is-warn" : ""), ss.text));
|
||||
} else {
|
||||
row.appendChild(counter);
|
||||
const hint = el("span", "ask-send-hint");
|
||||
@@ -413,7 +415,7 @@ function askComposer(ss) {
|
||||
// left of Send; in a browser, the line telling the person to.
|
||||
if (ss.state === "offline" && !finish()) row.appendChild(reconnectOffer("ask-reconnect"));
|
||||
|
||||
const go = el("button", "btn small primary", "Send");
|
||||
const go = el("button", "btn sm primary", "Send");
|
||||
go.type = "button";
|
||||
row.appendChild(go);
|
||||
comp.appendChild(row);
|
||||
@@ -476,7 +478,7 @@ function addContext(ss) {
|
||||
const wrap = el("span", "ask-context");
|
||||
const spec = isDashboard() ? selSpec() : page.S && page.S.specDir ? { dir: page.S.specDir } : null;
|
||||
const options = contextOptions(page.local.chat, spec);
|
||||
const btn = el("button", "btn small ghost", "+ Add context");
|
||||
const btn = el("button", "btn sm ghost", "+ Add context");
|
||||
btn.type = "button";
|
||||
btn.setAttribute("aria-haspopup", "menu");
|
||||
btn.setAttribute("aria-expanded", "false");
|
||||
@@ -551,7 +553,7 @@ function addContext(ss) {
|
||||
}
|
||||
|
||||
const CHAT_ERRORS = {
|
||||
stale: "A new conversation started. Your message is still here — press Send again.",
|
||||
stale: "A new conversation started. Your message is still here: press Send again.",
|
||||
"too-long": `That message is over ${CHAT_MAX_CHARS.toLocaleString()} characters. Shorten it and send again.`,
|
||||
image: "One of the images could not be attached. Remove it and try again.",
|
||||
file: "One of the files could not be attached. Remove it and try again.",
|
||||
@@ -713,8 +715,9 @@ export function renderAside() {
|
||||
// belong to a question stay on its own page.
|
||||
const item = page.view === "end" ? null : byId(page.selected);
|
||||
if (!item) {
|
||||
// The menu has no questions, so no notes either: the pane stays empty.
|
||||
if (!isDashboard()) aside.appendChild(el("p", "aside-empty", askOffered() ? ASK_HINT : "Pick a question to see its notes."));
|
||||
// No question, so no notes either: the pane stays empty (and its column
|
||||
// collapses, shell.css) unless the stopped loop has its one hint to give.
|
||||
if (!isDashboard() && askOffered()) aside.appendChild(el("p", "empty", ASK_HINT));
|
||||
return;
|
||||
}
|
||||
// Off the question's own page (a doc tab, Ask) "this" points at nothing on
|
||||
@@ -727,7 +730,7 @@ export function renderAside() {
|
||||
aside.appendChild(
|
||||
el(
|
||||
"p",
|
||||
"aside-empty",
|
||||
"empty",
|
||||
askOffered()
|
||||
? ASK_HINT
|
||||
: isOpen(item) && !finish()
|
||||
@@ -764,7 +767,7 @@ export function renderAside() {
|
||||
// say so, because the reply may have changed what the question asks.
|
||||
const last = thread[thread.length - 1];
|
||||
if (item.noted === true && isOpen(item) && !finish() && last && threadWho(last) === "agent") {
|
||||
const tag = el("p", "pill noted-tag", "Plan2Code replied, check this still fits");
|
||||
const tag = el("p", "pill is-stage noted-tag", "Plan2Code replied, check this still fits");
|
||||
tag.setAttribute("role", "note");
|
||||
aside.appendChild(tag);
|
||||
}
|
||||
@@ -840,7 +843,7 @@ const SUGGEST_KINDS = ["choice", "multi", "confirm", "lessons"];
|
||||
// stays in the panel: on the chip when it is live again, else the note box.
|
||||
function suggestChip(item) {
|
||||
const st = suggestState(item);
|
||||
const chip = el("button", "btn tiny suggest-chip", "Ask for suggestions");
|
||||
const chip = el("button", "btn xs soft suggest-chip", "Ask for suggestions");
|
||||
chip.type = "button";
|
||||
chip.id = "suggest-" + item.id;
|
||||
chip.setAttribute("aria-label", "Ask Plan2Code for suggestions on this question");
|
||||
@@ -882,7 +885,7 @@ function sentWaitingTag() {
|
||||
}
|
||||
|
||||
function suggestTag() {
|
||||
return el("span", "pill suggest-tag", "Asked for suggestions");
|
||||
return el("span", "pill is-accent suggest-tag", "Asked for suggestions");
|
||||
}
|
||||
|
||||
// The helpers the agent reported, as it last posted them. Everything here is
|
||||
@@ -894,7 +897,7 @@ export function renderSubagents(main) {
|
||||
const { alone, rows } = helperRows(page.S.helpers);
|
||||
if (alone) {
|
||||
card.appendChild(
|
||||
el("p", "sa-alone", "Working alone: your agent has no way to start helpers here, so it is doing this skill's work itself.")
|
||||
el("p", "sa-alone", "Working alone: your agent has no way to start subagents here, so it is doing this skill's work itself.")
|
||||
);
|
||||
main.appendChild(card);
|
||||
return;
|
||||
@@ -947,9 +950,12 @@ export function renderSubagentsButton() {
|
||||
btn.hidden = !offer;
|
||||
if (!offer) return;
|
||||
const label = switchLabel(page.subagentsFrame);
|
||||
btn.setAttribute("aria-pressed", String(Boolean(page.subagentsFrame.on)));
|
||||
// The state lives in the label and a data attribute (the lit look), never in
|
||||
// aria-pressed: the button opens a dialog, it does not toggle.
|
||||
btn.dataset.on = String(Boolean(page.subagentsFrame.on));
|
||||
btn.title = label;
|
||||
btn.setAttribute("aria-label", label);
|
||||
$("subagents-label").textContent = label;
|
||||
// The Subagents switch is the person's setting for the next agent; the loop's phases are already started.
|
||||
btn.disabled = page.gone || loopDriving();
|
||||
}
|
||||
@@ -967,6 +973,7 @@ export function openSubagents() {
|
||||
const strength = STRENGTHS.includes(page.subagentsFrame.strength) ? page.subagentsFrame.strength : DEFAULT_STRENGTH;
|
||||
for (const radio of document.querySelectorAll('input[name="subagents-strength"]')) radio.checked = radio.value === strength;
|
||||
syncStrengthHelp();
|
||||
loadedSubagents = subagentsFields();
|
||||
$("subagents-checkin").textContent = CHECKIN_LINE;
|
||||
const research = $("subagents-research");
|
||||
research.textContent = PATHFINDER_RESEARCH_LINE;
|
||||
@@ -979,6 +986,90 @@ export function openSubagents() {
|
||||
if (checked) checked.focus();
|
||||
}
|
||||
|
||||
// The dialog's four fields as they stand now: the Instruction (the default's
|
||||
// text and an empty box both count as the default), the number, the switch and
|
||||
// the strength. Compared with what openSubagents loaded to see an edit.
|
||||
let loadedSubagents = null;
|
||||
function subagentsFields() {
|
||||
const on = document.querySelector('input[name="subagents-on"]:checked');
|
||||
const strength = document.querySelector('input[name="subagents-strength"]:checked');
|
||||
return {
|
||||
on: Boolean(on && on.value === "on"),
|
||||
max: String($("subagents-max").value),
|
||||
strength: strength ? strength.value : DEFAULT_STRENGTH,
|
||||
instruction: instr().value.trim(),
|
||||
};
|
||||
}
|
||||
export function subagentsDirty() {
|
||||
if (!loadedSubagents) return false;
|
||||
const now = subagentsFields();
|
||||
return Object.keys(now).some((k) => now[k] !== loadedSubagents[k]);
|
||||
}
|
||||
|
||||
// The unsaved prompt, inside the dialog (never confirm()), in Preferences'
|
||||
// order: Keep editing, Discard, Save, with focus on Keep editing. Resolves true
|
||||
// when the dialog may close.
|
||||
let askingSubagents = null;
|
||||
function wireSubagentsPrompt() {
|
||||
const box = el("div", "prefs-unsaved");
|
||||
box.id = "subagents-unsaved";
|
||||
box.hidden = true;
|
||||
box.setAttribute("role", "alertdialog");
|
||||
box.setAttribute("aria-labelledby", "subagents-unsaved-title");
|
||||
const inner = el("div", "prefs-unsaved-box");
|
||||
const title = el("h3", null, "Discard your changes?");
|
||||
title.id = "subagents-unsaved-title";
|
||||
const keep = el("button", "btn sm ghost", "Keep editing");
|
||||
keep.type = "button";
|
||||
keep.id = "subagents-unsaved-keep";
|
||||
const discard = el("button", "btn sm ghost", "Discard");
|
||||
discard.type = "button";
|
||||
discard.id = "subagents-unsaved-discard";
|
||||
const save = el("button", "btn sm primary", "Save");
|
||||
save.type = "button";
|
||||
save.id = "subagents-unsaved-save";
|
||||
const end = (go) => {
|
||||
box.hidden = true;
|
||||
for (const n of behindSubagentsPrompt()) n.inert = false;
|
||||
const { resolve } = askingSubagents;
|
||||
askingSubagents = null;
|
||||
resolve(go);
|
||||
};
|
||||
keep.addEventListener("click", () => {
|
||||
end(false);
|
||||
const first = document.querySelector('input[name="subagents-on"]:checked');
|
||||
if (first) first.focus();
|
||||
});
|
||||
discard.addEventListener("click", () => end(true));
|
||||
save.addEventListener("click", async () => {
|
||||
save.disabled = true;
|
||||
const saved = await saveSubagents();
|
||||
save.disabled = false;
|
||||
if (askingSubagents) end(saved === true);
|
||||
});
|
||||
const actions = el("div", "prefs-unsaved-actions");
|
||||
actions.append(keep, discard, save);
|
||||
inner.append(title, actions);
|
||||
box.append(inner);
|
||||
$("subagents-modal").append(box);
|
||||
}
|
||||
const behindSubagentsPrompt = () => [$("subagents-title"), ...$("subagents-modal").querySelectorAll(":scope > :not(#subagents-unsaved)")];
|
||||
export function confirmSubagentsDiscard() {
|
||||
if (!subagentsDirty()) return Promise.resolve(true);
|
||||
if (askingSubagents) return askingSubagents.promise;
|
||||
let resolve;
|
||||
const promise = new Promise((r) => (resolve = r));
|
||||
askingSubagents = { resolve, promise };
|
||||
for (const n of behindSubagentsPrompt()) n.inert = true;
|
||||
$("subagents-unsaved").hidden = false;
|
||||
$("subagents-unsaved-save").disabled = false;
|
||||
$("subagents-unsaved-keep").focus();
|
||||
return promise;
|
||||
}
|
||||
async function closeSubagents() {
|
||||
if (await confirmSubagentsDiscard()) $("subagents-modal").close();
|
||||
}
|
||||
|
||||
// Instruction, "at most" and strength only mean anything with helpers on, so
|
||||
// they are inert under Work alone (kept as picked, for when helpers go back on).
|
||||
export function syncSubagentsFields() {
|
||||
@@ -998,12 +1089,12 @@ function syncStrengthHelp() {
|
||||
const SUBAGENTS_ERRORS = {
|
||||
max: "Pick a number from 1 to 20.",
|
||||
"too-long": "The instruction is over 2,000 characters.",
|
||||
strength: "That strength isn't one of the four choices.",
|
||||
"not-offered": "This skill doesn't use helpers.",
|
||||
bad: "That didn't save. Try again.",
|
||||
strength: "That strength is not one of the four choices.",
|
||||
"not-offered": "This skill does not use subagents.",
|
||||
bad: "That did not save. Try again.",
|
||||
};
|
||||
|
||||
const SUBAGENTS_LOST = "Lost contact with Plan2Code. Try again once it's back.";
|
||||
const SUBAGENTS_LOST = `${NOT_CONNECTED} Try again once it is back.`;
|
||||
|
||||
export async function saveSubagents() {
|
||||
const save = $("subagents-save");
|
||||
@@ -1025,10 +1116,14 @@ export async function saveSubagents() {
|
||||
const res = await postJson("/subagents", body);
|
||||
save.disabled = false;
|
||||
// The next state frame redraws the button.
|
||||
if (res.status === 200) return $("subagents-modal").close();
|
||||
if (res.status === 200) {
|
||||
$("subagents-modal").close();
|
||||
return true;
|
||||
}
|
||||
if (res.status === 400) status.textContent = SUBAGENTS_ERRORS[res.body && res.body.error] || SUBAGENTS_ERRORS.bad;
|
||||
else if (res.status === 403 || res.status === 0) status.textContent = SUBAGENTS_LOST;
|
||||
else status.textContent = SUBAGENTS_ERRORS.bad;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Whether the agent coming or going has changed what the Ask pane painted,
|
||||
@@ -1039,13 +1134,28 @@ export const askOfflineFlipped = () => (askState().send.state === "offline") !==
|
||||
export function wireAsk() {
|
||||
for (const radio of document.querySelectorAll('input[name="subagents-on"]')) radio.addEventListener("change", syncSubagentsFields);
|
||||
for (const radio of document.querySelectorAll('input[name="subagents-strength"]')) radio.addEventListener("change", syncStrengthHelp);
|
||||
lightDismiss($("subagents-modal"));
|
||||
wireSubagentsPrompt();
|
||||
lightDismiss($("subagents-modal"), confirmSubagentsDiscard);
|
||||
$("subagents-modal").addEventListener("keydown", (e) => {
|
||||
if (e.key !== "Escape") return;
|
||||
if (askingSubagents) {
|
||||
e.preventDefault();
|
||||
$("subagents-unsaved-keep").click();
|
||||
} else if (subagentsDirty()) {
|
||||
e.preventDefault();
|
||||
closeSubagents();
|
||||
}
|
||||
});
|
||||
$("subagents-modal").addEventListener("cancel", (e) => {
|
||||
if (!askingSubagents && !subagentsDirty()) return;
|
||||
e.preventDefault();
|
||||
});
|
||||
$("btn-subagents").addEventListener("click", openSubagents);
|
||||
$("subagents-default").addEventListener("click", () => {
|
||||
instr().value = defaultInstruction(page.S.workflow);
|
||||
});
|
||||
$("subagents-save").addEventListener("click", saveSubagents);
|
||||
$("subagents-cancel").addEventListener("click", () => $("subagents-modal").close());
|
||||
$("subagents-cancel").addEventListener("click", closeSubagents);
|
||||
$("subagents-modal").addEventListener("close", () => $("btn-subagents").focus());
|
||||
|
||||
// Dropping files onto the notes panel attaches them to the selected
|
||||
|
||||
@@ -42,8 +42,9 @@ import {
|
||||
lessonMissing,
|
||||
lessonEditStart,
|
||||
lessonReworded,
|
||||
startsTicked,
|
||||
} from "../answers.js";
|
||||
import { el, md } from "../render.js";
|
||||
import { el, hiddenText, icon, md, stateMark } from "../render.js";
|
||||
import {
|
||||
sentAttachments,
|
||||
incomingFiles,
|
||||
@@ -68,14 +69,14 @@ export function markFor(item) {
|
||||
// and can no longer be added to, or it was never answered and never can be.
|
||||
if (isOpen(item) && finish()) {
|
||||
return recordedAnswer(item)
|
||||
? { glyph: "✓", cls: "done", label: "sent" }
|
||||
: { glyph: "○", cls: "open", label: "left unanswered" };
|
||||
? { icon: "check", cls: "done", label: "sent" }
|
||||
: { icon: "circle", cls: "open", label: "left unanswered" };
|
||||
}
|
||||
if (page.local.staged[item.id]) return { glyph: "●", cls: "staged", label: "ready to send" };
|
||||
if (page.local.staged[item.id]) return { icon: "dot", cls: "staged", label: "ready to send" };
|
||||
if (isOpen(item) && ((page.local.sent && page.local.sent[item.id]) || submittedInFlight(item)))
|
||||
return { glyph: "◐", cls: "staged", label: "sent, waiting for Plan2Code" };
|
||||
if (!isOpen(item)) return { glyph: "✓", cls: "done", label: "answered" };
|
||||
return { glyph: "○", cls: "open", label: "waiting for you" };
|
||||
return { icon: "half", cls: "staged", label: "sent, waiting for Plan2Code" };
|
||||
if (!isOpen(item)) return { icon: "check", cls: "done", label: "answered" };
|
||||
return { icon: "circle", cls: "open", label: "waiting for you" };
|
||||
}
|
||||
|
||||
// The session's own ending, as a page of its own at the top of the rail.
|
||||
@@ -88,10 +89,10 @@ export function renderEndItem(fin) {
|
||||
const b = el("button", "rail-item");
|
||||
b.type = "button";
|
||||
b.setAttribute("aria-current", String(page.view === "end"));
|
||||
const mark = el("span", "rail-mark " + (paused ? "staged" : "done"), paused ? "❚❚" : "✓");
|
||||
mark.title = paused ? "session paused" : "session ended";
|
||||
b.appendChild(mark);
|
||||
b.appendChild(el("span", "rail-end-label", paused ? "Paused" : "Session ended"));
|
||||
b.appendChild(
|
||||
stateMark("rail-mark " + (paused ? "staged" : "done"), paused ? "half" : "check", paused ? "session stopped" : "session finished")
|
||||
);
|
||||
b.appendChild(el("span", "rail-end-label", paused ? "Stopped" : "Session finished"));
|
||||
b.addEventListener("click", () => {
|
||||
page.view = "end";
|
||||
redraw();
|
||||
@@ -237,7 +238,7 @@ export function buildPager(item) {
|
||||
if (at === -1) {
|
||||
// Reading something already settled. The only move that means anything
|
||||
// here is back to the work.
|
||||
const b = el("button", "btn small pager-btn next");
|
||||
const b = el("button", "btn sm pager-btn next");
|
||||
b.type = "button";
|
||||
const box = el("span", "pager-label");
|
||||
box.appendChild(el("span", "pager-kicker", "Back to what is waiting"));
|
||||
@@ -273,7 +274,7 @@ export function buildPager(item) {
|
||||
if (!target) return el("span", "pager-slot");
|
||||
const b = el(
|
||||
"button",
|
||||
"btn small pager-btn " + (back ? "prev" : "next") + (lead ? " lead" : " ghost")
|
||||
"btn sm pager-btn " + (back ? "prev" : "next") + (lead ? " lead" : " ghost")
|
||||
);
|
||||
b.type = "button";
|
||||
const arrow = el("span", "pager-arrow", back ? "←" : "→");
|
||||
@@ -300,7 +301,7 @@ export function buildPager(item) {
|
||||
// A notice is context for the question it sits beside, so it lives inside the
|
||||
// one card rather than as a second one under it.
|
||||
export function renderNotice(item) {
|
||||
const box = el("div", "card-note card-extra");
|
||||
const box = el("div", "callout is-info card-note card-extra");
|
||||
box.appendChild(el("p", "note-kicker", "Note"));
|
||||
box.appendChild(el("h3", "note-title", item.title));
|
||||
box.appendChild(md(item.body, "md"));
|
||||
@@ -398,7 +399,7 @@ export function renderCard(item) {
|
||||
const skipped = Boolean(staged && staged.skipped);
|
||||
// A small accent chip, like a comment box's quick answer ("No changes"),
|
||||
// rather than an underlined link that reads as fine print.
|
||||
const skip = el("button", "btn tiny", skipped ? "Do not skip" : "Skip this one");
|
||||
const skip = el("button", "btn xs soft", skipped ? "Do not skip" : "Skip this one");
|
||||
skip.type = "button";
|
||||
skip.style.marginTop = "16px";
|
||||
skip.addEventListener("click", () => {
|
||||
@@ -438,7 +439,9 @@ function renderSettled(card, item) {
|
||||
const nothing = !lines.length && !prose;
|
||||
const box = el("div", "answered" + (nothing ? " is-empty" : ""));
|
||||
const head = el("p", "answered-head");
|
||||
head.appendChild(el("span", "answered-mark", nothing ? "·" : "✓"));
|
||||
const doneMark = el("span", "answered-mark");
|
||||
doneMark.appendChild(icon(nothing ? "dot" : "check"));
|
||||
head.appendChild(doneMark);
|
||||
// A note is not an answer: say which it is.
|
||||
head.appendChild(el("span", null, nothing ? "No answer recorded" : fromNote ? "Your last note" : "Your answer"));
|
||||
box.appendChild(head);
|
||||
@@ -455,7 +458,7 @@ function renderSettled(card, item) {
|
||||
"p",
|
||||
"answered-none",
|
||||
isOpen(item)
|
||||
? "The session ended before this was answered."
|
||||
? "The session finished before this was answered."
|
||||
: "This was answered somewhere other than this page, so there is nothing to show."
|
||||
)
|
||||
);
|
||||
@@ -580,12 +583,15 @@ function lockedOptions(card, item, keys) {
|
||||
for (const o of item.options) {
|
||||
const on = picked.has(o.k);
|
||||
const li = el("li", "option is-locked" + (on ? " is-recorded" : ""));
|
||||
li.appendChild(el("span", "option-mark" + (on ? " on" : ""), on ? "✓" : "·"));
|
||||
const optMark = el("span", "option-mark" + (on ? " on" : ""));
|
||||
optMark.appendChild(icon(on ? "check" : "dot"));
|
||||
optMark.appendChild(hiddenText(on ? "chosen" : "not chosen"));
|
||||
li.appendChild(optMark);
|
||||
const body = el("div", "option-body");
|
||||
const head = el("div", "option-label");
|
||||
if (showKey(o.k, o.text)) head.appendChild(el("span", "option-key", o.k));
|
||||
if (showKey(o.k, o.text)) head.appendChild(el("span", "code-tag option-key", o.k));
|
||||
head.appendChild(el("span", null, o.text));
|
||||
if (on) head.appendChild(el("span", "pill done", "Your answer"));
|
||||
if (on) head.appendChild(el("span", "pill is-ok is-caps done", "Your answer"));
|
||||
body.appendChild(head);
|
||||
if (o.detail) body.appendChild(el("p", "option-detail", o.detail));
|
||||
li.appendChild(body);
|
||||
@@ -602,7 +608,10 @@ function lockedSteps(card, item, v) {
|
||||
const li = el("li", "step is-locked");
|
||||
li.appendChild(el("span", "step-num", String(i + 1)));
|
||||
const on = done.has(i);
|
||||
li.appendChild(el("span", "option-mark" + (on ? " on" : ""), on ? "✓" : "·"));
|
||||
const stepMark = el("span", "option-mark" + (on ? " on" : ""));
|
||||
stepMark.appendChild(icon(on ? "check" : "dot"));
|
||||
stepMark.appendChild(hiddenText(on ? "done" : "not done"));
|
||||
li.appendChild(stepMark);
|
||||
const body = el("div", "step-body");
|
||||
body.appendChild(md(typeof step === "string" ? step : step.text, "md"));
|
||||
li.appendChild(body);
|
||||
@@ -629,7 +638,7 @@ function lockedRows(card, item, v) {
|
||||
|
||||
function lockedSummary(card, item) {
|
||||
if (!item.summary) return;
|
||||
const box = el("div", "card-note");
|
||||
const box = el("div", "callout is-info card-note");
|
||||
box.appendChild(md(item.summary, "md"));
|
||||
card.appendChild(box);
|
||||
}
|
||||
@@ -760,7 +769,8 @@ function otherField(card, item, staged) {
|
||||
stageQuiet(item.id, { ...(cur || { type: "answer", kind: item.kind }), text: ta.value.trim() });
|
||||
} else if (cur && cur.text) {
|
||||
const { text, ...rest } = cur;
|
||||
if (rest.k || (rest.ks && rest.ks.length)) stageQuiet(item.id, rest);
|
||||
// On a card with starting ticks an empty pick is itself an answer ("none"), so it stays.
|
||||
if (rest.k || (rest.ks && (rest.ks.length || startsTicked(item)))) stageQuiet(item.id, rest);
|
||||
else stageQuiet(item.id, null);
|
||||
}
|
||||
stagedChanged();
|
||||
@@ -791,13 +801,13 @@ function fillKicker(kicker, item) {
|
||||
kicker.replaceChildren(document.createTextNode(topic ? topic.title : "Question"));
|
||||
|
||||
let pill = null;
|
||||
if (!isOpen(item)) pill = el("span", "pill done", item.status === "skipped" ? "Skipped" : "Answered");
|
||||
if (!isOpen(item)) pill = el("span", "pill is-ok is-caps done", item.status === "skipped" ? "Skipped" : "Answered");
|
||||
// Frozen on a finished session: the send it carries is the record, and a
|
||||
// staged leftover can no longer be sent, so it earns no pill.
|
||||
else if (finish()) pill = recordedAnswer(item) ? el("span", "pill done", "Sent") : null;
|
||||
else if (page.local.staged[item.id]) pill = el("span", "pill staged", "Ready to send");
|
||||
else if (finish()) pill = recordedAnswer(item) ? el("span", "pill is-ok is-caps done", "Sent") : null;
|
||||
else if (page.local.staged[item.id]) pill = el("span", "pill is-stage is-caps staged", "Ready to send");
|
||||
else if ((page.local.sent && page.local.sent[item.id]) || submittedInFlight(item))
|
||||
pill = el("span", "pill staged", "Sent");
|
||||
pill = el("span", "pill is-stage is-caps staged", "Sent");
|
||||
if (!pill) return;
|
||||
pill.style.marginLeft = "8px";
|
||||
kicker.appendChild(pill);
|
||||
@@ -875,9 +885,9 @@ function buildChoice(card, item, staged) {
|
||||
|
||||
const body = el("div", "option-body");
|
||||
const head = el("div", "option-label");
|
||||
if (showKey(o.k, o.text)) head.appendChild(el("span", "option-key", o.k));
|
||||
if (showKey(o.k, o.text)) head.appendChild(el("span", "code-tag option-key", o.k));
|
||||
head.appendChild(el("span", null, o.text));
|
||||
if (o.recommended) head.appendChild(el("span", "pill suggested", "Suggested"));
|
||||
if (o.recommended) head.appendChild(el("span", "pill is-accent is-caps suggested", "Suggested"));
|
||||
body.appendChild(head);
|
||||
if (o.detail) body.appendChild(el("p", "option-detail", o.detail));
|
||||
|
||||
@@ -915,7 +925,7 @@ function clearIcon() {
|
||||
// call it, and they only run for a form that has not been sent.
|
||||
function clearRow(card, item) {
|
||||
const row = el("div", "btn-row options-clear");
|
||||
const b = el("button", "btn small ghost clear-btn");
|
||||
const b = el("button", "btn sm ghost clear-btn");
|
||||
b.type = "button";
|
||||
b.appendChild(clearIcon());
|
||||
b.appendChild(el("span", null, "Clear answer"));
|
||||
@@ -958,6 +968,7 @@ function multiCount(item, ks) {
|
||||
|
||||
function buildMulti(card, item, staged) {
|
||||
const locked = lockedKeys(item);
|
||||
const seeds = startsTicked(item);
|
||||
const chosen = new Set(((staged && staged.ks) || []).filter((k) => !locked.has(k)));
|
||||
const grouped = (item.options || []).some((o) => o && typeof o.group === "string" && o.group);
|
||||
const list = el("ul", "options");
|
||||
@@ -988,7 +999,9 @@ function buildMulti(card, item, staged) {
|
||||
box.id = optionId(item, o, i);
|
||||
box.value = o.k;
|
||||
box.checked = on;
|
||||
box.setAttribute("aria-label", o.k ? `${o.k}: ${o.text}` : o.text);
|
||||
const tag = typeof o.tag === "string" ? o.tag.trim() : "";
|
||||
const named = o.k ? `${o.k}: ${o.text}` : o.text;
|
||||
box.setAttribute("aria-label", tag ? `${named}, ${tag}` : named);
|
||||
if (isLocked) {
|
||||
box.disabled = true;
|
||||
box.setAttribute("aria-disabled", "true");
|
||||
@@ -1002,7 +1015,7 @@ function buildMulti(card, item, staged) {
|
||||
// Unticking the last box keeps what is written in "Anything else".
|
||||
stage(
|
||||
item.id,
|
||||
withNote(item, next.size ? { type: "answer", kind: "multi", ks: [...next] } : null, {
|
||||
withNote(item, next.size ? { type: "answer", kind: "multi", ks: [...next] } : seeds ? { type: "answer", kind: "multi", ks: [] } : null, {
|
||||
type: "answer",
|
||||
kind: "multi",
|
||||
ks: [],
|
||||
@@ -1012,9 +1025,11 @@ function buildMulti(card, item, staged) {
|
||||
|
||||
const body = el("div", "option-body");
|
||||
const head = el("div", "option-label");
|
||||
if (showKey(o.k, o.text)) head.appendChild(el("span", "option-key", o.k));
|
||||
if (showKey(o.k, o.text)) head.appendChild(el("span", "code-tag option-key", o.k));
|
||||
head.appendChild(el("span", null, o.text));
|
||||
if (o.recommended) head.appendChild(el("span", "pill suggested", "Suggested"));
|
||||
if (o.recommended) head.appendChild(el("span", "pill is-accent is-caps suggested", "Suggested"));
|
||||
// The agent's note on the row, drawn as a pill; it never moves with the tick.
|
||||
if (tag) head.appendChild(el("span", "pill is-neutral tag", tag));
|
||||
body.appendChild(head);
|
||||
if (o.detail) body.appendChild(el("p", "option-detail", o.detail));
|
||||
|
||||
@@ -1028,7 +1043,7 @@ function buildMulti(card, item, staged) {
|
||||
const key = moreKey(item, o);
|
||||
const open = openMore.has(key);
|
||||
const bodyId = `more-${item.id}-${o.k || i}`;
|
||||
const toggle = el("button", "option-more-btn", open ? "Less" : "More");
|
||||
const toggle = el("button", "btn xs soft option-more-btn", open ? "Less" : "More");
|
||||
toggle.type = "button";
|
||||
// Stable across redraws, so the click handler can find the new button.
|
||||
toggle.id = `more-btn-${item.id}-${o.k || i}`;
|
||||
@@ -1101,13 +1116,13 @@ function renderPresets(card, item, staged) {
|
||||
const now = new Set((staged && staged.ks) || []);
|
||||
for (const p of presets) {
|
||||
const on = p.ks.length === now.size && p.ks.every((k) => now.has(k));
|
||||
const b = el("button", "btn small" + (on ? " primary" : " ghost"), p.label);
|
||||
const b = el("button", "btn sm" + (on ? " primary" : " ghost"), p.label);
|
||||
b.type = "button";
|
||||
b.setAttribute("aria-pressed", String(on));
|
||||
b.addEventListener("click", () =>
|
||||
stage(
|
||||
item.id,
|
||||
withNote(item, on ? null : { type: "answer", kind: "multi", ks: [...p.ks] }, {
|
||||
withNote(item, on ? (startsTicked(item) ? { type: "answer", kind: "multi", ks: [] } : null) : { type: "answer", kind: "multi", ks: [...p.ks] }, {
|
||||
type: "answer",
|
||||
kind: "multi",
|
||||
ks: [],
|
||||
@@ -1188,7 +1203,7 @@ function buildText(card, item, staged) {
|
||||
input.addEventListener("input", check);
|
||||
|
||||
if (suggestion) {
|
||||
fill = el("button", "btn tiny", "Autofill suggestion");
|
||||
fill = el("button", "btn xs soft", "Autofill suggestion");
|
||||
fill.type = "button";
|
||||
fill.title = "Put the example into the box. It is yours to edit from there.";
|
||||
fill.hidden = Boolean(input.value.trim());
|
||||
@@ -1249,9 +1264,9 @@ function templateRow(item, input, entries, check) {
|
||||
fitGrowBox();
|
||||
};
|
||||
const chips = entries.map((entry) => {
|
||||
const chip = el("button", "tpl-chip", entry.label);
|
||||
const chip = el("button", "btn sm tpl-chip", entry.label);
|
||||
chip.type = "button";
|
||||
if (entry.forYou) chip.appendChild(el("span", "tpl-pill", "For your role"));
|
||||
if (entry.forYou) chip.appendChild(el("span", "pill is-accent tpl-pill", "For your role"));
|
||||
chip.addEventListener("click", () => pick(entry));
|
||||
row.appendChild(chip);
|
||||
return chip;
|
||||
@@ -1286,13 +1301,13 @@ function templateRow(item, input, entries, check) {
|
||||
return;
|
||||
}
|
||||
dropStrip();
|
||||
strip = el("div", "tpl-replace");
|
||||
strip = el("div", "callout is-stage tpl-replace");
|
||||
strip.setAttribute("role", "alert");
|
||||
strip.appendChild(el("span", null, "Replace what you typed?"));
|
||||
const replace = el("button", "btn tiny primary", "Replace");
|
||||
const replace = el("button", "btn xs soft primary", "Replace");
|
||||
replace.type = "button";
|
||||
replace.addEventListener("click", () => apply(entry, sw.text));
|
||||
const keep = el("button", "btn tiny ghost", "Keep mine");
|
||||
const keep = el("button", "btn xs soft", "Keep mine");
|
||||
keep.type = "button";
|
||||
keep.addEventListener("click", () => {
|
||||
dropStrip();
|
||||
@@ -1334,7 +1349,7 @@ function buildConfirm(card, item, staged) {
|
||||
if (item.consequences) {
|
||||
// "is-consequences": the command here is what Yes runs, so no "paste it
|
||||
// into the Ask tab" nudge under it (app.css).
|
||||
const note = el("div", "card-note is-consequences");
|
||||
const note = el("div", "callout is-info card-note is-consequences");
|
||||
note.appendChild(md(item.consequences, "md"));
|
||||
card.appendChild(note);
|
||||
}
|
||||
@@ -1367,7 +1382,7 @@ function buildRecap(card, item, staged) {
|
||||
// The recap is not optional: a click captured the pick, this captures the
|
||||
// agreement. Rendered as a document so it reads like a summary, not a form.
|
||||
if (item.summary) {
|
||||
const box = el("div", "card-note");
|
||||
const box = el("div", "callout is-info card-note");
|
||||
box.appendChild(md(item.summary, "md"));
|
||||
card.appendChild(box);
|
||||
}
|
||||
@@ -1399,7 +1414,7 @@ function buildRecap(card, item, staged) {
|
||||
function docLink(item) {
|
||||
const doc = item.doc && docs().find((d) => d.id === item.doc);
|
||||
if (!doc) return null;
|
||||
const open = el("button", "btn small", `Read “${doc.title || "the document"}” in full`);
|
||||
const open = el("button", "btn sm", `Read “${doc.title || "the document"}” in full`);
|
||||
open.type = "button";
|
||||
open.style.marginTop = "14px";
|
||||
open.addEventListener("click", () => {
|
||||
@@ -1411,7 +1426,7 @@ function docLink(item) {
|
||||
|
||||
function buildReview(card, item, staged) {
|
||||
if (item.summary) {
|
||||
const box = el("div", "card-note");
|
||||
const box = el("div", "callout is-info card-note");
|
||||
box.appendChild(md(item.summary, "md"));
|
||||
card.appendChild(box);
|
||||
}
|
||||
@@ -1542,7 +1557,7 @@ function buildMenu(card, item, staged) {
|
||||
const body = el("div", "option-body");
|
||||
const head = el("div", "option-label");
|
||||
head.appendChild(el("span", null, text));
|
||||
if (o.recommended) head.appendChild(el("span", "pill suggested", "Suggested"));
|
||||
if (o.recommended) head.appendChild(el("span", "pill is-accent is-caps suggested", "Suggested"));
|
||||
body.appendChild(head);
|
||||
if (o.detail) body.appendChild(el("p", "option-detail", o.detail));
|
||||
label.appendChild(radio);
|
||||
@@ -1554,7 +1569,7 @@ function buildMenu(card, item, staged) {
|
||||
clearRow(card, item);
|
||||
|
||||
if (item.command) {
|
||||
const note = el("div", "card-note");
|
||||
const note = el("div", "callout is-info card-note");
|
||||
note.appendChild(el("p", "help", "To pick this up in a fresh session, run:"));
|
||||
note.appendChild(md("```\n" + handoffText({ command: item.command }) + "\n```", "md"));
|
||||
card.appendChild(note);
|
||||
@@ -1614,7 +1629,8 @@ function buildList(card, item, staged) {
|
||||
commit(next);
|
||||
});
|
||||
|
||||
const handle = el("button", "row-handle", "⠿");
|
||||
const handle = el("button", "row-handle");
|
||||
handle.appendChild(icon("grip"));
|
||||
handle.type = "button";
|
||||
handle.title = "Drag to reorder";
|
||||
handle.setAttribute("aria-label", `Move “${row.title}”`);
|
||||
@@ -1660,7 +1676,7 @@ function buildList(card, item, staged) {
|
||||
li.appendChild(main);
|
||||
|
||||
const tools = el("div", "row-tools");
|
||||
const up = el("button", "btn ghost small", "↑");
|
||||
const up = el("button", "btn ghost sm", "↑");
|
||||
up.type = "button";
|
||||
up.title = "Move up";
|
||||
up.disabled = i === 0;
|
||||
@@ -1671,7 +1687,7 @@ function buildList(card, item, staged) {
|
||||
[next[at - 1], next[at]] = [next[at], next[at - 1]];
|
||||
commit(next);
|
||||
});
|
||||
const down = el("button", "btn ghost small", "↓");
|
||||
const down = el("button", "btn ghost sm", "↓");
|
||||
down.type = "button";
|
||||
down.title = "Move down";
|
||||
down.disabled = i === rows.length - 1;
|
||||
@@ -1682,7 +1698,8 @@ function buildList(card, item, staged) {
|
||||
[next[at + 1], next[at]] = [next[at], next[at + 1]];
|
||||
commit(next);
|
||||
});
|
||||
const del = el("button", "btn ghost small", "×");
|
||||
const del = el("button", "btn ghost sm");
|
||||
del.appendChild(icon("close"));
|
||||
del.type = "button";
|
||||
del.title = "Remove";
|
||||
del.setAttribute("aria-label", `Remove “${row.title}”`);
|
||||
@@ -1700,7 +1717,7 @@ function buildList(card, item, staged) {
|
||||
card.appendChild(ul);
|
||||
|
||||
const row = el("div", "btn-row");
|
||||
const add = el("button", "btn small", "Add one");
|
||||
const add = el("button", "btn sm", "Add one");
|
||||
add.type = "button";
|
||||
keepFocus(add);
|
||||
add.addEventListener("click", () =>
|
||||
@@ -1820,7 +1837,7 @@ function buildLessons(card, item, staged) {
|
||||
const foot = el("div", "lessons-foot");
|
||||
foot.appendChild(summary);
|
||||
// Sending with nothing chosen is allowed: everything keeps waiting (FR-14).
|
||||
const leave = el("button", "btn tiny" + (draft.leaveAll ? " primary" : ""), "Leave them all waiting");
|
||||
const leave = el("button", "btn xs soft" + (draft.leaveAll ? " primary" : ""), "Leave them all waiting");
|
||||
leave.type = "button";
|
||||
leave.setAttribute("aria-pressed", String(draft.leaveAll));
|
||||
leave.addEventListener("click", () => {
|
||||
@@ -1871,14 +1888,14 @@ function lessonRow(item, row, draft, commit) {
|
||||
|
||||
for (const f of Array.isArray(row.flags) ? row.flags : []) {
|
||||
const what = FLAG_WORDS[f && f.pattern] || "something personal";
|
||||
li.appendChild(el("p", "lessons-flag", `Holds what looks like ${what}${f && f.part ? ` (“${f.part}”)` : ""}. Keep only if that is intended.`));
|
||||
li.appendChild(el("p", "callout is-stage lessons-flag", `Holds what looks like ${what}${f && f.part ? ` (“${f.part}”)` : ""}. Keep only if that is intended.`));
|
||||
}
|
||||
|
||||
const reworded = lessonReworded(row, draft.edits[row.id] || {});
|
||||
const keepWord = LESSON_KEEP_WORD[row.type];
|
||||
if (row.refused) {
|
||||
const part = row.refused.part ? ` (it starts “${row.refused.part}”)` : "";
|
||||
li.appendChild(el("p", "lessons-refused", `Refused: part of it looks like a secret${part}. Reword it to ${keepWord.toLowerCase()} it.`));
|
||||
li.appendChild(el("p", "callout is-warn lessons-refused", `Refused: part of it looks like a secret${part}. Reword it to ${keepWord.toLowerCase()} it.`));
|
||||
}
|
||||
|
||||
// The choices, in the order given; a refused row shows its keep word
|
||||
@@ -1890,7 +1907,7 @@ function lessonRow(item, row, draft, commit) {
|
||||
group.setAttribute("aria-label", "Choices for: " + (row.text || row.id));
|
||||
choices.forEach((word, i) => {
|
||||
const on = pick === word;
|
||||
const b = el("button", "btn small" + (on ? " primary" : ""), word);
|
||||
const b = el("button", "btn sm" + (on ? " primary" : ""), word);
|
||||
b.type = "button";
|
||||
b.id = `lesson-${item.id}-${row.id}-${i}`;
|
||||
b.setAttribute("aria-pressed", String(on));
|
||||
@@ -2050,7 +2067,7 @@ function commentField(card, item, labelText, required, quickAnswers = []) {
|
||||
label.htmlFor = id;
|
||||
wrap.appendChild(label);
|
||||
const quicks = quickAnswers.map(({ label, text }) => {
|
||||
const b = el("button", "btn tiny quick-answer", label);
|
||||
const b = el("button", "btn xs soft quick-answer", label);
|
||||
b.type = "button";
|
||||
b.title = "Fill in \"" + text + "\"";
|
||||
wrap.appendChild(b);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// Plan2Code Web Console - User Preferences, the Cleanup section on the System tab.
|
||||
|
||||
import { NOT_CONNECTED, agoWords, whenTitle } from "../labels.js";
|
||||
import { SKILLS } from "../skills.js";
|
||||
import { formatBytes } from "../answers.js";
|
||||
import { el } from "../render.js";
|
||||
import { postJson } from "../net.js";
|
||||
@@ -11,9 +13,17 @@ const $ = (id) => document.getElementById(id);
|
||||
// server re-checks every one before removing it.
|
||||
let cleanupFound = null;
|
||||
|
||||
// The ids ticked for deletion. A session or a stray file starts ticked; a
|
||||
// Notebook (private writing) or a completed spec starts unticked, so deleting
|
||||
// those is always a choice.
|
||||
let ticked = new Set();
|
||||
const startsTicked = (item) => item.where !== "notepad" && item.where !== "completed";
|
||||
|
||||
// Bumped by every scan, delete and reset: a response from an older one is
|
||||
// dropped, so a scan still in flight when Preferences closes cannot refill it.
|
||||
let cleanupGen = 0;
|
||||
// True while a delete is on its way: a ticked box must not re-enable Delete.
|
||||
let cleanupBusy = false;
|
||||
|
||||
const CLEANUP_SHOWN = 8;
|
||||
|
||||
@@ -25,8 +35,17 @@ function setCleanupStatus(text, isError) {
|
||||
|
||||
const CLEANUP_WHERE = { root: "~/.plan2code/", console: "~/.plan2code/console/", completed: "specs--completed/" };
|
||||
|
||||
// "Pathfinder · shop · 6 weeks ago": the skill, the session's title and when it
|
||||
// was last touched. An older session with no title keeps its folder name.
|
||||
function sessionLabel(item) {
|
||||
const skill = SKILLS.find((s) => s.workflow === item.workflow);
|
||||
const age = item.at && !Number.isNaN(Date.parse(item.at)) ? agoWords(Math.max(0, Date.now() - Date.parse(item.at))) : "";
|
||||
const parts = item.title ? [skill ? skill.name : "", item.title, age] : ["Session " + item.name, age];
|
||||
return parts.filter(Boolean).join(" · ");
|
||||
}
|
||||
|
||||
function cleanupLabel(item) {
|
||||
if (item.where === "session") return "Session " + item.name;
|
||||
if (item.where === "session") return sessionLabel(item);
|
||||
// One notebook is one item, named by the folder it belongs to; its key only
|
||||
// when its meta.json is gone.
|
||||
if (item.where === "notepad") return "Notebook for " + (item.folder || item.name);
|
||||
@@ -52,9 +71,25 @@ function cleanupSummary(items, bytes) {
|
||||
const keptBack = (item) => item.where === "completed" && item.tracked === false;
|
||||
const deletable = () => ((cleanupFound && cleanupFound.items) || []).filter((i) => !keptBack(i));
|
||||
|
||||
// What Delete will do, said on the button: the ticked items and their size.
|
||||
function tickedItems() {
|
||||
return deletable().filter((i) => ticked.has(i.id));
|
||||
}
|
||||
|
||||
function paintDeleteButton() {
|
||||
const chosen = tickedItems();
|
||||
const button = $("cleanup-delete");
|
||||
const bytes = chosen.reduce((n, i) => n + (i.bytes || 0), 0);
|
||||
button.textContent = chosen.length
|
||||
? `Delete ${chosen.length} ${chosen.length === 1 ? "item" : "items"} · ${formatBytes(bytes)}`
|
||||
: "Nothing ticked";
|
||||
button.disabled = cleanupBusy || !chosen.length;
|
||||
}
|
||||
|
||||
function resetCleanup() {
|
||||
cleanupGen++;
|
||||
cleanupFound = null;
|
||||
ticked = new Set();
|
||||
$("cleanup-list").replaceChildren();
|
||||
$("cleanup-delete").hidden = true;
|
||||
$("cleanup-delete").disabled = false;
|
||||
@@ -70,8 +105,18 @@ function renderCleanup() {
|
||||
const kept = all.filter(keptBack);
|
||||
$("cleanup-delete").hidden = !items.length;
|
||||
const rows = (some) => some.map((item) => {
|
||||
const row = el("div", "cleanup-row");
|
||||
row.append(el("span", null, cleanupLabel(item)), el("span", "cleanup-size", formatBytes(item.bytes)));
|
||||
const row = el("label", "cleanup-row");
|
||||
const box = el("input");
|
||||
box.type = "checkbox";
|
||||
box.checked = ticked.has(item.id);
|
||||
box.addEventListener("change", () => {
|
||||
if (box.checked) ticked.add(item.id);
|
||||
else ticked.delete(item.id);
|
||||
paintDeleteButton();
|
||||
});
|
||||
const label = el("span", null, cleanupLabel(item));
|
||||
if (item.at) label.title = whenTitle(item.at);
|
||||
row.append(box, label, el("span", "cleanup-size", formatBytes(item.bytes)));
|
||||
return row;
|
||||
});
|
||||
if (items.length) {
|
||||
@@ -83,6 +128,7 @@ function renderCleanup() {
|
||||
list.appendChild(more);
|
||||
}
|
||||
}
|
||||
paintDeleteButton();
|
||||
for (const item of kept) {
|
||||
const row = el("div", "cleanup-row cleanup-kept");
|
||||
row.append(el("span", null, cleanupLabel(item)), el("span", "cleanup-size", "kept: git does not track it as it stands"));
|
||||
@@ -102,9 +148,10 @@ async function scanCleanup() {
|
||||
if (status !== 200 || !body.ok) {
|
||||
cleanupFound = null;
|
||||
renderCleanup();
|
||||
return setCleanupStatus(status ? body.error || "Could not look." : "Plan2Code isn't reachable.", true);
|
||||
return setCleanupStatus(status ? body.error || "Could not look." : NOT_CONNECTED, true);
|
||||
}
|
||||
cleanupFound = { items: body.items || [], bytes: body.bytes || 0 };
|
||||
ticked = new Set(cleanupFound.items.filter((i) => startsTicked(i)).map((i) => i.id));
|
||||
renderCleanup();
|
||||
// Left in the status line, not cleared: it is the live region, so this is
|
||||
// what a screen reader hears when the scan finishes.
|
||||
@@ -115,18 +162,21 @@ async function scanCleanup() {
|
||||
}
|
||||
|
||||
async function deleteCleanup() {
|
||||
const ids = deletable().map((i) => i.id);
|
||||
const ids = tickedItems().map((i) => i.id);
|
||||
if (!ids.length) return;
|
||||
const gen = ++cleanupGen;
|
||||
$("cleanup-delete").disabled = true;
|
||||
$("cleanup-scan").disabled = true;
|
||||
setCleanupStatus("Deleting…", false);
|
||||
const { status, body } = await postJson("/cleanup", { delete: ids });
|
||||
cleanupBusy = true;
|
||||
const { status, body } = await postJson("/cleanup", { delete: ids }).finally(() => {
|
||||
cleanupBusy = false;
|
||||
});
|
||||
if (gen !== cleanupGen) return;
|
||||
$("cleanup-delete").disabled = false;
|
||||
$("cleanup-scan").disabled = false;
|
||||
paintDeleteButton();
|
||||
if (status !== 200 || !body.ok) {
|
||||
return setCleanupStatus(status ? body.error || "Could not delete." : "Plan2Code isn't reachable.", true);
|
||||
return setCleanupStatus(status ? body.error || "Could not delete." : NOT_CONNECTED, true);
|
||||
}
|
||||
const removed = (body.removed || []).length;
|
||||
const failed = (body.failed || []).length;
|
||||
@@ -137,6 +187,7 @@ async function deleteCleanup() {
|
||||
const asked = ids.length;
|
||||
const kept = Math.max(0, asked - removed - failed - refused);
|
||||
cleanupFound = null;
|
||||
ticked = new Set();
|
||||
renderCleanup();
|
||||
const done = removed ? "Deleted " + removed + (removed === 1 ? " item" : " items") + " · " + formatBytes(body.bytes) + " freed." : "Nothing was deleted.";
|
||||
const keptLine = kept ? ` ${kept} ${kept === 1 ? "was" : "were"} kept because ${kept === 1 ? "it" : "they"} changed since the scan.` : "";
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
// the one that starts it. The screens draw through state.js's redraw() and
|
||||
// keep the draft through saveNow(), never by importing this file.
|
||||
|
||||
import { looks, saveLooks } from "../looks.js";
|
||||
import { notConnected } from "../labels.js";
|
||||
import { fresh, freshChat, page, redraw, saveNow, scrollMemory } from "../state.js";
|
||||
import {
|
||||
CATALOG_GROUPS,
|
||||
@@ -31,7 +33,9 @@ import {
|
||||
progressTotal,
|
||||
pruneStaged,
|
||||
recordedAnswer,
|
||||
seedStaged,
|
||||
sentAnswer,
|
||||
startsTicked,
|
||||
staleLaunchFeedback,
|
||||
submittedAwaiting,
|
||||
suggestAction,
|
||||
@@ -47,7 +51,7 @@ import {
|
||||
shouldChime,
|
||||
unreadDot,
|
||||
} from "../chat.js";
|
||||
import { copyButton, el, isMac, textWithCode } from "../render.js";
|
||||
import { copyButton, el, hiddenText, icon, isMac, stateMark, textWithCode } from "../render.js";
|
||||
import { isBuild, isAgentless } from "../skills.js";
|
||||
import { startsClean } from "../hops.js";
|
||||
import { faviconState, setFavicon } from "../favicon.js";
|
||||
@@ -65,7 +69,7 @@ import { sound } from "../sound.js";
|
||||
import { renderConfirm, renderDashboard } from "./dashboard.js";
|
||||
import { renderLoopSetup } from "./loop-setup.js";
|
||||
import { renderLaunching, renderWaiting } from "./starting.js";
|
||||
import { attachFiles, heldNotes, noteImages, pendingNotes, removeImage } from "../uploads.js";
|
||||
import { attachFiles, findSetAside, heldNotes, noteImages, pendingNotes, purgeImages } from "../uploads.js";
|
||||
import { closeMentions } from "../mention-box.js";
|
||||
import { destroyFields } from "../md-field.js";
|
||||
import { buildPager, fitGrowBox, markFor, markMore, renderCard, renderEndItem, renderNotice } from "./cards.js";
|
||||
@@ -73,8 +77,9 @@ import { sendState, suggestState } from "../send-state.js";
|
||||
import { renderAgentsDoc, renderBriefButton, renderDoc, renderOverview, renderPrototypes } from "./docs.js";
|
||||
import { board, renderGitBoard, resetBoard } from "./git-host.js";
|
||||
import { renderWorkspace, tellFolderIssues } from "./workspace.js";
|
||||
import { openHelpOn } from "./help-dialog.js";
|
||||
import { framed, linkLeavesPage, onAppMessage, startNewSession, tellApp } from "../app-bridge.js";
|
||||
import { openHelp, openHelpOn } from "./help-dialog.js";
|
||||
import { framed, linkLeavesPage, onAppMessage, shortcutIdFor, startNewSession, tellApp } from "../app-bridge.js";
|
||||
import { openPrefs as openPrefsDialog } from "./prefs-dialog.js";
|
||||
import { continueButton } from "../continue-button.js";
|
||||
import { askOfflineFlipped, askState, declineOpen, renderAside, renderAsk, renderSubagents, renderSubagentsButton } from "./ask.js";
|
||||
import { renderHandoff, renderLoopEnd, renderHomeButton, renderStopButton, renderStopControls, renderStopping, renderFooterDashboard, stopInProgress, stopWarning } from "./ending.js";
|
||||
@@ -112,7 +117,16 @@ export const GONE_AFTER_MS = 8000;
|
||||
// wipe an unrelated warning that landed while the page was gone (an upload
|
||||
// failure, a refused send).
|
||||
const GONE_BANNER =
|
||||
"Lost contact with Plan2Code. Nothing you have typed is lost. A blip clears by itself; if Plan2Code starts again, it gives you a new link, so open that one.";
|
||||
notConnected("Nothing you have typed is lost. A blip clears by itself; if Plan2Code starts again, it gives you a new link, so open that one.");
|
||||
// Under the app there is no link to open: its own bar offers the way back
|
||||
// (the same split as Help's Troubleshooting wording, help-dialog.js).
|
||||
const GONE_BANNER_IN_APP =
|
||||
notConnected("Nothing you have typed is lost. A blip clears by itself; otherwise the bar at the top offers Reconnect the console.");
|
||||
const goneBanner = () => (page.inApp ? GONE_BANNER_IN_APP : GONE_BANNER);
|
||||
// The token of the "not connected" banner while it is up (banner() hands it back).
|
||||
let goneBannerToken = 0;
|
||||
// True while the popover that first showed the one-time meter tip is open.
|
||||
let meterTipOpen = false;
|
||||
|
||||
// The server's frame counter as of the last frame, and the last time the page
|
||||
// heard from the server at all.
|
||||
@@ -250,7 +264,7 @@ async function pushDraft() {
|
||||
await fetch("/draft", {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
body: JSON.stringify({ staged: page.local.staged, drafts: page.local.drafts, images: page.local.images }),
|
||||
body: JSON.stringify({ staged: page.local.staged, drafts: page.local.drafts, images: page.local.images, seeded: page.local.seeded }),
|
||||
});
|
||||
} catch {}
|
||||
}
|
||||
@@ -302,8 +316,8 @@ export function adopt(body) {
|
||||
// A "still being picked up" banner is over once the send is: it said a
|
||||
// moment, and left up it reads as a fault through every later screen.
|
||||
if (!page.pendingResult && page.pendingBannerUp) {
|
||||
clearBanner(page.pendingBannerUp);
|
||||
page.pendingBannerUp = false;
|
||||
banner(null);
|
||||
}
|
||||
page.pendingStop = Boolean(body.pendingStop);
|
||||
page.chatFrame = body.chat || null;
|
||||
@@ -325,7 +339,7 @@ export function adopt(body) {
|
||||
lastContact = Date.now();
|
||||
if (page.gone) {
|
||||
page.gone = false;
|
||||
if ($("banner").textContent === GONE_BANNER) banner(null);
|
||||
clearBanner(goneBannerToken);
|
||||
}
|
||||
if (firstLoad) {
|
||||
load();
|
||||
@@ -335,6 +349,8 @@ export function adopt(body) {
|
||||
page.local.staged = body.draft.staged;
|
||||
page.local.drafts = body.draft.drafts || {};
|
||||
page.local.images = body.draft.images || {};
|
||||
// A draft saved by an older page has no `seeded`: none were seeded.
|
||||
page.local.seeded = body.draft.seeded || {};
|
||||
settleStaleUploads();
|
||||
}
|
||||
}
|
||||
@@ -447,9 +463,9 @@ export function adopt(body) {
|
||||
// banner wait for the first thing it actually puts on the page.
|
||||
if (!finish() && (asked().length || doingNow() || docs().length)) {
|
||||
sound("skillReady");
|
||||
banner(`${was.title} is ready.`, "good");
|
||||
const ready = banner(`${was.title} is ready.`, "good");
|
||||
clearTimeout(arrivalBannerTimer);
|
||||
arrivalBannerTimer = setTimeout(() => !page.gone && banner(null), 4000);
|
||||
arrivalBannerTimer = setTimeout(() => !page.gone && clearBanner(ready), 4000);
|
||||
}
|
||||
}
|
||||
// Anything the agent has now recorded is no longer "staged" or in flight.
|
||||
@@ -489,9 +505,17 @@ export function adopt(body) {
|
||||
save();
|
||||
const titles = pruned.dropped.map((id) => (byId(id) && byId(id).title) || id).join(", ");
|
||||
staleLine = `A pick on ${titles} no longer matches the reworded question, so it was cleared.`;
|
||||
banner(staleLine, "info");
|
||||
const stale = banner(staleLine, "info");
|
||||
clearTimeout(arrivalBannerTimer);
|
||||
arrivalBannerTimer = setTimeout(() => !page.gone && $("banner").textContent === staleLine && banner(null), 8000);
|
||||
arrivalBannerTimer = setTimeout(() => !page.gone && clearBanner(stale), 8000);
|
||||
}
|
||||
// A multi card that asks to start with ticks gets them staged once, as if the
|
||||
// person had ticked them (an `answer` on the item would settle it instead).
|
||||
const seeding = seedStaged(page.S.items || [], page.local.staged, page.local.seeded || {}, page.local.sent || {});
|
||||
if (seeding.changed) {
|
||||
page.local.staged = seeding.staged;
|
||||
page.local.seeded = seeding.seeded;
|
||||
save();
|
||||
}
|
||||
// A retracted send suppresses exactly that send. Once the item moves --
|
||||
// settled, sent again (a new `at`), or answered by an agent reply -- the
|
||||
@@ -532,7 +556,7 @@ export function adopt(body) {
|
||||
// The question already on screen needs no mark: it is where they are looking.
|
||||
for (const q of arrived) if (!(page.view === "questions" && page.selected === q.id)) page.newQuestions.add(q.id);
|
||||
arrivalNotice = staleLine ? `${staleLine} ${arrivedLine}` : arrivedLine;
|
||||
banner(arrivalNotice, "info");
|
||||
arrivalToken = banner(arrivalNotice, "info");
|
||||
clearTimeout(arrivalBannerTimer);
|
||||
} else {
|
||||
page.selected = arrived[0].id;
|
||||
@@ -614,9 +638,10 @@ function scrollRail(where) {
|
||||
let arrivalBannerTimer = null;
|
||||
// The text of a notice that stays up (see adopt), so only that banner is cleared.
|
||||
let arrivalNotice = "";
|
||||
let arrivalToken = 0;
|
||||
|
||||
function dropArrivalNotice() {
|
||||
if (arrivalNotice && $("banner").textContent === arrivalNotice) banner(null);
|
||||
if (arrivalNotice) clearBanner(arrivalToken);
|
||||
arrivalNotice = "";
|
||||
}
|
||||
|
||||
@@ -713,12 +738,12 @@ function markGone() {
|
||||
// of the server means there, and a banner promising a reconnect would
|
||||
// argue with it.
|
||||
if (!finish() && !stopInProgress()) {
|
||||
banner(GONE_BANNER, "warn");
|
||||
goneBannerToken = banner(goneBanner(), "warn");
|
||||
}
|
||||
render();
|
||||
} else if (!bad && page.gone) {
|
||||
page.gone = false;
|
||||
if ($("banner").textContent === GONE_BANNER) banner(null);
|
||||
clearBanner(goneBannerToken);
|
||||
render();
|
||||
}
|
||||
}
|
||||
@@ -1065,18 +1090,40 @@ function restoreScroll() {
|
||||
scroller.scrollTop = saved ? saved.top : 0;
|
||||
}
|
||||
|
||||
// `extras` are nodes shown after the text: a copyable hint, an action.
|
||||
// `extras` are nodes shown after the text: a copyable hint, an action. Hands
|
||||
// back a token for this message: a timer that wants it gone calls
|
||||
// clearBanner(token), which clears only that message, so a timed success never
|
||||
// erases a newer warning. A warning carries a Dismiss button.
|
||||
let bannerSeq = 0;
|
||||
let bannerShowing = 0;
|
||||
|
||||
export function banner(text, kind, extras) {
|
||||
const n = $("banner");
|
||||
if (!text) {
|
||||
n.hidden = true;
|
||||
n.textContent = "";
|
||||
return;
|
||||
bannerShowing = 0;
|
||||
return 0;
|
||||
}
|
||||
n.hidden = false;
|
||||
n.className = "banner " + (kind || "");
|
||||
n.textContent = text;
|
||||
for (const node of extras || []) n.appendChild(node);
|
||||
bannerShowing = ++bannerSeq;
|
||||
if (kind === "warn") {
|
||||
const close = el("button", "banner-dismiss");
|
||||
close.type = "button";
|
||||
close.setAttribute("aria-label", "Dismiss");
|
||||
close.appendChild(icon("close"));
|
||||
close.addEventListener("click", () => banner(null));
|
||||
n.appendChild(close);
|
||||
}
|
||||
return bannerShowing;
|
||||
}
|
||||
|
||||
// Clears the banner only when it is still the message `token` named.
|
||||
export function clearBanner(token) {
|
||||
if (token && token === bannerShowing) banner(null);
|
||||
}
|
||||
|
||||
// The session meter's pill, straight from the frame's `meter` (meter.js did
|
||||
@@ -1094,6 +1141,18 @@ function renderMeter() {
|
||||
$("meter-words").textContent = page.meterFrame.words;
|
||||
pill.title = page.meterFrame.tooltip;
|
||||
$("meter-tip").textContent = page.meterFrame.tooltip;
|
||||
// The one-time tip (it used to sit in the Welcome dialog): the first time the
|
||||
// pill leaves green, the popover says what to do about it. It counts as read
|
||||
// once the popover has been opened with it showing (toggleMeterPop), and
|
||||
// stays up until that popover closes, so a redraw cannot take it away mid-read.
|
||||
const once = $("meter-once");
|
||||
const showOnce = page.meterFrame.level !== "green" && (looks.meterTipSeen !== true || meterTipOpen);
|
||||
once.hidden = !showOnce;
|
||||
if (showOnce) {
|
||||
once.textContent = page.inApp
|
||||
? "Tip: once the meter passes half, finish the step and press New Session at the top of the window."
|
||||
: "Tip: once the meter passes half, finish the step and start a new conversation.";
|
||||
}
|
||||
// What the points are made of: one row per piece of work that scored.
|
||||
const list = $("meter-list");
|
||||
const rows = Array.isArray(page.meterFrame.items) ? page.meterFrame.items : [];
|
||||
@@ -1121,7 +1180,7 @@ function renderMeter() {
|
||||
fresh.dataset.built = "1";
|
||||
if (page.inApp) {
|
||||
// The same press as the app bar's New Session, confirm and all.
|
||||
const press = el("button", "btn small primary meter-fresh-btn", "Start a New Session");
|
||||
const press = el("button", "btn sm primary meter-fresh-btn", "Start a New Session");
|
||||
press.type = "button";
|
||||
press.addEventListener("click", () => !loopDriving() && tellApp("new-session"));
|
||||
press.disabled = loopDriving();
|
||||
@@ -1131,9 +1190,9 @@ function renderMeter() {
|
||||
const text = handoffText({ command: DASHBOARD_COMMAND });
|
||||
const code = el("code", "handoff-code", text);
|
||||
const row = el("div", "handoff-command meter-fresh-row");
|
||||
row.append(code, copyButton(text, "btn small ghost handoff-copy", code));
|
||||
row.append(code, copyButton(text, "btn sm ghost handoff-copy", code));
|
||||
fresh.append(
|
||||
textWithCode("p", "meter-fresh-text", `To start a new session, run \`${DASHBOARD_COMMAND}\` in a new conversation:`),
|
||||
textWithCode("p", "meter-fresh-text", `To start fresh, run \`${DASHBOARD_COMMAND}\` in a new conversation:`),
|
||||
row
|
||||
);
|
||||
}
|
||||
@@ -1189,7 +1248,7 @@ function renderChrome() {
|
||||
: `${done} of ${total} ${building ? "done" : "answered"}`
|
||||
: h.stage || "Getting started";
|
||||
$("confidence").textContent = h.confidence || "";
|
||||
$("progress-fill").style.width = pct + "%";
|
||||
$("progress-fill").style.setProperty("--p", String(pct / 100));
|
||||
const bar = $("progress-bar");
|
||||
// A stage with nothing to count (a review starting) says its words, no track.
|
||||
bar.hidden = !total && Boolean(h.stage);
|
||||
@@ -1341,7 +1400,7 @@ export function renderStatus() {
|
||||
if (page.local.afterBuild === "dashboard" && !page.gone) return say("work", "Opening the dashboard…", "", true);
|
||||
if (page.local.afterBuild === "commit" && !page.gone) return say("work", "Opening Git…", "", true);
|
||||
if (page.local.afterBuild === "changelog" && !page.gone) return say("work", "Opening Changelog…", "", true);
|
||||
if (page.local.afterBuild === "launch" && !page.gone) return say("work", "Starting the next step…", "", true);
|
||||
if (page.local.afterBuild === "launch" && !page.gone) return say("work", "Starting the next skill…", "", true);
|
||||
const offer = reviewPending();
|
||||
// There is no tab to close under the app, only the one window.
|
||||
const closeWord = page.inApp ? "window" : "tab";
|
||||
@@ -1352,10 +1411,10 @@ export function renderStatus() {
|
||||
if (offer === "open") return say("point", `Done. Review it here first, or close this ${closeWord}.`);
|
||||
// A stop past a warning kept nothing, so it promises no saved place.
|
||||
if (finishPaused(finish()))
|
||||
return say("done", stopWarning() ? "Paused. The command above starts it again." : "Paused. Your place is saved: the command above picks it up.");
|
||||
return say("done", stopWarning() ? "Stopped. The command above starts it again." : "Stopped. Your place is saved: the command above picks it up.");
|
||||
return say("done", `All done. You can close this ${closeWord}.`);
|
||||
}
|
||||
if (page.gone) return say("gone", "Not connected. Your answers are saved.", "", false, true);
|
||||
if (page.gone) return say("gone", notConnected("Your answers are saved."), "", false, true);
|
||||
// The loop's own end screen (the app's `loopEnd`) is no `finish()`: while it
|
||||
// still has presses on offer the move is theirs; with none, it is done.
|
||||
if (page.S.loopEnd) {
|
||||
@@ -1527,11 +1586,15 @@ function renderViews() {
|
||||
}
|
||||
b.setAttribute("aria-current", String(page.view === t.id || (t.id === "questions" && page.view === "end")));
|
||||
if (t.count) {
|
||||
// The number is drawn for the eye; the name reads ", 3 waiting".
|
||||
const c = el("span", "tab-count", String(t.count));
|
||||
c.setAttribute("aria-hidden", "true");
|
||||
b.appendChild(c);
|
||||
b.appendChild(hiddenText(t.id === "questions" ? `, ${t.count} waiting` : `, ${t.count}`));
|
||||
}
|
||||
if (t.dot) {
|
||||
const dot = el("span", "tab-dot");
|
||||
dot.setAttribute("role", "img");
|
||||
dot.setAttribute("aria-label", "New reply");
|
||||
b.appendChild(dot);
|
||||
}
|
||||
@@ -1596,13 +1659,13 @@ export function renderSidebar() {
|
||||
b.setAttribute("aria-current", String(Boolean(page.dashPick && page.dashPick.skill === e.skill)));
|
||||
const isGoing = page.local.launching && (page.local.launching.skill === e.skill || page.local.launching.skill === e.review);
|
||||
const isPicked = page.dashPick && page.dashPick.skill === e.skill;
|
||||
const mark = el(
|
||||
"span",
|
||||
"rail-mark " + (isGoing || isPicked ? "staged" : "open"),
|
||||
isGoing ? "◐" : isPicked ? "●" : "○"
|
||||
b.appendChild(
|
||||
stateMark(
|
||||
"rail-mark " + (isGoing || isPicked ? "staged" : "open"),
|
||||
isGoing ? "half" : isPicked ? "dot" : "circle",
|
||||
isGoing ? "starting" : isPicked ? "picked" : "pick to start"
|
||||
)
|
||||
);
|
||||
mark.title = isGoing ? "starting" : isPicked ? "picked" : "pick to start";
|
||||
b.appendChild(mark);
|
||||
b.appendChild(el("span", null, e.title));
|
||||
// The center pane's own "Suggested" pill scrolls out of view, so the
|
||||
// rail repeats the call-out here as a small dot next to the title.
|
||||
@@ -1626,10 +1689,8 @@ export function renderSidebar() {
|
||||
}
|
||||
|
||||
const list = asked();
|
||||
if (!list.length) {
|
||||
rail.appendChild(el("p", "rail-empty", "Nothing here yet."));
|
||||
return;
|
||||
}
|
||||
// Nothing asked yet: the rail stays empty, with no placeholder line.
|
||||
if (!list.length) return;
|
||||
|
||||
const groups = new Map();
|
||||
for (const item of list) {
|
||||
@@ -1654,12 +1715,10 @@ export function renderSidebar() {
|
||||
// the question that was last selected is not the thing being looked at.
|
||||
b.setAttribute("aria-current", String(page.view === "questions" && page.selected === item.id));
|
||||
const m = markFor(item);
|
||||
const mark = el("span", "rail-mark " + m.cls, m.glyph);
|
||||
mark.title = m.label;
|
||||
b.appendChild(mark);
|
||||
b.appendChild(stateMark("rail-mark " + m.cls, m.icon, m.label));
|
||||
b.appendChild(el("span", null, item.title));
|
||||
if (page.newQuestions.has(item.id)) {
|
||||
const fresh = el("span", "rail-new", "New");
|
||||
const fresh = el("span", "pill is-accent is-caps rail-new", "New");
|
||||
fresh.title = "arrived while you were typing";
|
||||
b.appendChild(fresh);
|
||||
}
|
||||
@@ -1824,7 +1883,7 @@ function paintMain(main) {
|
||||
// an ending, and until there was a way to tell the two apart the page said
|
||||
// it in both. The ending has its own page now, reached from the rail.
|
||||
if (!finish() && !myTurn().length && !stagedCount()) {
|
||||
const lull = el("div", "card-note card-lead");
|
||||
const lull = el("div", "callout is-info card-note card-lead");
|
||||
lull.appendChild(el("p", "note-kicker", "All caught up"));
|
||||
lull.appendChild(el("h3", "note-title", "Nothing needs you right now"));
|
||||
lull.appendChild(
|
||||
@@ -1891,7 +1950,7 @@ export function renderFooter() {
|
||||
} else if (finish()) {
|
||||
// Not "nothing to send yet". There is no yet.
|
||||
const fin = finish();
|
||||
next.appendChild(el("strong", null, finishPaused(fin) ? "Paused." : "All done."));
|
||||
next.appendChild(el("strong", null, finishPaused(fin) ? "Stopped." : "All done."));
|
||||
next.appendChild(
|
||||
document.createTextNode(
|
||||
n || notes.length
|
||||
@@ -1949,6 +2008,8 @@ export function renderFooter() {
|
||||
const state = sendState();
|
||||
const btn = $("btn-send");
|
||||
btn.disabled = state.disabled;
|
||||
// Nothing to send on this view: the button is gone, the status words stay.
|
||||
btn.hidden = Boolean(state.hide);
|
||||
// Filled accent means "this is the step". That is only true of Send once
|
||||
// nothing is left to answer; before then it is the quieter of the two, so
|
||||
// the next question wins the eye. Still one click either way: someone who
|
||||
@@ -1957,7 +2018,7 @@ export function renderFooter() {
|
||||
btn.classList.toggle("primary", state.disabled || sendIsStep);
|
||||
btn.classList.toggle("standby", !state.disabled && !sendIsStep);
|
||||
// The chevron before Send sways only while Send is the filled, live step.
|
||||
$("send-nudge").hidden = !sendIsStep;
|
||||
$("send-nudge").hidden = !sendIsStep || Boolean(state.hide);
|
||||
|
||||
const hint = $("send-hint");
|
||||
hint.replaceChildren();
|
||||
@@ -2156,11 +2217,11 @@ export async function askSuggestions(itemId) {
|
||||
}),
|
||||
});
|
||||
if (res.status === 409) {
|
||||
banner(
|
||||
// The token, so the end of the send clears only this line.
|
||||
page.pendingBannerUp = banner(
|
||||
"Your last answers are still being picked up. Nothing is lost, and nothing was sent twice. Try again in a moment.",
|
||||
"info"
|
||||
);
|
||||
page.pendingBannerUp = true;
|
||||
page.pendingResult = true;
|
||||
} else if (!res.ok) {
|
||||
const body = await res.json().catch(() => null);
|
||||
@@ -2169,8 +2230,8 @@ export async function askSuggestions(itemId) {
|
||||
// A note held back on an upload did not go, so it stays drafted.
|
||||
if (note) clearSentNote(itemId, new Set(images.map((i) => i.key)));
|
||||
save();
|
||||
banner("Asked for suggestions. Plan2Code is picking it up now.", "good");
|
||||
setTimeout(() => banner(null), 4000);
|
||||
const asked = banner("Asked for suggestions. Plan2Code is picking it up now.", "good");
|
||||
setTimeout(() => clearBanner(asked), 4000);
|
||||
}
|
||||
} catch {
|
||||
await sendLost();
|
||||
@@ -2220,8 +2281,8 @@ export async function send() {
|
||||
// for the next, different one.
|
||||
if (loopWaiting()) page.local.askLockedAfterSend = loopWaitingKey();
|
||||
markSent(payload);
|
||||
banner("Sent. Plan2Code is picking it up now.", "good");
|
||||
setTimeout(() => banner(null), 4000);
|
||||
const sentBanner = banner("Sent. Plan2Code is picking it up now.", "good");
|
||||
setTimeout(() => clearBanner(sentBanner), 4000);
|
||||
// A menu option the agent marked `fresh` is a clean start, which under the
|
||||
// app is the bar's New Session; the agent still gets the pick, so a
|
||||
// declined confirm carries on with its usual finish.
|
||||
@@ -2229,11 +2290,11 @@ export async function send() {
|
||||
if (freshMenu) startNewSession(freshMenu.command ? handoffText({ command: freshMenu.command }) : "");
|
||||
} catch (err) {
|
||||
if (err && err.pending) {
|
||||
banner(
|
||||
// The token, so the end of the send clears only this line.
|
||||
page.pendingBannerUp = banner(
|
||||
"Your last answers are still being picked up. Nothing is lost, and nothing was sent twice. Try again in a moment.",
|
||||
"info"
|
||||
);
|
||||
page.pendingBannerUp = true;
|
||||
page.pendingResult = true;
|
||||
} else if (err && err.reason) {
|
||||
banner(refusedLine(err), "warn");
|
||||
@@ -2291,6 +2352,9 @@ function tokenFor(item, v) {
|
||||
const parts = [];
|
||||
if (v.k) parts.push(map[v.k] || v.k);
|
||||
if (Array.isArray(v.ks) && v.ks.length) parts.push(v.ks.map((k) => map[k] || k).join(", "));
|
||||
// A card that opened ticked can be sent with nothing ticked: that is an
|
||||
// answer, said even when a note rides with it ("none; keep the logo").
|
||||
else if (Array.isArray(v.ks) && startsTicked(item)) parts.push("none");
|
||||
if (v.verdict) parts.push(map[v.verdict] || v.verdict);
|
||||
if (typeof v.yes === "boolean") parts.push(map[v.yes ? "yes" : "no"] || (v.yes ? "yes" : "no"));
|
||||
if (typeof v.ok === "boolean") parts.push(v.ok ? "confirmed" : "needs changes");
|
||||
@@ -2323,6 +2387,69 @@ function fmtMs(ms) {
|
||||
return `${m}m ${s % 60}s`;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------- Clear, with Undo */
|
||||
|
||||
// Clear throws away what has not been sent, at once, and offers Undo for ten
|
||||
// seconds. The staged answers, the typed boxes and the attachments are kept in
|
||||
// memory meanwhile; the attachments' files on the server are deleted only when
|
||||
// the window closes (or the next Clear), so Undo has something to restore.
|
||||
const UNDO_CLEAR_MS = 10000;
|
||||
let clearedUndo = null;
|
||||
findSetAside((itemId, key) => (clearedUndo && (clearedUndo.images[itemId] || []).find((img) => img.key === key)) || null);
|
||||
|
||||
// The window is over: the set-aside pictures go for good.
|
||||
function settleClear() {
|
||||
if (!clearedUndo) return;
|
||||
clearTimeout(clearedUndo.timer);
|
||||
purgeImages(clearedUndo.images);
|
||||
clearBanner(clearedUndo.banner);
|
||||
clearedUndo = null;
|
||||
}
|
||||
|
||||
function clearUnsent() {
|
||||
// A second Clear closes the first one's window.
|
||||
settleClear();
|
||||
const count = Object.keys(page.local.staged).length + pendingNotes().length;
|
||||
const kept = { staged: page.local.staged, images: page.local.images, drafts: {} };
|
||||
page.local.staged = {};
|
||||
page.local.images = {};
|
||||
// Every typed box, the same set markSent clears: a draft left behind would
|
||||
// refill its box on the next render and look as if nothing was cleared.
|
||||
const typed = ["thread-", "other-", "text-", "note-"];
|
||||
for (const key of Object.keys(page.local.drafts)) {
|
||||
if (!typed.some((p) => key.startsWith(p))) continue;
|
||||
kept.drafts[key] = page.local.drafts[key];
|
||||
delete page.local.drafts[key];
|
||||
}
|
||||
saveNow();
|
||||
redraw();
|
||||
const undo = el("button", "btn xs soft banner-action", "Undo");
|
||||
undo.type = "button";
|
||||
undo.addEventListener("click", () => undoClear());
|
||||
const said = count ? `Cleared ${count} ${count === 1 ? "answer" : "answers"}. ` : "Cleared what you had not sent. ";
|
||||
const token = banner(said, "info", [undo]);
|
||||
clearedUndo = { ...kept, banner: token, timer: setTimeout(settleClear, UNDO_CLEAR_MS) };
|
||||
}
|
||||
|
||||
// Puts back what Clear set aside, except where the person has already typed or
|
||||
// picked something newer for the same question.
|
||||
function undoClear() {
|
||||
const was = clearedUndo;
|
||||
if (!was) return;
|
||||
clearTimeout(was.timer);
|
||||
clearedUndo = null;
|
||||
page.local.staged = { ...was.staged, ...page.local.staged };
|
||||
for (const [key, text] of Object.entries(was.drafts)) if (!(key in page.local.drafts)) page.local.drafts[key] = text;
|
||||
// Per note, so a picture attached during the window sits beside the restored ones.
|
||||
for (const [itemId, list] of Object.entries(was.images)) {
|
||||
const now = page.local.images[itemId] || [];
|
||||
page.local.images[itemId] = [...list.filter((img) => !now.some((x) => x.key === img.key)), ...now];
|
||||
}
|
||||
clearBanner(was.banner);
|
||||
saveNow();
|
||||
redraw();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------- page chrome */
|
||||
|
||||
function toggleMeterPop(open) {
|
||||
@@ -2330,6 +2457,14 @@ function toggleMeterPop(open) {
|
||||
const show = open ?? pop.hidden;
|
||||
pop.hidden = !show;
|
||||
$("meter-pill").setAttribute("aria-expanded", String(show));
|
||||
if (show && !$("meter-once").hidden && looks.meterTipSeen !== true) {
|
||||
meterTipOpen = true;
|
||||
looks.meterTipSeen = true;
|
||||
saveLooks();
|
||||
} else if (!show && meterTipOpen) {
|
||||
meterTipOpen = false;
|
||||
renderMeter();
|
||||
}
|
||||
}
|
||||
|
||||
let whereResizeTimer = null;
|
||||
@@ -2348,7 +2483,7 @@ async function openOutside(href) {
|
||||
.catch(() => false);
|
||||
if (ok) return;
|
||||
const link = el("code", "banner-link", href);
|
||||
banner("That link could not open from here. Copy it and paste it into your browser: ", "warn", [link, document.createTextNode(" "), copyButton(href, "btn small", link)]);
|
||||
banner("That link could not open from here. Copy it and paste it into your browser: ", "warn", [link, document.createTextNode(" "), copyButton(href, "btn sm", link)]);
|
||||
}
|
||||
|
||||
export function wireChrome() {
|
||||
@@ -2367,6 +2502,30 @@ export function wireChrome() {
|
||||
renderStatus();
|
||||
});
|
||||
|
||||
// The app's shortcuts (Ctrl or Cmd with a backtick, 1, 2, Shift+N, O and a comma) are also typed
|
||||
// here, inside its frame, where the shell never hears them: the page forwards the id and nothing
|
||||
// else. And its Preferences shortcut asks this page to open User Preferences.
|
||||
if (framed()) {
|
||||
document.addEventListener(
|
||||
"keydown",
|
||||
(e) => {
|
||||
const id = shortcutIdFor(e, isMac());
|
||||
if (!id) return;
|
||||
e.preventDefault();
|
||||
tellApp("shortcut", { id });
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
onAppMessage("open-help", () => {
|
||||
if (document.querySelector("dialog[open]")) return;
|
||||
openHelp();
|
||||
});
|
||||
onAppMessage("open-preferences", () => {
|
||||
if (document.querySelector("dialog[open]")) return;
|
||||
openPrefsDialog();
|
||||
});
|
||||
|
||||
// Under the app, a link off the page goes to the default browser through
|
||||
// the console: the app's window opens no new ones, so the click alone would
|
||||
// do nothing. Capture phase, ahead of any handler on the link itself. The
|
||||
@@ -2412,19 +2571,7 @@ export function wireChrome() {
|
||||
});
|
||||
|
||||
$("btn-send").addEventListener("click", send);
|
||||
$("btn-clear").addEventListener("click", () => {
|
||||
if (!confirm("Clear everything you have not sent yet?")) return;
|
||||
page.local.staged = {};
|
||||
// Every typed box, the same set markSent clears: a draft left behind would
|
||||
// refill its box on the next render and look as if nothing was cleared.
|
||||
const typed = ["thread-", "other-", "text-", "note-"];
|
||||
for (const key of Object.keys(page.local.drafts)) if (typed.some((p) => key.startsWith(p))) delete page.local.drafts[key];
|
||||
for (const [itemId, list] of Object.entries(page.local.images)) {
|
||||
for (const img of list) removeImage(itemId, img.key);
|
||||
}
|
||||
saveNow();
|
||||
redraw();
|
||||
});
|
||||
$("btn-clear").addEventListener("click", clearUnsent);
|
||||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
|
||||
@@ -2435,6 +2582,22 @@ export function wireChrome() {
|
||||
send();
|
||||
return;
|
||||
}
|
||||
// ? opens Help where the `?` button does (its contextual tab), but never
|
||||
// from a field, a select, an editor or the Notebook, behind an open dialog
|
||||
// (a game plays in one) or with a modifier held. Matches the typed
|
||||
// character, so a layout that needs Shift for it works.
|
||||
if (e.key === "?" && !e.ctrlKey && !e.metaKey && !e.altKey && !e.defaultPrevented && !document.querySelector("dialog[open]")) {
|
||||
// The Markdown editors live in a shadow root, so the target is their
|
||||
// host (.md-host) at the document: read the whole composed path.
|
||||
const typing = e.composedPath().some(
|
||||
(n) => n.nodeType === 1 && (n.isContentEditable || n.matches("input, textarea, select, .md-host, .cm-editor, [contenteditable]"))
|
||||
);
|
||||
if (!typing) {
|
||||
e.preventDefault();
|
||||
openHelp();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Escape is the confirm pane's Back — but not while a dialog has it. Native
|
||||
// dialogs close themselves on the same key; backing out of the pick at the
|
||||
// same time would be two undos for one press.
|
||||
|
||||
@@ -13,8 +13,9 @@ import {
|
||||
learningBusyNow,
|
||||
LEARNING_BUSY_MS,
|
||||
} from "../selectors.js";
|
||||
import { whenTitle, whenWords } from "../labels.js";
|
||||
import { hooks, page, redraw, saveNow } from "../state.js";
|
||||
import { el, approvalTip, mdInto, releasesLink, copyButton, lightDismiss, SVG_NS } from "../render.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";
|
||||
import { RED_BANNER, RED_BANNER_IN_APP } from "../meter.js";
|
||||
@@ -75,39 +76,56 @@ export let wakeHoldsChime = false;
|
||||
// the waking click, since browsers refuse sound before one.
|
||||
let snore = null;
|
||||
|
||||
function roleNudge() {
|
||||
const nudge = el("div", "dash-nudge");
|
||||
nudge.setAttribute("role", "status");
|
||||
nudge.appendChild(el("span", "dash-nudge-text", "Pick your role to get starter templates ordered for you."));
|
||||
const actions = el("div", "dash-nudge-actions");
|
||||
const setUp = el("button", "btn small primary", "Set up preferences");
|
||||
setUp.type = "button";
|
||||
setUp.addEventListener("click", () => {
|
||||
// Closed without a role is a "Not now" too: having been to the dialog,
|
||||
// they were asked, and the banner does not come back (Help says so).
|
||||
$("looks-modal").addEventListener(
|
||||
"close",
|
||||
() => {
|
||||
if (looks.role === undefined) {
|
||||
looks.role = ROLE_NOT_SET;
|
||||
saveLooks();
|
||||
redraw();
|
||||
}
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
// The role is asked once; closing Preferences without one, or Not now, counts
|
||||
// as asked and ends the line (Help says so).
|
||||
function roleAsked() {
|
||||
if (looks.role === undefined) {
|
||||
looks.role = ROLE_NOT_SET;
|
||||
saveLooks();
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
|
||||
// After the first launch: one quiet line for the two optional extras, a role
|
||||
// (starter templates ordered for you) and Learning. Until then both are held,
|
||||
// so the first dashboard offers a card and nothing else.
|
||||
function extrasLine() {
|
||||
const line = el("p", "dash-extras");
|
||||
// Learning is only on offer while it is Not set up; the role is always there
|
||||
// (the line shows only while the role is unasked).
|
||||
const learning = scan() && scan().learning;
|
||||
const withLearning = Boolean(learning && learning.state === "not-set-up");
|
||||
line.appendChild(document.createTextNode(withLearning ? "Two optional extras: " : "One optional extra: "));
|
||||
const role = el("button", "dash-extras-link", "set your role");
|
||||
role.type = "button";
|
||||
role.addEventListener("click", () => {
|
||||
$("looks-modal").addEventListener("close", roleAsked, { once: true });
|
||||
hooks.openPrefs("appearance");
|
||||
});
|
||||
const notNow = el("button", "btn tiny ghost", "Not now");
|
||||
line.appendChild(role);
|
||||
if (withLearning) {
|
||||
line.appendChild(document.createTextNode(", "));
|
||||
const learn = el("button", "dash-extras-link", "switch on Learning");
|
||||
learn.type = "button";
|
||||
learn.addEventListener("click", () => {
|
||||
const row = $("main").querySelector(".learn-row");
|
||||
if (!row) return;
|
||||
row.scrollIntoView({ block: "center" });
|
||||
const go = row.querySelector("button");
|
||||
if (go) go.focus();
|
||||
});
|
||||
line.appendChild(learn);
|
||||
}
|
||||
line.appendChild(document.createTextNode("."));
|
||||
const notNow = el("button", "btn xs soft", "Not now");
|
||||
notNow.type = "button";
|
||||
notNow.addEventListener("click", () => {
|
||||
looks.role = ROLE_NOT_SET;
|
||||
saveLooks();
|
||||
redraw();
|
||||
});
|
||||
actions.append(setUp, notNow);
|
||||
nudge.appendChild(actions);
|
||||
return nudge;
|
||||
line.appendChild(notNow);
|
||||
return line;
|
||||
}
|
||||
|
||||
// × on the update banner hides it for this console session only, and only
|
||||
@@ -131,7 +149,7 @@ function updateDismissed() {
|
||||
const UPDATE_COMMAND = "plan2code update";
|
||||
|
||||
// For a machine without the plan2code command: the full installer, menu and all.
|
||||
const UPDATE_FALLBACK_COMMAND = "npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git";
|
||||
const UPDATE_FALLBACK_COMMAND = "npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release";
|
||||
|
||||
function openUpdateModal() {
|
||||
if (!page.updateFrame) return;
|
||||
@@ -139,24 +157,27 @@ function openUpdateModal() {
|
||||
versions.replaceChildren(
|
||||
document.createTextNode("Version "),
|
||||
releasesLink("v" + page.updateFrame.latest),
|
||||
document.createTextNode(" is out — you have "),
|
||||
document.createTextNode(" is out, you have "),
|
||||
el("code", null, page.updateFrame.installed),
|
||||
document.createTextNode(".")
|
||||
);
|
||||
const row = $("update-command");
|
||||
const code = el("code", null, UPDATE_COMMAND);
|
||||
row.replaceChildren(code, copyButton(UPDATE_COMMAND, "btn small ghost handoff-copy", code));
|
||||
row.replaceChildren(code, copyButton(UPDATE_COMMAND, "btn sm ghost handoff-copy", code));
|
||||
const fallbackRow = $("update-fallback");
|
||||
const fallback = el("code", null, UPDATE_FALLBACK_COMMAND);
|
||||
fallbackRow.replaceChildren(fallback, copyButton(UPDATE_FALLBACK_COMMAND, "btn small ghost handoff-copy", fallback));
|
||||
// Under the app, its terminal panel runs the agent, and the app it would
|
||||
// update is the one running this page.
|
||||
$("update-step-run").textContent = page.inApp
|
||||
? "Run this in a terminal outside the app (not in its terminal panel, which runs your agent):"
|
||||
: "Run this in your terminal (not in this page or your agent):";
|
||||
fallbackRow.replaceChildren(fallback, copyButton(UPDATE_FALLBACK_COMMAND, "btn sm ghost handoff-copy", fallback));
|
||||
// Under the app, the bar's Update and restart does all of it in one click;
|
||||
// the command is the fallback, and its terminal panel runs the agent, so
|
||||
// it goes in a terminal outside the app.
|
||||
$("update-step-run").replaceChildren(
|
||||
...(page.inApp
|
||||
? ["Press ", el("strong", null, "Update and restart"), " in the app's top bar. Or run this in a terminal outside the app (not in its terminal panel, which runs your agent):"]
|
||||
: ["Run this in your terminal (not in this page or your agent):"])
|
||||
);
|
||||
$("update-step-restart").replaceChildren(
|
||||
...(page.inApp
|
||||
? ["When it finishes, close the app and open it again."]
|
||||
? ["Update and restart reopens the app by itself. After the command, close the app and open it again."]
|
||||
: ["When it finishes, close this console and start ", el("code", null, "plan2code"), " again."])
|
||||
);
|
||||
$("update-modal").showModal();
|
||||
@@ -173,10 +194,10 @@ export function renderDashboard(main) {
|
||||
settleDeleting();
|
||||
const menu = (page.S && page.S.menu) || {};
|
||||
const wrap = el("div", "dash");
|
||||
if (needsRoleNudge(looks)) wrap.appendChild(roleNudge());
|
||||
const firstRun = looks.skillLaunched !== true;
|
||||
// Advice only: words, never a button, and nothing is blocked.
|
||||
if (page.meterFrame && page.meterFrame.level === "red") {
|
||||
const warn = el("div", "dash-nudge meter-banner", page.inApp ? RED_BANNER_IN_APP : RED_BANNER);
|
||||
const warn = el("div", "callout is-warn dash-nudge meter-banner", page.inApp ? RED_BANNER_IN_APP : RED_BANNER);
|
||||
warn.setAttribute("role", "status");
|
||||
wrap.appendChild(warn);
|
||||
}
|
||||
@@ -186,12 +207,13 @@ export function renderDashboard(main) {
|
||||
// (the bar's one-click Update skills only levels skills to the app's own
|
||||
// version), and the modal words its steps for the app.
|
||||
if (page.updateFrame && !updateDismissed()) {
|
||||
const notice = el("div", "dash-nudge update-banner");
|
||||
const notice = el("div", "callout is-info dash-nudge update-banner");
|
||||
notice.setAttribute("role", "status");
|
||||
const open = el("button", "update-banner-open", "UPDATE AVAILABLE · v" + page.updateFrame.latest);
|
||||
const open = el("button", "update-banner-open", "Update available · v" + page.updateFrame.latest);
|
||||
open.type = "button";
|
||||
open.addEventListener("click", openUpdateModal);
|
||||
const dismiss = el("button", "update-banner-dismiss", "×");
|
||||
const dismiss = el("button", "update-banner-dismiss");
|
||||
dismiss.appendChild(icon("close"));
|
||||
dismiss.type = "button";
|
||||
dismiss.setAttribute("aria-label", "Dismiss until next time");
|
||||
dismiss.addEventListener("click", () => {
|
||||
@@ -207,6 +229,7 @@ export function renderDashboard(main) {
|
||||
// title (the others are more urgent). Hidden while paused or off.
|
||||
const learnBanner = learningBanner(scan());
|
||||
if (learnBanner) wrap.appendChild(learnBanner);
|
||||
if (!firstRun && needsRoleNudge(looks)) wrap.appendChild(extrasLine());
|
||||
wrap.appendChild(el("p", "card-kicker", "Plan2Code"));
|
||||
wrap.appendChild(el("h2", "dash-title", "What are we doing today?"));
|
||||
// The agent's note reads the spec the picker opened on (the same "initial"
|
||||
@@ -286,7 +309,7 @@ export function renderDashboard(main) {
|
||||
}
|
||||
if (!shown) {
|
||||
wrap.appendChild(
|
||||
el("p", "dash-empty", "Nothing fits this pick right now. Turn off the toggle above to see every workflow.")
|
||||
el("p", "empty", "Nothing fits this pick right now. Turn off the toggle above to see every skill.")
|
||||
);
|
||||
}
|
||||
// Learning while on: after the last card group, before the approval tip.
|
||||
@@ -505,7 +528,7 @@ function hideUnavailableToggle() {
|
||||
});
|
||||
label.appendChild(box);
|
||||
label.appendChild(el("span", "dash-toggle-track"));
|
||||
label.appendChild(el("span", "dash-toggle-text", "Hide unavailable workflows"));
|
||||
label.appendChild(el("span", "dash-toggle-text", "Hide unavailable skills"));
|
||||
return label;
|
||||
}
|
||||
|
||||
@@ -563,7 +586,8 @@ function renderSpecPicker(specs) {
|
||||
if (isDeletableSpecDir(spec.dir)) {
|
||||
// A fixed bug is done with, so its Delete is a visible button rather
|
||||
// than the hover ✕ every other spec has.
|
||||
const del = fixed ? el("button", "spec-chip-del-label", "Delete") : el("button", "spec-chip-del", "✕");
|
||||
const del = fixed ? el("button", "spec-chip-del-label", "Delete") : el("button", "spec-chip-del");
|
||||
if (!fixed) del.appendChild(icon("close"));
|
||||
del.type = "button";
|
||||
del.title = `Delete ${spec.dir}/`;
|
||||
del.setAttribute("aria-label", `Delete the spec ${spec.name}`);
|
||||
@@ -611,11 +635,13 @@ function renderHandoffPreview(h) {
|
||||
box.appendChild(el("h3", "handoff-preview-title", h.title || "Handoff"));
|
||||
const entry = catalogEntry(h.skill);
|
||||
const meta = [
|
||||
"Written " + (h.written ? new Date(h.written).toLocaleString() : "at an unknown time"),
|
||||
"Written " + (h.written ? whenWords(h.written) || "at an unknown time" : "at an unknown time"),
|
||||
h.spec ? "spec " + h.spec.replace(/^specs\//, "") : "no spec",
|
||||
"from " + (entry ? entry.title : h.skill),
|
||||
];
|
||||
box.appendChild(el("p", "handoff-preview-meta", meta.join(" · ")));
|
||||
const metaLine = el("p", "handoff-preview-meta", meta.join(" · "));
|
||||
if (h.written) metaLine.title = whenTitle(h.written);
|
||||
box.appendChild(metaLine);
|
||||
if (h.next) {
|
||||
box.appendChild(el("p", "handoff-preview-label", "Next task"));
|
||||
box.appendChild(el("p", "handoff-preview-next", h.next));
|
||||
@@ -740,8 +766,8 @@ function dashCard(entry, menu) {
|
||||
if (!presentation.on && presentation.reason) b.title = presentation.reason;
|
||||
|
||||
const head = el("span", "dash-card-head");
|
||||
head.appendChild(el("span", "dash-chip", entry.chip));
|
||||
if (presentation.recommended) head.appendChild(el("span", "pill suggested", "Suggested"));
|
||||
head.appendChild(el("span", "pill is-neutral is-caps dash-chip", entry.chip));
|
||||
if (presentation.recommended) head.appendChild(el("span", "pill is-accent is-caps suggested", "Suggested"));
|
||||
b.appendChild(head);
|
||||
const title = el("span", "dash-card-title");
|
||||
if (entry.icon) {
|
||||
@@ -770,7 +796,14 @@ function dashCard(entry, menu) {
|
||||
page.dashPick = entry;
|
||||
redraw();
|
||||
});
|
||||
if (entry.appOnly) b.appendChild(loopHelpLink());
|
||||
// "How the loop works" is a link of its own beside the card, never inside
|
||||
// the button (a link in a button is not valid and reads badly aloud).
|
||||
if (entry.appOnly) {
|
||||
const wrap = el("div", "dash-card-wrap");
|
||||
wrap.appendChild(b);
|
||||
wrap.appendChild(loopHelpLink());
|
||||
return wrap;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@@ -782,19 +815,12 @@ function loopPresentation(entry, menu) {
|
||||
return { ...cardPresentation(entry, scan(), selSpec(), menu), recommended: false };
|
||||
}
|
||||
|
||||
// "How the loop works" on the card: a link inside a button is not allowed, so
|
||||
// it is a span that acts like one and keeps the click from opening the setup.
|
||||
// "How the loop works" under the card: a real button styled as a link, a
|
||||
// sibling of the card button inside its wrapper.
|
||||
function loopHelpLink() {
|
||||
const a = el("span", "dash-card-link", "How the loop works");
|
||||
a.setAttribute("role", "link");
|
||||
a.tabIndex = 0;
|
||||
const open = (e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
hooks.openHelpOn("loop");
|
||||
};
|
||||
a.addEventListener("click", open);
|
||||
a.addEventListener("keydown", (e) => (e.key === "Enter" || e.key === " ") && open(e));
|
||||
const a = el("button", "dash-card-link", "How the loop works");
|
||||
a.type = "button";
|
||||
a.addEventListener("click", () => hooks.openHelpOn("loop"));
|
||||
return a;
|
||||
}
|
||||
|
||||
@@ -908,7 +934,7 @@ function drawNoteBox(entry, box, cmdNote) {
|
||||
label.append(toggle, el("span", "confirm-note-switch-text", "Start with a note from your Notebook"));
|
||||
// A callout row, so the switch stands out under the card's long text; the
|
||||
// hint sits outside the label to keep the checkbox's name short.
|
||||
const head = el("div", "confirm-note-head" + (state.on ? " is-on" : ""));
|
||||
const head = el("div", "callout is-info confirm-note-head" + (state.on ? " is-on" : ""));
|
||||
head.appendChild(label);
|
||||
if (!state.on) {
|
||||
const hint = el("span", "confirm-note-hint", "Hand it a tab you wrote earlier, with its pictures.");
|
||||
@@ -927,7 +953,12 @@ function drawNoteBox(entry, box, cmdNote) {
|
||||
if (state.tabs === null) {
|
||||
wrap.appendChild(el("p", "confirm-note-msg", "Reading your Notebook…"));
|
||||
} else if (state.failed) {
|
||||
wrap.appendChild(el("p", "confirm-note-msg", "Your Notebook could not be read. Turn the switch off and on to try again."));
|
||||
wrap.appendChild(el("p", "confirm-note-msg", "Your Notebook could not be read."));
|
||||
const retry = el("button", "btn xs soft confirm-note-retry", "Try again");
|
||||
retry.type = "button";
|
||||
retry.dataset.noteFocus = "retry";
|
||||
retry.addEventListener("click", () => refreshNoteTabs(state, true));
|
||||
wrap.appendChild(retry);
|
||||
} else if (!state.tabs.length) {
|
||||
wrap.appendChild(el("p", "confirm-note-msg", "Your Notebook has no tabs yet. Open it from the top bar to write one."));
|
||||
} else {
|
||||
@@ -943,7 +974,7 @@ function drawNoteBox(entry, box, cmdNote) {
|
||||
b.setAttribute("aria-pressed", String(t.id === state.picked));
|
||||
b.appendChild(el("span", "confirm-note-tab-name", t.name));
|
||||
if (t.sent) {
|
||||
const badge = el("span", "notepad-sent-badge", "previously sent");
|
||||
const badge = el("span", "pill is-accent notepad-sent-badge", "previously sent");
|
||||
badge.setAttribute("aria-hidden", "true");
|
||||
b.appendChild(badge);
|
||||
}
|
||||
@@ -1055,8 +1086,8 @@ export function renderConfirm(main, entry) {
|
||||
pane.appendChild(stage);
|
||||
|
||||
const head = el("div", "confirm-head");
|
||||
head.appendChild(el("span", "dash-chip", entry.chip));
|
||||
if (presentation.recommended) head.appendChild(el("span", "pill suggested", "Suggested"));
|
||||
head.appendChild(el("span", "pill is-neutral is-caps dash-chip", entry.chip));
|
||||
if (presentation.recommended) head.appendChild(el("span", "pill is-accent is-caps suggested", "Suggested"));
|
||||
pane.appendChild(head);
|
||||
pane.appendChild(el("h2", "dash-title", entry.title));
|
||||
pane.appendChild(el("p", "confirm-about", entry.about || entry.blurb));
|
||||
@@ -1086,7 +1117,7 @@ export function renderConfirm(main, entry) {
|
||||
page.dashReview = review.checked;
|
||||
cmdCode.textContent = launchVariant(entry, review.checked).command;
|
||||
});
|
||||
label.append(review, el("span", null, "Auto Review: fresh agent pass over the phase's changes before sign-off"));
|
||||
label.append(review, el("span", null, "Review each phase with a fresh agent before sign-off"));
|
||||
pane.appendChild(label);
|
||||
}
|
||||
|
||||
@@ -1151,7 +1182,7 @@ export async function launchSkill(entry) {
|
||||
// The card was clickable, so this should never fire — but a spec picked in
|
||||
// one tab could have shifted the ground under a stale render in another.
|
||||
if (!cardAvailability(entry, scan(), selSpec()).on) {
|
||||
hooks.banner("That card is not available for the spec you picked.", "warn");
|
||||
hooks.banner("That skill is not available for the spec you picked.", "warn");
|
||||
redraw();
|
||||
return;
|
||||
}
|
||||
@@ -1210,6 +1241,12 @@ export async function launchSkill(entry) {
|
||||
}
|
||||
if (!res.ok) throw new Error(String(res.status));
|
||||
sound("startSkill");
|
||||
// The first launch from this machine ends the first-run hold on the
|
||||
// optional extras (never cleared, not even by Back to default).
|
||||
if (looks.skillLaunched !== true) {
|
||||
looks.skillLaunched = true;
|
||||
saveLooks();
|
||||
}
|
||||
page.local.launching = { skill: entry.skill, title: entry.title, at: Date.now() };
|
||||
page.launchScoping = false;
|
||||
page.pendingResult = true;
|
||||
@@ -1251,14 +1288,16 @@ function openHandoffDelete(h) {
|
||||
$("delete-warn-handoff").hidden = false;
|
||||
const facts = $("delete-facts");
|
||||
facts.replaceChildren();
|
||||
const fact = (term, value) => {
|
||||
const fact = (term, value, title) => {
|
||||
if (!value) return;
|
||||
facts.appendChild(el("dt", "", term));
|
||||
facts.appendChild(el("dd", "", value));
|
||||
const dd = el("dd", "", value);
|
||||
if (title) dd.title = title;
|
||||
facts.appendChild(dd);
|
||||
};
|
||||
const entry = catalogEntry(h.skill);
|
||||
fact("Handoff", h.title || h.id);
|
||||
fact("Written", h.written ? new Date(h.written).toLocaleString() : "");
|
||||
fact("Written", h.written ? whenWords(h.written) : "", h.written ? whenTitle(h.written) : "");
|
||||
fact("Spec", h.spec ? h.spec.replace(/^specs\//, "") : "");
|
||||
fact("From", entry ? entry.title : h.skill);
|
||||
$("delete-confirm").hidden = true;
|
||||
@@ -1289,16 +1328,18 @@ function openDeleteConfirm(spec) {
|
||||
$("delete-blurb").textContent = `Everything in ${sum.folder} will be deleted from this project.`;
|
||||
const facts = $("delete-facts");
|
||||
facts.replaceChildren();
|
||||
const fact = (term, value) => {
|
||||
const fact = (term, value, title) => {
|
||||
if (!value) return;
|
||||
facts.appendChild(el("dt", "", term));
|
||||
facts.appendChild(el("dd", "", value));
|
||||
const dd = el("dd", "", value);
|
||||
if (title) dd.title = title;
|
||||
facts.appendChild(dd);
|
||||
};
|
||||
fact("Spec", spec.name);
|
||||
fact("Folder", sum.folder);
|
||||
fact("Stage", sum.stage);
|
||||
fact("Files", sum.files);
|
||||
fact("Last changed", sum.touched ? new Date(sum.touched).toLocaleString() : "");
|
||||
fact("Last changed", sum.touched ? whenWords(sum.touched) : "", sum.touched ? whenTitle(sum.touched) : "");
|
||||
$("delete-name-hint").textContent = spec.name;
|
||||
$("delete-name").value = "";
|
||||
$("delete-confirm").hidden = true;
|
||||
@@ -1402,7 +1443,7 @@ function learningBanner(sc) {
|
||||
const working = busy && (busy.what === "review" || busy.what === "decide") ? busy : null;
|
||||
const text = learningBannerText(sc && sc.learning);
|
||||
if (!text && !working) return null;
|
||||
const banner = el("div", "dash-nudge learn-banner");
|
||||
const banner = el("div", "callout is-info dash-nudge learn-banner");
|
||||
banner.setAttribute("role", "status");
|
||||
if (working) {
|
||||
banner.classList.add("is-busy");
|
||||
@@ -1411,7 +1452,7 @@ function learningBanner(sc) {
|
||||
line.append(el("span", "spinner tiny"), document.createTextNode(working.what === "review" ? "Opening lessons…" : "Saving your lessons…"));
|
||||
banner.appendChild(line);
|
||||
if (working.what === "review") {
|
||||
const review = el("button", "btn small primary", "Review");
|
||||
const review = el("button", "btn sm primary", "Review");
|
||||
review.type = "button";
|
||||
review.disabled = true;
|
||||
banner.appendChild(review);
|
||||
@@ -1419,7 +1460,7 @@ function learningBanner(sc) {
|
||||
return banner;
|
||||
}
|
||||
banner.appendChild(el("span", "dash-nudge-text", text));
|
||||
const review = el("button", "btn small primary", "Review");
|
||||
const review = el("button", "btn sm primary", "Review");
|
||||
review.type = "button";
|
||||
const why = hooks.learningBlocked();
|
||||
review.disabled = Boolean(why);
|
||||
@@ -1453,8 +1494,8 @@ function watchLearningBusy(busy) {
|
||||
clearInterval(timer);
|
||||
page.learningBusy = null;
|
||||
if (busy.what === "review") {
|
||||
hooks.banner("No lessons are waiting any more.", "info");
|
||||
setTimeout(() => hooks.banner(null), 4000);
|
||||
const none = hooks.banner("No lessons are waiting any more.", "info");
|
||||
setTimeout(() => hooks.clearBanner(none), 4000);
|
||||
}
|
||||
redraw();
|
||||
}, 400);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import {
|
||||
docs, agentWorking, workingMs, patience, WORKING_GRACE_MS, finish, SPEC_FILES, loadAgentsDoc, openPrototypeDoc, closePrototypeDoc,
|
||||
} from "../selectors.js";
|
||||
import { el, md } from "../render.js";
|
||||
import { el, icon, md } from "../render.js";
|
||||
import { downloadDocHtml, docSavedNote, downloadDoc, blockBody } from "../doc-files.js";
|
||||
import { hooks, page, redraw } from "../state.js";
|
||||
|
||||
@@ -93,8 +93,8 @@ export async function sendBrief() {
|
||||
if (res.status === 409) throw Object.assign(new Error("pending"), { pending: true });
|
||||
if (!res.ok) throw new Error(String(res.status));
|
||||
$("brief-modal").close();
|
||||
hooks.banner("Asked for a brief. It will appear as a tab when it is written.", "good");
|
||||
setTimeout(() => hooks.banner(null), 5000);
|
||||
const asked = hooks.banner("Asked for a brief. It will appear as a tab when it is written.", "good");
|
||||
setTimeout(() => hooks.clearBanner(asked), 5000);
|
||||
page.pendingResult = true;
|
||||
redraw();
|
||||
} catch (err) {
|
||||
@@ -120,17 +120,25 @@ export function renderBriefButton() {
|
||||
if (offer) btn.disabled = page.gone || page.pendingResult || Boolean(finish());
|
||||
}
|
||||
|
||||
// The page's one empty block (.empty): an icon from the sheet and one line.
|
||||
function emptyBlock(text) {
|
||||
const box = el("div", "empty");
|
||||
box.appendChild(icon("document", "empty-icon"));
|
||||
box.appendChild(el("p", null, text));
|
||||
return box;
|
||||
}
|
||||
|
||||
export function renderDoc(main, id) {
|
||||
const doc = docs().find((d) => d.id === id);
|
||||
if (!doc) {
|
||||
main.appendChild(el("p", "doc-empty", "That document is not ready yet."));
|
||||
main.appendChild(emptyBlock("That document is not ready yet."));
|
||||
return;
|
||||
}
|
||||
const head = el("div", "doc-head");
|
||||
head.appendChild(el("h2", null, doc.title || "Document"));
|
||||
head.appendChild(el("span", "doc-version", "v" + (doc.version || 1)));
|
||||
if (doc.stale) {
|
||||
head.appendChild(el("span", "pill staged", "Out of date"));
|
||||
head.appendChild(el("span", "pill is-stage", "Out of date"));
|
||||
}
|
||||
|
||||
const tools = el("div", "doc-tools");
|
||||
@@ -138,7 +146,7 @@ export function renderDoc(main, id) {
|
||||
// A brief is handed to people who were not in the room, so it gets a copy
|
||||
// that opens in any browser, formatting and all.
|
||||
if (doc.id === "brief") {
|
||||
const html = el("button", "btn small", "Save as HTML");
|
||||
const html = el("button", "btn sm", "Save as HTML");
|
||||
html.type = "button";
|
||||
html.addEventListener("click", () => downloadDocHtml(doc));
|
||||
tools.appendChild(html);
|
||||
@@ -148,7 +156,7 @@ export function renderDoc(main, id) {
|
||||
if (doc.saved) {
|
||||
tools.appendChild(docSavedNote(doc));
|
||||
} else {
|
||||
const save = el("button", "btn small", "Download");
|
||||
const save = el("button", "btn sm", "Download");
|
||||
save.type = "button";
|
||||
save.addEventListener("click", () => downloadDoc(doc));
|
||||
tools.appendChild(save);
|
||||
@@ -160,7 +168,7 @@ export function renderDoc(main, id) {
|
||||
|
||||
const blocks = doc.blocks || [];
|
||||
if (!blocks.length) {
|
||||
main.appendChild(el("p", "doc-empty", "Nothing written yet. It fills in as you answer."));
|
||||
main.appendChild(emptyBlock("Nothing written yet. It fills in as you answer."));
|
||||
return;
|
||||
}
|
||||
// The block nearest the top of the column is the section + Add context
|
||||
@@ -202,7 +210,7 @@ export function renderDoc(main, id) {
|
||||
function backButton() {
|
||||
const flow = page.S.workflow;
|
||||
const home = flow === "dashboard" ? "Dashboard" : flow === "git" ? "Git" : "Questions";
|
||||
const back = el("button", "btn small back-home", "Back to " + home);
|
||||
const back = el("button", "btn sm back-home", "Back to " + home);
|
||||
back.type = "button";
|
||||
back.addEventListener("click", () => {
|
||||
page.view = finish() ? "end" : "questions";
|
||||
@@ -213,7 +221,7 @@ function backButton() {
|
||||
}
|
||||
|
||||
function printButton() {
|
||||
const print = el("button", "btn small", "Print");
|
||||
const print = el("button", "btn sm", "Print");
|
||||
print.type = "button";
|
||||
// The print stylesheet drops everything that steers the session, so what
|
||||
// comes out is the document alone. "Save as PDF" in that dialog is also the
|
||||
@@ -237,10 +245,21 @@ export function renderOverview(main, kind = "overview") {
|
||||
main.appendChild(head);
|
||||
main.appendChild(el("p", "help", `${page.overview.key}/${found ? found.file : ""} · read-only, straight from disk`));
|
||||
const box = el("div", "block settled");
|
||||
box.appendChild(md(found ? found.text : "", "md"));
|
||||
if (found) box.appendChild(md(found.text, "md"));
|
||||
else box.appendChild(loadingRows());
|
||||
main.appendChild(box);
|
||||
}
|
||||
|
||||
// Muted rows where a file's lines will be, the diff view's loading look
|
||||
// (they shimmer under no-preference, diff.css).
|
||||
function loadingRows(count = 7) {
|
||||
const rows = el("div", "diff-skeleton doc-skeleton");
|
||||
rows.setAttribute("role", "status");
|
||||
rows.setAttribute("aria-label", "Reading the file");
|
||||
for (let i = 0; i < count; i++) rows.appendChild(el("span", "diff-skel-row"));
|
||||
return rows;
|
||||
}
|
||||
|
||||
// The files the AGENTS.md tab may show: the same two shapes the server serves.
|
||||
const AGENTS_FILE = /^(?:AGENTS\.md|\.agents-docs\/[A-Za-z0-9._-]+\.md)$/;
|
||||
|
||||
@@ -267,7 +286,7 @@ export function renderAgentsDoc(main) {
|
||||
head.appendChild(el("h2", null, open === "AGENTS.md" ? "AGENTS.md" : open));
|
||||
const tools = el("div", "doc-tools");
|
||||
if (open !== "AGENTS.md") {
|
||||
const guide = el("button", "btn small", "Back to AGENTS.md");
|
||||
const guide = el("button", "btn sm", "Back to AGENTS.md");
|
||||
guide.type = "button";
|
||||
guide.addEventListener("click", () => {
|
||||
page.agentsDoc.open = "AGENTS.md";
|
||||
@@ -323,7 +342,7 @@ export function renderPrototypes(main) {
|
||||
head.appendChild(el("h2", null, reading ? open : "Prototypes"));
|
||||
const tools = el("div", "doc-tools");
|
||||
if (reading) {
|
||||
const list = el("button", "btn small", "Back to Prototypes");
|
||||
const list = el("button", "btn sm", "Back to Prototypes");
|
||||
list.type = "button";
|
||||
list.addEventListener("click", () => {
|
||||
closePrototypeDoc();
|
||||
@@ -347,7 +366,7 @@ export function renderPrototypes(main) {
|
||||
const row = el("li", "proto-row");
|
||||
const b = el("button", "proto-open", null);
|
||||
b.type = "button";
|
||||
b.appendChild(el("span", "proto-kind proto-kind-" + f.kind, f.kind === "md" ? "MD" : "HTML"));
|
||||
b.appendChild(el("span", "code-tag" + (f.kind === "md" ? "" : " is-accent") + " proto-kind proto-kind-" + f.kind, f.kind === "md" ? "MD" : "HTML"));
|
||||
b.appendChild(el("span", "proto-name", f.name));
|
||||
b.appendChild(el("span", "proto-how", f.kind === "md" ? "Read it here" : "Opens in your browser ↗"));
|
||||
b.title = f.kind === "md" ? `Read ${f.name} here` : `Open ${f.name} in your default browser`;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Plan2Code Web Console - how a session ends: the finished screen, its offers, Stop and the way home; defines only.
|
||||
|
||||
import { NOT_CONNECTED } from "../labels.js";
|
||||
import { el, md, copyButton, copyText, selectContents, textWithCode, SVG_NS } from "../render.js";
|
||||
import {
|
||||
finishPaused,
|
||||
@@ -246,9 +247,9 @@ export function renderLoopEnd(end) {
|
||||
const reason = !finished && typeof end.reason === "string" && end.reason ? end.reason : "";
|
||||
card.appendChild(el("h2", "loop-end-heading", finished ? "Every phase is built" : reason || end.line));
|
||||
// On a stop the full line is the colored reason, and the advice sits under it.
|
||||
if ((finished || reason) && end.line) card.appendChild(el("p", finished ? "loop-line" : "loop-line loop-why", end.line));
|
||||
if ((finished || reason) && end.line) card.appendChild(el("p", finished ? "loop-line" : "callout is-warn loop-line loop-why", end.line));
|
||||
if (!finished && typeof end.advice === "string" && end.advice) {
|
||||
const next = el("p", "loop-advice");
|
||||
const next = el("p", "callout is-info loop-advice");
|
||||
next.appendChild(el("strong", null, "What to do next: "));
|
||||
next.appendChild(document.createTextNode(end.advice));
|
||||
card.appendChild(next);
|
||||
@@ -260,7 +261,7 @@ export function renderLoopEnd(end) {
|
||||
|
||||
const evidence = end.evidence && docs().find((d) => d.id === end.evidence);
|
||||
if (evidence) {
|
||||
const read = el("button", "btn small", finished ? "Read the full report" : "Read why, and the report so far");
|
||||
const read = el("button", "btn sm", finished ? "Read the full report" : "Read why, and the report so far");
|
||||
read.type = "button";
|
||||
read.addEventListener("click", () => {
|
||||
page.view = "doc:" + evidence.id;
|
||||
@@ -399,7 +400,7 @@ function renderReport(text) {
|
||||
body.tabIndex = 0;
|
||||
body.setAttribute("role", "region");
|
||||
body.setAttribute("aria-label", "Bug report");
|
||||
const copy = el("button", "btn small", "Copy report");
|
||||
const copy = el("button", "btn sm", "Copy report");
|
||||
copy.type = "button";
|
||||
// Word for word what the file holds, so it pastes into a ticket as Markdown.
|
||||
copy.addEventListener("click", () =>
|
||||
@@ -417,7 +418,7 @@ function renderReport(text) {
|
||||
export function renderHandoff(fin) {
|
||||
if (page.S && page.S.loopEnd) return renderLoopEnd(page.S.loopEnd);
|
||||
const card = el("article", "card handoff");
|
||||
card.appendChild(el("p", "card-kicker", finishPaused(fin) ? "Session paused" : "Session ended"));
|
||||
card.appendChild(el("p", "card-kicker", finishPaused(fin) ? "Session stopped" : "Session finished"));
|
||||
card.appendChild(el("h2", null, fin.headline));
|
||||
if (fin.body) card.appendChild(md(fin.body, "md prompt"));
|
||||
|
||||
@@ -451,6 +452,9 @@ export function renderHandoff(fin) {
|
||||
// session with nothing left to run, which gets a quiet pointer at the
|
||||
// dashboard instead of a Next step block.
|
||||
const shape = handoffShape(fin);
|
||||
// The quiet extras of a finish (a second way to start something else, and
|
||||
// "Before you close this") fold into one closed section at the foot.
|
||||
const folded = [];
|
||||
if (shape === "all-done") {
|
||||
const done = el("div", "handoff-done");
|
||||
done.appendChild(md(`${ALL_DONE_LEAD} ${page.inApp ? ALL_DONE_REST_IN_APP : ALL_DONE_REST}`, "md handoff-done-text"));
|
||||
@@ -461,7 +465,7 @@ export function renderHandoff(fin) {
|
||||
const row = el("div", "handoff-command");
|
||||
const code = el("code", "handoff-code", text);
|
||||
row.appendChild(code);
|
||||
row.appendChild(copyButton(text, "btn small ghost handoff-copy", code));
|
||||
row.appendChild(copyButton(text, "btn sm ghost handoff-copy", code));
|
||||
done.appendChild(row);
|
||||
// Once the server is gone, the row above already is the offer's fallback.
|
||||
if (dashboardLive(fin) && !page.gone) done.appendChild(renderDashboardOffer(true));
|
||||
@@ -491,13 +495,13 @@ export function renderHandoff(fin) {
|
||||
const row = el("div", "handoff-command");
|
||||
const code = el("code", "handoff-code", text);
|
||||
row.appendChild(code);
|
||||
row.appendChild(copyButton(text, "btn small handoff-copy", code));
|
||||
row.appendChild(copyButton(text, "btn sm handoff-copy", code));
|
||||
step.appendChild(row);
|
||||
// Under the app a clean start is the bar's New Session: one press, with
|
||||
// the command already on the clipboard to paste into the new terminal.
|
||||
if (page.inApp && command.startsWith("/") && !page.gone && !pressStranded()) {
|
||||
const fresh = el("div", "handoff-newsession");
|
||||
const press = el("button", "btn small", "Start a New Session");
|
||||
const press = el("button", "btn sm", "Start a New Session");
|
||||
press.type = "button";
|
||||
press.addEventListener("click", () => startNewSession(text));
|
||||
fresh.appendChild(press);
|
||||
@@ -528,7 +532,7 @@ export function renderHandoff(fin) {
|
||||
// `/plan2code`"), right below this card, so repeating it here would
|
||||
// be the third mention of the one action on this screen.
|
||||
if (!page.inApp && !(offerDash && page.gone)) {
|
||||
card.appendChild(
|
||||
folded.push(
|
||||
textWithCode(
|
||||
"p",
|
||||
"handoff-fresh",
|
||||
@@ -539,8 +543,8 @@ export function renderHandoff(fin) {
|
||||
const freshRow = el("div", "handoff-command handoff-fresh-row");
|
||||
const freshCode = el("code", "handoff-code", freshText);
|
||||
freshRow.appendChild(freshCode);
|
||||
freshRow.appendChild(copyButton(freshText, "btn small ghost handoff-copy", freshCode));
|
||||
card.appendChild(freshRow);
|
||||
freshRow.appendChild(copyButton(freshText, "btn sm ghost handoff-copy", freshCode));
|
||||
folded.push(freshRow);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -548,7 +552,8 @@ export function renderHandoff(fin) {
|
||||
// Not while a hand-off they just asked for is starting on this page: "Safe
|
||||
// to close" and "start a new one" would contradict the line above it. The
|
||||
// press re-renders the page, and so does the agent taking it up.
|
||||
if (!closeGuideHeld()) card.appendChild(renderCloseGuide(shape, fin));
|
||||
if (!closeGuideHeld()) folded.push(renderCloseGuide(shape, fin));
|
||||
if (folded.length) card.appendChild(renderFoldedExtras(folded));
|
||||
|
||||
card.appendChild(
|
||||
el(
|
||||
@@ -571,13 +576,14 @@ export function renderHandoff(fin) {
|
||||
if (keep.saved) {
|
||||
tools.appendChild(docSavedNote(keep));
|
||||
} else {
|
||||
const save = el("button", "btn small", `Download ${keep.title || "the document"}`);
|
||||
const save = el("button", "btn sm", `Download ${keep.title || "the document"}`);
|
||||
save.type = "button";
|
||||
save.addEventListener("click", () => downloadDoc(keep));
|
||||
tools.appendChild(save);
|
||||
}
|
||||
card.appendChild(tools);
|
||||
}
|
||||
onePrimary(card);
|
||||
|
||||
// Answers staged and never sent are lost the moment this page closes, and
|
||||
// this page's one promise is that nothing gets lost. Say so plainly rather
|
||||
@@ -587,7 +593,7 @@ export function renderHandoff(fin) {
|
||||
card.appendChild(
|
||||
el(
|
||||
"p",
|
||||
"handoff-unsent",
|
||||
"callout is-stage handoff-unsent",
|
||||
`${stuck} answer${stuck === 1 ? "" : "s"} here ${stuck === 1 ? "was" : "were"} never sent, ` +
|
||||
`and Plan2Code has finished. If ${stuck === 1 ? "it" : "they"} still matter, say so in the ` +
|
||||
`next session: nothing on this page will reach it now.`
|
||||
@@ -597,6 +603,37 @@ export function renderHandoff(fin) {
|
||||
return card;
|
||||
}
|
||||
|
||||
// Whether "Closing or starting fresh" is open, kept across redraws: a section
|
||||
// that closes under a reader who just opened it is worse than one left open.
|
||||
let foldedOpen = null;
|
||||
|
||||
// The fresh-session advice is what a red meter asks for, so it opens by itself
|
||||
// there (until the person closes it).
|
||||
function renderFoldedExtras(nodes) {
|
||||
const box = el("details", "handoff-more");
|
||||
const red = Boolean(page.meterFrame && page.meterFrame.level === "red");
|
||||
box.open = foldedOpen === null ? red : foldedOpen;
|
||||
box.appendChild(el("summary", "handoff-more-title", "Closing or starting fresh"));
|
||||
box.append(...nodes);
|
||||
box.addEventListener("toggle", () => {
|
||||
foldedOpen = box.open;
|
||||
});
|
||||
return box;
|
||||
}
|
||||
|
||||
// Exactly one primary button per finish, by a fixed rule: the review when it is
|
||||
// on offer, else the commit, else Continue here, else Back to the dashboard, else
|
||||
// the stranded screen's New Session, else the next command's Copy button (a
|
||||
// pause, a gone server: the one thing to do is take the command). The rest are
|
||||
// plain buttons.
|
||||
const PRIMARY_RULE = [".review-go", ".commit-go", ".continue-go", ".dashboard-go", ".stranded-go", ".handoff-copy"];
|
||||
|
||||
function onePrimary(card) {
|
||||
const keep = PRIMARY_RULE.map((sel) => card.querySelector(sel)).find(Boolean) || null;
|
||||
for (const b of card.querySelectorAll("button.primary")) if (b !== keep) b.classList.remove("primary");
|
||||
if (keep) keep.classList.add("primary");
|
||||
}
|
||||
|
||||
// The escape hatch of a finished screen whose press nothing collects (the
|
||||
// agent's turn ended while the page waited). Always enabled: under the app a
|
||||
// New Session, with the dashboard command copied first; in a browser the
|
||||
@@ -614,7 +651,7 @@ function renderStrandedEscape() {
|
||||
)
|
||||
);
|
||||
const row = el("div", "btn-row");
|
||||
const go = el("button", "btn primary", "Start a New Session");
|
||||
const go = el("button", "btn primary stranded-go", "Start a New Session");
|
||||
go.type = "button";
|
||||
go.addEventListener("click", () => startNewSession(text));
|
||||
row.appendChild(go);
|
||||
@@ -631,7 +668,7 @@ function renderStrandedEscape() {
|
||||
const row = el("div", "handoff-command");
|
||||
const code = el("code", "handoff-code", text);
|
||||
row.appendChild(code);
|
||||
row.appendChild(copyButton(text, "btn small handoff-copy", code));
|
||||
row.appendChild(copyButton(text, "btn sm handoff-copy", code));
|
||||
box.appendChild(row);
|
||||
return box;
|
||||
}
|
||||
@@ -669,7 +706,7 @@ function renderReviewOffer(offer) {
|
||||
const row = el("div", "handoff-command");
|
||||
const code = el("code", "handoff-code", text);
|
||||
row.appendChild(code);
|
||||
row.appendChild(copyButton(text, "btn small handoff-copy", code));
|
||||
row.appendChild(copyButton(text, "btn sm handoff-copy", code));
|
||||
box.appendChild(row);
|
||||
return box;
|
||||
}
|
||||
@@ -714,7 +751,7 @@ function renderCommitOffer() {
|
||||
);
|
||||
const { asked, disabled } = afterFinishButton(page.local.afterBuild, "commit", page.pendingResult);
|
||||
const row = el("div", "btn-row");
|
||||
const go = el("button", "btn primary", asked ? "Opening Git…" : "Commit it now");
|
||||
const go = el("button", "btn primary commit-go", asked ? "Opening Git…" : "Commit it now");
|
||||
go.type = "button";
|
||||
go.disabled = disabled;
|
||||
go.addEventListener("click", () => sendAfterBuild("commit"));
|
||||
@@ -738,7 +775,7 @@ function continueLive() {
|
||||
function renderContinueOffer(next) {
|
||||
const box = el("div", "continue-offer");
|
||||
const { asked, disabled } = afterFinishButton(page.local.afterBuild, "launch", page.pendingResult);
|
||||
const go = el("button", "btn primary continue-go", asked ? "Starting the next step…" : "Continue here");
|
||||
const go = el("button", "btn primary continue-go", asked ? "Starting the next skill…" : "Continue here");
|
||||
go.type = "button";
|
||||
go.disabled = disabled;
|
||||
go.addEventListener("click", () => sendAfterBuild("launch", next));
|
||||
@@ -803,14 +840,14 @@ function renderDashboardOffer(primary) {
|
||||
const row = el("div", "handoff-command");
|
||||
const code = el("code", "handoff-code", text);
|
||||
row.appendChild(code);
|
||||
row.appendChild(copyButton(text, "btn small handoff-copy", code));
|
||||
row.appendChild(copyButton(text, "btn sm handoff-copy", code));
|
||||
box.appendChild(row);
|
||||
return box;
|
||||
}
|
||||
const { asked, disabled } = afterFinishButton(page.local.afterBuild, "dashboard", page.pendingResult);
|
||||
const go = el(
|
||||
"button",
|
||||
primary ? "btn primary" : "btn",
|
||||
primary ? "btn primary dashboard-go" : "btn dashboard-go",
|
||||
asked ? "Opening the dashboard…" : "Back to the dashboard"
|
||||
);
|
||||
go.type = "button";
|
||||
@@ -854,11 +891,11 @@ async function sendAfterBuild(kind, launch = null) {
|
||||
dashboard: "Opening the dashboard. It appears here in a moment.",
|
||||
commit: "Opening Git. It appears here in a moment.",
|
||||
changelog: "Opening Changelog. It appears here in a moment.",
|
||||
launch: "Starting the next step. It appears here in a moment.",
|
||||
launch: "Starting the next skill. It appears here in a moment.",
|
||||
}[kind];
|
||||
if (started) {
|
||||
hooks.banner(started, "good");
|
||||
setTimeout(() => hooks.banner(null), 5000);
|
||||
const startedBanner = hooks.banner(started, "good");
|
||||
setTimeout(() => hooks.clearBanner(startedBanner), 5000);
|
||||
}
|
||||
} catch {
|
||||
hooks.banner("That did not go through. Nothing was lost; try again.", "warn");
|
||||
@@ -891,6 +928,7 @@ export function renderStopButton() {
|
||||
b.textContent = "Stopping…";
|
||||
b.disabled = false;
|
||||
b.title = "Show how the stop is going";
|
||||
setLocked(b, "");
|
||||
return;
|
||||
}
|
||||
b.textContent = "Stop session";
|
||||
@@ -898,12 +936,78 @@ export function renderStopButton() {
|
||||
const gate = turnGate({ gone: page.gone, pendingResult: page.pendingResult, waiting: agentHasTheBall() });
|
||||
// A way home in flight holds Stop back too, unless the agent went quiet
|
||||
// after collecting it: Stop's resume screen is then the only way out.
|
||||
b.disabled = Boolean(gate) || (Boolean(page.local.homeward) && !agentAdrift()) || loopDriving();
|
||||
// Locked with aria-disabled, never disabled: a press still lands and says why.
|
||||
const locked = Boolean(gate) || (Boolean(page.local.homeward) && !agentAdrift()) || loopDriving();
|
||||
b.title = loopDriving() ? LOOP_LOCK_TITLE : {
|
||||
gone: "Not connected right now.",
|
||||
gone: NOT_CONNECTED,
|
||||
pending: "Your last answers are still being picked up. You can stop once they have been.",
|
||||
waiting: "Plan2Code is working on your answers. You can stop once it replies.",
|
||||
}[gate] || (stopWarning() ? "End this session. Work since the last save is not kept." : "Save your place and end this session. You get a command to pick it up later.");
|
||||
setLocked(b, locked ? lockWhy("Stop", gate, b.title) : "");
|
||||
}
|
||||
|
||||
// What a locked Stop or Back says when pressed. While Plan2Code is mid-task the
|
||||
// lock lifts at its next check-in, and the way to interrupt it is the terminal.
|
||||
function lockWhy(what, gate, fallback) {
|
||||
if (loopDriving()) return LOOP_LOCK_TITLE;
|
||||
if (gate === "waiting") {
|
||||
const where = page.inApp ? "the terminal panel" : "the terminal";
|
||||
return `Plan2Code is mid-task, so ${what} unlocks at its next check-in. To interrupt it now, press Esc in ${where}.`;
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
function setLocked(b, why) {
|
||||
if (why) {
|
||||
b.setAttribute("aria-disabled", "true");
|
||||
b.dataset.why = why;
|
||||
} else {
|
||||
b.removeAttribute("aria-disabled");
|
||||
delete b.dataset.why;
|
||||
}
|
||||
b.classList.toggle("is-locked", Boolean(why));
|
||||
}
|
||||
|
||||
// The small note a press on a locked button opens, under that button. It goes
|
||||
// on the next press anywhere, on Escape, or after a few seconds.
|
||||
let lockPop = null;
|
||||
let lockPopTimer = null;
|
||||
|
||||
function closeLockPop() {
|
||||
clearTimeout(lockPopTimer);
|
||||
if (lockPop) lockPop.remove();
|
||||
lockPop = null;
|
||||
}
|
||||
|
||||
function showLockPop(b) {
|
||||
closeLockPop();
|
||||
const pop = el("div", "lock-pop", b.dataset.why || "");
|
||||
pop.setAttribute("role", "status");
|
||||
document.body.appendChild(pop);
|
||||
const at = b.getBoundingClientRect();
|
||||
pop.style.top = `${Math.round(at.bottom + 6)}px`;
|
||||
// Anchored by its left edge (Stop and Back sit at the left of the bar), kept
|
||||
// inside the window; right-anchoring squeezed the note into a narrow strip.
|
||||
pop.style.left = `${Math.max(8, Math.min(Math.round(at.left), window.innerWidth - pop.offsetWidth - 8))}px`;
|
||||
lockPop = pop;
|
||||
lockPopTimer = setTimeout(closeLockPop, 8000);
|
||||
const away = (e) => {
|
||||
if (e.type === "keydown" && e.key !== "Escape") return;
|
||||
if (e.type === "click" && b.contains(e.target)) return;
|
||||
closeLockPop();
|
||||
document.removeEventListener("click", away, true);
|
||||
document.removeEventListener("keydown", away, true);
|
||||
};
|
||||
document.addEventListener("click", away, true);
|
||||
document.addEventListener("keydown", away, true);
|
||||
}
|
||||
|
||||
// A locked button answers a press with its reason instead of acting.
|
||||
function whenOpen(b, act) {
|
||||
return () => {
|
||||
if (b.getAttribute("aria-disabled") === "true") showLockPop(b);
|
||||
else act();
|
||||
};
|
||||
}
|
||||
|
||||
// Plan2Code has the ball: it is working, or owes a reply to a send, and has
|
||||
@@ -929,8 +1033,12 @@ export function renderHomeButton() {
|
||||
warned: Boolean(page.S) && Boolean(stopWarning()),
|
||||
});
|
||||
b.hidden = st.hidden;
|
||||
b.disabled = st.disabled || loopDriving();
|
||||
b.title = loopDriving() ? LOOP_LOCK_TITLE : st.title;
|
||||
const gate = turnGate({ gone: page.gone, pendingResult: page.pendingResult, waiting: Boolean(page.S) && agentHasTheBall() });
|
||||
// Already on its way home: say so, never "mid-task, press Esc", which would
|
||||
// invite interrupting the hand-off the person just asked for.
|
||||
const homeward = page.local.homeward && !agentAdrift() && !loopDriving();
|
||||
setLocked(b, st.disabled || loopDriving() ? (homeward ? st.title : lockWhy("Back to the dashboard", gate, b.title)) : "");
|
||||
}
|
||||
|
||||
function openHomeConfirm() {
|
||||
@@ -1117,7 +1225,7 @@ export function renderStopping() {
|
||||
const row = el("div", "handoff-command");
|
||||
const code = el("code", "handoff-code", text);
|
||||
row.appendChild(code);
|
||||
row.appendChild(copyButton(text, "btn small handoff-copy", code));
|
||||
row.appendChild(copyButton(text, "btn sm handoff-copy", code));
|
||||
extra.appendChild(row);
|
||||
} else {
|
||||
extra.appendChild(
|
||||
@@ -1191,10 +1299,10 @@ export function renderFooterDashboard() {
|
||||
// The top bar's way home and Stop, wired once at start-up.
|
||||
export function wireEnding() {
|
||||
$("btn-dashboard").addEventListener("click", () => sendAfterBuild("dashboard"));
|
||||
$("btn-home").addEventListener("click", openHomeConfirm);
|
||||
$("btn-home").addEventListener("click", whenOpen($("btn-home"), openHomeConfirm));
|
||||
$("home-cancel").addEventListener("click", () => $("home-modal").close());
|
||||
$("home-go").addEventListener("click", goHome);
|
||||
$("btn-stop").addEventListener("click", openStopConfirm);
|
||||
$("btn-stop").addEventListener("click", whenOpen($("btn-stop"), openStopConfirm));
|
||||
$("stop-cancel").addEventListener("click", () => $("stop-modal").close());
|
||||
$("stop-handoff").addEventListener("click", () => stopSession(true));
|
||||
$("stop-go").addEventListener("click", () => stopSession(false));
|
||||
|
||||
@@ -135,8 +135,7 @@ const gitLocked = () => gitMode() !== "idle";
|
||||
async function sendGit(op, fields = {}, wording = {}) {
|
||||
if (page.gone || finish()) return;
|
||||
if (page.pendingResult) {
|
||||
hooks.banner("Your last click is still being picked up. One moment.", "info");
|
||||
page.pendingBannerUp = true;
|
||||
page.pendingBannerUp = hooks.banner("Your last click is still being picked up. One moment.", "info");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -150,8 +149,7 @@ async function sendGit(op, fields = {}, wording = {}) {
|
||||
});
|
||||
if (res.status === 409) {
|
||||
page.pendingResult = true;
|
||||
hooks.banner("Your last click is still being picked up. One moment.", "info");
|
||||
page.pendingBannerUp = true;
|
||||
page.pendingBannerUp = hooks.banner("Your last click is still being picked up. One moment.", "info");
|
||||
redraw();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { looksReady, looks, saveLooks } from "../looks.js";
|
||||
import { page } from "../state.js";
|
||||
import { isDashboard, finish, agentAdrift } from "../selectors.js";
|
||||
import { releasesLink, el, copyButton, lightDismiss } from "../render.js";
|
||||
import { HELP_TABS, helpTabFor } from "../help.js";
|
||||
import { HELP_TABS, helpGroupStart, helpTabFor } from "../help.js";
|
||||
import { wireTabs } from "../tabs.js";
|
||||
import { CATALOG_GROUPS, SKILL_CATALOG } from "../answers.js";
|
||||
|
||||
@@ -20,15 +20,14 @@ export function maybeWelcome() {
|
||||
openWelcome();
|
||||
}
|
||||
|
||||
// The same "finish the step and start fresh" tip the meter popover and the
|
||||
// dashboard's own red banner give, worded for the app's New Session button there.
|
||||
function renderWelcomeRefreshHelp() {
|
||||
// Under the app the agent runs in the window's terminal panel, not a terminal.
|
||||
function renderWelcomeTerminalHelp() {
|
||||
if (!page.inApp) return;
|
||||
$("welcome-refresh-text").textContent = "Once the session meter passes half, finish the step and press New Session at the top of the window.";
|
||||
$("welcome-terminal-text").textContent = "If the page goes quiet, your agent may be asking permission in the terminal panel.";
|
||||
}
|
||||
|
||||
export function openWelcome() {
|
||||
renderWelcomeRefreshHelp();
|
||||
renderWelcomeTerminalHelp();
|
||||
if ($("help-modal").open) $("help-modal").close();
|
||||
const slot = $("welcome-bot");
|
||||
if (!slot.firstElementChild) {
|
||||
@@ -67,21 +66,23 @@ function renderAbout() {
|
||||
}
|
||||
}
|
||||
|
||||
// Under the app, a new release still needs a terminal (the app cannot replace
|
||||
// itself), but not the terminal panel, and the restart is the app's, not a
|
||||
// new /plan2code; a skills/app mismatch is the bar's one-click Update
|
||||
// skills (see docs/desktop-app.md). Patched once, the first time Help opens,
|
||||
// since page.inApp never changes for the session's life.
|
||||
// Under the app, a new release is the bar's one click, Update and restart;
|
||||
// the command stays as the fallback, run outside the terminal panel, and the
|
||||
// restart is the app's, not a new /plan2code; a skills/app mismatch is the
|
||||
// bar's one-click Update skills (see docs/desktop-app.md). Patched once, the
|
||||
// first time Help opens, since page.inApp never changes for the session's life.
|
||||
function renderUpdateHelp() {
|
||||
if (!page.inApp) return;
|
||||
$("help-update-text").replaceChildren(
|
||||
"When a newer Plan2Code release is out, the dashboard shows ",
|
||||
el("strong", null, "UPDATE AVAILABLE"),
|
||||
el("strong", null, "Update available"),
|
||||
" at the top and the app's top bar shows ",
|
||||
el("strong", null, "Update available"),
|
||||
". Both give you the same command, ",
|
||||
" with ",
|
||||
el("strong", null, "Update and restart"),
|
||||
", which installs the new release and reopens the app on the same project. If that fails, run ",
|
||||
el("code", null, "plan2code update"),
|
||||
": run it in a terminal outside the app (not its terminal panel), then close the app and open it again. The app cannot replace itself while it runs, so a new release has no one-click update. When the app and the installed skills fall out of step, the bar offers ",
|
||||
" in a terminal outside the app (not its terminal panel), then close the app and open it again. When the app and the installed skills fall out of step, the bar offers ",
|
||||
el("strong", null, "Update skills"),
|
||||
" instead, which brings them level in one click."
|
||||
);
|
||||
@@ -108,7 +109,7 @@ function renderFinishingHelp() {
|
||||
function renderFinishingDashboardHelp() {
|
||||
if (!page.inApp) return;
|
||||
$("help-finishing-dashboard-text").replaceChildren(
|
||||
"A finished screen (never a paused one) has a ",
|
||||
"A finished screen (never a stopped one) has a ",
|
||||
el("strong", null, "Back to the dashboard"),
|
||||
" button. It turns this page back into the cards, in the same conversation, so the next step starts right here. Plan2Code listens for it for as long as the session is open. Once the session has closed, the app's own bar notices and offers to reconnect it, no command needed."
|
||||
);
|
||||
@@ -277,7 +278,7 @@ function buildHelp() {
|
||||
}
|
||||
for (const row of panels.querySelectorAll("[data-copy]")) {
|
||||
const code = row.querySelector("code");
|
||||
row.appendChild(copyButton(code.textContent, "btn small handoff-copy", code));
|
||||
row.appendChild(copyButton(code.textContent, "btn sm handoff-copy", code));
|
||||
}
|
||||
helpTabs = wireTabs({
|
||||
tabs: HELP_TABS,
|
||||
@@ -285,6 +286,8 @@ function buildHelp() {
|
||||
panels,
|
||||
prefix: "help",
|
||||
tabClass: "help-tab",
|
||||
groupStart: helpGroupStart,
|
||||
groupClass: "help-tab-group",
|
||||
renderTab: (t, btn) => {
|
||||
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||
svg.setAttribute("class", "help-tab-icon");
|
||||
@@ -299,6 +302,29 @@ function buildHelp() {
|
||||
$("help-panels").scrollTop = 0;
|
||||
},
|
||||
});
|
||||
// The filter box: a topic stays when every word typed is in its label or its
|
||||
// panel's text (the panels are all in the page once Help is built).
|
||||
const filterBox = $("help-filter");
|
||||
filterBox.addEventListener("input", () => {
|
||||
const words = filterBox.value.toLowerCase().split(/\s+/).filter(Boolean);
|
||||
const shown = helpTabs.filter(
|
||||
words.length
|
||||
? (t) => {
|
||||
const text = (t.label + " " + (panels.querySelector(`[data-tab="${t.id}"]`)?.textContent || "")).toLowerCase();
|
||||
return words.every((w) => text.includes(w));
|
||||
}
|
||||
: null
|
||||
);
|
||||
$("help-filter-empty").hidden = shown > 0;
|
||||
});
|
||||
// From the filter box, the down arrow steps into the topics that are left.
|
||||
filterBox.addEventListener("keydown", (e) => {
|
||||
if (e.key !== "ArrowDown") return;
|
||||
const first = helpTabs.shown()[0];
|
||||
if (!first) return;
|
||||
e.preventDefault();
|
||||
$("help-tab-" + first.id).focus();
|
||||
});
|
||||
helpBuilt = true;
|
||||
}
|
||||
|
||||
@@ -320,6 +346,13 @@ export function openHelp() {
|
||||
renderPlannyDoneHelp();
|
||||
renderHandoffCopyHelp();
|
||||
}
|
||||
// A filter left typed in a closed Help would hide the topic it opens on.
|
||||
const filterBox = $("help-filter");
|
||||
if (filterBox.value) {
|
||||
filterBox.value = "";
|
||||
helpTabs.filter(null);
|
||||
$("help-filter-empty").hidden = true;
|
||||
}
|
||||
const id = helpTabFor({
|
||||
view: page.view,
|
||||
dashboard: isDashboard(),
|
||||
|
||||
@@ -9,20 +9,21 @@
|
||||
// in dashboard.js, reached through hooks: a screen never imports another),
|
||||
// and is disabled whenever a card would be.
|
||||
|
||||
import { NOT_CONNECTED } from "../labels.js";
|
||||
import { page, redraw, hooks, stage } from "../state.js";
|
||||
import { el, md, mdInto, lightDismiss } from "../render.js";
|
||||
import { el, icon, md, mdInto, lightDismiss } from "../render.js";
|
||||
import { postJson } from "../net.js";
|
||||
import { sendState, suggestState } from "../send-state.js";
|
||||
import { threadWho, threadText } from "../answers.js";
|
||||
import { loopDriving, isOpen, stagedCount, learningBusyNow } from "../selectors.js";
|
||||
|
||||
const TOP_STATES = new Set(["not-set-up", "off", "paused"]);
|
||||
const TOP_STATES = new Set(["off", "paused"]);
|
||||
|
||||
const PILLS = {
|
||||
"not-set-up": { text: "Not set up", cls: "" },
|
||||
off: { text: "Off", cls: "" },
|
||||
on: { text: "On", cls: " is-on" },
|
||||
paused: { text: "Paused for you", cls: " is-hold" },
|
||||
on: { text: "On", cls: " is-accent" },
|
||||
paused: { text: "Paused for you", cls: " is-stage" },
|
||||
};
|
||||
|
||||
// The More menu stays open across the dashboard's redraws until it is closed.
|
||||
@@ -42,9 +43,9 @@ function shortDate(iso) {
|
||||
* same conditions that disable a dashboard card (dashCard()).
|
||||
*/
|
||||
export function learningBlocked() {
|
||||
if (page.gone) return "Plan2Code is not answering right now.";
|
||||
if (page.gone) return NOT_CONNECTED;
|
||||
if (page.pendingResult) return "Plan2Code is still picking up your last choice.";
|
||||
if (page.local && page.local.launching) return "A workflow is starting.";
|
||||
if (page.local && page.local.launching) return "A skill is starting.";
|
||||
if (loopDriving()) return "The Implementation Loop is running.";
|
||||
return "";
|
||||
}
|
||||
@@ -77,7 +78,7 @@ function pauseSwitch(paused) {
|
||||
b.setAttribute("role", "switch");
|
||||
b.setAttribute("aria-checked", paused ? "true" : "false");
|
||||
b.disabled = pausing || Boolean(page.gone);
|
||||
if (page.gone) b.title = "The console is not reachable right now.";
|
||||
if (page.gone) b.title = NOT_CONNECTED;
|
||||
const track = el("span", "learn-track");
|
||||
track.setAttribute("aria-hidden", "true");
|
||||
b.append(track, document.createTextNode("Pause for me"));
|
||||
@@ -107,7 +108,7 @@ function closeMore(focusButton) {
|
||||
|
||||
function moreMenu() {
|
||||
const wrap = document.createDocumentFragment();
|
||||
const btn = el("button", "learn-link learn-more-btn", "More ▴");
|
||||
const btn = el("button", "learn-link learn-more-btn", "More");
|
||||
btn.type = "button";
|
||||
btn.setAttribute("aria-haspopup", "menu");
|
||||
btn.setAttribute("aria-expanded", moreOpen ? "true" : "false");
|
||||
@@ -318,14 +319,15 @@ export function renderLessonsDialog(on) {
|
||||
dlg.setAttribute("aria-busy", saving ? "true" : "false");
|
||||
const card = hooks.renderCard(item);
|
||||
if (saving) card.inert = true;
|
||||
const x = el("button", "modal-x", "×");
|
||||
const x = el("button", "modal-x");
|
||||
x.appendChild(icon("close"));
|
||||
x.type = "button";
|
||||
x.setAttribute("aria-label", "Close without saving");
|
||||
x.disabled = saving;
|
||||
x.addEventListener("click", () => requestClose(item));
|
||||
const actions = el("div", "modal-actions");
|
||||
if (askingClose && !saving) {
|
||||
const ask = el("div", "lessons-unsaved");
|
||||
const ask = el("div", "callout is-warn lessons-unsaved");
|
||||
ask.setAttribute("role", "alert");
|
||||
ask.appendChild(el("p", "lessons-unsaved-text", "You have choices that are not saved."));
|
||||
const row = el("div", "modal-actions");
|
||||
@@ -391,7 +393,7 @@ function suggestionsBox(item) {
|
||||
const waiting = item.sentNote && item.sentNote.suggest === true && !thread.slice(asked + 1).some((m) => threadWho(m) === "agent");
|
||||
const reply = asked >= 0 ? thread.slice(asked + 1).filter((m) => threadWho(m) === "agent").pop() : null;
|
||||
if (!waiting && !reply) return null;
|
||||
const box = el("div", "lessons-suggestions");
|
||||
const box = el("div", "callout is-info lessons-suggestions");
|
||||
box.id = "lessons-suggestions";
|
||||
box.setAttribute("role", "status");
|
||||
box.appendChild(el("h3", null, "Suggestions"));
|
||||
@@ -494,7 +496,7 @@ async function openLessons() {
|
||||
|
||||
/**
|
||||
* The Learning row for `position` ("top" or "bottom"), or null: the top place
|
||||
* takes Not set up, Off and Paused, the bottom place takes On, and no row is
|
||||
* takes Off and Paused, the bottom place takes On and Not set up, and no row is
|
||||
* drawn when the scan carries no `learning` (an unknown settings format).
|
||||
*/
|
||||
export function renderLearningRow(scan, position) {
|
||||
@@ -511,7 +513,7 @@ export function renderLearningRow(scan, position) {
|
||||
const line = el("div", "learn-line");
|
||||
line.appendChild(el("span", "learn-label", "Learning"));
|
||||
const pill = PILLS[state];
|
||||
line.appendChild(el("span", "learn-pill" + pill.cls, pill.text));
|
||||
line.appendChild(el("span", "pill is-caps learn-pill" + pill.cls, pill.text));
|
||||
const controls = el("span", "learn-controls");
|
||||
const busy = busySwitch(state);
|
||||
if (busy) {
|
||||
@@ -524,10 +526,10 @@ export function renderLearningRow(scan, position) {
|
||||
controls.appendChild(working);
|
||||
} else if (state === "not-set-up") {
|
||||
line.appendChild(el("span", "learn-say", "Plan2Code can keep lessons about this codebase, approved by you."));
|
||||
controls.appendChild(agentButton("Switch on", "btn small primary", "switch-on"));
|
||||
controls.appendChild(agentButton("Switch on", "btn sm", "switch-on"));
|
||||
} else if (state === "off") {
|
||||
line.appendChild(el("span", "learn-say", "Off for this project."));
|
||||
controls.appendChild(agentButton("Switch on", "btn small", "switch-on"));
|
||||
controls.appendChild(agentButton("Switch on", "btn sm", "switch-on"));
|
||||
} else if (state === "paused") {
|
||||
const since = shortDate(learning.pausedSince);
|
||||
line.appendChild(
|
||||
|
||||
@@ -43,7 +43,7 @@ const fieldsetOf = (node) => node.closest("fieldset");
|
||||
// and Back to default are prefs-dialog.js's.
|
||||
export function wireLooks() {
|
||||
$("looks-modal").addEventListener("close", () => {
|
||||
if (isDashboard() && !needsRoleNudge(looks) && $("main").querySelector(".dash-nudge")) redraw();
|
||||
if (isDashboard() && !needsRoleNudge(looks) && $("main").querySelector(".dash-extras")) redraw();
|
||||
});
|
||||
for (const [value, label] of [[ROLE_NOT_SET, ROLE_NOT_SET_LABEL], ...ROLES.map((r) => [r.id, r.label])]) {
|
||||
const option = el("option", null, label);
|
||||
|
||||
@@ -12,6 +12,8 @@ import { SKILL_CATALOG } from "../answers.js";
|
||||
import { postJson } from "../net.js";
|
||||
import { tellApp, wireLoopMessages } from "../app-bridge.js";
|
||||
|
||||
let justPicked = ""; // the strength node picked a moment ago, which alone plays its grow
|
||||
|
||||
const LEVELS = [
|
||||
["critical", "Critical"],
|
||||
["warning", "Warning"],
|
||||
@@ -532,9 +534,11 @@ function strengthField(s, redo) {
|
||||
if (!input.checked) return;
|
||||
setPick(f, s.spec, p, c.value);
|
||||
s.problems = [];
|
||||
justPicked = input.id; // only this redraw plays the grow
|
||||
redraw();
|
||||
justPicked = "";
|
||||
});
|
||||
const node = el("span", "loop-strength-node");
|
||||
const node = el("span", "loop-strength-node" + (input.id === justPicked ? " is-picked" : ""));
|
||||
node.appendChild(strengthBars(c.level));
|
||||
cell.append(input, node);
|
||||
row.appendChild(cell);
|
||||
@@ -631,7 +635,7 @@ function drawBody(pane, s) {
|
||||
);
|
||||
const kindLabel = el("label", "loop-number");
|
||||
kindLabel.appendChild(el("span", null, "Send to"));
|
||||
const kindSelect = el("select", "loop-text");
|
||||
const kindSelect = el("select", "is-compact loop-text");
|
||||
kindSelect.id = "loop-notify-kind";
|
||||
for (const kind of NOTIFY_KINDS) {
|
||||
const option = el("option", null, kind.label);
|
||||
@@ -641,7 +645,7 @@ function drawBody(pane, s) {
|
||||
kindSelect.value = f.notifyKind;
|
||||
kindLabel.appendChild(kindSelect);
|
||||
const kindHint = el("p", "loop-hint");
|
||||
const notifyInput = el("input", "loop-text");
|
||||
const notifyInput = el("input", "is-compact loop-text");
|
||||
notifyInput.type = "text";
|
||||
notifyInput.inputMode = "url";
|
||||
notifyInput.id = "loop-notify-url";
|
||||
@@ -652,7 +656,7 @@ function drawBody(pane, s) {
|
||||
const paramLabel = el("label", "loop-number");
|
||||
const paramText = el("span");
|
||||
paramLabel.appendChild(paramText);
|
||||
const paramInput = el("input", "loop-text loop-param");
|
||||
const paramInput = el("input", "is-compact loop-text loop-param");
|
||||
paramInput.type = "text";
|
||||
paramInput.id = "loop-notify-param";
|
||||
paramInput.value = f.notifyParam;
|
||||
@@ -716,7 +720,7 @@ function drawBody(pane, s) {
|
||||
form.appendChild(notify);
|
||||
|
||||
const check = field("Quick check", "A command the app runs after each phase, such as npm run build. The page never runs it.");
|
||||
const checkInput = el("input", "loop-text");
|
||||
const checkInput = el("input", "is-compact loop-text");
|
||||
checkInput.type = "text";
|
||||
checkInput.id = "loop-quickcheck";
|
||||
checkInput.value = f.quickCheck;
|
||||
@@ -736,7 +740,7 @@ function drawBody(pane, s) {
|
||||
retry.appendChild(toggle("loop-retry", "Retry it once", f.retryOnce, (v) => ((f.retryOnce = v), redo())));
|
||||
const silence = el("label", "loop-number");
|
||||
silence.appendChild(el("span", null, "Count the agent as stuck after this many minutes with no activity"));
|
||||
const silenceInput = el("input", "loop-text loop-narrow");
|
||||
const silenceInput = el("input", "is-compact loop-text loop-narrow");
|
||||
silenceInput.type = "number";
|
||||
silenceInput.id = "loop-silence";
|
||||
silenceInput.min = "1";
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
// this file runs the timers and requests, and binds every save and every
|
||||
// picture to the tab it was made in, so a switch can never move either.
|
||||
|
||||
import { NOT_CONNECTED } from "../labels.js";
|
||||
import { page } from "../state.js";
|
||||
import {
|
||||
EDITOR_NOT_LOADED,
|
||||
@@ -31,7 +32,7 @@ import {
|
||||
tabSwitch,
|
||||
unsaved,
|
||||
} from "../notepad.js";
|
||||
import { el, lightDismiss } from "../render.js";
|
||||
import { el, icon, lightDismiss } from "../render.js";
|
||||
import { postJson } from "../net.js";
|
||||
import { reencode, openPicview } from "../uploads.js";
|
||||
import { createTabs } from "../notepad-tabs.js";
|
||||
@@ -39,7 +40,6 @@ import { skillFor } from "../skills.js";
|
||||
|
||||
const $ = (id) => document.getElementById(id);
|
||||
|
||||
const NOT_CONNECTED = "Not connected right now.";
|
||||
const STAY = "Not saved yet, so staying on this tab.";
|
||||
|
||||
// One editor for the page's life, made on first open, and the tab bar, made
|
||||
@@ -295,6 +295,8 @@ function show(body, keep = false) {
|
||||
problem = "";
|
||||
rev += 1;
|
||||
loaded = true;
|
||||
$("notepad-retry").hidden = true;
|
||||
$("notepad-retry").disabled = false;
|
||||
editor.setReadOnly(!tab);
|
||||
takeStored(tab ? tab.images : [], activeId);
|
||||
drawTabs();
|
||||
@@ -658,9 +660,9 @@ function thumbItem(entry, n) {
|
||||
if (src) {
|
||||
const pic = el("img");
|
||||
pic.src = src;
|
||||
pic.alt = `Notebook image ${n}`;
|
||||
pic.alt = `Notebook picture ${n}`;
|
||||
open.appendChild(pic);
|
||||
} else open.setAttribute("aria-label", `Notebook image ${n}`);
|
||||
} else open.setAttribute("aria-label", `Notebook picture ${n}`);
|
||||
// Never `disabled`, which would push the focus out of the strip while the
|
||||
// picture uploads: it only does nothing until there is a picture to show.
|
||||
const viewable = Boolean(entry.url) && entry.status !== "uploading";
|
||||
@@ -670,25 +672,26 @@ function thumbItem(entry, n) {
|
||||
});
|
||||
item.appendChild(open);
|
||||
if (entry.status !== "uploading" && !entry.asking) {
|
||||
const x = el("button", "attach-remove notepad-thumb-delete", "×");
|
||||
const x = el("button", "attach-remove notepad-thumb-delete");
|
||||
x.appendChild(icon("close"));
|
||||
x.type = "button";
|
||||
x.setAttribute("aria-label", `Delete image ${n}`);
|
||||
x.setAttribute("aria-label", `Delete picture ${n}`);
|
||||
x.addEventListener("click", () => ask(entry));
|
||||
item.appendChild(x);
|
||||
}
|
||||
if (entry.asking) {
|
||||
// Keep comes first and takes the focus, so Enter keeps the picture.
|
||||
const over = el("div", "attach-overlay notepad-ask");
|
||||
over.appendChild(el("p", null, "Delete this image?"));
|
||||
over.appendChild(el("p", null, "Delete this picture?"));
|
||||
const row = el("div", "notepad-ask-row");
|
||||
const keep = el("button", "btn tiny notepad-ask-keep", "Keep");
|
||||
const keep = el("button", "btn xs soft notepad-ask-keep", "Keep");
|
||||
keep.type = "button";
|
||||
keep.addEventListener("click", () => {
|
||||
entry.asking = false;
|
||||
drawStrip();
|
||||
focusIn(entry.key, ".notepad-thumb-delete");
|
||||
});
|
||||
const del = el("button", "btn tiny notepad-ask-delete", "Delete");
|
||||
const del = el("button", "btn xs soft notepad-ask-delete", "Delete");
|
||||
del.type = "button";
|
||||
del.addEventListener("click", () => remove(entry));
|
||||
keep.disabled = del.disabled = Boolean(entry.deleting);
|
||||
@@ -703,7 +706,7 @@ function thumbItem(entry, n) {
|
||||
} else if (entry.status === "failed") {
|
||||
const over = el("div", "attach-overlay failed");
|
||||
over.appendChild(el("p", null, "Upload failed"));
|
||||
const again = el("button", "btn tiny notepad-retry", "Retry");
|
||||
const again = el("button", "btn xs soft notepad-retry", "Retry");
|
||||
again.type = "button";
|
||||
again.addEventListener("click", () => upload(entry));
|
||||
over.appendChild(again);
|
||||
@@ -796,7 +799,7 @@ function takeStored(list, tabId) {
|
||||
function openPreview(entry) {
|
||||
const list = images.filter((img) => img.url);
|
||||
openPicview(
|
||||
list.map((img) => ({ url: img.url, alt: `Notebook image ${images.indexOf(img) + 1}` })),
|
||||
list.map((img) => ({ url: img.url, alt: `Notebook picture ${images.indexOf(img) + 1}` })),
|
||||
list.indexOf(entry),
|
||||
() => focusIn(entry.key, ".attach-open"),
|
||||
);
|
||||
@@ -869,16 +872,28 @@ function wireImages(dlg) {
|
||||
// show up. Text typed here and not yet saved (or too long to save) is never
|
||||
// replaced; the tab it belongs to stays on screen.
|
||||
async function load() {
|
||||
// Kept on screen (and focused, if it was) while it reads, so a second failure
|
||||
// finds it where it was.
|
||||
$("notepad-retry").disabled = true;
|
||||
const keep = keepsText(save);
|
||||
let res = await readNote(activeId);
|
||||
if (!res.ok && res.code === "no-such-tab" && activeId && !keep) res = await readNote(null);
|
||||
if (!res.ok) {
|
||||
if (loaded) return;
|
||||
if (loaded) {
|
||||
$("notepad-retry").hidden = true;
|
||||
$("notepad-retry").disabled = false;
|
||||
return;
|
||||
}
|
||||
const line = $("notepad-status");
|
||||
line.textContent = NOT_LOADED;
|
||||
line.classList.add("is-problem");
|
||||
$("notepad-retry").hidden = false;
|
||||
$("notepad-retry").disabled = false;
|
||||
$("notepad-retry").focus();
|
||||
return;
|
||||
}
|
||||
$("notepad-retry").hidden = true;
|
||||
$("notepad-retry").disabled = false;
|
||||
show(res.body, keep);
|
||||
paintStatus();
|
||||
if (!tabs.length) $("notepad-empty-new").focus();
|
||||
@@ -930,6 +945,7 @@ export function wireNotepad() {
|
||||
wireImages(dlg);
|
||||
$("btn-notepad").addEventListener("click", openNotepad);
|
||||
$("notepad-close").addEventListener("click", () => dlg.close());
|
||||
$("notepad-retry").addEventListener("click", () => load());
|
||||
$("notepad-tab-new").addEventListener("click", () => openNameForm("new"));
|
||||
$("notepad-empty-new").addEventListener("click", () => openNameForm("new"));
|
||||
$("notepad-delete-keep").addEventListener("click", () => closeDelete(true));
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// to open and close it, the Saved mark, Back to default for the tab on screen
|
||||
// and the prompt that stops an unsaved agent edit being lost.
|
||||
|
||||
import { onSwatchSaved, renderSwatches, resetLooks, saveLooks } from "../looks.js";
|
||||
import { looks, onSwatchSaved, renderSwatches, resetLooks, saveLooks } from "../looks.js";
|
||||
import { ROLE_NOT_SET } from "../starters.js";
|
||||
import { PREFS_TABS, prefsOpenTab, prefsResetScope } from "../prefs.js";
|
||||
import { wireTabs } from "../tabs.js";
|
||||
import { el, lightDismiss } from "../render.js";
|
||||
@@ -12,7 +13,7 @@ const $ = (id) => document.getElementById(id);
|
||||
|
||||
let prefsTabs = null;
|
||||
|
||||
// Back to default only where the tab has looks to reset.
|
||||
// Reset this tab only where the tab has looks to reset.
|
||||
function showResetFor(id) {
|
||||
$("looks-reset").hidden = prefsResetScope(id) === null;
|
||||
}
|
||||
@@ -55,6 +56,36 @@ export async function markSaved(fieldset, result) {
|
||||
}
|
||||
}
|
||||
|
||||
// "Reset. Undo" in the mark's place after Reset this tab: the same corner as
|
||||
// Saved, for a few seconds, with a button that puts the tab's values back.
|
||||
const RESET_UNDO_MS = 8000;
|
||||
|
||||
function markReset(fieldset, undo) {
|
||||
if (!fieldset) return;
|
||||
let mark = fieldset.querySelector(":scope > .prefs-saved");
|
||||
if (!mark) {
|
||||
mark = el("span", "prefs-saved");
|
||||
mark.setAttribute("role", "status");
|
||||
fieldset.appendChild(mark);
|
||||
}
|
||||
clearTimeout(markTimers.get(mark));
|
||||
mark.classList.remove("is-saved", "error");
|
||||
mark.classList.add("is-reset");
|
||||
const button = el("button", "linky prefs-undo", "Undo");
|
||||
button.type = "button";
|
||||
const end = () => {
|
||||
clearTimeout(markTimers.get(mark));
|
||||
mark.classList.remove("is-reset");
|
||||
mark.textContent = "";
|
||||
};
|
||||
button.addEventListener("click", () => {
|
||||
end();
|
||||
undo();
|
||||
});
|
||||
mark.replaceChildren(document.createTextNode("Reset. "), button);
|
||||
markTimers.set(mark, setTimeout(end, RESET_UNDO_MS));
|
||||
}
|
||||
|
||||
// Every way in: the gear, the dashboard's Set up preferences, or a caller
|
||||
// naming the tab it wants. Agents and models load each time it opens.
|
||||
export function openPrefs(tab) {
|
||||
@@ -70,7 +101,7 @@ export function openPrefs(tab) {
|
||||
let asking = null;
|
||||
|
||||
// Everything in the dialog but the prompt, kept out of reach while it asks.
|
||||
const behindPrompt = () => [$("looks-title"), $("looks-modal").querySelector(".prefs-body"), $("looks-modal").querySelector(".modal-actions")];
|
||||
const behindPrompt = () => [$("looks-title"), $("prefs-lead"), $("looks-modal").querySelector(".prefs-body"), $("looks-modal").querySelector(".modal-actions")];
|
||||
|
||||
function endAsking(go) {
|
||||
$("prefs-unsaved").hidden = true;
|
||||
@@ -85,8 +116,9 @@ function endAsking(go) {
|
||||
}
|
||||
|
||||
// Before anything leaves an agent form with an unsaved edit (Close, Esc, a
|
||||
// backdrop click, another tab, another agent's row): Save, Discard or Keep
|
||||
// editing, asked inside the dialog. Resolves true when it may go on.
|
||||
// backdrop click, another tab, another agent's row): Keep editing, Discard or
|
||||
// Save, asked inside the dialog, in the Lessons prompt's order (learning-row.js)
|
||||
// and with focus on the safe choice. Resolves true when it may go on.
|
||||
export function confirmUnsaved() {
|
||||
if (!hooks.hasUnsaved()) return Promise.resolve(true);
|
||||
if (asking) return asking.promise;
|
||||
@@ -97,7 +129,7 @@ export function confirmUnsaved() {
|
||||
for (const node of behindPrompt()) node.inert = true;
|
||||
$("prefs-unsaved").hidden = false;
|
||||
$("prefs-unsaved-save").disabled = false;
|
||||
$("prefs-unsaved-save").focus();
|
||||
$("prefs-unsaved-keep").focus();
|
||||
return promise;
|
||||
}
|
||||
|
||||
@@ -124,13 +156,14 @@ function wireUnsaved() {
|
||||
const name = el("strong");
|
||||
name.id = "prefs-unsaved-name";
|
||||
text.append("You have unsaved changes to ", name, ".");
|
||||
const save = el("button", "btn small primary", "Save");
|
||||
const save = el("button", "btn sm primary", "Save");
|
||||
save.type = "button";
|
||||
save.id = "prefs-unsaved-save";
|
||||
const discard = el("button", "btn small ghost", "Discard");
|
||||
const discard = el("button", "btn sm ghost", "Discard");
|
||||
discard.type = "button";
|
||||
const keep = el("button", "btn small ghost", "Keep editing");
|
||||
const keep = el("button", "btn sm ghost", "Keep editing");
|
||||
keep.type = "button";
|
||||
keep.id = "prefs-unsaved-keep";
|
||||
save.addEventListener("click", async () => {
|
||||
save.disabled = true;
|
||||
const ok = await hooks.saveOpen();
|
||||
@@ -143,7 +176,7 @@ function wireUnsaved() {
|
||||
});
|
||||
keep.addEventListener("click", () => endAsking(false));
|
||||
const actions = el("div", "prefs-unsaved-actions");
|
||||
actions.append(save, discard, keep);
|
||||
actions.append(keep, discard, save);
|
||||
inner.append(title, text, actions);
|
||||
box.append(inner);
|
||||
$("looks-modal").append(box);
|
||||
@@ -197,10 +230,18 @@ export function wirePrefs() {
|
||||
const tab = prefsTabs.current();
|
||||
const keys = prefsResetScope(tab);
|
||||
if (!keys) return;
|
||||
// What the tab held before, so Undo can put it back. A role never chosen
|
||||
// comes back as Not set: the server's file cannot un-have a key.
|
||||
const before = Object.fromEntries(keys.map((k) => [k, k === "role" ? (looks.role ?? ROLE_NOT_SET) : looks[k]]));
|
||||
resetLooks(keys);
|
||||
const saved = saveLooks();
|
||||
saveLooks();
|
||||
redraw();
|
||||
markSaved($("prefs-panel-" + tab).querySelector("fieldset"), saved);
|
||||
markReset($("prefs-panel-" + tab).querySelector("fieldset"), () => {
|
||||
for (const [k, v] of Object.entries(before)) looks[k] = v;
|
||||
const saved = saveLooks();
|
||||
redraw();
|
||||
markSaved($("prefs-panel-" + tab).querySelector("fieldset"), saved);
|
||||
});
|
||||
});
|
||||
onSwatchSaved((saved) => markSaved($("looks-swatches").closest("fieldset"), saved));
|
||||
}
|
||||
@@ -110,7 +110,7 @@ function buildRoot(mountAgents) {
|
||||
const agents = el("div", "setup-agents");
|
||||
box.appendChild(agents);
|
||||
const actions = el("div", "setup-actions");
|
||||
const again = el("button", "btn small", "Check again");
|
||||
const again = el("button", "btn sm", "Check again");
|
||||
again.type = "button";
|
||||
again.addEventListener("click", () => view?.load());
|
||||
actions.appendChild(again);
|
||||
@@ -149,7 +149,7 @@ function startingPane(started) {
|
||||
pane.appendChild(noPage);
|
||||
// A wait that died unmoved should not park the page on "Starting" forever:
|
||||
// once the grace hint is up, the way back to the pick list shows beside it.
|
||||
const back = el("button", "btn small setup-back", "Show the agent list again");
|
||||
const back = el("button", "btn sm setup-back", "Show the agent list again");
|
||||
back.type = "button";
|
||||
back.hidden = !graceShown;
|
||||
back.addEventListener("click", () => {
|
||||
|
||||
@@ -123,7 +123,7 @@ export function renderLaunching(main) {
|
||||
|
||||
const stale = staleLaunchFeedback(l.title, agentAdrift(), page.inApp);
|
||||
pane.appendChild(el("p", "card-kicker", stale ? stale.kicker : "On it"));
|
||||
pane.appendChild(el("h2", "launch-title", stale ? stale.title : `Waking up ${l.title || "the next mode"}`));
|
||||
pane.appendChild(el("h2", "launch-title", stale ? stale.title : `Waking up ${l.title || "the next skill"}`));
|
||||
pane.appendChild(el("p", "launch-quip", stale ? stale.quip : LAUNCH_QUIPS[0]));
|
||||
pane.appendChild(
|
||||
el(
|
||||
@@ -225,7 +225,7 @@ function startLaunchTicker() {
|
||||
const reconnect = document.querySelector(".launch-reconnect");
|
||||
if (reconnect) reconnect.hidden = !stale;
|
||||
if (kicker) kicker.textContent = stale ? stale.kicker : "On it";
|
||||
if (title) title.textContent = stale ? stale.title : `Waking up ${cur.title || "the next mode"}`;
|
||||
if (title) title.textContent = stale ? stale.title : `Waking up ${cur.title || "the next skill"}`;
|
||||
q.textContent = stale ? stale.quip : LAUNCH_QUIPS[Math.floor(elapsed / 2600) % LAUNCH_QUIPS.length];
|
||||
if (hint) {
|
||||
hint.textContent = stale
|
||||
|
||||
@@ -31,19 +31,19 @@ export function tellFolderIssues() {
|
||||
extras.push(document.createTextNode(" "));
|
||||
extras.push(el("code", "banner-hint", fresh.hint));
|
||||
}
|
||||
const open = el("button", "btn tiny banner-action", "Open workspace");
|
||||
const open = el("button", "btn xs soft banner-action", "Open workspace");
|
||||
open.type = "button";
|
||||
open.addEventListener("click", () => {
|
||||
hooks.banner(null);
|
||||
openWorkspace();
|
||||
});
|
||||
extras.push(open);
|
||||
hooks.banner(`The agent can't read @${fresh.name}: ${fresh.reason}`, "warn", extras);
|
||||
const issue = hooks.banner(`The agent cannot read @${fresh.name}: ${fresh.reason}`, "warn", extras);
|
||||
clearTimeout(issueBannerTimer);
|
||||
// Then the next folder waiting to be told, if several came at once.
|
||||
issueBannerTimer = setTimeout(() => {
|
||||
if (page.gone) return;
|
||||
hooks.banner(null);
|
||||
hooks.clearBanner(issue);
|
||||
tellFolderIssues();
|
||||
}, 15000);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ function workspaceScopeText() {
|
||||
|
||||
const NAME_RULE = "Names use lowercase letters, numbers and hyphens.";
|
||||
|
||||
const BROWSE_UNAVAILABLE = "Browse isn't available here — type or paste the path.";
|
||||
const BROWSE_UNAVAILABLE = "Browse is not available here: type or paste the path.";
|
||||
|
||||
// The folder whose Remove is waiting on its inline confirm, by id.
|
||||
let wsConfirm = null;
|
||||
@@ -127,14 +127,14 @@ function workspaceRow(f) {
|
||||
li.dataset.fid = f.id;
|
||||
|
||||
const head = el("div", "ws-head");
|
||||
head.appendChild(el("span", "ws-chip"));
|
||||
if (f.original) head.appendChild(el("span", "ws-original", "started here — can't be removed"));
|
||||
head.appendChild(el("span", "pill is-accent ws-chip"));
|
||||
if (f.original) head.appendChild(el("span", "ws-original", "started here, cannot be removed"));
|
||||
li.appendChild(head);
|
||||
|
||||
const pathRow = el("div", "ws-path-row");
|
||||
const code = el("code", "ws-path");
|
||||
pathRow.appendChild(code);
|
||||
const copy = el("button", "btn small", "Copy path");
|
||||
const copy = el("button", "btn sm", "Copy path");
|
||||
copy.type = "button";
|
||||
copy.addEventListener("click", async () => {
|
||||
const folder = workspaceFolders().find((x) => x.id === f.id);
|
||||
@@ -151,7 +151,7 @@ function workspaceRow(f) {
|
||||
});
|
||||
pathRow.appendChild(copy);
|
||||
if (!f.original) {
|
||||
const remove = el("button", "btn small danger ws-remove", "Remove");
|
||||
const remove = el("button", "btn sm danger ws-remove", "Remove");
|
||||
remove.type = "button";
|
||||
remove.addEventListener("click", () => {
|
||||
wsConfirm = f.id;
|
||||
@@ -175,7 +175,7 @@ function workspaceField(f, field, labelText) {
|
||||
const id = `ws-${field}-${f.id}`;
|
||||
const label = el("label", null, labelText);
|
||||
label.htmlFor = id;
|
||||
const input = el("input");
|
||||
const input = el("input", "is-compact");
|
||||
input.type = "text";
|
||||
input.id = id;
|
||||
input.dataset.field = field;
|
||||
@@ -209,7 +209,7 @@ function workspaceField(f, field, labelText) {
|
||||
setAddMsg("");
|
||||
return showError("");
|
||||
}
|
||||
if (body.reason === "name-taken") showError(`@${value} is taken — try @${body.suggest}.`);
|
||||
if (body.reason === "name-taken") showError(`@${value} is taken, try @${body.suggest}.`);
|
||||
else if (body.reason === "bad-name") showError(NAME_RULE);
|
||||
else showError("That did not save. Try again.");
|
||||
if (leaving) input.value = saved();
|
||||
@@ -241,11 +241,11 @@ function paintWorkspaceRow(li, f) {
|
||||
marks.replaceChildren();
|
||||
if (missing) marks.appendChild(el("p", "ws-mark is-missing", "This folder no longer exists"));
|
||||
if (issue) {
|
||||
marks.appendChild(el("p", "ws-mark is-issue", "The agent can't read this yet: " + issue.reason));
|
||||
marks.appendChild(el("p", "ws-mark is-issue", "The agent cannot read this yet: " + issue.reason));
|
||||
if (issue.hint) {
|
||||
const row = el("div", "ws-hint-row");
|
||||
const code = el("code", "ws-hint", issue.hint);
|
||||
row.append(code, copyButton(issue.hint, "btn tiny", code));
|
||||
row.append(code, copyButton(issue.hint, "btn xs soft", code));
|
||||
marks.appendChild(row);
|
||||
}
|
||||
}
|
||||
@@ -260,14 +260,14 @@ function paintWorkspaceRow(li, f) {
|
||||
const box = el("div", "ws-confirm");
|
||||
box.setAttribute("role", "alert");
|
||||
box.appendChild(el("span", null, `Remove @${f.name}? The agent is told.`));
|
||||
const keep = el("button", "btn small ghost", "Keep it");
|
||||
const keep = el("button", "btn sm ghost", "Keep it");
|
||||
keep.type = "button";
|
||||
keep.addEventListener("click", () => {
|
||||
wsConfirm = null;
|
||||
renderWorkspace();
|
||||
li.querySelector(".ws-remove")?.focus();
|
||||
});
|
||||
const go = el("button", "btn small danger", "Remove");
|
||||
const go = el("button", "btn sm danger", "Remove");
|
||||
go.type = "button";
|
||||
go.addEventListener("click", async () => {
|
||||
go.disabled = true;
|
||||
@@ -305,15 +305,15 @@ async function addWorkspaceFolder(path, name) {
|
||||
}
|
||||
switch (body.reason) {
|
||||
case "not-a-folder":
|
||||
return setAddMsg("That isn't a folder on this machine.", "error");
|
||||
return setAddMsg("That is not a folder on this machine.", "error");
|
||||
case "duplicate":
|
||||
return setAddMsg(`Already in the workspace as @${body.name}.`, "error");
|
||||
case "name-taken": {
|
||||
const taken = name || String(body.suggest || "").replace(/-\d+$/, "");
|
||||
const use = el("button", "btn tiny", `Use @${body.suggest}`);
|
||||
const use = el("button", "btn xs soft", `Use @${body.suggest}`);
|
||||
use.type = "button";
|
||||
use.addEventListener("click", () => addWorkspaceFolder(trimmed, body.suggest));
|
||||
return setAddMsg(`@${taken} is taken — try @${body.suggest}.`, "error", use);
|
||||
return setAddMsg(`@${taken} is taken, try @${body.suggest}.`, "error", use);
|
||||
}
|
||||
case "bad-name":
|
||||
return setAddMsg(NAME_RULE, "error");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Plan2Code Web Console - whether Send is available, and what its button says; defines only.
|
||||
|
||||
import { NOT_CONNECTED } from "./labels.js";
|
||||
import {
|
||||
finish,
|
||||
stranded,
|
||||
@@ -22,13 +23,24 @@ import { pendingNotes } from "./uploads.js";
|
||||
// the main Send would carry. The suggestion chip passes `true`: its request is
|
||||
// the payload.
|
||||
export function sendState(hasPayload = stagedCount() || pendingNotes().length > 0) {
|
||||
const state = sendStateFor(hasPayload);
|
||||
// A view with nothing to send, ever: a finished session, or the git board
|
||||
// with no card open and nothing staged. The button goes (`hide`), and the
|
||||
// footer keeps its status words, so the bar says why rather than showing a
|
||||
// dead button.
|
||||
const finished = Boolean(finish());
|
||||
const idleGit = page.S && page.S.workflow === "git" && !hasPayload && openItems().length === 0;
|
||||
return finished || idleGit ? { ...state, hide: true } : state;
|
||||
}
|
||||
|
||||
function sendStateFor(hasPayload) {
|
||||
// Before `gone`, and before the grace period that can re-enable a send. A
|
||||
// finished session has nobody left to send to, whatever the socket says.
|
||||
if (finish())
|
||||
return finishPaused(finish())
|
||||
? { disabled: true, why: "This session is paused.", short: "Session paused" }
|
||||
? { disabled: true, why: "This session is stopped.", short: "Session stopped" }
|
||||
: { disabled: true, why: "This session is finished.", short: "Session finished" };
|
||||
if (page.gone) return { disabled: true, why: "Not connected right now.", short: "Not connected" };
|
||||
if (page.gone) return { disabled: true, why: NOT_CONNECTED, short: "Not connected" };
|
||||
// The Implementation Loop answers for the agent: nothing to send until it
|
||||
// stops to ask the person something (FR-15, FR-14).
|
||||
if (loopDriving() && !loopWaiting()) {
|
||||
|
||||
@@ -40,6 +40,9 @@ export function fresh() {
|
||||
drafts: {},
|
||||
images: {},
|
||||
sent: {},
|
||||
// Multi cards whose starting ticks were already staged (answers.js seedStaged),
|
||||
// keyed by item id: a card the person cleared is never ticked again.
|
||||
seeded: {},
|
||||
stopping: null,
|
||||
afterBuild: null,
|
||||
// The finish `afterBuild` was pressed on (finishKey), so a different one is a new offer.
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
your-turn banner and the notes. The game draws its own board on the canvas. */
|
||||
|
||||
/* The top bar's die, drawn and lit like the megaphone and the gear beside it. */
|
||||
.icon-btn .dc-body { fill: none; stroke: var(--ink-3); stroke-width: 1.4; }
|
||||
.icon-btn .dc-pip { fill: var(--ink-2); stroke: none; }
|
||||
.icon-btn:hover .dc-body { stroke: var(--accent); }
|
||||
.icon-btn:hover .dc-pip { fill: var(--accent); }
|
||||
/* Show Activities off in User Preferences: .icon-btn's grid would beat the
|
||||
attribute's own display. */
|
||||
#btn-activities[hidden] { display: none; }
|
||||
@@ -280,7 +276,7 @@
|
||||
}
|
||||
.activities-order-pill:hover { border-color: var(--accent-line); color: var(--ink); }
|
||||
.activities-order-pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
|
||||
.activities-order-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.activities-order-pill:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.activities-count { margin-left: auto; color: var(--ink-3); font-size: 0.9em; font-weight: 600; font-variant-numeric: tabular-nums; }
|
||||
.activities-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
|
||||
@container (min-width: 640px) {
|
||||
@@ -303,7 +299,7 @@
|
||||
}
|
||||
.activities-row:hover,
|
||||
.activities-row:focus-visible { border-color: var(--accent-line); background: var(--panel-2); }
|
||||
.activities-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
||||
.activities-row:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.activities-row .activities-cover { border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; }
|
||||
.activities-row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
|
||||
.activities-row-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* agents.css: the Agents & models view - a master-detail split shared by User
|
||||
Preferences' tab and the agent-less setup page. The list is pinned left;
|
||||
the right pane holds the picked agent's form (prefs), the picked entry's
|
||||
state and way forward (setup), or the empty text. Every rule that used to
|
||||
be spread over prefs.css and responsive.css lives here. */
|
||||
/* agents.css: the Agents & models view, a master-detail split shared by
|
||||
Preferences' tab and the agent-less setup page. List left; the pane holds
|
||||
the agent's form (prefs), the entry's state (setup), or the empty text. */
|
||||
|
||||
/* ------------------------------------------------------------- the mount */
|
||||
|
||||
@@ -10,7 +8,7 @@
|
||||
.prefs-agents > .help { margin: 0; }
|
||||
.prefs-agents [hidden], .setup-agents [hidden] { display: none; }
|
||||
[data-av="status"]:empty { display: none; }
|
||||
[data-av="status"].error { color: var(--danger, #d64545); }
|
||||
[data-av="status"].error { color: var(--warn); }
|
||||
|
||||
/* ----------------------------------------------------------- the split */
|
||||
|
||||
@@ -29,7 +27,7 @@
|
||||
min-width: 0;
|
||||
background: var(--panel-2);
|
||||
}
|
||||
.split-list-head { padding: 8px 12px 2px; color: var(--ink-3); font-size: 13px; }
|
||||
.split-list-head { padding: 8px 12px 2px; color: var(--ink-3); font-size: var(--fs-sm); }
|
||||
.split-row {
|
||||
appearance: none;
|
||||
font: inherit;
|
||||
@@ -45,11 +43,11 @@
|
||||
}
|
||||
.split-row:hover { background: var(--accent-soft); }
|
||||
.split-row[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
|
||||
.split-row .row-name { font-weight: 600; font-size: 13.5px; }
|
||||
.split-row .row-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
|
||||
.split-row .row-name { font-weight: 600; font-size: var(--fs-md); }
|
||||
.split-row .row-sub { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-3); flex-wrap: wrap; }
|
||||
.split-row .row-sub code { color: var(--ink-3); }
|
||||
.split-row .row-models { color: var(--ink-2); overflow-wrap: anywhere; }
|
||||
.split-row .row-note { display: block; margin-top: 2px; font-size: 12px; }
|
||||
.split-row .row-note { display: block; margin-top: 2px; font-size: var(--fs-xs); }
|
||||
.split-row.soon { color: var(--ink-3); font-style: italic; cursor: default; }
|
||||
.split-add { margin: 8px; align-self: flex-start; }
|
||||
|
||||
@@ -60,70 +58,54 @@
|
||||
align-content: start;
|
||||
min-width: 0;
|
||||
}
|
||||
.split-empty { color: var(--ink-3); display: grid; place-items: center; min-height: 240px; text-align: center; }
|
||||
|
||||
/* ------------------------------------------------------------- badges */
|
||||
|
||||
.prefs-badge, .prefs-unsaved-badge {
|
||||
display: inline-block;
|
||||
font-size: 11.5px;
|
||||
line-height: 1.5;
|
||||
padding: 0 7px;
|
||||
border-radius: 10px;
|
||||
background: var(--panel-2);
|
||||
color: var(--ink-3);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.split-row .prefs-badge { background: var(--panel); }
|
||||
.prefs-badge.ok { color: var(--ok); }
|
||||
.prefs-badge.missing { color: var(--warn); }
|
||||
.prefs-unsaved-badge { background: none; border: 1px solid var(--warn); color: var(--warn); }
|
||||
|
||||
/* -------------------------------------------------------------- the form */
|
||||
|
||||
.form-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
|
||||
.prefs-agents-title { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 15px; }
|
||||
.prefs-agents-title code { font-size: 12px; color: var(--ink-3); }
|
||||
.prefs-agents-title { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: var(--fs-base); }
|
||||
.prefs-agents-title code { font-size: var(--fs-xs); color: var(--ink-3); }
|
||||
.prefs-agents-title:focus { outline: none; }
|
||||
|
||||
.prefs-agents-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
|
||||
.prefs-agents-fields input { min-width: 0; }
|
||||
.prefs-agents-fields input.invalid, .split-pane input.invalid { border-color: var(--danger, #d64545); }
|
||||
.prefs-agents-fields input.invalid, .split-pane input.invalid { border-color: var(--warn); }
|
||||
|
||||
.agent-field { display: grid; gap: 4px; min-width: 0; }
|
||||
.agent-field > span, .agent-field > label { font-size: 0.85em; opacity: 0.85; }
|
||||
.agent-field > span, .agent-field > label { font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.agent-rows { display: grid; gap: 4px; }
|
||||
.agent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
|
||||
.agent-row.model { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
|
||||
.agent-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
||||
.agent-foot .help { margin: 0; }
|
||||
.prefs-agents-test .agent-test-result { flex: 1 1 auto; }
|
||||
.agent-error { margin: 0; color: var(--danger, #d64545); font-size: 0.9em; }
|
||||
.agent-error { margin: 0; color: var(--warn); font-size: var(--fs-sm); }
|
||||
|
||||
.prefs-agents-test { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
||||
.prefs-agents-test .help { margin: 0; }
|
||||
.prefs-agents-none { margin: 0; }
|
||||
|
||||
/* A folded section (Models, Command-line arguments): the picked design keeps
|
||||
both behind a summary line until opened. */
|
||||
/* Folded sections (Models, Command-line arguments). */
|
||||
.agent-fold { display: grid; gap: 8px; }
|
||||
.agent-fold > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
|
||||
.agent-fold > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-sm); }
|
||||
.agent-fold[open] > summary { margin-bottom: 4px; }
|
||||
.agent-fold > .agent-field + .agent-field, .agent-fold > .models-note + .agent-field { margin-top: 8px; }
|
||||
.prefs-agents-args > .agent-field + .agent-field { margin-top: 8px; }
|
||||
|
||||
/* The Saved mark sits in the form's foot, in the flow, after the buttons. */
|
||||
/* The Saved mark flows in the foot after the buttons. */
|
||||
.prefs-agents-foot > .prefs-saved { position: static; max-width: none; text-align: left; }
|
||||
|
||||
/* ------------------------------------------------------------- models lists */
|
||||
|
||||
.models-note { font-size: 0.9em; opacity: 0.85; }
|
||||
.models-note { font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.models-note p, .models-note ul { margin: 0 0 6px; }
|
||||
.models-note ul { padding-left: 18px; }
|
||||
.models-list { display: grid; gap: 4px; max-height: 160px; overflow: auto; }
|
||||
.models-list:empty { display: none; }
|
||||
.models-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
|
||||
.models-row.locked { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); font-size: 0.88em; opacity: 0.75; }
|
||||
.models-row.locked { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.models-row input { min-width: 0; }
|
||||
|
||||
/* --------------------------------------------------------- the setup pane */
|
||||
@@ -133,7 +115,7 @@
|
||||
.setup-agent-line {
|
||||
margin: 0;
|
||||
color: var(--ink-2);
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
.setup-install {
|
||||
display: flex;
|
||||
@@ -144,9 +126,9 @@
|
||||
}
|
||||
.setup-install code {
|
||||
background: var(--panel-2);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 2px 7px;
|
||||
font-size: 12px;
|
||||
font-size: var(--fs-xs);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------- narrow screens */
|
||||
@@ -162,16 +144,15 @@
|
||||
.strength-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr) auto; gap: 6px; align-items: center; }
|
||||
.strength-row:has(select + select) { grid-template-columns: 5.5em minmax(0, 1fr) minmax(0, 8em) auto; }
|
||||
.strength-row select { min-width: 0; }
|
||||
.strength-word { font-size: 0.9em; }
|
||||
.strength-default { margin: 0; font-size: 0.8em; color: var(--ink-3); }
|
||||
.strength-word { font-size: var(--fs-sm); }
|
||||
.strength-default { margin: 0; font-size: var(--fs-xs); color: var(--ink-3); }
|
||||
.strength-empty, .strength-offer { margin: 0; }
|
||||
|
||||
/* ------------------------------------------------- Preferences: the roster */
|
||||
|
||||
/* The Agents & models tab in User Preferences: a roster of cards, the picked
|
||||
agent's form in a drawer over it, and the Add agent chooser over both. The
|
||||
drawer and chooser sit in the tab's own box (absolute) and stick to the top
|
||||
of the dialog's scroll, so they stay in view on a long roster. */
|
||||
/* Roster of cards, the agent's form in a drawer over it, the Add agent
|
||||
chooser over both. Drawer and chooser are absolute in the tab and stick to
|
||||
the dialog's scroll top, staying in view on a long roster. */
|
||||
.prefs-agents { position: relative; min-height: 520px; align-content: start; }
|
||||
.roster-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
|
||||
.roster-head > .help { max-width: 62ch; }
|
||||
@@ -192,16 +173,16 @@
|
||||
align-content: start;
|
||||
min-width: 0;
|
||||
}
|
||||
.agent-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
|
||||
.agent-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2); }
|
||||
.agent-card[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
|
||||
.agent-card .card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
|
||||
.agent-card .card-who { display: grid; gap: 2px; min-width: 0; }
|
||||
.agent-card .row-name { font-weight: 700; font-size: 14.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
|
||||
.agent-card .card-who code { color: var(--ink-3); font-size: 12px; }
|
||||
.agent-card .card-tiers { display: grid; gap: 5px; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
|
||||
.agent-card .card-tier { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; }
|
||||
.agent-card .row-name { font-weight: 700; font-size: var(--fs-base); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
|
||||
.agent-card .card-who code { color: var(--ink-3); font-size: var(--fs-xs); }
|
||||
.agent-card .card-tiers { display: grid; gap: 5px; background: var(--panel-2); border-radius: var(--radius-md); padding: 8px 10px; }
|
||||
.agent-card .card-tier { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 8px; align-items: center; font-size: var(--fs-sm); }
|
||||
.agent-card .card-tier .muted, .strength-model.none { color: var(--ink-3); font-style: italic; }
|
||||
.agent-card .card-foot { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; }
|
||||
.agent-card .card-foot { display: flex; justify-content: space-between; color: var(--ink-3); font-size: var(--fs-xs); }
|
||||
.agent-card .card-edit { color: var(--accent); font-weight: 600; }
|
||||
.agent-card .row-note { margin: 0; }
|
||||
.agent-card.ghost {
|
||||
@@ -214,31 +195,19 @@
|
||||
min-height: 150px;
|
||||
color: var(--ink-2);
|
||||
}
|
||||
.agent-card.ghost .plus { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
|
||||
.agent-card.ghost .muted { font-size: 12.5px; color: var(--ink-3); }
|
||||
.agent-card.ghost .plus { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-h2); }
|
||||
.agent-card.ghost .muted { font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
|
||||
.tag {
|
||||
display: inline-block;
|
||||
font-size: 11.5px;
|
||||
font-weight: 500;
|
||||
line-height: 1.5;
|
||||
padding: 0 7px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--rule-2);
|
||||
background: var(--panel-2);
|
||||
color: var(--ink-3);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Thrifty, Balanced and Best take the rank colors (see tokens.css). */
|
||||
.tier {
|
||||
display: inline-block;
|
||||
justify-self: start;
|
||||
font-size: 11.5px;
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
padding: 0 8px;
|
||||
border-radius: 10px;
|
||||
border-radius: var(--radius);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.tier.t-thrifty { color: var(--lvl-1); background: var(--lvl-1-soft); }
|
||||
@@ -247,9 +216,9 @@
|
||||
|
||||
/* ---------------------------------------------------------------- the drawer */
|
||||
|
||||
.agents-drawer, .agents-chooser { position: absolute; inset: 0; z-index: 5; }
|
||||
.agents-drawer, .agents-chooser { position: absolute; inset: 0; z-index: var(--z-sticky); }
|
||||
.agents-drawer[hidden], .agents-chooser[hidden] { display: none; }
|
||||
.drawer-scrim, .chooser-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(1px); }
|
||||
.drawer-scrim, .chooser-scrim { position: absolute; inset: 0; background: var(--scrim); }
|
||||
.drawer {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
@@ -262,16 +231,16 @@
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
box-shadow: var(--shadow-3);
|
||||
overflow: hidden;
|
||||
}
|
||||
.drawer .form-head { padding: 14px 16px 6px; justify-content: space-between; align-items: center; flex-wrap: nowrap; }
|
||||
.drawer .prefs-agents-title { font-size: 16px; flex-wrap: wrap; }
|
||||
.drawer .prefs-agents-title { font-size: var(--fs-h4); flex-wrap: wrap; }
|
||||
.agent-tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--rule); }
|
||||
.agent-tab {
|
||||
appearance: none;
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
background: none;
|
||||
border: 0;
|
||||
border-bottom: 2px solid transparent;
|
||||
@@ -280,40 +249,40 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
.agent-tab:hover { color: var(--ink); }
|
||||
.agent-tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
|
||||
.agent-tab[aria-selected="true"] { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
|
||||
.agent-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 16px; display: grid; gap: 12px; align-content: start; }
|
||||
.drawer .prefs-agents-foot { border-top: 1px solid var(--rule); padding: 10px 16px; background: var(--panel); }
|
||||
/* Nothing to offer on a clean built-in: no empty bar. */
|
||||
.drawer .prefs-agents-foot:not(:has(> :not([hidden]))) { display: none; }
|
||||
/* The same form on the setup page's split pane is not a drawer: let it flow. */
|
||||
/* In the setup split pane the form is not a drawer: let it flow. */
|
||||
.split-pane .agent-body { overflow: visible; padding: 12px 0 0; }
|
||||
.split-pane .agent-tabs { padding: 0; }
|
||||
|
||||
.note { background: var(--accent-soft); color: var(--ink); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
|
||||
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
|
||||
.note { padding: 9px 12px; font-size: var(--fs-sm); }
|
||||
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: var(--fs-sm); }
|
||||
.kv dt { color: var(--ink-3); }
|
||||
.kv dd { margin: 0; }
|
||||
|
||||
/* In the loop: the three words, what each resolves to, and the model pills. */
|
||||
/* In the loop: the three words, what they resolve to, the model pills. */
|
||||
.strength-body .strength-row { grid-template-columns: minmax(0, 11em) minmax(0, 1fr) auto auto; }
|
||||
.strength-body .strength-row:not(:has(select)) { grid-template-columns: minmax(0, 11em) minmax(0, 1fr) auto; }
|
||||
.strength-word { display: grid; gap: 1px; font-size: inherit; }
|
||||
.strength-word small { font-size: 11.5px; }
|
||||
.strength-model { overflow-wrap: anywhere; font-size: 13px; }
|
||||
.strength-word small { font-size: var(--fs-xs); }
|
||||
.strength-model { overflow-wrap: anywhere; font-size: var(--fs-sm); }
|
||||
.models-tip { margin: 0; }
|
||||
.models-list { max-height: none; }
|
||||
.models-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 4px 6px; border-radius: 6px; font-size: 13px; }
|
||||
.models-row.locked { grid-template-columns: minmax(0, 1fr) auto auto; font-size: 13px; opacity: 1; }
|
||||
.models-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); font-size: var(--fs-sm); }
|
||||
.models-row.locked { grid-template-columns: minmax(0, 1fr) auto auto; font-size: var(--fs-sm); color: inherit; }
|
||||
.models-row:hover { background: var(--panel-2); }
|
||||
.model-name { display: grid; min-width: 0; overflow-wrap: anywhere; }
|
||||
.model-name code { font-size: 11.5px; color: var(--ink-3); }
|
||||
.model-name code { font-size: var(--fs-xs); color: var(--ink-3); }
|
||||
.strength-pills { display: inline-flex; gap: 4px; }
|
||||
.strength-pill {
|
||||
appearance: none;
|
||||
font: inherit;
|
||||
font-size: 11.5px;
|
||||
font-size: var(--fs-xs);
|
||||
padding: 1px 9px;
|
||||
border-radius: 10px;
|
||||
border-radius: var(--radius);
|
||||
border: 1px solid var(--rule-2);
|
||||
background: transparent;
|
||||
color: var(--ink-3);
|
||||
@@ -339,11 +308,11 @@
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
box-shadow: var(--shadow-3);
|
||||
padding: 16px 18px 18px;
|
||||
}
|
||||
.chooser-head { display: flex; justify-content: space-between; align-items: center; }
|
||||
.chooser-head h3 { margin: 0; font-size: 16px; }
|
||||
.chooser-head h3 { margin: 0; font-size: var(--fs-h4); }
|
||||
.chooser-sheet > .help { margin: 0; }
|
||||
.chooser-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
|
||||
.chooser-tile {
|
||||
@@ -353,23 +322,23 @@
|
||||
color: var(--ink);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
padding: 10px 12px;
|
||||
cursor: pointer;
|
||||
display: grid;
|
||||
gap: 3px;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
.chooser-tile:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
|
||||
.chooser-tile:disabled { opacity: 0.55; cursor: default; }
|
||||
.chooser-tile b { font-size: 14px; }
|
||||
.chooser-tile code { color: var(--ink-3); font-size: 12px; }
|
||||
.chooser-tile b { font-size: var(--fs-md); }
|
||||
.chooser-tile code { color: var(--ink-3); font-size: var(--fs-xs); }
|
||||
.chooser-tile .muted { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-3); }
|
||||
.chooser-tile.wide { border-style: dashed; }
|
||||
.chooser-state { font-size: 12px; color: var(--ink-3); }
|
||||
.chooser-state { font-size: var(--fs-xs); color: var(--ink-3); }
|
||||
.chooser-state.ok { color: var(--ok); }
|
||||
.chooser-state.missing { color: var(--warn); }
|
||||
.chooser-or { text-align: center; color: var(--ink-3); font-size: 12px; display: flex; align-items: center; gap: 10px; }
|
||||
.chooser-or { text-align: center; color: var(--ink-3); font-size: var(--fs-xs); display: flex; align-items: center; gap: 10px; }
|
||||
.chooser-or::before, .chooser-or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
|
||||
|
||||
@media (max-width: 720px) {
|
||||
@@ -382,4 +351,4 @@
|
||||
.model-add { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
.drawer .help, .chooser-sheet .help, .strength-offer { font-size: 12.5px; color: var(--ink-3); }
|
||||
.drawer .help, .chooser-sheet .help, .strength-offer { font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
@@ -13,7 +13,7 @@
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
box-shadow: var(--shadow-1);
|
||||
overflow: hidden;
|
||||
}
|
||||
.ask-head {
|
||||
@@ -22,8 +22,8 @@
|
||||
padding: 16px 22px 14px;
|
||||
border-bottom: 1px solid var(--rule);
|
||||
}
|
||||
.ask-head h2 { font: 600 21px/1.2 var(--serif); margin: 0; flex: 1; }
|
||||
.ask-counter { font: 700 12px/1 var(--mono); color: var(--ink-3); }
|
||||
.ask-head h2 { font: 600 var(--fs-h2)/1.2 var(--serif); margin: 0; flex: 1; }
|
||||
.ask-counter { font: 700 var(--fs-xs)/1 var(--mono); color: var(--ink-3); }
|
||||
|
||||
.ask-list {
|
||||
flex: 1 1 auto;
|
||||
@@ -35,58 +35,41 @@
|
||||
}
|
||||
/* An empty conversation's starter questions, centered where the list is empty. */
|
||||
.ask-starters { display: flex; flex-direction: column; gap: 6px; margin: auto 0; width: 100%; max-width: 520px; align-self: center; }
|
||||
.ask-starters-lead { color: var(--ink-3); font-size: 13.5px; margin: 0 0 4px; text-align: center; }
|
||||
.ask-starter {
|
||||
width: 100%;
|
||||
padding: 9px 13px;
|
||||
border: 1px solid var(--rule);
|
||||
border-radius: var(--radius);
|
||||
background: var(--panel);
|
||||
font: inherit;
|
||||
font-size: 13.5px;
|
||||
color: var(--ink-2);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ask-starters-lead { color: var(--ink-3); font-size: var(--fs-md); margin: 0 0 4px; text-align: center; }
|
||||
.ask-starter { width: 100%; font-weight: 400; color: var(--ink-2); text-align: left; }
|
||||
.ask-starter:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
|
||||
.ask-starter:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
||||
.ask-starter:disabled { opacity: 0.55; cursor: not-allowed; }
|
||||
|
||||
.ask-row {
|
||||
max-width: 86%;
|
||||
border-radius: var(--radius);
|
||||
padding: 10px 14px;
|
||||
font-size: 14px;
|
||||
font-size: var(--fs-md);
|
||||
border: 1px solid var(--rule);
|
||||
}
|
||||
.ask-row.person { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-line); }
|
||||
.ask-row.pending { border-style: dashed; background: transparent; }
|
||||
.ask-row.agent { align-self: flex-start; background: var(--panel-2); }
|
||||
.ask-row.decision { align-self: flex-end; background: transparent; border-style: dashed; color: var(--ink-2); font-size: 13px; }
|
||||
.ask-row.decision { align-self: flex-end; background: transparent; border-style: dashed; color: var(--ink-2); font-size: var(--fs-sm); }
|
||||
.ask-row .md { max-width: none; }
|
||||
.ask-row .md > :first-child { margin-top: 0; }
|
||||
.ask-row .md > :last-child { margin-bottom: 0; }
|
||||
.ask-row .attach-tray { margin: 8px 0 0; }
|
||||
.ask-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
.ask-about { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; color: var(--accent); }
|
||||
.ask-about { margin: 0 0 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
|
||||
.ask-decision { margin: 0; font-weight: 600; }
|
||||
.ask-decision.working { display: flex; align-items: center; gap: 8px; }
|
||||
.ask-waiting { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
|
||||
.ask-waiting { margin: 6px 0 0; font-size: var(--fs-xs); color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
|
||||
.ask-failed { color: var(--warn); }
|
||||
|
||||
.ask-proposal {
|
||||
margin-top: 10px; padding: 10px 12px;
|
||||
border: 1px solid var(--stage); border-radius: 8px;
|
||||
background: var(--stage-soft);
|
||||
}
|
||||
.ask-proposal { margin-top: 10px; padding: 10px 12px; }
|
||||
.ask-proposal .note-kicker { margin-bottom: 4px; }
|
||||
.ask-proposal-files, .ask-changed { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; }
|
||||
.ask-proposal-files, .ask-changed { margin: 6px 0 0; padding-left: 18px; font-size: var(--fs-sm); }
|
||||
.ask-proposal-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
|
||||
.ask-proposal-actions input[type="text"] { flex: 1 1 200px; width: auto; padding: 7px 10px; }
|
||||
.ask-decided { margin: 8px 0 0; font-weight: 700; font-size: 13px; }
|
||||
.ask-decided { margin: 8px 0 0; font-weight: 700; font-size: var(--fs-sm); }
|
||||
.ask-decided.approve { color: var(--ok); }
|
||||
.ask-decided.decline { color: var(--ink-2); }
|
||||
.ask-changed-count { font: 12px/1 var(--mono); color: var(--ink-3); }
|
||||
.ask-changed-count { font: var(--fs-xs)/1 var(--mono); color: var(--ink-3); }
|
||||
|
||||
.ask-composer {
|
||||
flex: none;
|
||||
@@ -100,9 +83,9 @@
|
||||
.ask-about-chip {
|
||||
display: inline-flex; align-items: center; gap: 8px;
|
||||
margin-bottom: 8px; padding: 3px 4px 3px 11px;
|
||||
border: 1px solid var(--accent-line); border-radius: 99px;
|
||||
border: 1px solid var(--accent-line); border-radius: var(--radius-pill);
|
||||
background: var(--accent-soft); color: var(--accent);
|
||||
font-size: 12px; font-weight: 600;
|
||||
font-size: var(--fs-xs); font-weight: 600;
|
||||
max-width: 100%;
|
||||
}
|
||||
.ask-about-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
@@ -115,7 +98,7 @@
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: calc(100% + 4px);
|
||||
z-index: 20;
|
||||
z-index: var(--z-pop);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 220px;
|
||||
@@ -126,7 +109,7 @@
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: var(--radius);
|
||||
background: var(--panel);
|
||||
box-shadow: var(--shadow);
|
||||
box-shadow: var(--shadow-2);
|
||||
}
|
||||
.ask-context-item {
|
||||
display: flex;
|
||||
@@ -134,10 +117,10 @@
|
||||
gap: 10px;
|
||||
padding: 7px 10px;
|
||||
border: 0;
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
@@ -145,24 +128,23 @@
|
||||
.ask-context-item:hover,
|
||||
.ask-context-item:focus-visible { background: var(--accent-soft); outline: none; }
|
||||
.ask-context-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.ask-context-kind { flex: none; font-size: 11px; color: var(--ink-3); }
|
||||
.ask-context-kind { flex: none; font-size: var(--fs-2xs); color: var(--ink-3); }
|
||||
.ask-actions .btn.primary { margin-left: auto; }
|
||||
.ask-send-hint { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
|
||||
.ask-send-hint { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }
|
||||
.ask-send-hint + .btn.primary { margin-left: 0; }
|
||||
/* The wake-the-agent offer when nobody is there: a button (or, in a browser, a
|
||||
line) pushed right so it sits directly left of Send. */
|
||||
.ask-actions .ask-reconnect { margin-left: auto; }
|
||||
.ask-actions .ask-reconnect + .btn.primary { margin-left: 0; }
|
||||
p.ask-reconnect { margin-top: 0; margin-bottom: 0; font-size: 12.5px; }
|
||||
.ask-count { font: 12px/1 var(--mono); color: var(--ink-3); }
|
||||
p.ask-reconnect { margin-top: 0; margin-bottom: 0; font-size: var(--fs-sm); }
|
||||
.ask-count { font: var(--fs-xs)/1 var(--mono); color: var(--ink-3); }
|
||||
.ask-count.is-over { color: var(--warn); font-weight: 700; }
|
||||
.ask-error { color: var(--warn); font-size: 13px; margin: 8px 0 0; }
|
||||
.ask-error { color: var(--warn); font-size: var(--fs-sm); margin: 8px 0 0; }
|
||||
|
||||
/* The two reasons Send is off read differently, as their wording does: the
|
||||
limit is a plain fact, the missing agent is something to fix. */
|
||||
.ask-disabled-note { margin: 0; font-size: 12.5px; line-height: 1.35; padding: 6px 10px; border-radius: 8px; }
|
||||
.ask-disabled-note { margin: 0; font-size: var(--fs-sm); line-height: 1.35; padding: 6px 10px; border-radius: var(--radius-md); }
|
||||
.ask-disabled-note.is-limit, .ask-disabled-note.is-waiting { color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--rule); }
|
||||
.ask-disabled-note.is-offline { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn); }
|
||||
|
||||
/* Waiting on Plan2Code (an Ask answer, or answers sent from Questions):
|
||||
the tiny ring, left of the label. The extra .spinner is for specificity:
|
||||
|
||||
@@ -2,47 +2,34 @@
|
||||
|
||||
/* ------------------------------------------------------------ dashboard */
|
||||
|
||||
/* The dashboard replaces the question column with a menu, and the send bar
|
||||
with a click on a card. `hidden` alone loses to the bar's own display
|
||||
rule, so it needs saying here. */
|
||||
/* The dashboard replaces the question column and send bar. `hidden` alone loses to the bar's display rule. */
|
||||
.footer[hidden] { display: none; }
|
||||
|
||||
/* The menu follows the Card width setting like the question column does. */
|
||||
/* Follows the Card width setting. */
|
||||
.dash { max-width: min(var(--card-width), 100%); padding-top: 8px; }
|
||||
.dash-title { margin: 6px 0 8px; font: 600 clamp(26px, 4vw, 36px)/1.1 var(--serif); }
|
||||
.dash-note { margin: 0 0 26px; font-size: 14.5px; color: var(--ink-2); }
|
||||
/* The first-run role nudge: one line above the title, wrapping on a narrow
|
||||
window, until looks.json carries a role. */
|
||||
.dash-note { margin: 0 0 26px; font-size: var(--fs-base); color: var(--ink-2); }
|
||||
/* First-run role nudge, shown until looks.json carries a role. */
|
||||
.dash-nudge {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 10px 14px;
|
||||
margin: 0 0 18px;
|
||||
padding: 10px 14px;
|
||||
background: var(--accent-soft);
|
||||
border: 1px solid var(--accent-line);
|
||||
border-radius: var(--radius);
|
||||
color: var(--ink);
|
||||
font-size: 14px;
|
||||
font-size: var(--fs-md);
|
||||
}
|
||||
.dash-nudge-text { flex: 1 1 16em; }
|
||||
/* The session meter at red: the same slot, in the careful color. */
|
||||
.dash-nudge.meter-banner {
|
||||
background: var(--warn-soft);
|
||||
border-color: var(--warn);
|
||||
border-left-width: 4px;
|
||||
color: var(--ink);
|
||||
}
|
||||
/* A newer release: the same slot, in the accent, with the label as the way
|
||||
into the update modal and a small × that hides it for this session. */
|
||||
/* After the first launch: the two optional extras as one quiet line. */
|
||||
.dash-extras { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.dash-extras .btn { margin-left: 10px; }
|
||||
.dash-extras-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
|
||||
.dash-extras-link:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
/* Session meter at red: same slot, warn color. */
|
||||
/* Newer release: same slot, accent; the label opens the update modal, the x hides it for the session. */
|
||||
.dash-nudge.update-banner {
|
||||
position: relative;
|
||||
padding-left: 40px;
|
||||
padding-right: 40px;
|
||||
border-left-width: 4px;
|
||||
border-left-color: var(--accent-line);
|
||||
color: var(--ink);
|
||||
box-shadow: var(--glow);
|
||||
}
|
||||
.update-banner-open {
|
||||
@@ -58,8 +45,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
.update-banner-open:hover { text-decoration: underline; }
|
||||
/* Pinned to the right edge, out of the flow, so the label centers on the
|
||||
whole banner rather than on what the × leaves of it. */
|
||||
/* Out of the flow so the label centers on the whole banner. */
|
||||
.update-banner-dismiss {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
@@ -71,18 +57,21 @@
|
||||
background: none;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
font-size: 16px;
|
||||
font-size: var(--fs-h4);
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
.update-banner-dismiss:hover { background: var(--accent-line); }
|
||||
/* Wide enough that the update command sits on one line beside Copy; a
|
||||
narrow window still wraps it rather than overflowing. */
|
||||
/* Wide enough for the command on one line beside Copy; wraps when narrow. */
|
||||
#update-modal { max-width: 720px; }
|
||||
.update-steps { margin: 0 0 12px; padding-left: 1.4em; color: var(--ink); }
|
||||
.update-steps li { margin: 4px 0; }
|
||||
/* The hand-off copy row, in the modal's first step: the command and its Copy
|
||||
side by side. */
|
||||
/* Closed until the one command did not work. */
|
||||
.update-more { margin: 10px 0 0; }
|
||||
.update-more summary { cursor: pointer; color: var(--ink-2); }
|
||||
.update-more summary:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.update-more p { margin: 8px 0 4px; color: var(--ink-2); }
|
||||
/* The command and its Copy side by side. */
|
||||
.update-command {
|
||||
margin: 6px 0 4px;
|
||||
display: flex;
|
||||
@@ -93,17 +82,16 @@
|
||||
.update-command code {
|
||||
flex: 1 1 260px;
|
||||
min-width: 0;
|
||||
font: 13px/1.5 var(--mono);
|
||||
font: var(--fs-sm)/1.5 var(--mono);
|
||||
color: var(--ink);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
padding: 10px 12px;
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.dash-nudge-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
|
||||
.dash-nudge-actions .btn.tiny { margin-bottom: 0; }
|
||||
.dash-working {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -114,22 +102,21 @@
|
||||
color: var(--accent);
|
||||
background: var(--accent-soft);
|
||||
border: 1px solid var(--accent-line);
|
||||
border-radius: 10px;
|
||||
border-radius: var(--radius);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.dash-group { margin-bottom: 30px; }
|
||||
|
||||
/* A switch, not a checkbox look: it filters the menu live rather than being
|
||||
an answer. The real checkbox stays in the tree (visually hidden) so the
|
||||
keyboard, focus ring and screen readers all work as for any input. */
|
||||
/* A switch: it filters live, not an answer. The real checkbox stays (visually
|
||||
hidden) so keyboard, focus ring and screen readers work. */
|
||||
.dash-toggle {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin: -12px 0 26px;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-2);
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
@@ -140,10 +127,10 @@
|
||||
flex: none;
|
||||
width: 34px;
|
||||
height: 20px;
|
||||
border-radius: 999px;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--panel-2);
|
||||
border: 1px solid var(--rule-2);
|
||||
transition: background 0.15s ease, border-color 0.15s ease;
|
||||
transition: background var(--dur-1), border-color var(--dur-1);
|
||||
}
|
||||
.dash-toggle-track::after {
|
||||
content: "";
|
||||
@@ -154,40 +141,31 @@
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
background: var(--ink-3);
|
||||
transition: transform 0.15s ease, background 0.15s ease;
|
||||
transition: transform var(--dur-1), background var(--dur-1);
|
||||
}
|
||||
.dash-toggle input:checked + .dash-toggle-track { background: var(--accent); border-color: var(--accent); }
|
||||
.dash-toggle input:checked + .dash-toggle-track::after { transform: translateX(14px); background: var(--accent-ink); }
|
||||
.dash-toggle input:focus-visible + .dash-toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.dash-toggle input:focus-visible + .dash-toggle-track { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.dash-toggle:hover .dash-toggle-track { border-color: var(--accent-line); }
|
||||
|
||||
.dash-empty { margin: 0 0 30px; font-size: 13.5px; color: var(--ink-3); font-style: italic; }
|
||||
.dash-group-title {
|
||||
margin: 0 0 12px;
|
||||
font-size: 11.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.09em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-3);
|
||||
border-bottom: 1px solid var(--rule);
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
/* Every card in a group has one width, `--dash-cols` to a row: the dashboard
|
||||
picks the count (card-rows.js) so no card sits alone on a row, and centers a
|
||||
last row still short. The 3 is only the first paint's guess. */
|
||||
/* One card width, `--dash-cols` per row: card-rows.js picks the count so no
|
||||
card sits alone, and centers a short last row. The 3 is a first-paint guess. */
|
||||
.dash-grid {
|
||||
--dash-cols: 3;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
.dash-grid > .dash-card { flex: 0 0 calc((100% - (var(--dash-cols) - 1) * 12px) / var(--dash-cols)); min-width: 0; }
|
||||
.dash-grid > .dash-card, .dash-grid > .dash-card-wrap { flex: 0 0 calc((100% - (var(--dash-cols) - 1) * 12px) / var(--dash-cols)); min-width: 0; }
|
||||
.dash-grid.is-centered { justify-content: center; }
|
||||
|
||||
/* A card IS a button, so it carries the reset the page's other big clickable
|
||||
surfaces do; the look is the panel look with a lift on hover, and the
|
||||
accent border that elsewhere means "the thing in play". */
|
||||
/* A card is a button, so it carries the usual reset; panel look, lifts on hover. */
|
||||
.dash-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -200,35 +178,25 @@
|
||||
text-align: left;
|
||||
color: var(--ink);
|
||||
cursor: pointer;
|
||||
transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
|
||||
transition: transform var(--dur-1), box-shadow var(--dur-1), border-color var(--dur-1);
|
||||
}
|
||||
.dash-card:hover:not(:disabled) {
|
||||
transform: translateY(-2px);
|
||||
border-color: var(--accent-line);
|
||||
box-shadow: var(--shadow);
|
||||
box-shadow: var(--shadow-2);
|
||||
}
|
||||
.dash-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.dash-card:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.dash-card:disabled { cursor: default; opacity: 0.55; }
|
||||
.dash-card.is-suggested { border-color: var(--accent); }
|
||||
.dash-card.is-going { border-color: var(--accent); opacity: 1; }
|
||||
|
||||
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
|
||||
.dash-chip {
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-3);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 999px;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
.dash-card.is-suggested .dash-chip { color: var(--accent); border-color: var(--accent-line); }
|
||||
.dash-card.is-suggested .dash-chip { --t: var(--accent); --t-line: var(--accent-line); }
|
||||
|
||||
/* 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-title { display: flex; align-items: center; gap: 7px; font-size: var(--fs-base); font-weight: 600; }
|
||||
.dash-card-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
@@ -240,8 +208,8 @@
|
||||
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); }
|
||||
.dash-card-blurb { font-size: var(--fs-sm); color: var(--ink-2); flex: 1; }
|
||||
.dash-card-detail { font-size: var(--fs-xs); color: var(--accent); }
|
||||
|
||||
.dash-card-foot {
|
||||
display: flex;
|
||||
@@ -252,26 +220,23 @@
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid var(--rule);
|
||||
}
|
||||
/* Wraps at the dashes rather than cut off: a command missing its end
|
||||
("/plan2code-3-implement-revi…") is no command at all. */
|
||||
/* Wraps at the dashes, never cut off: a truncated command is no command. */
|
||||
.dash-card-cmd {
|
||||
font-family: var(--mono);
|
||||
font-size: 11.5px;
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--ink-3);
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.dash-card-go { color: var(--accent); font-weight: 700; transition: transform 0.15s ease; }
|
||||
.dash-card-go { color: var(--accent); font-weight: 700; transition: transform var(--dur-1); }
|
||||
.dash-card:hover:not(:disabled) .dash-card-go { transform: translateX(3px); }
|
||||
|
||||
/* The reason a card is off. The card grays via :disabled; this line is why,
|
||||
so the menu teaches the pipeline instead of just refusing clicks. */
|
||||
.dash-card-off { font-size: 12px; color: var(--ink-3); font-style: italic; }
|
||||
/* Why a card is off (it grays via :disabled), so the menu teaches the pipeline. */
|
||||
.dash-card-off { font-size: var(--fs-xs); color: var(--ink-3); font-style: italic; }
|
||||
|
||||
/* -------------------------------------------------------- spec picker */
|
||||
|
||||
/* The picker's chips are the same vocabulary as the rail's items: a bordered
|
||||
lozenge that lights up on the current one. */
|
||||
/* Chips match the rail's items: a bordered lozenge lit on the current one. */
|
||||
.spec-pick { margin-bottom: 30px; }
|
||||
.spec-row { display: flex; flex-wrap: wrap; gap: 10px; }
|
||||
.spec-chip {
|
||||
@@ -286,22 +251,18 @@
|
||||
text-align: left;
|
||||
color: var(--ink);
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
transition: border-color var(--dur-1), box-shadow var(--dur-1);
|
||||
}
|
||||
.spec-chip:hover { border-color: var(--accent-line); }
|
||||
.spec-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.spec-chip.is-sel { border-color: var(--accent); box-shadow: var(--shadow); }
|
||||
.spec-chip-name { font-size: 13.5px; font-weight: 650; }
|
||||
.spec-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.spec-chip.is-sel { border-color: var(--accent); box-shadow: var(--shadow-1); }
|
||||
.spec-chip-name { font-size: var(--fs-md); font-weight: 600; }
|
||||
.spec-chip-state {
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--accent);
|
||||
}
|
||||
.spec-chip:not(.is-sel) .spec-chip-state { color: var(--ink-3); }
|
||||
.spec-chip-detail { font-size: 11.5px; color: var(--ink-3); }
|
||||
/* A handoff in the picker: the same lozenge, dashed, in the stage color. */
|
||||
.spec-chip-detail { font-size: var(--fs-xs); color: var(--ink-3); }
|
||||
/* A handoff: dashed, stage color. */
|
||||
.spec-chip.is-handoff { border-style: dashed; }
|
||||
.spec-chip.is-handoff .spec-chip-state, .spec-chip.is-handoff:not(.is-sel) .spec-chip-state { color: var(--stage); }
|
||||
.spec-chip.is-handoff.is-sel { border-style: solid; border-color: var(--stage); }
|
||||
@@ -315,17 +276,13 @@
|
||||
border: 1px solid var(--stage);
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
.handoff-preview-title { font: 600 20px/1.25 var(--serif); margin: 0 0 4px; }
|
||||
.handoff-preview-meta { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-3); }
|
||||
.handoff-preview-title { font: 600 var(--fs-h2)/1.25 var(--serif); margin: 0 0 4px; }
|
||||
.handoff-preview-meta { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.handoff-preview-label {
|
||||
margin: 0 0 3px;
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--stage);
|
||||
}
|
||||
.handoff-preview-next { margin: 0 0 16px; font-size: 14px; color: var(--ink); }
|
||||
.handoff-preview-next { margin: 0 0 16px; font-size: var(--fs-md); color: var(--ink); }
|
||||
.handoff-preview-actions { display: flex; flex-wrap: wrap; gap: 10px; }
|
||||
.handoff-preview-actions .btn.danger { margin-left: auto; }
|
||||
.modal.handoff-read { width: min(960px, calc(100vw - 32px)); max-width: none; }
|
||||
@@ -334,8 +291,7 @@
|
||||
.handoff-body.md { max-width: none; }
|
||||
.modal.handoff-read .modal-actions { flex: none; }
|
||||
|
||||
/* A spec's Delete button sits beside its chip, not inside it: a button cannot
|
||||
hold a button. Quiet until the chip is hovered or focused. */
|
||||
/* Delete sits beside its chip (a button cannot hold a button); quiet until hover or focus. */
|
||||
.spec-chip-wrap { position: relative; display: flex; }
|
||||
.spec-chip-wrap.is-fixed .spec-chip:not(.is-sel) { opacity: 0.6; }
|
||||
.spec-chip-wrap .spec-chip { padding-right: 36px; }
|
||||
@@ -349,11 +305,11 @@
|
||||
place-items: center;
|
||||
padding: 0;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
color: var(--ink-3);
|
||||
font: inherit;
|
||||
font-size: 15px;
|
||||
font-size: var(--fs-base);
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
opacity: 0.55;
|
||||
@@ -361,11 +317,10 @@
|
||||
.spec-chip-wrap:hover .spec-chip-del,
|
||||
.spec-chip-del:focus-visible { opacity: 1; }
|
||||
.spec-chip-del:hover { color: var(--warn); border-color: var(--warn); opacity: 1; }
|
||||
.spec-chip-del:focus-visible { outline: 2px solid var(--warn); outline-offset: 1px; }
|
||||
.spec-chip-del:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.spec-chip-del:disabled { cursor: default; opacity: 0.3; }
|
||||
/* A fixed bug's Delete is always shown, as a pill at the chip's bottom right;
|
||||
the chip makes room below its lines so the pill never covers the name. The
|
||||
chip's is-fixed dimming targets .spec-chip, so the pill keeps full strength. */
|
||||
/* A fixed bug's Delete is always shown, a pill at the chip's bottom right with
|
||||
room below the lines. The is-fixed dimming targets .spec-chip, so the pill stays full strength. */
|
||||
.spec-chip-wrap.is-fixed .spec-chip { padding-right: 14px; padding-bottom: 36px; }
|
||||
.spec-chip-del-label {
|
||||
position: absolute;
|
||||
@@ -373,56 +328,44 @@
|
||||
bottom: 8px;
|
||||
padding: 2px 10px;
|
||||
border: 1px solid var(--warn);
|
||||
border-radius: 999px;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--panel);
|
||||
color: var(--warn);
|
||||
font: inherit;
|
||||
font-size: 12.5px;
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
cursor: pointer;
|
||||
}
|
||||
.spec-chip-del-label:hover:not(:disabled) { background: var(--warn-soft); }
|
||||
.spec-chip-del-label:focus-visible { outline: 2px solid var(--warn); outline-offset: 1px; }
|
||||
.spec-chip-del-label:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.spec-chip-del-label:disabled { cursor: default; opacity: 0.4; }
|
||||
.spec-chip-wrap.is-deleting .spec-chip { opacity: 0.5; }
|
||||
.delete-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; font-size: 13.5px; }
|
||||
.delete-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; font-size: var(--fs-md); }
|
||||
.delete-facts dt { color: var(--ink-3); }
|
||||
.delete-facts dd { margin: 0; overflow-wrap: anywhere; }
|
||||
.delete-confirm { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
|
||||
.delete-confirm { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-md); }
|
||||
.delete-confirm[hidden] { display: none; }
|
||||
.delete-confirm input {
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: var(--radius);
|
||||
background: var(--panel);
|
||||
color: var(--ink);
|
||||
font: inherit;
|
||||
}
|
||||
.delete-confirm input:focus-visible { outline: 2px solid var(--warn); outline-offset: 1px; }
|
||||
|
||||
/* ------------------------------------------------- dashboard confirm */
|
||||
|
||||
/* The beat between "I clicked a card" and "it is running": what the pick is,
|
||||
what it will do, and a START that means it. As wide as the menu (the page
|
||||
width setting), centered like the launching pane it precedes. */
|
||||
/* Between clicking a card and running it: what it is, what it will do, a
|
||||
START that means it. Menu width, centered like the launching pane. */
|
||||
.dash-confirm {
|
||||
max-width: min(var(--card-width), 100%);
|
||||
margin: 3vh auto 0;
|
||||
/* Column flex, not grid: a grid item's sticky range is its own row, so the
|
||||
tail bar below could never travel. align-items does the centering
|
||||
justify-items did; loop-setup opts back into grid. */
|
||||
tail bar could never travel. loop-setup opts back into grid. */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
text-align: center;
|
||||
/* Focused controls must land above the pinned bar, never under it:
|
||||
roughly .confirm-tail's height — keep them in step if the bar grows. */
|
||||
/* Focused controls land above the pinned bar: about .confirm-tail's height, keep in step. */
|
||||
scroll-padding-bottom: 96px;
|
||||
}
|
||||
|
||||
/* A smaller stage than the launching hero: the same sky, a moment shorter. */
|
||||
/* A smaller stage than the launching hero. */
|
||||
.confirm-stage { height: 130px; }
|
||||
.confirm-stage .sky .star { animation: star-fly var(--dur, 5s) linear var(--delay, 0s) infinite; }
|
||||
|
||||
@@ -438,38 +381,36 @@
|
||||
|
||||
.confirm-head { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
|
||||
.dash-confirm .dash-title { margin: 2px 0 0; }
|
||||
/* The pane is as wide as the menu, but prose is not: its lines stop at a
|
||||
readable measure while the controls below keep the full width. */
|
||||
/* Prose stops at a readable measure; the controls keep the full width. */
|
||||
.confirm-about, .confirm-detail, .confirm-spec { max-width: 70ch; }
|
||||
.confirm-about { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
|
||||
.confirm-detail { margin: 0; font-size: 13px; color: var(--accent); }
|
||||
.confirm-spec { margin: 0; font-size: 13px; color: var(--ink-2); }
|
||||
.confirm-spec code { font-family: var(--mono); font-size: 12px; }
|
||||
.confirm-about { margin: 0; font-size: var(--fs-base); line-height: 1.55; color: var(--ink-2); }
|
||||
.confirm-detail { margin: 0; font-size: var(--fs-sm); color: var(--accent); }
|
||||
.confirm-spec { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.confirm-spec code { font-family: var(--mono); font-size: var(--fs-xs); }
|
||||
.confirm-rule { width: 100%; height: 0; margin: 6px 0 2px; border: 0; border-top: 1px solid var(--accent); }
|
||||
.confirm-review { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; color: var(--ink-2); cursor: pointer; }
|
||||
.confirm-review input { accent-color: var(--accent, currentColor); }
|
||||
.confirm-cmd { margin: 2px 0 0; }
|
||||
.confirm-cmd code {
|
||||
font-family: var(--mono);
|
||||
font-size: 12.5px;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-2);
|
||||
background: var(--panel-2);
|
||||
border: 1px solid var(--rule);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 4px 10px;
|
||||
}
|
||||
.confirm-cmd-note { margin-left: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
|
||||
.confirm-cmd-note { margin-left: 8px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--accent); }
|
||||
.confirm-actions { display: flex; gap: 10px; margin-top: 10px; }
|
||||
|
||||
/* The command line and the buttons as one bar pinned to the pane's bottom
|
||||
edge: .dash-confirm is the scroller, so a last-child sticky tail stays in
|
||||
view whatever the Notebook box pushes past the fold. Opaque like .doc-head
|
||||
(the pane sits on var(--bg)), with the footer's border and shadow for
|
||||
separation; .confirm-actions keeps its own class so "Start" stays findable. */
|
||||
/* Command line and buttons as one bar pinned to the pane's bottom: .dash-confirm
|
||||
is the scroller, so the sticky last child stays in view past the Notebook box.
|
||||
Opaque like .doc-head, with the footer's border and shadow;
|
||||
.confirm-actions keeps its class so "Start" stays findable. */
|
||||
.confirm-tail {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
z-index: 5;
|
||||
z-index: var(--z-sticky);
|
||||
align-self: stretch;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
@@ -477,37 +418,29 @@
|
||||
padding: 10px 0 6px;
|
||||
background: var(--bg);
|
||||
border-top: 1px solid var(--rule);
|
||||
box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.07);
|
||||
box-shadow: var(--shadow-up);
|
||||
}
|
||||
/* The bar's gap sets the rhythm; the row's own margin is for loop-setup,
|
||||
which has no tail. */
|
||||
/* The bar's gap sets the rhythm; the row's margin is for loop-setup (no tail). */
|
||||
.confirm-tail .confirm-actions { margin-top: 0; }
|
||||
/* The Notebook box frames itself, so the rule line is one separation too
|
||||
many when it is on the pane; the shadow still marks the bar in a scroll. */
|
||||
/* The Notebook box has its own frame, so drop the rule; the shadow still marks the bar. */
|
||||
.dash-confirm:has(.confirm-note-box) .confirm-tail { border-top: 0; }
|
||||
|
||||
/* "Start with a note from your Notebook": the switch, then the tabs beside a
|
||||
preview of the picked one, its pictures each with a tick. */
|
||||
/* Capped rather than stretched past the confirm's centering, and left
|
||||
aligned: a note reads as a document, and documents have a measure. */
|
||||
/* Its own frame sets it apart from the text above, so no rule: just room. */
|
||||
/* "Start with a note from your Notebook": the switch, then tabs beside a
|
||||
preview, its pictures each with a tick. Capped and left aligned (a document
|
||||
has a measure); its own frame sets it apart, so no rule. */
|
||||
.confirm-note-box { display: grid; gap: 8px; width: min(720px, 100%); text-align: left; margin-top: 12px; }
|
||||
.confirm-note-head {
|
||||
display: grid;
|
||||
gap: 2px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--accent-line);
|
||||
border-left: 3px solid var(--accent);
|
||||
border-radius: 8px;
|
||||
background: var(--accent-soft);
|
||||
}
|
||||
.confirm-note-head.is-on { padding: 8px 12px; }
|
||||
.confirm-note-switch { display: flex; gap: 10px; align-items: center; color: var(--ink); font-weight: 600; cursor: pointer; }
|
||||
.confirm-note-switch input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent, currentColor); }
|
||||
.confirm-note-hint { padding-left: 28px; font-size: 12.5px; color: var(--ink-2); }
|
||||
.confirm-note-hint { padding-left: 28px; font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.confirm-note { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); gap: 10px; }
|
||||
.confirm-note > .confirm-note-msg { grid-column: 1 / -1; }
|
||||
.confirm-note-msg { margin: 0; font-size: 13px; color: var(--ink-3); }
|
||||
.confirm-note-msg { margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.confirm-note-tabs { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
|
||||
.confirm-note-tab {
|
||||
display: flex;
|
||||
@@ -515,18 +448,18 @@
|
||||
gap: 6px;
|
||||
padding: 6px 10px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--panel-2);
|
||||
color: var(--ink-2);
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.confirm-note-tab:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent); }
|
||||
.confirm-note-tab.is-picked { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
|
||||
.confirm-note-tab:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
.confirm-note-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
||||
.confirm-note-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.confirm-note-tab-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.confirm-note-preview {
|
||||
display: grid;
|
||||
@@ -537,14 +470,14 @@
|
||||
overflow-y: auto;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--panel);
|
||||
}
|
||||
.confirm-note-text { font-size: 13.5px; max-width: 65ch; }
|
||||
.confirm-note-long { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--warn); }
|
||||
.confirm-note-text { font-size: var(--fs-md); max-width: 65ch; }
|
||||
.confirm-note-long { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--warn); }
|
||||
.confirm-note-pics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
|
||||
.confirm-note-pic label { position: relative; display: block; cursor: pointer; }
|
||||
.confirm-note-pic img { display: block; width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--rule-2); border-radius: 6px; }
|
||||
.confirm-note-pic img { display: block; width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--rule-2); border-radius: var(--radius-sm); }
|
||||
.confirm-note-pic input { position: absolute; top: 4px; left: 4px; margin: 0; accent-color: var(--accent, currentColor); }
|
||||
.confirm-note-pic input:disabled + img { opacity: 0.45; }
|
||||
@media (max-width: 560px) {
|
||||
@@ -562,9 +495,7 @@
|
||||
justify-items: center;
|
||||
}
|
||||
|
||||
/* The same sky the dock fills behind Planny, here in a stage sized for a
|
||||
hero: the mask fades the stars at the edges exactly the way it does in
|
||||
the aside. */
|
||||
/* The dock's sky in a hero-sized stage; the mask fades the stars at the edges as in the aside. */
|
||||
.launch-stage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
@@ -574,8 +505,7 @@
|
||||
mask-image: radial-gradient(120% 100% at 50% 40%, #000 42%, transparent 78%);
|
||||
}
|
||||
.launch-sky { opacity: 0.9; }
|
||||
/* The dock only animates its stars while .is-flying; center stage they are
|
||||
the show, so the flight runs unconditionally. */
|
||||
/* The dock animates stars only while .is-flying; here the flight always runs. */
|
||||
.launch-stage .sky .star { animation: star-fly var(--dur, 5s) linear var(--delay, 0s) infinite; }
|
||||
|
||||
.launch-planny {
|
||||
@@ -585,25 +515,23 @@
|
||||
width: 74px;
|
||||
height: 102px;
|
||||
margin-left: -37px;
|
||||
/* The dock's flight keyframes carry the forward lean; a second, slower bob
|
||||
on top keeps a long wait from reading as a loop on rails. */
|
||||
/* The flight keyframes carry the lean; a slower bob keeps a long wait from looking like rails. */
|
||||
animation:
|
||||
planny-fly 1.7s ease-in-out infinite,
|
||||
launch-bob 3.4s ease-in-out infinite;
|
||||
}
|
||||
@keyframes launch-bob {
|
||||
0%, 100% { margin-bottom: 0; }
|
||||
50% { margin-bottom: 10px; }
|
||||
0%, 100% { translate: 0 0; }
|
||||
50% { translate: 0 -10px; }
|
||||
}
|
||||
|
||||
.launch-title { margin: 0; font: 600 clamp(24px, 4vw, 34px)/1.12 var(--serif); }
|
||||
.launch-quip {
|
||||
margin: 0;
|
||||
font-size: 14.5px;
|
||||
font-size: var(--fs-base);
|
||||
font-weight: 600;
|
||||
color: var(--accent);
|
||||
/* The line swaps on a timer; a minimum keeps the hint under it from
|
||||
hopping around as the words change length. */
|
||||
/* The line swaps on a timer; min-height keeps the hint from hopping. */
|
||||
min-height: 1.4em;
|
||||
animation: launch-quip-in 0.35s ease-out;
|
||||
}
|
||||
@@ -611,43 +539,46 @@
|
||||
from { opacity: 0; transform: translateY(5px); }
|
||||
to { opacity: 1; transform: none; }
|
||||
}
|
||||
.launch-hint { margin: 0; font-size: 12.5px; color: var(--ink-3); max-width: 46ch; }
|
||||
/* Under the app, a saved pick nobody collected: the button that types continue. */
|
||||
.launch-hint { margin: 0; font-size: var(--fs-sm); color: var(--ink-3); max-width: 46ch; }
|
||||
/* A saved pick nobody collected: the button that types continue. */
|
||||
.launch-reconnect { margin-top: 14px; }
|
||||
.launch-reconnect[hidden] { display: none; }
|
||||
/* A line, never a banner: no border, no background, no icon. */
|
||||
.approval-tip { max-width: 70ch; margin: 18px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
|
||||
/* Under the dashboard's cards it centers on the grid and runs most of its width. */
|
||||
.approval-tip { max-width: 70ch; margin: 18px 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-3); }
|
||||
/* Under the cards it centers on the grid. */
|
||||
.dash > .approval-tip { max-width: 140ch; margin-inline: auto; text-align: center; }
|
||||
|
||||
|
||||
/* --------------------------------------------- the Implementation Loop */
|
||||
|
||||
/* The card's own link; a span, since a link may not sit inside a button. */
|
||||
.dash-card-link { font-size: 12px; color: var(--accent); text-decoration: underline; cursor: pointer; justify-self: start; }
|
||||
/* A span: a link may not sit inside a button. */
|
||||
/* The loop card's wrapper: the card button, and its link under it. */
|
||||
.dash-card-wrap { display: flex; flex-direction: column; gap: 6px; }
|
||||
.dash-card-wrap > .dash-card { flex: 1 1 auto; }
|
||||
.dash-card-link { align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; font-size: var(--fs-xs); color: var(--accent); text-decoration: underline; cursor: pointer; }
|
||||
|
||||
/* The setup screen: the confirm pane's width, with a left-aligned form. */
|
||||
.loop-setup { display: grid; justify-items: stretch; text-align: left; gap: 14px; }
|
||||
.loop-setup .card-kicker, .loop-setup .dash-title, .loop-setup .confirm-spec { justify-self: start; }
|
||||
.loop-lines { display: grid; gap: 4px; }
|
||||
.loop-line { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); max-width: 75ch; }
|
||||
.loop-facts { display: grid; gap: 6px; margin: 0; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--rule); border-radius: 8px; }
|
||||
.loop-fact { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 10px; font-size: 13px; }
|
||||
.loop-line { margin: 0; font-size: var(--fs-md); line-height: 1.5; color: var(--ink-2); max-width: 75ch; }
|
||||
.loop-facts { display: grid; gap: 6px; margin: 0; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius-md); }
|
||||
.loop-fact { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 10px; font-size: var(--fs-sm); }
|
||||
.loop-fact dt { color: var(--ink-3); }
|
||||
.loop-fact dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
|
||||
.loop-form { display: grid; gap: 16px; }
|
||||
.loop-field { display: grid; gap: 6px; }
|
||||
.loop-label { margin: 0; font-weight: 600; font-size: 13.5px; }
|
||||
.loop-hint { margin: 0; font-size: 12.5px; color: var(--ink-3); }
|
||||
.loop-switch, .loop-radio { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: 14px; color: var(--ink-2); }
|
||||
.loop-label { margin: 0; font-weight: 600; font-size: var(--fs-md); }
|
||||
.loop-hint { margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.loop-switch, .loop-radio { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.loop-switch input, .loop-radio input { accent-color: var(--accent, currentColor); margin-top: 3px; }
|
||||
.loop-radios { display: grid; gap: 6px; }
|
||||
.loop-radio-body { display: grid; gap: 1px; }
|
||||
.loop-radio-detail { font-size: 12.5px; color: var(--ink-3); }
|
||||
.loop-radio-detail { font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.loop-switch.is-gray { opacity: 0.55; cursor: default; }
|
||||
.loop-switch[hidden] { display: none; }
|
||||
.loop-strength-none .linky { font-size: inherit; }
|
||||
.loop-strength-all { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
|
||||
.loop-strength-all { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.loop-strength-grid { position: relative; display: grid; gap: 6px; margin-top: 6px; }
|
||||
.loop-strength-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
|
||||
.loop-strength-line .step { fill: none; stroke: var(--ink-3); stroke-width: 3px; stroke-linecap: round; stroke-linejoin: round; }
|
||||
@@ -657,21 +588,23 @@
|
||||
.loop-strength-line .col.lvl-2 { stroke: var(--lvl-2); }
|
||||
.loop-strength-line .col.lvl-3 { stroke: var(--lvl-3); }
|
||||
.loop-strength-rows { display: grid; gap: 0; }
|
||||
.loop-strength-head, .loop-strength-row { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(130px, 1.5fr) repeat(4, minmax(0, 1fr)) 64px; align-items: center; column-gap: 4px; font-size: 13.5px; }
|
||||
.loop-strength-head, .loop-strength-row { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(130px, 1.5fr) repeat(4, minmax(0, 1fr)) 64px; align-items: center; column-gap: 4px; font-size: var(--fs-md); }
|
||||
.loop-strength-row { min-height: 46px; }
|
||||
.loop-strength-chip { justify-self: center; font-size: 12px; padding: 5px 9px; white-space: normal; text-align: center; line-height: 1.15; max-width: 100%; border-radius: 16px; }
|
||||
.loop-strength-chip { justify-self: center; font-size: var(--fs-xs); padding: 5px 9px; white-space: normal; text-align: center; line-height: 1.15; max-width: 100%; border-radius: 16px; /* one-off: a two-line chip, taller than a pill */ }
|
||||
.loop-strength-chip.is-unmapped { opacity: 0.5; }
|
||||
.loop-strength-phase { overflow-wrap: anywhere; color: var(--ink); padding-right: 8px; }
|
||||
.loop-strength-model { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; text-align: right; }
|
||||
.loop-strength-model { font-size: var(--fs-sm); color: var(--ink-3); overflow-wrap: anywhere; text-align: right; }
|
||||
.loop-strength-cell { --b: var(--lvl-0); position: relative; display: flex; align-items: center; justify-content: center; height: 46px; cursor: pointer; }
|
||||
.loop-strength-cell.lvl-1 { --b: var(--lvl-1); }
|
||||
.loop-strength-cell.lvl-2 { --b: var(--lvl-2); }
|
||||
.loop-strength-cell.lvl-3 { --b: var(--lvl-3); }
|
||||
.loop-strength-cell input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
|
||||
.loop-strength-node { box-sizing: border-box; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-3); background: var(--bg); display: grid; place-items: center; color: var(--bg); transition: all 0.12s; position: relative; z-index: 2; }
|
||||
.loop-strength-node { box-sizing: border-box; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-3); background: var(--bg); display: grid; place-items: center; color: var(--bg); transition: border-color var(--dur-1), background var(--dur-1), box-shadow var(--dur-1), transform var(--dur-1); position: relative; z-index: 2; }
|
||||
.loop-strength-cell:hover .loop-strength-node { border-color: var(--b); transform: scale(1.25); }
|
||||
.loop-strength-cell input:focus-visible + .loop-strength-node { outline: 2px solid var(--focus); outline-offset: 3px; }
|
||||
.loop-strength-cell input:checked + .loop-strength-node { width: 30px; height: 30px; background: var(--b); border-color: var(--b); box-shadow: 0 0 0 4px var(--bg); }
|
||||
.loop-strength-cell input:checked + .loop-strength-node.is-picked { animation: node-grow var(--dur-2) var(--ease-spring); }
|
||||
@keyframes node-grow { from { transform: scale(0.35); } }
|
||||
.loop-strength-node .sa-bars { display: none; }
|
||||
.loop-strength-cell input:checked + .loop-strength-node .sa-bars { display: inline-flex; }
|
||||
.loop-strength-cell.is-unmapped { cursor: default; }
|
||||
@@ -682,25 +615,25 @@
|
||||
/* Match my session has no rank: three flat bars, the middle one lighter. */
|
||||
.sa-bars.is-flat i:nth-child(n) { height: 7px; opacity: 1; }
|
||||
.sa-bars.is-flat i:nth-child(2) { opacity: 0.55; }
|
||||
.loop-select { font: inherit; font-size: 13.5px; padding: 5px 8px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--rule); border-radius: 6px; max-width: 100%; }
|
||||
.loop-select { max-width: 100%; }
|
||||
@media (max-width: 620px) {
|
||||
.loop-strength-head, .loop-strength-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
||||
.loop-strength-spacer, .loop-strength-model { display: none; }
|
||||
.loop-strength-phase { grid-column: 1 / -1; padding-top: 8px; }
|
||||
.loop-strength-chip { font-size: 10.5px; padding: 4px 6px; gap: 4px; flex-wrap: wrap; justify-content: center; }
|
||||
.loop-strength-chip { font-size: var(--fs-2xs); padding: 4px 6px; gap: 4px; flex-wrap: wrap; justify-content: center; }
|
||||
}
|
||||
.loop-ticks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-left: 4px; }
|
||||
.loop-text { font: inherit; font-size: 14px; padding: 6px 10px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--rule); border-radius: 6px; max-width: 520px; width: 100%; }
|
||||
.loop-text { max-width: 520px; width: 100%; }
|
||||
.loop-text.loop-narrow { width: 90px; }
|
||||
.loop-text.loop-param { width: 180px; }
|
||||
.loop-test { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
|
||||
.loop-test p { margin: 0; font-size: 12.5px; }
|
||||
.loop-number { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
|
||||
.loop-warn { margin: 0; font-size: 12.5px; color: var(--warn); }
|
||||
.loop-test p { margin: 0; font-size: var(--fs-sm); }
|
||||
.loop-number { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.loop-warn { margin: 0; font-size: var(--fs-sm); color: var(--warn); }
|
||||
.loop-start { display: grid; gap: 8px; justify-items: start; }
|
||||
.loop-why { margin: 0; font-size: 13px; color: var(--ink-2); }
|
||||
.loop-error { margin: 0; font-size: 13px; color: var(--warn); }
|
||||
.loop-problems { margin: 0; padding-left: 18px; font-size: 13px; color: var(--warn); }
|
||||
.loop-why { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.loop-error { margin: 0; font-size: var(--fs-sm); color: var(--warn); }
|
||||
.loop-problems { margin: 0; padding-left: 18px; font-size: var(--fs-sm); color: var(--warn); }
|
||||
.loop-help { margin-left: auto; }
|
||||
|
||||
/* A card the loop holds: a record with a tag, no inputs. */
|
||||
@@ -709,23 +642,19 @@
|
||||
|
||||
/* The stop and finish screens the loop's end draws. */
|
||||
.loop-end { display: grid; gap: 14px; }
|
||||
.loop-end-phases { width: 100%; border-collapse: collapse; font-size: 13.5px; }
|
||||
.loop-end-phases { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
|
||||
.loop-end-phases th, .loop-end-phases td { text-align: left; padding: 5px 10px 5px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
|
||||
.loop-end-phases code { font-family: var(--mono); font-size: 12px; }
|
||||
.loop-end-files { margin: 0; padding-left: 18px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
|
||||
.loop-end-phases code { font-family: var(--mono); font-size: var(--fs-xs); }
|
||||
.loop-end-files { margin: 0; padding-left: 18px; font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-2); }
|
||||
.loop-end-heading, .loop-end .loop-line { overflow-wrap: anywhere; }
|
||||
.loop-end .loop-why, .loop-end .loop-advice {
|
||||
padding: 9px 13px; border-left: 4px solid var(--warn); border-radius: 0 6px 6px 0;
|
||||
background: var(--warn-soft); color: var(--ink); font-size: 14px; line-height: 1.5; max-width: 75ch; margin: 0;
|
||||
}
|
||||
.loop-end .loop-advice { border-left-color: var(--accent); background: var(--accent-soft); }
|
||||
.loop-end .loop-advice strong { color: var(--accent); }
|
||||
/* Each button with one plain line under it saying what it does. */
|
||||
.loop-end .loop-why, .loop-end .loop-advice { font-size: var(--fs-md); line-height: 1.5; max-width: 75ch; margin: 0; }
|
||||
/* Each button has a line under it saying what it does. */
|
||||
.loop-end-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
|
||||
.loop-end-choice { display: grid; gap: 6px; align-content: start; justify-items: start; }
|
||||
.loop-end-choice .btn { max-width: 100%; }
|
||||
.loop-end-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
|
||||
.loop-end-safe { margin: 0; font-size: 13.5px; color: var(--ink-2); }
|
||||
.loop-end-hint { margin: 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); }
|
||||
.loop-end-safe { margin: 0; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.loop-end-details { display: grid; gap: 10px; }
|
||||
.loop-end-details > summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
|
||||
.loop-end-details > summary { cursor: pointer; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.loop-end-details[open] > summary { margin-bottom: 8px; }
|
||||
.confirm-note > .confirm-note-retry { justify-self: start; }
|
||||
@@ -6,14 +6,11 @@
|
||||
|
||||
.diff-view { --diff-gutter: 3.4em; --diff-sign: 1.6em; min-width: 0; }
|
||||
|
||||
.diff-totals { margin: 0 0 10px; color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
|
||||
.diff-notice {
|
||||
margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--stage); border-radius: 8px;
|
||||
background: var(--stage-soft); color: var(--ink); font-size: 13px;
|
||||
}
|
||||
.diff-totals { margin: 0 0 10px; color: var(--ink-2); font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
|
||||
.diff-notice { margin: 0 0 12px; padding: 8px 12px; font-size: var(--fs-sm); }
|
||||
.diff-plus { color: var(--ok); font-weight: 600; }
|
||||
.diff-minus { color: var(--warn); font-weight: 600; }
|
||||
.diff-counts { display: inline-flex; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
|
||||
.diff-counts { display: inline-flex; gap: 6px; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* Two columns, each scrolling inside itself: the tab never grows past the
|
||||
window, so the doc's head (with its way back to the sign-off card) stays in
|
||||
@@ -29,20 +26,14 @@
|
||||
}
|
||||
.diff-list:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
||||
.diff-file {
|
||||
display: grid; gap: 2px; padding: 7px 10px; border-radius: calc(var(--radius) / 2); cursor: pointer;
|
||||
display: grid; gap: 2px; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer;
|
||||
}
|
||||
.diff-file:hover { background: var(--panel-2); }
|
||||
.diff-file.is-picked { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
|
||||
.diff-file-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; min-width: 0; }
|
||||
.diff-file-name strong { font-weight: 600; overflow-wrap: anywhere; }
|
||||
.diff-file-dir { color: var(--ink-3); font-size: 12px; overflow-wrap: anywhere; }
|
||||
.diff-status {
|
||||
font: 700 10px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
|
||||
padding: 0 5px; border-radius: 4px; border: 1px solid var(--rule-2); color: var(--ink-2);
|
||||
}
|
||||
.diff-status-added { border-color: var(--ok); color: var(--ok); }
|
||||
.diff-status-deleted { border-color: var(--warn); color: var(--warn); }
|
||||
.diff-status-renamed { border-color: var(--accent); color: var(--accent); }
|
||||
.diff-file-dir { color: var(--ink-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
|
||||
.diff-status { text-transform: uppercase; }
|
||||
|
||||
/* The pane scrolls both ways, so the sideways scrollbar for a long line sits
|
||||
at the bottom of the pane, never under the file's last row. */
|
||||
@@ -58,7 +49,7 @@
|
||||
.diff-pane-path { font-weight: 600; overflow-wrap: anywhere; }
|
||||
|
||||
/* Long lines scroll sideways with the pane, all rows together, never the page. */
|
||||
.diff-rows { display: grid; min-width: 100%; width: max-content; font: 12px/1.55 var(--mono); }
|
||||
.diff-rows { display: grid; min-width: 100%; width: max-content; font: var(--fs-xs)/1.55 var(--mono); }
|
||||
.diff-hunk { padding: 3px 14px; color: var(--ink-3); background: var(--panel-2); white-space: pre; }
|
||||
.diff-line { display: grid; grid-template-columns: var(--diff-gutter) var(--diff-gutter) var(--diff-sign) auto; }
|
||||
.diff-no { text-align: right; padding-right: 8px; color: var(--ink-3); font-variant-numeric: tabular-nums; user-select: none; }
|
||||
@@ -76,14 +67,25 @@
|
||||
.diff-state { padding: 16px 18px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); }
|
||||
.diff-state.diff-error { border-color: var(--warn); background: var(--warn-soft); }
|
||||
.diff-state-msg { margin: 0 0 12px; }
|
||||
.diff-state-why { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }
|
||||
.diff-state-why { margin: 8px 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
|
||||
.diff-state-why:empty { display: none; }
|
||||
|
||||
/* Loading: muted rows where the list and the lines will be. */
|
||||
.diff-skeleton { display: grid; gap: 10px; padding: 14px; }
|
||||
.diff-skel-row { display: block; height: 14px; border-radius: 4px; background: var(--rule); }
|
||||
.diff-skel-row { display: block; height: 14px; border-radius: var(--radius-xs); background: var(--rule); }
|
||||
.diff-pane.diff-skeleton .diff-skel-row:nth-child(3n) { width: 70%; }
|
||||
.diff-pane.diff-skeleton .diff-skel-row:nth-child(4n + 1) { width: 85%; }
|
||||
.doc-skeleton .diff-skel-row:nth-child(3n) { width: 70%; }
|
||||
.doc-skeleton .diff-skel-row:nth-child(4n + 1) { width: 85%; }
|
||||
/* A shimmer only for people who have not asked for less motion. */
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.diff-skel-row {
|
||||
background: linear-gradient(90deg, var(--rule) 25%, var(--rule-2) 50%, var(--rule) 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: skel-shimmer 1.4s linear infinite;
|
||||
}
|
||||
@keyframes skel-shimmer { to { background-position: -200% 0; } }
|
||||
}
|
||||
|
||||
/* Narrow window: the file list stacks above the diff as a short list. */
|
||||
@media (max-width: 720px) {
|
||||
|
||||
@@ -8,36 +8,34 @@
|
||||
margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--rule);
|
||||
/* Stays put while the document scrolls under it. The ::before paints over
|
||||
the pane's own padding, so nothing shows through above the row. */
|
||||
position: sticky; top: 0; z-index: 5; background: var(--bg);
|
||||
position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg);
|
||||
}
|
||||
.doc-head::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px; background: var(--bg); }
|
||||
.doc-version { font: 700 12px/1 var(--mono); color: var(--ink-3); }
|
||||
.doc-version { font: 700 var(--fs-xs)/1 var(--mono); color: var(--ink-3); }
|
||||
|
||||
.block { max-width: min(var(--card-width), 100%); border-left: 3px solid transparent; padding: 2px 0 2px 14px; margin: 0 auto 4px; position: relative; }
|
||||
.block.assumed {
|
||||
border-left-color: var(--stage);
|
||||
border-left-style: dashed;
|
||||
background: var(--stage-soft);
|
||||
border-radius: 0 8px 8px 0;
|
||||
border-radius: 0 var(--radius-md) var(--radius-md) 0;
|
||||
}
|
||||
.block.draft { border-left-color: var(--rule-2); opacity: 0.72; }
|
||||
.block.settled { border-left-color: var(--ok-soft); }
|
||||
.block.settled { border-left-color: color-mix(in srgb, var(--ok) 45%, transparent); }
|
||||
.block .md { max-width: none; }
|
||||
|
||||
.block-tag {
|
||||
font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
|
||||
color: var(--stage); display: block; margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.doc-empty { color: var(--ink-3); font-style: italic; }
|
||||
|
||||
/* ----------------------------------------------------------- doc tools */
|
||||
|
||||
.doc-tools { display: flex; gap: 8px; margin-left: auto; flex: none; align-items: center; }
|
||||
.btn.back-home { border-color: var(--accent); color: var(--accent); }
|
||||
.btn.back-home:hover { background: var(--accent-soft); }
|
||||
.doc-saved { font-size: 12px; color: var(--ink-3); }
|
||||
.doc-saved code { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
|
||||
.doc-saved { font-size: var(--fs-xs); color: var(--ink-3); }
|
||||
.doc-saved code { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-2); }
|
||||
.doc-head { align-items: center; }
|
||||
|
||||
|
||||
@@ -48,14 +46,10 @@
|
||||
.proto-list { list-style: none; margin: 0 auto; padding: 0; max-width: min(var(--card-width), 100%); display: grid; gap: 8px; }
|
||||
.proto-open {
|
||||
width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
|
||||
padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px;
|
||||
padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius);
|
||||
background: var(--panel); color: var(--ink); font: inherit; cursor: pointer;
|
||||
}
|
||||
.proto-open:hover, .proto-open:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
|
||||
.proto-kind {
|
||||
flex: none; min-width: 44px; text-align: center; padding: 3px 6px; border-radius: 6px;
|
||||
font: 700 10.5px/1.2 var(--mono); letter-spacing: 0.05em; border: 1px solid var(--rule-2); color: var(--ink-2);
|
||||
}
|
||||
.proto-kind-html { border-color: var(--accent); color: var(--accent); }
|
||||
.proto-kind { flex: none; min-width: 44px; text-align: center; }
|
||||
.proto-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
|
||||
.proto-how { flex: none; font-size: 12px; color: var(--ink-3); }
|
||||
.proto-how { flex: none; font-size: var(--fs-xs); color: var(--ink-3); }
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
/* ----------------------------------------------------------- hand-off */
|
||||
|
||||
/* The end of the session. Accented edge because it is the one card on the
|
||||
page that is not a question and not a note: it is the way out. */
|
||||
/* Accented edge: the one card that is neither question nor note, the way out. */
|
||||
.card.handoff { border-color: var(--accent-line); }
|
||||
|
||||
.handoff-step {
|
||||
@@ -13,8 +12,7 @@
|
||||
border: 1px solid var(--accent-line);
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
/* Diagnose's saved write-up, whole, for pasting into a ticket elsewhere. It
|
||||
scrolls past a set height so Next step stays close below it. */
|
||||
/* Diagnose's write-up, for pasting into a ticket; scrolls so Next step stays close. */
|
||||
.handoff-report {
|
||||
margin: 20px 0 0;
|
||||
padding: 14px 18px 16px;
|
||||
@@ -33,19 +31,13 @@
|
||||
|
||||
.handoff-label {
|
||||
margin: 0 0 6px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.07em;
|
||||
text-transform: uppercase;
|
||||
color: var(--accent);
|
||||
}
|
||||
.handoff-where { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
|
||||
.handoff-where { margin: 0 0 10px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
|
||||
/* The command and its Copy share a row until the row will not take them.
|
||||
The text itself wraps: with the continue-in-the-browser sentence on the end
|
||||
it rarely fits one line, and a sideways scroll would hide exactly the part
|
||||
someone needs to read before pasting. Nobody retypes it; that is what Copy
|
||||
is for. */
|
||||
/* Command and Copy share a row until it is full. The text wraps: it rarely
|
||||
fits one line, and a sideways scroll would hide the part to read before
|
||||
pasting. */
|
||||
.handoff-command {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
@@ -55,34 +47,30 @@
|
||||
.handoff-code {
|
||||
flex: 1 1 260px;
|
||||
min-width: 0;
|
||||
font: 13px/1.5 var(--mono);
|
||||
font: var(--fs-sm)/1.5 var(--mono);
|
||||
color: var(--ink);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
padding: 10px 12px;
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
/* Always on show, unlike the Copy on a fenced code block, which waits for a
|
||||
hover it may never get. This one IS the screen's reason to exist. */
|
||||
/* Always visible, unlike a code block's hover-only Copy. */
|
||||
.handoff-copy { flex: none; }
|
||||
.handoff-note { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }
|
||||
.handoff-note { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.handoff-newsession { margin-top: 10px; }
|
||||
/* Continue here sits under the command row: keep a gap so the two do not touch. */
|
||||
/* Gap under the command row. */
|
||||
.continue-offer { margin-top: 14px; }
|
||||
|
||||
/* A session with nothing left to run. Quieter than a real next step: no
|
||||
accented box, plain body text and a small command, because there is
|
||||
nothing they need to do. */
|
||||
/* Nothing left to run: quieter than a next step, no accented box. */
|
||||
.handoff-done { margin: 18px 0 0; color: var(--ink-2); }
|
||||
.handoff-done-text p { margin: 0 0 10px; }
|
||||
.handoff-done .handoff-code { flex-basis: 180px; font-size: 12px; padding: 6px 10px; }
|
||||
.handoff-done .handoff-code { flex-basis: 180px; font-size: var(--fs-xs); padding: 6px 10px; }
|
||||
|
||||
|
||||
/* The review offer on a finished build. Louder than the next step, on
|
||||
purpose: it has to happen here, before they leave, while the next step can
|
||||
wait for a terminal. A solid accent edge and the big button carry that. */
|
||||
/* Review offer on a finished build. Louder than the next step on purpose: it
|
||||
must happen here, while the next step can wait for a terminal. */
|
||||
.review-offer {
|
||||
margin: 20px 0 0;
|
||||
padding: 18px 20px;
|
||||
@@ -90,35 +78,39 @@
|
||||
border-radius: var(--radius);
|
||||
background: var(--panel);
|
||||
}
|
||||
.review-offer-title { margin: 0 0 6px; font-size: 18px; }
|
||||
.review-offer-text { margin: 0; color: var(--ink-2); font-size: 14px; }
|
||||
.review-offer-title { margin: 0 0 6px; font-size: var(--fs-h3); }
|
||||
.review-offer-text { margin: 0; color: var(--ink-2); font-size: var(--fs-md); }
|
||||
.review-offer .btn-row { margin-top: 14px; }
|
||||
.review-offer .review-go { padding: 12px 26px; font-size: 15.5px; }
|
||||
.review-offer .review-go { padding: 12px 26px; font-size: var(--fs-h4); }
|
||||
.review-offer .handoff-command { margin-top: 10px; }
|
||||
|
||||
/* The way back to the dashboard on a finished screen. Quieter than the review
|
||||
offer: no box, just the button and a small note about the conversation. */
|
||||
/* Way back to the dashboard: quieter than the review offer, no box. */
|
||||
.dashboard-offer { margin: 20px 0 0; }
|
||||
.dashboard-offer > p:first-child { margin: 0; color: var(--ink-2); font-size: 14px; }
|
||||
.dashboard-offer > p:first-child { margin: 0; color: var(--ink-2); font-size: var(--fs-md); }
|
||||
.dashboard-offer .handoff-command { margin-top: 10px; }
|
||||
.dashboard-note { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }
|
||||
.handoff-fresh { margin: 16px 0 6px; font-size: 12.5px; color: var(--ink-2); }
|
||||
.handoff-fresh-row .handoff-code { flex-basis: 180px; font-size: 12px; padding: 6px 10px; }
|
||||
.dashboard-note { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.handoff-fresh { margin: 16px 0 6px; font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.handoff-fresh-row .handoff-code { flex-basis: 180px; font-size: var(--fs-xs); padding: 6px 10px; }
|
||||
|
||||
/* Quick picks under a long multi-select, the review's fix list above all. */
|
||||
/* "Closing or starting fresh": the finish's quiet extras, closed until asked for (open at a red meter). */
|
||||
.handoff-more { margin: 20px 0 0; }
|
||||
.handoff-more-title { cursor: pointer; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.handoff-more-title:hover { color: var(--ink); }
|
||||
.handoff-more > .handoff-guide { margin-top: 12px; }
|
||||
|
||||
/* Quick picks under a long multi-select. */
|
||||
.presets { margin-top: 12px; gap: 8px; }
|
||||
.presets-label { font-size: 12.5px; color: var(--ink-3); }
|
||||
.presets-label { font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
|
||||
/* "Before you close this": three rows on every finished screen. The icon sits
|
||||
in a colored circle and the label says the same thing, so no meaning rests
|
||||
on color alone. */
|
||||
/* "Before you close this": three rows. Icon and label say the same thing, so
|
||||
no meaning rests on color alone. */
|
||||
.handoff-guide {
|
||||
margin: 20px 0 0; padding: 14px 16px;
|
||||
background: var(--panel-2); border: 1px solid var(--rule-2); border-radius: var(--radius);
|
||||
}
|
||||
.handoff-guide-title { margin: 0 0 10px; font: 600 15px/1.3 var(--serif); color: var(--ink); }
|
||||
.handoff-guide-title { margin: 0 0 10px; font: 600 var(--fs-base)/1.3 var(--serif); color: var(--ink); }
|
||||
.handoff-guide-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
|
||||
.handoff-guide-row { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--ink-2); }
|
||||
.handoff-guide-row { display: flex; align-items: flex-start; gap: 12px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.handoff-guide-text { min-width: 0; overflow-wrap: anywhere; }
|
||||
.handoff-guide-label { color: var(--ink); }
|
||||
.handoff-guide-icon {
|
||||
@@ -133,22 +125,18 @@
|
||||
.handoff-tools { margin-top: 16px; }
|
||||
.handoff-unsent {
|
||||
margin: 14px 0 0;
|
||||
padding: 10px 14px;
|
||||
border-radius: 8px;
|
||||
background: var(--stage-soft);
|
||||
color: var(--stage);
|
||||
font-size: 13.5px;
|
||||
font-size: var(--fs-md);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------- stopping */
|
||||
|
||||
.stop-steps { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 10px; }
|
||||
.stop-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
|
||||
.stop-steps li { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.stop-steps li.is-done { color: var(--ink); }
|
||||
.stop-steps li.is-later { color: var(--ink-3); }
|
||||
.stop-steps li.is-stuck { color: var(--stage); }
|
||||
.stop-mark { width: 13px; flex: none; text-align: center; font-weight: 700; }
|
||||
.stop-steps li.is-done .stop-mark { color: var(--ok); }
|
||||
.stop-note { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
|
||||
.stop-note { margin: 0 0 12px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.stopping .handoff-command { margin-bottom: 4px; }
|
||||
|
||||
@@ -2,18 +2,16 @@
|
||||
|
||||
/* ------------------------------------------------------------ git board */
|
||||
|
||||
/* The git workflow's main column holds the board, and the agent's card sits
|
||||
inside it, in the card slot under the tab strip. A card that scrolled inside
|
||||
a scrolling board would put a scrollbar inside a scrollbar, so here the
|
||||
column takes the one scroll and both flow through it at natural height. */
|
||||
/* The agent's card sits in the board's card slot. A card scrolling inside a
|
||||
scrolling board nests scrollbars, so the column takes the one scroll and
|
||||
both flow at natural height. */
|
||||
.main:has(> .git-board) {
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
scrollbar-gutter: stable;
|
||||
}
|
||||
/* Listed with .is-primary.has-grow too: that rule (a card with a growing note
|
||||
box takes the column's height and shrinks into it) outranks a plain .card
|
||||
here, and a card shrunk under the board spilled its buttons beneath it. */
|
||||
/* .is-primary.has-grow is listed too: it outranks a plain .card, and a card
|
||||
shrunk under the board spilled its buttons beneath it. */
|
||||
.git-cards > .card,
|
||||
.git-cards > .card.is-primary.has-grow,
|
||||
.main:has(> .git-board) > .git-board {
|
||||
@@ -21,15 +19,12 @@
|
||||
overflow-y: visible;
|
||||
min-height: 0;
|
||||
}
|
||||
/* In the board's card slot a card's boxes cannot fill the column (it flows,
|
||||
it does not stretch), so a note box grows with what is typed instead,
|
||||
rather than scrolling inside a 96px box: an auto-height host does for the
|
||||
Markdown field what field-sizing did for the textarea. */
|
||||
/* The card flows rather than stretches, so a note box grows with the text
|
||||
instead of scrolling in a 96px box (an auto-height host, as field-sizing
|
||||
does for a textarea). */
|
||||
.git-cards > .card .md-host { min-height: 0; max-height: 50vh; }
|
||||
/* The card and the pager center themselves with auto inline margins, and a
|
||||
grid item with auto margins shrinks to its content, so a short confirm sat
|
||||
narrow in the middle of the board. In the slot both fill the board's width
|
||||
instead; the slot's gap spaces them. */
|
||||
/* Auto inline margins shrink a grid item to its content (a short confirm sat
|
||||
narrow mid-board), so in the slot both fill the width; the gap spaces them. */
|
||||
.git-cards > .card,
|
||||
.git-cards > .pager { margin: 0; }
|
||||
.main > .git-board {
|
||||
@@ -41,8 +36,7 @@
|
||||
gap: 14px;
|
||||
max-width: var(--card-width);
|
||||
}
|
||||
/* The board is sized by its column, not the window: the narrow layout keys
|
||||
off the board's own width. */
|
||||
/* Narrow layout keys off the board's width, not the window's. */
|
||||
.git-board { container-type: inline-size; container-name: git-board; }
|
||||
/* Plan2Code's card, between the tab strip and the tab's content. */
|
||||
.git-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
|
||||
@@ -62,24 +56,24 @@
|
||||
gap: 6px;
|
||||
padding: 8px 14px;
|
||||
border: 0;
|
||||
border-bottom: 3px solid transparent;
|
||||
border-radius: 6px 6px 0 0;
|
||||
border-bottom: 2px solid transparent;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
font: inherit;
|
||||
font-size: 14px;
|
||||
font-size: var(--fs-md);
|
||||
cursor: pointer;
|
||||
}
|
||||
.git-tab:hover { background: var(--panel-2); color: var(--ink); }
|
||||
.git-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
|
||||
.git-tab:hover { color: var(--ink); }
|
||||
.git-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
|
||||
.git-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
||||
.git-tab-badge {
|
||||
min-width: 18px;
|
||||
padding: 0 6px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 999px;
|
||||
border-radius: var(--radius-pill);
|
||||
font-family: var(--mono);
|
||||
font-size: 11.5px;
|
||||
font-size: var(--fs-xs);
|
||||
line-height: 17px;
|
||||
text-align: center;
|
||||
color: var(--ink-2);
|
||||
@@ -92,10 +86,8 @@
|
||||
.git-done:not(:disabled) { border-color: var(--accent); }
|
||||
|
||||
/* The next step: one primary button, at most one quieter one. */
|
||||
.git-step {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
padding: 14px 18px;
|
||||
.git-step { display: grid; gap: 6px; padding: 14px 18px; }
|
||||
.git-step:not(.callout) {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--accent-line);
|
||||
border-left-width: 4px;
|
||||
@@ -103,48 +95,33 @@
|
||||
}
|
||||
.git-step.is-warn { border-color: var(--stage); background: var(--stage-soft); }
|
||||
.git-step.is-calm { border-color: var(--ok); background: var(--ok-soft); }
|
||||
.git-step-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
|
||||
.git-step-kicker { color: var(--ink-2); }
|
||||
.git-step.is-calm .git-step-kicker { color: var(--ok); }
|
||||
.git-step-title, .git-op-title { margin: 0; font: 600 18px/1.25 var(--serif); }
|
||||
.git-step-why, .git-step-label { margin: 0; font-size: 14px; color: var(--ink-2); }
|
||||
.git-step-title, .git-op-title { margin: 0; font: 600 var(--fs-h3)/1.25 var(--serif); }
|
||||
.git-step-why, .git-step-label { margin: 0; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-step-label { font-weight: 600; color: var(--ink); }
|
||||
.git-step-actions, .git-sync-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
||||
.git-hint {
|
||||
justify-self: start;
|
||||
padding: 8px 12px;
|
||||
border: 1px dashed var(--accent-line);
|
||||
border-radius: var(--radius);
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
font: inherit;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.git-hint:hover { background: var(--accent-soft); }
|
||||
.git-hint:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
||||
.git-stale { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; color: var(--stage); }
|
||||
.git-held { font-size: 13.5px; color: var(--ink-2); }
|
||||
.git-hint { justify-self: start; border-style: dashed; font-weight: 400; }
|
||||
.git-stale { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-md); color: var(--stage); }
|
||||
.git-held { font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-held .md-p { margin: 0; }
|
||||
.git-wait { margin: 0; font-size: 13.5px; color: var(--stage); }
|
||||
.git-fresh { margin: 0; font-size: 13px; color: var(--ink-3); }
|
||||
.git-wait { margin: 0; font-size: var(--fs-md); color: var(--stage); }
|
||||
.git-fresh { margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.git-fresh.is-stale { color: var(--stage); }
|
||||
/* A landed result fills the step strip's place with two zones: the result
|
||||
itself (green, "Just landed") beside the leftover step (muted). The big
|
||||
headline belongs to what happened, not to the work that is not yours. */
|
||||
/* A landed result replaces the step strip with two zones: the result (green)
|
||||
beside the leftover step (muted). The headline goes to what happened. */
|
||||
.git-duo { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; align-items: start; }
|
||||
.git-landed, .git-left { display: grid; gap: 6px; padding: 14px 18px; border-radius: var(--radius); }
|
||||
.git-landed { background: var(--ok-soft); border: 1px solid var(--ok); border-left-width: 4px; }
|
||||
.git-landed .git-step-kicker { color: var(--ok); }
|
||||
.git-landed .git-result-body { font-size: 14px; color: var(--ink-2); }
|
||||
.git-landed .git-result-body { font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-landed .git-result-body .md-p { margin: 0; }
|
||||
.git-left { background: var(--panel-2); border: 1px solid var(--rule-2); }
|
||||
.git-left .git-step-title { font-size: 16px; }
|
||||
.git-left .git-step-title { font-size: var(--fs-h4); }
|
||||
.git-panel-tab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
|
||||
.git-changes, .git-sync { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
|
||||
.git-sweep-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink-2); }
|
||||
.git-sweep-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-pr-open.is-disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
/* The board's header is a section lead, not a card: the framed elements are
|
||||
the agent's card in the slot and the next step under it. */
|
||||
/* The header is a section lead, not a card. */
|
||||
.git-head {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
@@ -152,40 +129,24 @@
|
||||
border-bottom: 1px solid var(--rule);
|
||||
}
|
||||
.git-head-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
|
||||
.git-branch { margin: 0; font: 600 22px/1.2 var(--serif); overflow-wrap: anywhere; }
|
||||
/* The branch name as a link to its host: it reads as the title until hovered. */
|
||||
.git-branch { margin: 0; font: 600 var(--fs-h2)/1.2 var(--serif); overflow-wrap: anywhere; }
|
||||
/* Branch name as a host link: reads as the title until hovered. */
|
||||
.git-branch-link { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-2); text-decoration-thickness: 1px; text-underline-offset: 4px; }
|
||||
.git-branch-link::after { content: " ↗"; font: 400 14px/1 var(--mono); color: var(--ink-2); }
|
||||
/* No arrow glyph: the link's title says it opens the remote in the browser. */
|
||||
.git-branch-link:hover, .git-branch-link:focus-visible { color: var(--accent); text-decoration-color: currentColor; }
|
||||
.git-track { font-family: var(--mono); font-size: 14px; color: var(--ink-2); }
|
||||
.git-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13.5px; color: var(--ink-2); }
|
||||
.git-track { font-family: var(--mono); font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-noremote { font-weight: 600; color: var(--stage); }
|
||||
/* The ring sits on the first line of a wrapped activity, as the dock's does. */
|
||||
/* Ring on the first line of a wrapped activity, as in the dock. */
|
||||
.git-activity { display: flex; align-items: flex-start; gap: 8px; color: var(--accent); }
|
||||
.git-activity .spinner.tiny { margin-top: 0.25em; }
|
||||
.git-pr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid var(--rule); }
|
||||
.git-pr-open { text-decoration: none; }
|
||||
.git-pr-ask { font-size: 14px; color: var(--ink); }
|
||||
.git-pr-base { font-size: 13.5px; color: var(--ink-2); }
|
||||
.git-pr-base select, .git-field select, .git-field input, .git-search {
|
||||
font: inherit;
|
||||
font-size: 14px;
|
||||
padding: 6px 10px;
|
||||
color: var(--ink);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.git-warn, .git-op {
|
||||
padding: 12px 16px;
|
||||
border: 1px solid var(--warn);
|
||||
border-left-width: 4px;
|
||||
border-radius: var(--radius);
|
||||
background: var(--warn-soft);
|
||||
color: var(--ink);
|
||||
}
|
||||
.git-op { display: grid; gap: 8px; border-color: var(--stage); background: var(--stage-soft); }
|
||||
.git-op-files { margin: 0; padding-left: 20px; font-size: 13.5px; }
|
||||
.git-pr-ask { font-size: var(--fs-md); color: var(--ink); }
|
||||
.git-pr-base { font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-warn, .git-op { padding: 12px 16px; }
|
||||
.git-op { display: grid; gap: 8px; }
|
||||
.git-op-files { margin: 0; padding-left: 20px; font-size: var(--fs-md); }
|
||||
.git-op-left { color: var(--warn); }
|
||||
.git-op-clear { color: var(--ok); }
|
||||
.git-op-actions, .git-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
||||
@@ -195,10 +156,10 @@
|
||||
border: 1px solid var(--accent-line);
|
||||
border-radius: var(--radius);
|
||||
background: var(--accent-soft);
|
||||
font-size: 14px;
|
||||
font-size: var(--fs-md);
|
||||
}
|
||||
.git-result-body .md-p { margin: 4px 0 0; }
|
||||
/* The result box is the line length here: git's stderr runs the full width. */
|
||||
/* Git's stderr runs the full width. */
|
||||
.git-result-body.md { max-width: none; }
|
||||
.git-panel {
|
||||
display: grid;
|
||||
@@ -209,31 +170,26 @@
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
.git-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
||||
.git-panel-title { margin: 0; font-size: 16px; }
|
||||
.git-group-title { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }
|
||||
.git-panel-title { margin: 0; font-size: var(--fs-h4); }
|
||||
.git-group-title { margin: 4px 0 0; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-field-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
|
||||
.git-field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
|
||||
.git-field { display: grid; gap: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.git-field.is-wide { flex: 1 1 16em; }
|
||||
.git-new-name { font-family: var(--mono); }
|
||||
.git-name-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; color: var(--ink-2); }
|
||||
.git-name-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.git-name-status.is-free { color: var(--ok); }
|
||||
.git-name-status.is-invalid, .git-name-status.is-nested { color: var(--warn); }
|
||||
.git-name-status.is-local, .git-name-status.is-remote { color: var(--stage); }
|
||||
.git-offer { margin: 0 auto 0 0; font-size: 14px; }
|
||||
.git-sweep { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-family: var(--mono); font-size: 13.5px; }
|
||||
.git-offer { margin: 0 auto 0 0; font-size: var(--fs-md); }
|
||||
.git-sweep { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-family: var(--mono); font-size: var(--fs-md); }
|
||||
.git-ignore { margin-left: 8px; white-space: nowrap; }
|
||||
.git-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
|
||||
.git-search { flex: 1 1 auto; }
|
||||
.git-branches { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
|
||||
.git-table-wrap { overflow-x: auto; }
|
||||
.git-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
|
||||
.git-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
|
||||
.git-table th {
|
||||
text-align: left;
|
||||
font-size: 11.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-3);
|
||||
padding: 6px 8px;
|
||||
border-bottom: 1px solid var(--rule);
|
||||
}
|
||||
@@ -241,25 +197,21 @@
|
||||
.git-table tr.is-current td { background: var(--accent-soft); }
|
||||
.git-table tr.is-held td { color: var(--ink-2); }
|
||||
.git-cell-name { overflow-wrap: anywhere; }
|
||||
/* A branch name stays whole beside its badges (feature/export-csv never splits
|
||||
as feature/export- / csv), and the headers stay on one line: a narrow column
|
||||
scrolls the table sideways instead. */
|
||||
/* Branch names never split beside badges, and headers stay on one line: a
|
||||
narrow column scrolls the table sideways. */
|
||||
.git-cell-name .git-name { white-space: nowrap; }
|
||||
.git-table th { white-space: nowrap; }
|
||||
.git-name, .git-path { font-family: var(--mono); }
|
||||
.git-badge { margin-left: 6px; font-size: 10px; padding: 2px 6px; }
|
||||
.git-badge.is-merged { color: var(--ok); background: var(--ok-soft); border-color: var(--ok); }
|
||||
.git-badge.is-gone, .git-badge.is-held { color: var(--stage); background: var(--stage-soft); border-color: var(--stage); }
|
||||
.git-badge { margin-left: 6px; }
|
||||
.git-cell-track { font-family: var(--mono); white-space: nowrap; color: var(--ink-2); }
|
||||
/* Stacked with blocks, not `display: grid`: a grid <td> stops being a table
|
||||
cell, and its row's separator no longer lines up with the others. */
|
||||
/* Blocks, not `display: grid`: a grid <td> stops being a table cell and its
|
||||
row separator misaligns. */
|
||||
.git-cell-last > span { display: block; }
|
||||
.git-cell-last > .git-by { margin-top: 2px; }
|
||||
.git-by { font-size: 12px; color: var(--ink-3); }
|
||||
.git-by { font-size: var(--fs-xs); color: var(--ink-3); }
|
||||
.git-cell-actions { white-space: nowrap; text-align: right; }
|
||||
.git-cell-actions .btn + .btn { margin-left: 6px; }
|
||||
.git-remote-only summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
|
||||
.git-empty { margin: 0; font-size: 13.5px; color: var(--ink-3); }
|
||||
|
||||
/* Last on purpose: the narrow layout overrides the board rules above it. */
|
||||
@container git-board (max-width: 720px) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
}
|
||||
.modal.help[open] { display: flex; }
|
||||
.modal.help .modal-actions { flex: none; margin-top: 16px; align-items: center; }
|
||||
.help-version { margin-right: auto; font-size: 12.5px; color: var(--ink-3); }
|
||||
.help-version { margin-right: auto; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.help-version a { color: inherit; }
|
||||
|
||||
.help-layout {
|
||||
@@ -22,6 +22,12 @@
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
.help-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
|
||||
.help-filter { width: 100%; min-height: 32px; padding: 4px 10px; font: inherit; font-size: var(--fs-md); }
|
||||
.help-filter-empty { margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.help-tab-group { margin: 10px 0 2px; padding: 0 13px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
|
||||
.help-tab-group:first-child { margin-top: 0; }
|
||||
.help-tab-group[hidden], .help-tab[hidden] { display: none; }
|
||||
.help-tabs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -37,19 +43,19 @@
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
padding: 8px 10px;
|
||||
padding: 8px 10px 8px 13px;
|
||||
border: 0;
|
||||
border-left: 3px solid transparent;
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
font: inherit;
|
||||
font-size: 13.5px;
|
||||
font-size: var(--fs-md);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.help-tab:hover { background: var(--panel-2); color: var(--ink); }
|
||||
.help-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
|
||||
/* The selected bar is an inset shadow, not a border, so it stays straight against the rounded corners. */
|
||||
.help-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
|
||||
.help-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
||||
.help-tab-icon {
|
||||
width: 18px;
|
||||
@@ -63,18 +69,18 @@
|
||||
}
|
||||
.help-tab:hover .help-tab-icon { stroke: var(--accent); }
|
||||
|
||||
.help-panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
|
||||
.help-panel h3 { font: 600 18px/1.3 var(--serif); margin: 0 0 12px; color: var(--accent); }
|
||||
.help-panel p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
|
||||
.help-panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
|
||||
.help-panel h3 { font: 600 var(--fs-h3)/1.3 var(--serif); margin: 0 0 12px; color: var(--accent); }
|
||||
.help-panel p { margin: 0 0 12px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.help-panel p:last-child { margin-bottom: 0; }
|
||||
.help-panel strong { color: var(--ink); }
|
||||
.help-panel .help-lead { font-size: 14.5px; color: var(--ink); margin-bottom: 16px; }
|
||||
.help-panel h4 { font: 600 14px/1.35 var(--sans); margin: 18px 0 6px; color: var(--ink); }
|
||||
.help-panel .help-lead { font-size: var(--fs-base); color: var(--ink); margin-bottom: 16px; }
|
||||
.help-panel h4 { font: 600 var(--fs-md)/1.35 var(--sans); margin: 18px 0 6px; color: var(--ink); }
|
||||
.help-panel ul,
|
||||
.help-panel ol { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); }
|
||||
.help-panel ol { margin: 0 0 12px; padding-left: 20px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.help-panel li { margin-bottom: 5px; }
|
||||
.help-panel li:last-child { margin-bottom: 0; }
|
||||
.help-panel table { border-collapse: collapse; width: 100%; margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
|
||||
.help-panel table { border-collapse: collapse; width: 100%; margin: 0 0 12px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.help-panel th,
|
||||
.help-panel td { border: 1px solid var(--rule); padding: 7px 10px; text-align: left; vertical-align: top; }
|
||||
.help-panel th { background: var(--panel-2); font-weight: 600; color: var(--ink); }
|
||||
@@ -82,7 +88,7 @@
|
||||
font: 0.88em var(--mono);
|
||||
background: var(--panel-2);
|
||||
border: 1px solid var(--rule);
|
||||
border-radius: 4px;
|
||||
border-radius: var(--radius-xs);
|
||||
padding: 1px 5px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
@@ -94,17 +100,16 @@
|
||||
.help-panel .help-callout {
|
||||
display: flex; align-items: flex-start; gap: 12px;
|
||||
margin: 0 0 16px; padding: 12px 14px;
|
||||
background: var(--stage-soft); border: 1px solid var(--stage); border-left-width: 4px; border-radius: var(--radius);
|
||||
}
|
||||
.help-callout-icon { flex: none; width: 22px; height: 22px; margin-top: 1px; fill: none; stroke: var(--stage); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.help-panel .help-callout-label { display: block; margin-bottom: 2px; font-size: 14px; color: var(--ink); }
|
||||
.help-panel .help-callout-label { display: block; margin-bottom: 2px; font-size: var(--fs-md); color: var(--ink); }
|
||||
.help-panel .help-callout p { margin: 0; color: var(--ink); }
|
||||
.help-panel ol.help-rows { list-style: none; margin: 0 0 12px; padding: 0; }
|
||||
.help-row { margin: 0 0 8px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius); }
|
||||
.help-panel .help-row:last-child { margin-bottom: 0; }
|
||||
.help-row dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; }
|
||||
.help-row dt { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-2); padding-top: 1px; }
|
||||
.help-row dd { margin: 0; font-size: 13.5px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
|
||||
.help-row dt { color: var(--ink-2); padding-top: 1px; }
|
||||
.help-row dd { margin: 0; font-size: var(--fs-md); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
|
||||
@media (max-width: 520px) {
|
||||
.help-row dl { grid-template-columns: 1fr; gap: 0; }
|
||||
.help-row dt { margin-top: 6px; }
|
||||
@@ -113,10 +118,10 @@
|
||||
.help-panel .handoff-command { margin: 0 0 12px; }
|
||||
.help-panel .handoff-command:last-child { margin-bottom: 0; }
|
||||
.help-panel .handoff-code {
|
||||
font: 13px/1.5 var(--mono);
|
||||
font: var(--fs-sm)/1.5 var(--mono);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
@@ -141,13 +146,13 @@
|
||||
theme and the chosen highlight without a line of script. */
|
||||
.help-figure { margin: 4px 0 16px; }
|
||||
.help-figure figcaption,
|
||||
.help-moods-title { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
|
||||
.help-moods-title { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.help-diagram { display: block; width: 100%; max-width: 560px; height: auto; margin: 8px 0 4px; }
|
||||
.hd-box { fill: var(--panel-2); stroke: var(--rule-2); stroke-width: 1.2; }
|
||||
.hd-line { fill: none; stroke: var(--ink-3); stroke-width: 1.4; }
|
||||
.hd-dash { stroke-dasharray: 4 4; }
|
||||
.hd-label { fill: var(--ink); font: 13px var(--sans); }
|
||||
.hd-label.small { fill: var(--ink-2); font-size: 12px; }
|
||||
.hd-label { fill: var(--ink); font: var(--fs-sm) var(--sans); }
|
||||
.hd-label.small { fill: var(--ink-2); font-size: var(--fs-xs); }
|
||||
.hd-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
|
||||
.hd-label.hd-accent { fill: var(--accent); stroke: none; font-weight: 600; }
|
||||
.hd-flow { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 10; stroke-linecap: round; }
|
||||
@@ -160,7 +165,7 @@
|
||||
}
|
||||
.help-mood { display: flex; flex-direction: column; align-items: center; gap: 6px; }
|
||||
.help-mood-bot { width: 40px; height: 56px; }
|
||||
.help-mood span { font-size: 12.5px; color: var(--ink-2); text-align: center; }
|
||||
.help-mood span { font-size: var(--fs-sm); color: var(--ink-2); text-align: center; }
|
||||
|
||||
/* The traveling highlight on the flow diagrams: only on the visible panel,
|
||||
only while the dialog is open, and only when the system allows motion.
|
||||
@@ -173,20 +178,20 @@
|
||||
@media (max-width: 720px) {
|
||||
.help-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 12px; }
|
||||
.help-tabs { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 0 0 4px; }
|
||||
.help-tab-group { display: none; }
|
||||
.help-tab {
|
||||
width: auto;
|
||||
flex: none;
|
||||
white-space: nowrap;
|
||||
border-left: 0;
|
||||
border-bottom: 3px solid transparent;
|
||||
border-radius: 6px 6px 0 0;
|
||||
padding-left: 10px;
|
||||
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
|
||||
}
|
||||
.help-tab[aria-selected="true"] { border-bottom-color: var(--accent); }
|
||||
.help-tab[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--accent); }
|
||||
}
|
||||
|
||||
.about-live {
|
||||
padding: 9px 12px;
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--panel-2);
|
||||
border: 1px solid var(--rule);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/* Learning on the dashboard: the slim row (screens/learning-row.js) and the
|
||||
waiting banner. From the saved prototype's variant A
|
||||
(specs/project-learning/prototypes/learning-row.html), on the page's own
|
||||
tokens: the prototype's hold color is --stage, its border --rule. */
|
||||
waiting banner. Hold color is --stage, border --rule. */
|
||||
|
||||
/* The row. Under the spec picker while it needs the person (not set up, off,
|
||||
/* The row: under the spec picker while it needs the person (not set up, off,
|
||||
paused); after the last card group while on. */
|
||||
.learn-row { position: relative; }
|
||||
.learn-row.is-top { margin: 0 0 22px; }
|
||||
@@ -16,32 +14,19 @@
|
||||
padding: 8px 12px;
|
||||
border-top: 1px solid var(--rule);
|
||||
border-bottom: 1px solid var(--rule);
|
||||
font-size: 14px;
|
||||
font-size: var(--fs-md);
|
||||
color: var(--ink);
|
||||
}
|
||||
/* Paused for you: the amber tint, so a paused person sees it at a glance. */
|
||||
/* Paused: amber tint, visible at a glance. */
|
||||
.learn-row.is-paused .learn-line {
|
||||
background: var(--stage-soft);
|
||||
border: 1px solid var(--stage);
|
||||
border-radius: calc(var(--radius) * 0.7);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
.learn-label { font-weight: 650; }
|
||||
.learn-pill {
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
padding: 2px 8px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 999px;
|
||||
color: var(--ink-3);
|
||||
}
|
||||
.learn-pill.is-on { color: var(--accent); border-color: var(--accent); }
|
||||
.learn-pill.is-hold { color: var(--stage); border-color: var(--stage); }
|
||||
.learn-label { font-weight: 600; }
|
||||
.learn-say { flex: 1 1 14em; min-width: 0; color: var(--ink-3); }
|
||||
.learn-row.is-paused .learn-say { color: var(--ink); }
|
||||
.learn-controls { margin-left: auto; display: flex; align-items: center; gap: 12px; }
|
||||
.learn-controls .btn { margin: 0; }
|
||||
|
||||
/* Pause for me: a sliding switch. Amber while paused. */
|
||||
.learn-switch {
|
||||
@@ -63,7 +48,7 @@
|
||||
width: 34px;
|
||||
height: 20px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 999px;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--bg);
|
||||
border: 1px solid var(--rule-2);
|
||||
}
|
||||
@@ -76,15 +61,15 @@
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
background: var(--ink-3);
|
||||
transition: left 0.15s ease;
|
||||
transition: transform var(--dur-1);
|
||||
}
|
||||
.learn-switch.is-on .learn-track { background: var(--stage); border-color: var(--stage); }
|
||||
.learn-switch.is-on .learn-track::after { left: 16px; background: var(--panel); }
|
||||
.learn-switch.is-on .learn-track::after { transform: translateX(14px); background: var(--panel); }
|
||||
.learn-switch:hover:not(:disabled) .learn-track { border-color: var(--accent); }
|
||||
|
||||
.learn-link {
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
min-height: 24px;
|
||||
padding: 0 4px;
|
||||
background: none;
|
||||
@@ -96,14 +81,14 @@
|
||||
.learn-link:hover { text-decoration-thickness: 2px; }
|
||||
.learn-switch:focus-visible,
|
||||
.learn-link:focus-visible,
|
||||
.learn-more-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
||||
.learn-more-item:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
|
||||
/* More: at the bottom of the page, so it opens upward. */
|
||||
.learn-more {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 100%;
|
||||
z-index: 5;
|
||||
z-index: var(--z-sticky);
|
||||
min-width: 17em;
|
||||
margin: 0 0 4px;
|
||||
padding: 4px;
|
||||
@@ -111,100 +96,88 @@
|
||||
text-align: left;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--rule);
|
||||
border-radius: calc(var(--radius) * 0.7);
|
||||
box-shadow: var(--shadow);
|
||||
font-size: 13.5px;
|
||||
border-radius: var(--radius-md);
|
||||
box-shadow: var(--shadow-2);
|
||||
font-size: var(--fs-md);
|
||||
color: var(--ink);
|
||||
}
|
||||
.learn-more[hidden] { display: none; }
|
||||
.learn-more-item { padding: 7px 10px; border-radius: calc(var(--radius) * 0.5); cursor: pointer; }
|
||||
.learn-more-item { padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; }
|
||||
.learn-more-item:hover,
|
||||
.learn-more-item:focus { background: var(--accent-soft); outline: none; }
|
||||
.learn-more-item:focus { background: var(--accent-soft); }
|
||||
.learn-more-item.is-danger { color: var(--warn); border-top: 1px solid var(--rule); border-top-left-radius: 0; border-top-right-radius: 0; }
|
||||
.learn-more-item[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
|
||||
.learn-more-item[aria-disabled="true"]:hover { background: none; }
|
||||
|
||||
/* Lessons waiting: the banner nearest the title, in the accent tint. */
|
||||
.dash-nudge.learn-banner { border-left-width: 4px; }
|
||||
.learn-banner .btn { margin: 0 0 0 auto; }
|
||||
.learn-banner .btn { margin-left: auto; }
|
||||
|
||||
/* Open the lessons: each file under its own name. */
|
||||
.learn-lessons-file + .learn-lessons-file { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
|
||||
.learn-lessons-name { margin: 0 0 6px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
|
||||
.learn-lessons-name { margin: 0 0 6px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
|
||||
/* The lessons card (screens/cards.js buildLessons): one block per waiting
|
||||
item, each with its own choices and nothing chosen at first. */
|
||||
.lessons-opening { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-3); }
|
||||
/* The lessons card (cards.js buildLessons): one block per item, none chosen at first. */
|
||||
.lessons-opening { margin: 14px 0 0; font-size: var(--fs-md); color: var(--ink-3); }
|
||||
.lessons-rows { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
|
||||
.lessons-row {
|
||||
padding: 12px 14px;
|
||||
border: 1px solid var(--rule);
|
||||
border-radius: calc(var(--radius) * 0.7);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--panel);
|
||||
}
|
||||
.lessons-row.is-chosen { border-color: var(--accent); }
|
||||
.lessons-row p { margin: 0 0 6px; }
|
||||
.lessons-heading { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
|
||||
.lessons-heading { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
|
||||
.lessons-text { font-weight: 600; color: var(--ink); }
|
||||
.lessons-why,
|
||||
.lessons-found { font-size: 13.5px; color: var(--ink-2); }
|
||||
.lessons-found { font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.lessons-origin,
|
||||
.lessons-note { font-size: 12.5px; color: var(--ink-3); }
|
||||
.lessons-fix-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
|
||||
.lessons-note { font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.lessons-fix blockquote {
|
||||
margin: 0 0 8px;
|
||||
padding: 6px 10px;
|
||||
border-left: 3px solid var(--rule-2);
|
||||
font-family: var(--mono);
|
||||
font-size: 12.5px;
|
||||
font-size: var(--fs-sm);
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.lessons-fix .lessons-after { border-left-color: var(--accent); }
|
||||
.lessons-become { margin: 0 0 6px; padding-left: 18px; font-size: 13.5px; }
|
||||
.lessons-become { margin: 0 0 6px; padding-left: 18px; font-size: var(--fs-md); }
|
||||
/* Flagged and refused: said in words, not only in color. */
|
||||
.lessons-flag,
|
||||
.lessons-refused {
|
||||
padding: 5px 9px;
|
||||
border-radius: calc(var(--radius) * 0.5);
|
||||
font-size: 13px;
|
||||
background: var(--stage-soft);
|
||||
color: var(--ink);
|
||||
}
|
||||
.lessons-refused { background: var(--warn-soft); color: var(--warn); }
|
||||
.lessons-refused { padding: 5px 9px; font-size: var(--fs-sm); }
|
||||
.lessons-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
|
||||
.lessons-choices .btn { margin: 0; }
|
||||
.lessons-edit { margin-top: 10px; display: grid; gap: 8px; }
|
||||
.lessons-field { margin: 0; }
|
||||
.lessons-input,
|
||||
.lessons-select { width: 100%; box-sizing: border-box; }
|
||||
.lessons-error { margin: 10px 0 0; }
|
||||
.lessons-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
|
||||
.lessons-summary { margin: 0; font-size: 13.5px; color: var(--ink-2); }
|
||||
.lessons-foot .btn { margin: 0 0 0 auto; }
|
||||
.lessons-summary { margin: 0; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.lessons-foot .btn { margin-left: auto; }
|
||||
.lessons-first-lesson {
|
||||
margin: 14px 0 0;
|
||||
padding: 12px 14px;
|
||||
border-left: 4px solid var(--accent);
|
||||
background: var(--accent-soft);
|
||||
border-radius: calc(var(--radius) * 0.5);
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
.lessons-first-lesson p { margin: 0 0 4px; }
|
||||
.lessons-first-about { margin: 12px 0 0; }
|
||||
.lessons-later { margin-top: 8px; }
|
||||
|
||||
/* Review from the dashboard: the same card in a dialog over the menu. Sized
|
||||
like the Notebook dialog; max-width: none lifts the base .modal 440px cap. */
|
||||
/* Review: the same card in a dialog, sized like the Notebook; max-width: none
|
||||
lifts the base .modal 440px cap. */
|
||||
.modal.lessons-dialog { width: min(1200px, 90vw); max-width: none; }
|
||||
.lessons-dialog .card { margin: 0; box-shadow: none; border: 0; padding: 0; max-width: none; }
|
||||
|
||||
/* The lessons dialog: closable (the corner ×, Not now, Escape), and locked
|
||||
while Save lessons goes. */
|
||||
/* Closable (corner x, Not now, Escape), locked while saving. */
|
||||
.lessons-dialog .modal-actions { align-items: center; justify-content: flex-end; }
|
||||
.lessons-dialog .modal-actions .btn { margin: 0; }
|
||||
.lessons-suggestions { flex: 1 1 100%; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: calc(var(--radius) * 0.5); }
|
||||
.lessons-suggestions h3 { margin: 0 0 6px; font-size: 13.5px; }
|
||||
.lessons-suggestions .md { max-height: 40vh; overflow: auto; font-size: 13.5px; }
|
||||
.lessons-suggestions { flex: 1 1 100%; }
|
||||
.lessons-suggestions h3 { margin: 0 0 6px; font-size: var(--fs-md); }
|
||||
.lessons-suggestions .md { max-height: 40vh; overflow: auto; font-size: var(--fs-md); }
|
||||
.lessons-dialog .modal-actions { flex-wrap: wrap; }
|
||||
.lessons-dialog .modal-actions .btn .spinner { margin-right: 8px; }
|
||||
.modal-x {
|
||||
@@ -216,25 +189,24 @@
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 0;
|
||||
font-size: 22px;
|
||||
font-size: var(--fs-h2);
|
||||
line-height: 1;
|
||||
color: var(--ink-3);
|
||||
background: none;
|
||||
border: 0;
|
||||
border-radius: calc(var(--radius) * 0.5);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
.modal-x:hover:not(:disabled),
|
||||
.modal-x:focus-visible { color: var(--ink); background: var(--panel-2); }
|
||||
.modal-x:disabled { opacity: 0.4; cursor: default; }
|
||||
.lessons-dialog.is-saving .card { opacity: 0.6; }
|
||||
.lessons-unsaved { flex: 1 1 100%; padding: 10px 12px; border-left: 4px solid var(--warn); background: var(--warn-soft); border-radius: calc(var(--radius) * 0.5); }
|
||||
.lessons-unsaved { flex: 1 1 100%; }
|
||||
.lessons-unsaved .modal-actions { flex-wrap: wrap; }
|
||||
.lessons-unsaved .btn { white-space: nowrap; }
|
||||
.lessons-unsaved-text { margin: 0 0 8px; font-size: 13.5px; color: var(--ink); }
|
||||
.lessons-unsaved-text { margin: 0 0 8px; font-size: var(--fs-md); color: var(--ink); }
|
||||
|
||||
/* Switching Learning on or off, opening Review, saving: shown the moment the
|
||||
button is pressed. */
|
||||
/* Shown the moment a Learning, Review or save button is pressed. */
|
||||
.learn-busy { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); }
|
||||
.learn-banner.is-busy .dash-nudge-text { display: inline-flex; align-items: center; gap: 8px; }
|
||||
.learn-row.is-busy .learn-pill { opacity: 0.6; }
|
||||
@@ -2,41 +2,35 @@
|
||||
|
||||
/* ------------------------------------------------------- looks button */
|
||||
|
||||
/* The top bar's tools: one group at the right edge. */
|
||||
.topbar-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
|
||||
.icon-btn {
|
||||
appearance: none;
|
||||
flex: none;
|
||||
margin-left: 14px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
.icon-btn:hover { background: var(--panel-2); border-color: var(--rule); }
|
||||
/* One icon set: 24-unit drawings, a 1.8 stroke, round caps and joins, one ink
|
||||
color at rest and the highlight on hover. The top bar buttons (here) and
|
||||
the second row's buttons (below) share it. */
|
||||
.icon-btn svg { width: 22px; height: 22px; }
|
||||
.icon-btn .ab-ring { fill: none; stroke: var(--ink-3); stroke-width: 1.4; }
|
||||
.icon-btn .ab-mark { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; }
|
||||
.icon-btn .ab-dot { fill: var(--ink-2); }
|
||||
.icon-btn:hover .ab-ring { stroke: var(--accent); }
|
||||
.icon-btn:hover .ab-mark, .icon-btn:hover .ab-dot { stroke: var(--accent); fill: none; }
|
||||
.icon-btn:hover .ab-dot { fill: var(--accent); }
|
||||
.icon-btn svg * { fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.icon-btn svg .ab-dot, .icon-btn svg .dc-pip { fill: var(--ink-2); stroke: none; }
|
||||
.icon-btn:hover svg * { stroke: var(--accent); }
|
||||
.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; }
|
||||
/* 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); }
|
||||
.icon-btn .mg-body { fill: none; stroke: var(--ink-3); stroke-width: 1.4; stroke-linejoin: round; }
|
||||
.icon-btn .mg-line { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.icon-btn:hover .mg-body, .icon-btn:hover .mg-line { stroke: var(--accent); }
|
||||
|
||||
.icon-btn .gr-teeth { fill: none; stroke: var(--ink-3); stroke-width: 2.2; }
|
||||
.icon-btn .gr-ring { fill: none; stroke: var(--ink-3); stroke-width: 1.6; }
|
||||
.icon-btn .gr-hub { fill: none; stroke: var(--ink-2); stroke-width: 1.4; }
|
||||
.icon-btn:hover .gr-teeth, .icon-btn:hover .gr-ring, .icon-btn:hover .gr-hub { stroke: var(--accent); }
|
||||
|
||||
/* ------------------------------------------------------------ swatches */
|
||||
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
/* `hidden` loses to the display above without this (agent-less sessions hide it). */
|
||||
.notepad-btn[hidden] { display: none; }
|
||||
.btn.notepad-btn { padding: 0 8px; align-self: stretch; }
|
||||
.notepad-btn .notepad-label { font-size: 13px; line-height: 1; }
|
||||
.notepad-btn .notepad-label { font-size: var(--fs-sm); line-height: 1; }
|
||||
.notepad-btn .np-band { fill: var(--ink-2); stroke: none; }
|
||||
.notepad-btn:hover:not(:disabled) .np-band { fill: var(--accent); }
|
||||
.notepad-btn:disabled .np-band { fill: var(--ink-3); }
|
||||
.notepad-btn svg { width: 16px; height: 16px; display: block; }
|
||||
.notepad-btn .np-page,
|
||||
.notepad-btn .np-ring,
|
||||
.notepad-btn .np-line { fill: none; stroke: var(--ink-2); stroke-width: 1.2; stroke-linecap: round; }
|
||||
.notepad-btn .np-page { stroke-width: 1.3; }
|
||||
.notepad-btn .np-line { fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.notepad-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-line); }
|
||||
.notepad-btn:hover:not(:disabled) .np-page,
|
||||
.notepad-btn:hover:not(:disabled) .np-ring,
|
||||
@@ -23,8 +22,7 @@
|
||||
.notepad-btn:disabled .np-ring,
|
||||
.notepad-btn:disabled .np-line { stroke: var(--ink-3); }
|
||||
|
||||
/* The Notebook dialog: large, with the editor taking whatever height the
|
||||
title, the pictures and the actions leave. Only the editor scrolls. */
|
||||
/* The dialog: the editor takes the height left over and alone scrolls. */
|
||||
.modal.notepad {
|
||||
width: min(1200px, 90vw);
|
||||
height: min(900px, 85vh);
|
||||
@@ -46,12 +44,10 @@
|
||||
}
|
||||
.notepad-editor:focus-within { border-color: var(--accent-line); }
|
||||
/* The open tab's last send from the dashboard, muted under the editor. */
|
||||
.notepad-sent { flex: none; margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
|
||||
.notepad-sent { flex: none; margin: 6px 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.notepad-sent[hidden] { display: none; }
|
||||
/* The pictures under the editor: the Add image button, then the thumbnails,
|
||||
wrapping. Capped at two rows, so 200 pictures never squeeze the editor
|
||||
away; the strip scrolls instead. The whole region lights while pictures are
|
||||
dragged over the dialog. */
|
||||
/* Add image, then wrapping thumbnails. Capped at two rows so many pictures
|
||||
never squeeze the editor; the strip scrolls. Lights up on drag-over. */
|
||||
.notepad-images {
|
||||
flex: none;
|
||||
display: flex;
|
||||
@@ -60,7 +56,7 @@
|
||||
margin-top: 12px;
|
||||
padding: 6px;
|
||||
border: 1px dashed transparent;
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
.notepad-add { flex: none; }
|
||||
.notepad-strip {
|
||||
@@ -80,25 +76,23 @@
|
||||
background: var(--accent-soft);
|
||||
}
|
||||
|
||||
/* One thumbnail: the picture is a button that opens the picview (the shared
|
||||
.attach-open in shell.css), with the tray's round X in its corner, and the
|
||||
inline delete question or the upload state laid over it. */
|
||||
/* A thumbnail: a button opening the picview (shared .attach-open), with a
|
||||
round X, and the delete question or upload state overlaid. */
|
||||
.notepad-thumb.attach-thumb { width: 88px; height: 88px; }
|
||||
.notepad-thumb .attach-overlay p { margin: 0; padding: 0 4px; }
|
||||
.notepad-thumb .attach-overlay .btn.tiny { margin: 0; padding: 1px 6px; font-size: 10.5px; }
|
||||
.notepad-thumb .attach-overlay .btn.xs { padding: 1px 6px; font-size: var(--fs-2xs); }
|
||||
.notepad-ask {
|
||||
background: color-mix(in srgb, var(--panel) 92%, transparent);
|
||||
color: var(--ink); font-size: 10.5px; font-weight: 600; text-align: center;
|
||||
color: var(--ink); font-size: var(--fs-2xs); font-weight: 600; text-align: center;
|
||||
}
|
||||
.notepad-ask-row { display: flex; gap: 4px; }
|
||||
|
||||
.modal.notepad .modal-actions { flex: none; align-items: center; margin-top: 14px; }
|
||||
.notepad-status { margin: 0 auto 0 0; min-height: 1.4em; font-size: 12.5px; color: var(--ink-3); }
|
||||
.notepad-status { margin: 0 auto 0 0; min-height: 1.4em; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
.notepad-status.is-problem { color: var(--warn); }
|
||||
|
||||
/* The tab bar: a scrolling row of tabs, each its name and an x, with the
|
||||
current one marked, then New tab. A double-click renames, the x deletes and
|
||||
a drag moves; the questions open in the small dialogs below. */
|
||||
/* Scrolling tab row, then New tab. Double-click renames, x deletes, drag
|
||||
moves; questions open in the small dialogs below. */
|
||||
.notepad-tabbar { flex: none; display: flex; align-items: flex-end; gap: 8px; margin-bottom: -1px; position: relative; z-index: 1; }
|
||||
.notepad-tabs { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 0; }
|
||||
.notepad-tabwrap {
|
||||
@@ -107,7 +101,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px 8px 0 0;
|
||||
border-radius: var(--radius-md) var(--radius-md) 0 0;
|
||||
background: var(--panel-2);
|
||||
color: var(--ink-2);
|
||||
}
|
||||
@@ -126,7 +120,7 @@
|
||||
background: none;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
line-height: 1.2;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
@@ -134,19 +128,7 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
.notepad-tab[aria-selected="true"] { font-weight: 600; }
|
||||
.notepad-sent-badge {
|
||||
flex: none;
|
||||
margin: 0 2px 0 2px;
|
||||
padding: 1px 5px;
|
||||
border: 1px solid var(--accent-line);
|
||||
border-radius: 999px;
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
font-size: 10.5px;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.notepad-sent-badge { flex: none; margin: 0 2px; }
|
||||
.notepad-tab-x {
|
||||
flex: none;
|
||||
width: 20px;
|
||||
@@ -154,11 +136,11 @@
|
||||
margin-right: 6px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--radius-xs);
|
||||
background: none;
|
||||
color: inherit;
|
||||
font: inherit;
|
||||
font-size: 16px;
|
||||
font-size: var(--fs-h4);
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
opacity: 0.6;
|
||||
@@ -169,36 +151,25 @@
|
||||
.notepad-tab-x:hover { background: var(--panel); color: var(--warn); }
|
||||
.notepad-tab:focus-visible,
|
||||
.notepad-tab-x:focus-visible,
|
||||
.notepad-tab-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
||||
.notepad-tab-new:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
.notepad-tabwrap:has(.is-dragging) { opacity: 0.5; }
|
||||
.notepad-tabwrap:has(.is-drop-before) { box-shadow: -3px 0 0 0 var(--accent); }
|
||||
.notepad-tabs.is-drop-end { box-shadow: inset -3px 0 0 0 var(--accent); }
|
||||
.notepad-tab-new { flex: none; margin-bottom: 4px; }
|
||||
|
||||
/* The name and delete questions: small dialogs over the Notebook, never a
|
||||
browser prompt. The empty state sits where the editor would. */
|
||||
/* Name and delete questions: small dialogs, never a browser prompt. */
|
||||
.notepad-empty {
|
||||
flex: none;
|
||||
margin: 0 0 10px;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--panel-2);
|
||||
}
|
||||
.notepad-empty[hidden] { display: none; }
|
||||
.modal.notepad-sub { width: min(420px, calc(100vw - 32px)); }
|
||||
.modal.notepad-sub h2 { margin: 0 0 10px; }
|
||||
.notepad-name-form input {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 6px 8px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 6px;
|
||||
background: var(--panel);
|
||||
color: var(--ink);
|
||||
font: inherit;
|
||||
}
|
||||
.notepad-name-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
|
||||
.notepad-name-form input { display: block; }
|
||||
.notepad-name-count { margin: 4px 0 0; text-align: right; font-variant-numeric: tabular-nums; }
|
||||
.notepad-name-count.over { color: var(--warn); }
|
||||
.notepad-name-error { min-height: 1.2em; margin: 6px 0 0; }
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,14 +2,12 @@
|
||||
|
||||
/* ---------------------------------------------------------- the flight
|
||||
|
||||
While Plan2Code is thinking, stars stream past and Planny leans into it:
|
||||
tilted forward, bobbing, with speed lines behind him. The motion belongs to
|
||||
him, so it reads as "he is off working on it" rather than as a background
|
||||
effect. Chosen from ten prototypes (prototypes/thinking-starfield.html).
|
||||
While Plan2Code is thinking, stars stream past and Planny leans in, bobbing,
|
||||
with speed lines behind him, so it reads as "he is off working on it", not
|
||||
as a background effect.
|
||||
|
||||
The flight and the spinner are one signal: every line that turns the ring
|
||||
also flies. Every other state keeps the dock still, so the motion itself
|
||||
carries meaning. */
|
||||
also flies. Every other state keeps the dock still. */
|
||||
|
||||
.sky {
|
||||
position: absolute;
|
||||
@@ -24,9 +22,7 @@
|
||||
.dock.is-flying .sky { opacity: 0.85; }
|
||||
|
||||
/* Each star rides a track as wide as the dock and moves by a percentage of
|
||||
it, so the field fills whatever width the dock has: 250px, 210px on a
|
||||
narrower window, the full width on a phone. The dot sits at the track's
|
||||
right-hand end. */
|
||||
it, so the field fills any dock width. The dot sits at the track's right end. */
|
||||
.sky .star {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -58,12 +54,11 @@
|
||||
50% { transform: translateY(-3px) rotate(6deg); }
|
||||
}
|
||||
|
||||
/* Speed lines, trailing off his back. Hung off Planny rather than off the
|
||||
dock, so they follow him into the phone layout, where he sits beside the
|
||||
text instead of above it. */
|
||||
/* Speed lines off his back. Hung off Planny, not the dock, so they follow him
|
||||
into the phone layout, where he sits beside the text. */
|
||||
.trail { position: absolute; right: 100%; top: 0; width: 40px; height: 100%; margin-right: 4px; opacity: 0; transition: opacity 0.5s; pointer-events: none; }
|
||||
.dock.is-flying .trail { opacity: 1; }
|
||||
.trail i { position: absolute; right: 0; height: 1.5px; border-radius: 1px; background: linear-gradient(90deg, transparent, var(--ink-3)); }
|
||||
.trail i { position: absolute; right: 0; height: 1.5px; border-radius: var(--radius-xs); background: linear-gradient(90deg, transparent, var(--ink-3)); }
|
||||
.trail i:nth-child(1) { top: 38%; width: 26px; }
|
||||
.trail i:nth-child(2) { top: 52%; width: 36px; }
|
||||
.trail i:nth-child(3) { top: 66%; width: 22px; }
|
||||
@@ -75,12 +70,12 @@
|
||||
to { transform: translateX(-22px); opacity: 0; }
|
||||
}
|
||||
|
||||
/* The line under him stays readable with stars passing behind it. */
|
||||
/* Keeps his line readable over passing stars. */
|
||||
.dock.is-flying .dock-say { text-shadow: 0 0 3px var(--panel-2), 0 0 6px var(--panel-2), 0 0 10px var(--panel-2); }
|
||||
|
||||
.dock-say {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-size: var(--fs-sm);
|
||||
line-height: 1.45;
|
||||
color: var(--ink-2);
|
||||
text-wrap: balance;
|
||||
@@ -88,10 +83,9 @@
|
||||
|
||||
/* ------------------------------------------------------------ Planny */
|
||||
|
||||
/* The mascot is the page's state, not decoration on top of it: his star eye
|
||||
lights up when something is yours and turns while the agent works, his arms
|
||||
take a pose for each mood, and he fades and shuts his eye when the
|
||||
connection drops. One class from app.js switches all of it. */
|
||||
/* The mascot is the page's state: his star eye lights when something is yours
|
||||
and turns while the agent works, his arms pose per mood, and he fades with
|
||||
his eye shut when the connection drops. One class from app.js switches it. */
|
||||
.planny { width: 46px; height: 63px; flex: none; overflow: visible; }
|
||||
|
||||
.planny .shell,
|
||||
@@ -103,7 +97,7 @@
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
/* The mouth is a lip, not a grin: at the body's own 1.3 it reads as lipstick. */
|
||||
/* Thinner than the body's 1.3, which reads as lipstick. */
|
||||
.planny .smile { stroke-width: 0.9; }
|
||||
.planny .arm path { stroke-width: 1.2; }
|
||||
.planny .arm circle,
|
||||
@@ -120,10 +114,9 @@
|
||||
animation: planny-blink 6.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
/* Arms: one set per mood, and only that set shows. Moods without a set of
|
||||
their own (happy) keep the resting arms; adrift has none at all, which is
|
||||
most of what makes him look lost. Arms that move pivot at the shoulder, so
|
||||
they carry view-box origins rather than their own boxes. */
|
||||
/* Arms: one set per mood, only that set shows. Moods without one (happy) keep
|
||||
the resting arms; adrift has none, which makes him look lost. Moving arms
|
||||
pivot at the shoulder, so they use view-box origins. */
|
||||
.planny .arms { display: none; }
|
||||
.planny .a-rest { display: inline; }
|
||||
.planny:is(.is-point, .is-work, .is-done, .is-gone, .is-adrift, .is-setup) .a-rest { display: none; }
|
||||
@@ -154,11 +147,11 @@
|
||||
@keyframes foot-step-a { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.1px); } }
|
||||
@keyframes foot-step-b { 0%, 100% { transform: translateY(-1.1px); } 50% { transform: translateY(0); } }
|
||||
|
||||
/* Something for you to do: star lit in the highlight color, a wave. */
|
||||
/* Yours to do: star lit, a wave. */
|
||||
.planny.is-point { animation: planny-lean 2.6s ease-in-out infinite; }
|
||||
.planny.is-point .eye { fill: var(--accent); }
|
||||
|
||||
/* The agent has it: the star turns, arms pump and his feet walk on the spot. */
|
||||
/* The agent has it: star turns, arms pump, feet walk in place. */
|
||||
.planny.is-work .eye { fill: var(--accent); animation: planny-spin 2.6s linear infinite; }
|
||||
.planny.is-work .foot.f1 { animation: foot-step-a 0.7s ease-in-out infinite; }
|
||||
.planny.is-work .foot.f2 { animation: foot-step-b 0.7s ease-in-out infinite; }
|
||||
@@ -166,16 +159,13 @@
|
||||
/* Nothing outstanding. */
|
||||
.planny.is-happy .eye { fill: var(--ok); }
|
||||
|
||||
/* The server is up, but nothing is answering at the other end of it. Not the
|
||||
faded, eye-shut `gone` look: this page is working perfectly, and the thing
|
||||
that is not is somewhere else. Gray, still, and no arms: he has nothing to
|
||||
do with them until someone answers. */
|
||||
/* The server is up but nothing answers at the other end. Not the `gone` look:
|
||||
this page works fine. Gray, still, no arms until someone answers. */
|
||||
.planny.is-adrift .eye { fill: var(--ink-3); animation: none; }
|
||||
.planny.is-adrift .smile { opacity: 0.6; }
|
||||
|
||||
/* Finished. Settled rather than switched off: green star, arms up, eye open.
|
||||
The `gone` look below would be wrong here -- the server IS about to go away,
|
||||
and a faded Planny with his eye shut reads as a breakage. */
|
||||
/* Finished: green star, arms up, eye open. Not `gone`: a faded Planny with
|
||||
his eye shut reads as a breakage. */
|
||||
.planny.is-done .eye { fill: var(--ok); animation: none; }
|
||||
.planny.is-done .smile { stroke-width: 1.5; }
|
||||
|
||||
@@ -183,21 +173,18 @@
|
||||
.planny.is-gone { opacity: 0.5; }
|
||||
.planny.is-gone .eye { fill: var(--warn); animation: none; transform: scaleY(0.12); }
|
||||
|
||||
/* The setup page, waiting on a pick: the point look without the work
|
||||
spinner -- a friendly lean and wave, star lit, while nothing runs yet. */
|
||||
/* The setup page, waiting on a pick: the point look, nothing running yet. */
|
||||
.planny.is-setup { animation: planny-lean 2.6s ease-in-out infinite; }
|
||||
.planny.is-setup .eye { fill: var(--accent); }
|
||||
|
||||
/* ------------------------------------------------------ mood variants
|
||||
|
||||
Each mood above is a family, not a single drawing: app.js rolls a v0/v1/v2
|
||||
every time the mood CHANGES, so "your turn" does not look identical every
|
||||
time it comes around. v0 is always the plain version written above; the
|
||||
variants below are the alternates. Rules stay on the parts (arms, eye,
|
||||
feet) rather than on the svg where a variant can help it, so the flight
|
||||
transform can keep owning the svg itself while the agent works. */
|
||||
app.js rolls a v0/v1/v2 each time the mood CHANGES, so "your turn" does not
|
||||
always look the same. v0 is the plain version above. Rules stay on the
|
||||
parts (arms, eye, feet) where possible, so the flight transform keeps
|
||||
owning the svg while the agent works. */
|
||||
|
||||
/* Parts only the alternates use. Hidden here, woken by the variant. */
|
||||
/* Parts only the variants use; hidden until woken. */
|
||||
.planny .spark { opacity: 0; }
|
||||
.planny .spark path {
|
||||
fill: var(--accent);
|
||||
@@ -256,17 +243,16 @@
|
||||
}
|
||||
|
||||
/* point -- something is yours to do. */
|
||||
/* v1: an eager little hop while he waves. */
|
||||
/* v1: a little hop while he waves. */
|
||||
.planny.is-point.v1 { animation: planny-float 1.4s ease-in-out infinite; }
|
||||
/* v2: still leaning, but his star darts like he is pointing things out. */
|
||||
/* v2: leaning, star darting as if pointing things out. */
|
||||
.planny.is-point.v2 { animation: planny-lean 3.2s ease-in-out infinite; }
|
||||
.planny.is-point.v2 .eye { animation: eye-dart 3.4s ease-in-out infinite; }
|
||||
|
||||
/* work -- the agent has it. The flight already owns the svg, so every work
|
||||
variant plays on his parts only. */
|
||||
/* v1: reading. The star sweeps back and forth instead of turning. */
|
||||
/* work -- the agent has it. The flight owns the svg, so variants use parts only. */
|
||||
/* v1: reading, the star sweeps instead of turning. */
|
||||
.planny.is-work.v1 .eye { animation: eye-scan 1.6s ease-in-out infinite; }
|
||||
/* v2: full tilt. The star turns faster and throbs while he runs. */
|
||||
/* v2: full tilt, star turns faster and throbs. */
|
||||
.planny.is-work.v2 .eye { animation: planny-spin 1.4s linear infinite, star-throb 0.7s ease-in-out infinite; }
|
||||
.planny.is-work.v2 .arm.pump-l,
|
||||
.planny.is-work.v2 .arm.pump-r,
|
||||
@@ -281,13 +267,13 @@
|
||||
.planny.is-happy.v2 .spark g + g path { animation-delay: 1.5s; }
|
||||
|
||||
/* done -- session over. */
|
||||
/* v1: a small satisfied nod, on a long leash so it reads as occasional. */
|
||||
/* v1: a small nod, spaced out so it reads as occasional. */
|
||||
.planny.is-done.v1 { animation: planny-nod 4.4s ease-in-out infinite; transform-origin: 50% 92%; }
|
||||
.planny.is-done.v1 .spark { opacity: 1; }
|
||||
.planny.is-done.v1 .spark path { animation: spark-pop 4.4s ease-in-out infinite; }
|
||||
|
||||
/* adrift -- the page is fine, the other end is not. */
|
||||
/* v1: a slow lost sway, star drifting up to look for him. */
|
||||
/* v1: a slow lost sway, star drifting up. */
|
||||
.planny.is-adrift.v1 { animation: planny-sway 5.4s ease-in-out infinite; transform-origin: 50% 100%; }
|
||||
.planny.is-adrift.v1 .eye { animation: eye-up 5.4s ease-in-out infinite; }
|
||||
|
||||
@@ -299,13 +285,12 @@
|
||||
|
||||
/* ------------------------------------------------------------ wake-up
|
||||
|
||||
A freshly opened dashboard: Planny powers on center stage, then glides
|
||||
into the rail (boot.js). Each beat is a keyframe on a delay under
|
||||
`.booting`, one class for the whole run; the glide's target depends on
|
||||
where the rail sits, so boot.js hands it over as --wake-glide. The layer
|
||||
takes clicks so none lands on a card underneath while he wakes. */
|
||||
.wake { position: fixed; inset: 0; z-index: 45; pointer-events: auto; }
|
||||
/* Solid page color behind the sleeping bot, following light/dark via --bg. */
|
||||
A fresh dashboard: Planny powers on center stage, then glides into the rail
|
||||
(boot.js). Each beat is a delayed keyframe under `.booting`; boot.js passes
|
||||
the glide target as --wake-glide. The layer takes clicks so none reaches a
|
||||
card underneath. */
|
||||
.wake { position: fixed; inset: 0; z-index: var(--z-wake); pointer-events: auto; }
|
||||
/* Solid page color behind the bot (--bg follows light/dark). */
|
||||
.wake::before { content: ""; position: absolute; inset: 0; background: var(--bg); }
|
||||
.wake[hidden] { display: none; }
|
||||
.wake-bot {
|
||||
@@ -322,8 +307,8 @@
|
||||
.wake-bot .shell { fill: var(--panel-2); }
|
||||
.wake-bot .foot { fill: var(--ink-3); }
|
||||
.wake-bot .eye { fill: var(--ink); transform-box: fill-box; transform-origin: center; }
|
||||
/* The star and its scan sit in .look, so the glance moves them together
|
||||
without fighting the star's own open-and-light transform. */
|
||||
/* Star and scan sit in .look so the glance moves both without fighting the
|
||||
star's own open-and-light transform. */
|
||||
.wake-bot .look { transform-box: view-box; }
|
||||
.wake-bot .scan { fill: none; stroke: var(--accent); stroke-width: 0.5; opacity: 0; }
|
||||
.wake-bot .body { transform-box: view-box; transform-origin: 11px 28.8px; }
|
||||
@@ -331,13 +316,13 @@
|
||||
.wake-bot .limb { transform-box: view-box; }
|
||||
.wake-bot .limb.l { transform-origin: 3px 18px; }
|
||||
.wake-bot .limb.r { transform-origin: 19px 18px; }
|
||||
/* His Z's sit outside .body, so neither the breathing nor the hop moves them. */
|
||||
/* The Z's sit outside .body, so breathing and the hop do not move them. */
|
||||
.wake-bot .zzz { transform-box: view-box; transform-origin: 18px 1px; }
|
||||
.wake-bot .zzz path {
|
||||
fill: none; stroke: var(--ink-3); stroke-width: 0.8; stroke-linecap: round; stroke-linejoin: round;
|
||||
opacity: 0; transform-box: fill-box;
|
||||
}
|
||||
/* Dormant, before the first click: the one line telling them to wake him. */
|
||||
/* Dormant, before the first click: tells them to wake him. */
|
||||
.wake.dormant { cursor: pointer; }
|
||||
.wake-hint {
|
||||
position: absolute; left: 0; right: 0; top: 50%; margin: 147px 0 0;
|
||||
@@ -346,18 +331,17 @@
|
||||
}
|
||||
.wake.dormant .wake-hint { opacity: 1; }
|
||||
|
||||
/* Skip: bottom right, out of the animation's way but big enough to find. */
|
||||
/* Skip: bottom right, out of the way but easy to find. */
|
||||
.wake-skip {
|
||||
position: absolute; right: 24px; bottom: 24px;
|
||||
min-width: 120px; padding: 10px 26px; border: 1.5px solid var(--ink-2); border-radius: 6px;
|
||||
min-width: 120px; padding: 10px 26px; border: 1.5px solid var(--ink-2); border-radius: var(--radius-sm);
|
||||
background: var(--panel-2); color: var(--ink-2);
|
||||
font: inherit; font-size: 1rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
|
||||
cursor: pointer; opacity: 0.9;
|
||||
}
|
||||
.wake-skip:hover, .wake-skip:focus-visible { opacity: 1; color: var(--ink); border-color: var(--ink); }
|
||||
|
||||
/* 0.0 s, powered down: the resting state every beat starts from. Arms hang
|
||||
slack against his sides, the star is shut and the smile not yet drawn. */
|
||||
/* 0.0 s, powered down: the start of every beat. Arms slack, star shut, no smile. */
|
||||
.wake-bot { filter: grayscale(1); opacity: 0.55; }
|
||||
.wake-bot .limb.l { transform: rotate(-14deg); }
|
||||
.wake-bot .limb.r { transform: rotate(14deg); }
|
||||
@@ -365,10 +349,9 @@
|
||||
.wake-bot .smile { stroke-dasharray: 7; stroke-dashoffset: 7; }
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
/* Asleep until the click, on loop: Z's drift up, he breathes, his slack
|
||||
arms sway out of step, and his feet pulse like a standby light. Each
|
||||
stops the moment .booting swaps in and hands the part to its beat below.
|
||||
The Z's keep rising through the pop, so they never jump back. */
|
||||
/* Asleep until the click, looping: Z's drift up, he breathes, arms sway out
|
||||
of step, feet pulse like a standby light. Each stops when .booting swaps
|
||||
in its beat below; the Z's keep rising through the pop so they never jump. */
|
||||
.wake:is(.dormant, .stirring, .booting) .wake-bot .zzz path { animation: zzz-rise 3.2s ease-in infinite; }
|
||||
.wake:is(.dormant, .stirring, .booting) .wake-bot .zzz path:nth-of-type(2) { animation-delay: 1.05s; }
|
||||
.wake:is(.dormant, .stirring, .booting) .wake-bot .zzz path:nth-of-type(3) { animation-delay: 2.1s; }
|
||||
@@ -376,16 +359,14 @@
|
||||
.wake:is(.dormant, .stirring) .wake-bot .limb.l { animation: wake-doze-l 3.6s ease-in-out infinite; }
|
||||
.wake:is(.dormant, .stirring) .wake-bot .limb.r { animation: wake-doze-r 4.1s ease-in-out infinite; }
|
||||
.wake:is(.dormant, .stirring) .wake-bot .foot { animation: wake-standby 2.8s ease-in-out infinite; }
|
||||
/* Nudged, for one snore (app.js stir): still asleep, rocked gently side to
|
||||
side about his feet, a pair of rocks then a pause, as if being shaken. */
|
||||
/* Nudged for one snore (app.js stir): still asleep, rocked about his feet. */
|
||||
.wake.stirring .wake-bot .body { animation: wake-nudge 1.3s ease-in-out infinite; }
|
||||
/* Startled awake: the Z's blow outward and are gone. */
|
||||
/* Startled awake: the Z's blow outward. */
|
||||
.wake.booting .wake-bot .zzz { animation: wake-zzz-pop 0.3s ease-out both; }
|
||||
|
||||
/* 0.4 s power-on and feet blink · 1.35 s feet plant · 1.5 s / 1.9 s arms
|
||||
lift off his sides · 2.5 s star opens with the scan, lit · 2.85 s he
|
||||
looks left, then right, then ahead · 3.2 s smile · 3.6 s hop, arms up in
|
||||
a cheer, star back to ink. */
|
||||
/* 0.4 s power-on, feet blink · 1.35 s feet plant · 1.5/1.9 s arms lift ·
|
||||
2.5 s star opens, lit · 2.85 s looks left, right, ahead · 3.2 s smile ·
|
||||
3.6 s hop, arms up, star back to ink. */
|
||||
.wake.booting .wake-bot { animation: wake-power 0.3s ease 0.4s both; }
|
||||
.wake.booting .wake-bot .foot { animation: wake-feet 0.5s steps(1) 0.4s both, wake-plant 0.2s ease 1.35s both; }
|
||||
.wake.booting .wake-bot .limb.l { animation: wake-lift-l 0.45s cubic-bezier(.3,1.6,.5,1) 1.5s both, wake-cheer-l 0.5s ease-out 3.6s both; }
|
||||
@@ -396,13 +377,12 @@
|
||||
.wake.booting .wake-bot .smile { animation: wake-smile 0.4s ease-out 3.2s both; }
|
||||
.wake.booting .wake-bot .body { animation: wake-hop 0.5s ease-out 3.6s both; }
|
||||
|
||||
/* 4.3 s, into the rail. The power-on is long finished by now and holds its
|
||||
last frame, so the transition owns the transform alone. */
|
||||
/* 4.3 s, into the rail. The power-on holds its last frame, so the transition
|
||||
owns the transform alone. */
|
||||
.wake.gliding .wake-bot { transform: var(--wake-glide); transition: transform 0.6s cubic-bezier(.6,0,.2,1); }
|
||||
.wake.gliding::before { opacity: 0; transition: opacity 0.6s ease; }
|
||||
|
||||
/* The menu comes in as he leaves: pre-hidden while he wakes, then each
|
||||
group rises in, a beat after the one above it. */
|
||||
/* The menu is hidden while he wakes, then each group rises in turn. */
|
||||
.dash.waking .dash-group { opacity: 0; transform: translateY(8px); }
|
||||
.dash.waking.is-in .dash-group { animation: dash-rise 0.5s ease both; }
|
||||
.dash.waking.is-in .dash-group:nth-child(2 of .dash-group) { animation-delay: 0.06s; }
|
||||
@@ -412,14 +392,14 @@
|
||||
.dash.waking.is-in .dash-group:nth-child(6 of .dash-group) { animation-delay: 0.3s; }
|
||||
}
|
||||
|
||||
/* One Planny on screen: the rail's waits out of sight (keeping its place,
|
||||
so the glide can measure it) until the big one lands on it. */
|
||||
/* One Planny on screen: the rail's hides, keeping its place so the glide can
|
||||
measure it, until the big one lands. */
|
||||
.pilot.is-waking { visibility: hidden; }
|
||||
/* The note types in (app.js revealNote): what it has not reached waits. */
|
||||
.dash-note .is-untyped { visibility: hidden; }
|
||||
|
||||
@keyframes wake-power { from { filter: grayscale(1); opacity: 0.55; } to { filter: none; opacity: 1; } }
|
||||
/* Off for the delay, then on-off-on-off-on, like a standby light waking. */
|
||||
/* Off for the delay, then on-off-on-off-on like a standby light. */
|
||||
@keyframes wake-feet {
|
||||
0% { fill: var(--ink-3); }
|
||||
0.1% { fill: var(--accent); }
|
||||
@@ -431,8 +411,7 @@
|
||||
@keyframes wake-plant { from { fill: var(--accent); } to { fill: var(--ink-2); } }
|
||||
@keyframes wake-lift-l { from { transform: rotate(-14deg); } to { transform: rotate(0); } }
|
||||
@keyframes wake-lift-r { from { transform: rotate(14deg); } to { transform: rotate(0); } }
|
||||
/* Up and back down: the arms end on the rest pose the rail draws, so the
|
||||
glide hands over to an identical drawing. */
|
||||
/* Arms end on the rail's rest pose so the glide hands over seamlessly. */
|
||||
@keyframes wake-cheer-l {
|
||||
0%, 100% { transform: rotate(0); }
|
||||
45%, 60% { transform: rotate(116deg); }
|
||||
@@ -452,8 +431,7 @@
|
||||
20%, 80% { opacity: 1; }
|
||||
100% { opacity: 0; transform: translateX(3px); }
|
||||
}
|
||||
/* A glance each way, then eyes front before the hop: he ends where the rail
|
||||
draws him, so the glide still lands on an identical drawing. */
|
||||
/* A glance each way, then eyes front: he ends as the rail draws him. */
|
||||
@keyframes wake-look {
|
||||
0%, 100% { transform: translateX(0); }
|
||||
17.5%, 42.5% { transform: translateX(-2.2px); }
|
||||
@@ -530,9 +508,9 @@
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
font: inherit;
|
||||
font-size: 13.5px;
|
||||
font-size: var(--fs-md);
|
||||
padding: 6px 13px;
|
||||
border-radius: 99px;
|
||||
border-radius: var(--radius-pill);
|
||||
cursor: pointer;
|
||||
/* A doc titled with a sentence keeps the tab row to one line. */
|
||||
max-width: 22ch;
|
||||
@@ -548,7 +526,7 @@
|
||||
font-weight: 600;
|
||||
}
|
||||
.view-tab .tab-count {
|
||||
font-size: 11px;
|
||||
font-size: var(--fs-2xs);
|
||||
opacity: 0.75;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
@@ -22,22 +22,21 @@
|
||||
align-items: flex-start;
|
||||
gap: 2px;
|
||||
width: 100%;
|
||||
padding: 8px 10px;
|
||||
padding: 8px 10px 8px 13px;
|
||||
border: 0;
|
||||
border-left: 3px solid transparent;
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
font: inherit;
|
||||
font-size: 13.5px;
|
||||
font-size: var(--fs-md);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.prefs-tab:hover { background: var(--panel-2); color: var(--ink); }
|
||||
.prefs-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
|
||||
.prefs-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
|
||||
.prefs-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
||||
.prefs-tab-label { display: block; line-height: 1.3; }
|
||||
.prefs-tab-hint { display: block; font-size: 12px; line-height: 1.35; color: var(--ink-3); }
|
||||
.prefs-tab-hint { display: block; font-size: var(--fs-xs); line-height: 1.35; color: var(--ink-3); }
|
||||
|
||||
.prefs-panels { min-width: 0; }
|
||||
.prefs-panel[hidden] { display: none; }
|
||||
@@ -54,14 +53,17 @@
|
||||
top: 0;
|
||||
right: 0;
|
||||
max-width: 60%;
|
||||
font-size: 12px;
|
||||
font-size: var(--fs-xs);
|
||||
line-height: 1.3;
|
||||
text-align: right;
|
||||
color: var(--ok);
|
||||
opacity: 0;
|
||||
}
|
||||
.prefs-saved.is-saved { opacity: 1; }
|
||||
.prefs-saved.error { color: var(--danger, #d64545); opacity: 1; }
|
||||
.prefs-saved.error { color: var(--warn); opacity: 1; }
|
||||
/* After Reset this tab: "Reset. Undo", held a few seconds, no fade. */
|
||||
.prefs-saved.is-reset { opacity: 1; color: var(--ink-2); }
|
||||
.prefs-saved .prefs-undo { padding: 0 2px; font: inherit; color: var(--accent); text-decoration: underline; background: none; border: 0; cursor: pointer; }
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
@keyframes prefs-saved-fade {
|
||||
@@ -80,22 +82,22 @@
|
||||
.prefs-unsaved {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 5;
|
||||
z-index: var(--z-sticky);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 16px;
|
||||
background: color-mix(in srgb, var(--bg, #000) 55%, transparent);
|
||||
background: var(--scrim);
|
||||
}
|
||||
.prefs-unsaved[hidden] { display: none; }
|
||||
.prefs-unsaved-box {
|
||||
max-width: 380px;
|
||||
padding: 16px 18px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 10px;
|
||||
border-radius: var(--radius);
|
||||
background: var(--panel);
|
||||
box-shadow: 0 8px 30px rgb(0 0 0 / 0.25);
|
||||
box-shadow: var(--shadow-3);
|
||||
}
|
||||
.prefs-unsaved-box h3 { margin: 0 0 6px; font-size: 15px; }
|
||||
.prefs-unsaved-box h3 { margin: 0 0 6px; font-size: var(--fs-base); }
|
||||
.prefs-unsaved-box p { margin: 0 0 12px; }
|
||||
.prefs-unsaved-actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
|
||||
@@ -115,11 +117,10 @@
|
||||
width: auto;
|
||||
flex: none;
|
||||
white-space: nowrap;
|
||||
border-left: 0;
|
||||
border-bottom: 3px solid transparent;
|
||||
border-radius: 6px 6px 0 0;
|
||||
padding-left: 10px;
|
||||
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
|
||||
}
|
||||
.prefs-tab[aria-selected="true"] { border-bottom-color: var(--accent); }
|
||||
.prefs-tab[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--accent); }
|
||||
.prefs-tab-hint { display: none; }
|
||||
}
|
||||
|
||||
@@ -146,3 +147,6 @@
|
||||
}
|
||||
.setup-no-page { margin: 10px 0 0; }
|
||||
.setup-no-page[hidden] { display: none; }
|
||||
|
||||
/* One line under the title: what saves by itself and what does not. */
|
||||
.prefs-lead { margin: -4px 0 10px; font-size: var(--fs-sm); color: var(--ink-3); }
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
/* ---------------------------------------------------------------- print */
|
||||
|
||||
/* What gets printed is the document being read, on its own. Everything that
|
||||
steers the session is furniture and has no business on paper. */
|
||||
/* Print only the document; session furniture stays off paper. */
|
||||
@media print {
|
||||
.topbar, .rail, .aside, .footer, .banner, .skip, .doc-tools, .pager, .modal, .arrival, .review-offer { display: none !important; }
|
||||
html, body { height: auto; background: #fff; color: #000; }
|
||||
@@ -11,7 +10,7 @@
|
||||
.layout { display: block; overflow: visible; }
|
||||
.main { overflow: visible; padding: 0; max-width: none; }
|
||||
.main > * { max-width: none; }
|
||||
/* The diagnosis prints whole, not cut at the box's on-screen height. */
|
||||
/* Diagnosis prints whole. */
|
||||
.handoff-report-body { max-height: none; overflow: visible; }
|
||||
.block, .card { break-inside: avoid; box-shadow: none; }
|
||||
.doc-head { border-bottom: 1px solid #ccc; }
|
||||
@@ -22,22 +21,32 @@
|
||||
/* ------------------------------------------------------------ responsive */
|
||||
|
||||
@media (max-width: 1080px) {
|
||||
.layout { grid-template-columns: 210px minmax(0, 1fr); }
|
||||
.layout,
|
||||
.layout:has(> .aside:empty),
|
||||
.layout:has(.git-board) { grid-template-columns: 210px minmax(0, 1fr); }
|
||||
.aside { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule); }
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
/* V20, from a live look at 700 to 1000px: from 900px down the rail beside the
|
||||
question and the notes pane under it left the card a few lines tall, so the
|
||||
rail becomes a strip above the page (Planny beside the list) and the notes
|
||||
follow the card, as on a phone. */
|
||||
@media (max-width: 900px) {
|
||||
body { display: block; }
|
||||
.layout { display: block; }
|
||||
.layout, .layout:has(> .aside:empty), .layout:has(.git-board) { display: block; }
|
||||
.rail { border-right: 0; border-bottom: 1px solid var(--rule); }
|
||||
.sidebar, .aside { border: 0; border-bottom: 1px solid var(--rule); max-height: 30vh; }
|
||||
.main { padding: 18px 16px 30px; }
|
||||
.card { --card-pad-b: 18px; padding: 18px 16px var(--card-pad-b); border-radius: 8px; }
|
||||
.dock { flex-direction: row; text-align: left; gap: 12px; padding: 12px 16px; }
|
||||
.planny { width: 32px; height: 44px; }
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.card { --card-pad-b: 18px; padding: 18px 16px var(--card-pad-b); border-radius: var(--radius-md); }
|
||||
.main > .card { padding-right: 22px; }
|
||||
.card h2 { font-size: 21px; }
|
||||
/* Back to a wrapping row: the summary and Send take two lines here and fill
|
||||
the bar's middle, so the where slot has no room and goes. */
|
||||
.footer { display: flex; flex-wrap: wrap; position: sticky; bottom: 0; z-index: 20; box-shadow: 0 -4px 14px rgba(0,0,0,0.07); }
|
||||
.card h2 { font-size: var(--fs-h2); }
|
||||
/* Wrapping row: summary and Send fill the bar, so the where slot goes. */
|
||||
.footer { display: flex; flex-wrap: wrap; position: sticky; bottom: 0; z-index: var(--z-sticky); box-shadow: var(--shadow-up); }
|
||||
.footer-summary { flex: 1; }
|
||||
.footer-actions { white-space: normal; }
|
||||
.footer-where { display: none; }
|
||||
@@ -47,17 +56,15 @@
|
||||
.topbar { padding: 12px 16px 0; }
|
||||
.topbar-row.second { gap: 9px; }
|
||||
.views-arrow { display: none; }
|
||||
/* Side by side, because vertical space is the scarce thing here. */
|
||||
.topbar-label { display: none; }
|
||||
/* Side by side: vertical space is scarce. */
|
||||
.dock { flex-direction: row; text-align: left; gap: 12px; padding: 12px 16px; }
|
||||
.planny { width: 32px; height: 44px; }
|
||||
/* Three items on one line is one too many at this width, and the count is
|
||||
the one that is only nice to have. */
|
||||
/* Three items per line is too many; the count is the optional one. */
|
||||
.pager { gap: 8px; }
|
||||
.pager-count { display: none; }
|
||||
/* The Notebook takes the whole screen, and every control in it is a
|
||||
fingertip wide. The pictures go under Add image rather than beside it, so
|
||||
the strip gets the full width, and the preview's side columns narrow to
|
||||
give the picture their room. */
|
||||
/* The Notebook is full screen with fingertip-sized controls. Pictures go
|
||||
under Add image for full strip width; the preview's side columns narrow. */
|
||||
.btn.notepad-btn { min-width: 44px; }
|
||||
.modal.notepad { width: 100%; height: 100%; margin: 0; padding: 18px 16px 16px; border: 0; border-radius: 0; }
|
||||
.modal.notepad .notepad-add,
|
||||
@@ -71,73 +78,95 @@
|
||||
.notepad-tab-x { min-height: 44px; }
|
||||
.notepad-tab-x { width: 32px; }
|
||||
.notepad-add { align-self: flex-start; }
|
||||
.notepad-thumb .notepad-thumb-delete { width: 30px; height: 30px; font-size: 18px; }
|
||||
.notepad-thumb .notepad-thumb-delete { width: 30px; height: 30px; font-size: var(--fs-h3); }
|
||||
.modal.picview[open] { grid-template-columns: 52px minmax(0, 1fr) 52px; }
|
||||
}
|
||||
|
||||
/* A finger, not a pointer: buttons are at least 40px tall and the small close
|
||||
buttons 32px. Nothing here is drawn for a mouse. */
|
||||
@media (pointer: coarse) {
|
||||
.btn, .btn.sm, .btn.tiny { min-height: 40px; }
|
||||
.attach-remove, .notepad-tab-x, .modal-x { min-width: 32px; min-height: 32px; }
|
||||
}
|
||||
|
||||
/* No hover to reveal them, so the controls that wait for one are always shown. */
|
||||
@media (hover: none) {
|
||||
.md-copy, .spec-chip-del { opacity: 1; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
|
||||
/* Re-enable the indicators whose whole job is to show that time is passing.
|
||||
Frozen, the spinner reads as a broken ring and Planny's star as a dead
|
||||
light, so the star keeps turning, slowly. His lean, blink, arms and feet
|
||||
are decoration and stay off. */
|
||||
/* Pseudo-elements too, and no delay (a delayed entrance would sit blank). */
|
||||
*, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
|
||||
/* Keep the progress indicators: frozen, the spinner looks broken and
|
||||
Planny's star dead, so the star turns slowly. Lean, blink, arms and feet
|
||||
stay off. */
|
||||
.spinner { animation: spin 1.6s linear infinite !important; }
|
||||
.planny.is-work .eye { animation: planny-spin 4s linear infinite !important; }
|
||||
/* The flight holds still rather than collapsing. Collapsed to its last
|
||||
frame every star would sit off the left edge and the sky would be empty;
|
||||
stopped, the field stays and Planny keeps his forward lean. */
|
||||
/* The flight holds still: collapsed to its last frame every star would sit
|
||||
off the left edge and the sky would be empty. */
|
||||
.sky .star, .trail i, .dock.is-flying .planny { animation: none !important; }
|
||||
/* The step poses hold their finished drawing -- every tick and line
|
||||
written, confetti where it was drawn -- and keep only the star's pulse. */
|
||||
/* Step poses hold their finished drawing; only the star pulses. */
|
||||
.pose, .pose * { animation: none !important; }
|
||||
.pose .ey.blink { animation: pose-pulse 2.4s ease-in-out infinite !important; }
|
||||
/* Help's Planny moods are pictures, not indicators: all of them hold
|
||||
still, the working star included. */
|
||||
/* Help's Planny moods are pictures: all hold still. */
|
||||
.help-mood-bot, .help-mood-bot *, .help-mood-bot.is-work .eye { animation: none !important; }
|
||||
#btn-send { animation: none; }
|
||||
.nudge { animation: none; }
|
||||
}
|
||||
|
||||
/* User Preferences: action rows (Cleanup's scan/delete buttons share this
|
||||
class; the model menu's own rules moved to agents.css). */
|
||||
/* Preferences action rows (Cleanup's buttons share this class). */
|
||||
.models-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
||||
.models-actions .help.error { color: var(--danger, #d64545); }
|
||||
.models-actions .help.error { color: var(--warn); }
|
||||
|
||||
/* User Preferences: Cleanup's list of what would go, shown before anything
|
||||
is deleted. */
|
||||
/* Cleanup's list of what would go. */
|
||||
.cleanup-list { display: grid; gap: 4px; max-height: 200px; overflow: auto; font-size: 0.88em; }
|
||||
.cleanup-list:empty { display: none; }
|
||||
.cleanup-summary { margin: 0 0 2px; font-weight: 600; }
|
||||
.cleanup-row { display: flex; justify-content: space-between; gap: 12px; }
|
||||
.cleanup-row span:first-child { min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); }
|
||||
.cleanup-size { flex: none; color: var(--ink-3); }
|
||||
.cleanup-row { display: flex; align-items: baseline; gap: 10px; }
|
||||
label.cleanup-row { cursor: pointer; }
|
||||
.cleanup-row input { flex: none; margin: 0; align-self: center; }
|
||||
.cleanup-row > span:not(.cleanup-size) { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); }
|
||||
.cleanup-kept-note summary { cursor: pointer; color: var(--ink-2); font-size: var(--fs-sm); }
|
||||
.cleanup-size { flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
|
||||
.cleanup-more { display: grid; gap: 4px; }
|
||||
.cleanup-more summary { cursor: pointer; color: var(--ink-2); }
|
||||
#cleanup-delete[hidden] { display: none; }
|
||||
|
||||
/* A word the person has to type, bold and in their highlight color so it
|
||||
does not get lost in the status sentence. */
|
||||
/* A word to type, bold and accented so it stands out in the sentence. */
|
||||
.agent-key {
|
||||
color: var(--accent);
|
||||
font-weight: 700;
|
||||
}
|
||||
/* Under the app, the word is a button that types it into the agent's terminal;
|
||||
"terminal" itself, while the app's panel is collapsed, expands it. */
|
||||
/* In the app the word is a button typing it into the terminal; "terminal"
|
||||
expands a collapsed panel. */
|
||||
.agent-key-btn, .agent-terminal-btn {
|
||||
font: inherit; font-weight: 700; color: var(--accent);
|
||||
background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 6px;
|
||||
background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-sm);
|
||||
padding: 0 6px; cursor: pointer;
|
||||
}
|
||||
.agent-key-btn:hover:not(:disabled), .agent-terminal-btn:hover { border-color: var(--accent); }
|
||||
.agent-key-btn:disabled { opacity: 0.55; cursor: default; }
|
||||
.agent-key-btn:focus-visible, .agent-terminal-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
||||
|
||||
/* "What to check", beside the quiet and Not running lines. A link in a button's clothes. */
|
||||
/* "What to check": a link styled as a button. */
|
||||
.status-help {
|
||||
font: inherit; font-size: 0.92em; font-weight: 600;
|
||||
color: var(--accent); background: none; border: 0; padding: 0 2px;
|
||||
text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
|
||||
}
|
||||
.status-help:hover { text-decoration-thickness: 2px; }
|
||||
.status-help:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
|
||||
.status-help:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
|
||||
|
||||
|
||||
/* V25: Windows High Contrast. Looked at first (forced colors, emulated in
|
||||
Chromium): the progress bar vanished (its fill and track are backgrounds),
|
||||
and the selected tab and the current rail item looked like the others
|
||||
(their selected look is a background). Those get a system-color outline;
|
||||
the filled marks keep their own colors, the switch thumbs take the text
|
||||
color so they stay visible. */
|
||||
@media (forced-colors: active) {
|
||||
.swatch, .progress-fill, .meter-ring { forced-color-adjust: none; }
|
||||
.progress-track { outline: 1px solid CanvasText; }
|
||||
[aria-selected="true"], [aria-current="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
|
||||
.learn-track::after, .learn-switch.is-on .learn-track::after { background: ButtonText; }
|
||||
}
|
||||
@@ -2,25 +2,23 @@
|
||||
|
||||
/* ------------------------------------------------------------- banner */
|
||||
|
||||
/* A pill floated over the footer, centered on the bar. It used to be the top
|
||||
grid row, and every time it appeared it pushed the whole page down a track;
|
||||
overlaying it means the message lands without the layout moving under the
|
||||
reader's cursor. It covers the footer's middle while it is up, which is
|
||||
safe: the messages it carries are the reason nothing there needs pressing. */
|
||||
/* A pill over the footer, centered on the bar. Overlaid, not a grid row, so
|
||||
it never shifts the layout. It covers the footer's middle, which is safe:
|
||||
nothing there needs pressing while it shows. */
|
||||
.banner {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
bottom: 10px;
|
||||
transform: translateX(-50%);
|
||||
z-index: 46;
|
||||
z-index: var(--z-toast);
|
||||
max-width: min(680px, calc(100vw - 32px));
|
||||
padding: 9px 22px;
|
||||
border: 1px solid var(--rule-2);
|
||||
border-radius: 99px;
|
||||
box-shadow: var(--shadow);
|
||||
border-radius: var(--radius-pill);
|
||||
box-shadow: var(--shadow-2);
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
font-size: var(--fs-md);
|
||||
background: var(--warn-soft);
|
||||
color: var(--warn);
|
||||
animation: banner-in 0.22s ease;
|
||||
@@ -59,36 +57,31 @@
|
||||
.row-left { display: flex; align-items: center; gap: 8px; }
|
||||
.brief-btn { border-color: var(--rule-2); color: var(--ink-2); }
|
||||
|
||||
/* Back to the dashboard: a filled triangle in the highlight color, so it
|
||||
recolors with the swatch like everything else that is the person's to use. */
|
||||
/* Back to the dashboard: a triangle in the highlight color. */
|
||||
.home-btn { border-color: var(--rule-2); display: inline-flex; align-items: center; justify-content: center; }
|
||||
/* As tall as Stop session beside it, with an icon's narrower sides. */
|
||||
.btn.home-btn { padding: 0 6px; align-self: stretch; margin-right: -8px; }
|
||||
.home-btn[hidden] { display: none; }
|
||||
.home-btn svg { width: 16px; height: 16px; display: block; }
|
||||
.home-btn path { fill: var(--accent); }
|
||||
.home-btn:hover:not(:disabled) { border-color: var(--accent-line); background: var(--accent-soft); }
|
||||
.home-btn:disabled path { fill: var(--ink-3); }
|
||||
.home-btn path { fill: var(--accent); stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
|
||||
.home-btn:hover:not(:disabled):not(.is-locked) { border-color: var(--accent-line); background: var(--accent-soft); }
|
||||
.home-btn:disabled path, .home-btn.is-locked path { fill: var(--ink-3); stroke: var(--ink-3); }
|
||||
|
||||
/* Ending the session. Quiet, because it is the one control on the page that
|
||||
is never the next step, and red only on hover, because it is not dangerous:
|
||||
it saves, then stops. */
|
||||
/* Ending the session: quiet (never the next step), red only on hover (it
|
||||
saves, then stops, so it is not dangerous). */
|
||||
.stop-btn { border-color: var(--rule-2); color: var(--ink-2); }
|
||||
.stop-btn:hover:not(:disabled) { color: var(--warn); border-color: var(--warn); }
|
||||
.stop-btn:hover:not(:disabled):not(.is-locked) { color: var(--warn); border-color: var(--warn); }
|
||||
.brief-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-line); }
|
||||
|
||||
/* Subagents: an orchestrator and its helpers. Unlit is a hollow outline in
|
||||
the quiet ink; lit fills the nodes with the highlight color. */
|
||||
/* Subagents: hollow outline unlit, filled with the highlight color when lit. */
|
||||
.subagents-btn { border-color: var(--rule-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
|
||||
.btn.subagents-btn { padding: 0 6px; align-self: stretch; }
|
||||
.subagents-btn[hidden] { display: none; }
|
||||
.subagents-btn svg { width: 16px; height: 16px; display: block; }
|
||||
.subagents-btn .sa-link { fill: none; stroke: var(--ink-2); stroke-width: 1.2; stroke-linecap: round; }
|
||||
.subagents-btn .sa-hub { fill: none; stroke: var(--ink-2); stroke-width: 1.4; }
|
||||
.subagents-btn .sa-node { fill: none; stroke: var(--ink-2); stroke-width: 1.2; }
|
||||
.subagents-btn[aria-pressed="true"] .sa-hub,
|
||||
.subagents-btn[aria-pressed="true"] .sa-node { fill: var(--accent); stroke: var(--accent); }
|
||||
.subagents-btn[aria-pressed="true"] .sa-link { stroke: var(--accent); }
|
||||
.subagents-btn .sa-link, .subagents-btn .sa-hub, .subagents-btn .sa-node { fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
||||
.subagents-btn[data-on="true"] .sa-hub,
|
||||
.subagents-btn[data-on="true"] .sa-node { fill: var(--accent); stroke: var(--accent); }
|
||||
.subagents-btn[data-on="true"] .sa-link { stroke: var(--accent); }
|
||||
.subagents-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-line); }
|
||||
.subagents-btn:hover:not(:disabled) .sa-link,
|
||||
.subagents-btn:hover:not(:disabled) .sa-hub,
|
||||
@@ -99,19 +92,18 @@
|
||||
|
||||
.ident { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
|
||||
|
||||
/* The session meter: a ring that fills with the points and a few words, in
|
||||
the level's color. Green, amber and red are the page's own done / staged /
|
||||
careful colors, so both themes are covered by the variables. */
|
||||
/* The session meter: a ring that fills with the points, in the level's color
|
||||
(the page's done / staged / careful variables, so both themes work). */
|
||||
.meter-slot { position: relative; flex: none; align-self: center; }
|
||||
.meter-pill {
|
||||
--m: var(--ok);
|
||||
display: inline-flex; align-items: center; gap: 7px;
|
||||
padding: 2px 10px 2px 3px;
|
||||
border: 1px solid color-mix(in srgb, var(--m) 40%, transparent);
|
||||
border-radius: 99px;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--panel);
|
||||
color: var(--m);
|
||||
font: inherit; font-size: 12px; font-weight: 600;
|
||||
font: inherit; font-size: var(--fs-xs); font-weight: 600;
|
||||
white-space: nowrap; cursor: pointer;
|
||||
}
|
||||
.meter-pill[hidden] { display: none; }
|
||||
@@ -121,59 +113,48 @@
|
||||
.meter-ring { width: 20px; height: 20px; transform: rotate(-90deg); flex: none; }
|
||||
.meter-ring circle { fill: none; stroke-width: 3; }
|
||||
.meter-track { stroke: var(--rule); }
|
||||
.meter-fill { stroke: var(--m); transition: stroke-dashoffset 0.2s ease; }
|
||||
.meter-fill { stroke: var(--m); transition: stroke-dashoffset var(--dur-2); }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.meter-fill { transition: none; }
|
||||
}
|
||||
.meter-pop {
|
||||
position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
|
||||
position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-pop);
|
||||
width: max-content; max-width: min(320px, calc(100vw - 32px));
|
||||
padding: 10px 12px;
|
||||
background: var(--panel); color: var(--ink);
|
||||
border: 1px solid var(--rule-2); border-radius: 8px;
|
||||
box-shadow: var(--shadow);
|
||||
border: 1px solid var(--rule-2); border-radius: var(--radius-md);
|
||||
box-shadow: var(--shadow-2);
|
||||
}
|
||||
.meter-pop[hidden] { display: none; }
|
||||
.meter-tip { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
|
||||
.meter-tip { margin: 0 0 6px; font-size: var(--fs-sm); color: var(--ink-2); }
|
||||
.meter-once { margin: 0 0 8px; padding: 6px 8px; border-left: 3px solid var(--stage); font-size: var(--fs-sm); color: var(--ink); }
|
||||
.meter-list {
|
||||
list-style: none; margin: 0 0 8px; padding: 6px 0 0;
|
||||
border-top: 1px solid var(--rule);
|
||||
max-height: 40vh; overflow-y: auto;
|
||||
font-size: 12px; color: var(--ink-2);
|
||||
font-size: var(--fs-xs); color: var(--ink-2);
|
||||
}
|
||||
.meter-list[hidden] { display: none; }
|
||||
.meter-list li { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
|
||||
.meter-fresh { margin: 0 0 8px; padding-top: 6px; border-top: 1px solid var(--rule); }
|
||||
.meter-fresh[hidden] { display: none; }
|
||||
.meter-fresh-text { margin: 0 0 6px; font-size: 12px; color: var(--ink-2); }
|
||||
.meter-fresh-text { margin: 0 0 6px; font-size: var(--fs-xs); color: var(--ink-2); }
|
||||
/* Under the app the whole note is one button: a press is the bar's New Session. */
|
||||
.meter-fresh-btn { display: block; width: 100%; margin: 2px 0 6px; }
|
||||
.meter-fresh-row .handoff-code { flex-basis: 180px; font-size: 12px; padding: 6px 10px; }
|
||||
.meter-fresh-row .handoff-code { flex-basis: 180px; font-size: var(--fs-xs); padding: 6px 10px; }
|
||||
.meter-item-points { flex: none; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* The spec in hand: small and muted so it never competes with the title. */
|
||||
.spec-tag {
|
||||
flex: 0 1 auto; min-width: 0; max-width: 220px; align-self: center;
|
||||
font-size: 11.5px; color: var(--ink-3);
|
||||
font-size: var(--fs-xs); color: var(--ink-3);
|
||||
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
}
|
||||
.spec-tag[hidden] { display: none; }
|
||||
|
||||
.badge {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.07em;
|
||||
text-transform: uppercase;
|
||||
color: var(--accent);
|
||||
background: var(--accent-soft);
|
||||
border: 1px solid var(--accent-line);
|
||||
padding: 3px 8px;
|
||||
border-radius: 99px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font: 600 19px/1.2 var(--serif);
|
||||
font: 600 var(--fs-h3)/1.2 var(--serif);
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -182,43 +163,37 @@ h1 {
|
||||
|
||||
.progress-block { flex: 1 1 260px; min-width: 200px; max-width: 460px; margin-left: auto; }
|
||||
|
||||
/* When the progress block is hidden (the dashboard, the git board) nothing
|
||||
grows to fill the row, so the icon buttons would sit beside the title. The
|
||||
first takes the slack instead; with the block shown its flex already eats
|
||||
the space, so this costs nothing. */
|
||||
#btn-looks { margin-left: auto; }
|
||||
|
||||
.progress-label {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
font-size: 12.5px;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-2);
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#progress-text { font-weight: 600; color: var(--ink); }
|
||||
#progress-text { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
|
||||
.confidence { color: var(--ink-3); text-align: right; }
|
||||
|
||||
.progress-track {
|
||||
height: 7px;
|
||||
background: var(--rule);
|
||||
border-radius: 99px;
|
||||
border-radius: var(--radius-pill);
|
||||
overflow: hidden;
|
||||
}
|
||||
.progress-fill {
|
||||
height: 100%;
|
||||
width: 0%;
|
||||
width: 100%;
|
||||
background: var(--ok);
|
||||
border-radius: 99px;
|
||||
transition: width 0.5s ease;
|
||||
/* The track clips the rounded left end; scaleX leaves the right end square. */
|
||||
transform: scaleX(var(--p, 0));
|
||||
transform-origin: left;
|
||||
transition: transform 0.5s ease;
|
||||
}
|
||||
|
||||
.tick { color: var(--ink-3); font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* Planny's own corner. He was 23px in a title bar, which is a logo, not a
|
||||
guide: too small to read a mood off and too small to look at. Here he has
|
||||
room, he sits above the question list where the eye starts, and his line
|
||||
wraps instead of squeezing the view tabs. */
|
||||
/* Planny's corner, above the question list: big enough to read a mood off,
|
||||
and his line wraps instead of squeezing the view tabs. */
|
||||
.dock {
|
||||
flex: none;
|
||||
display: flex;
|
||||
@@ -244,6 +219,15 @@ h1 {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* A side column with nothing to show is not drawn: an empty aside gives its
|
||||
track back (the dashboard, the git board, the finish and document views),
|
||||
and the git board never has notes. The main column is centered, so the
|
||||
freed width becomes margin or, past card-rows.js's math, another card column. */
|
||||
.layout:has(> .aside:empty),
|
||||
.layout:has(.git-board) { grid-template-columns: 250px minmax(0, 1fr); }
|
||||
.layout > .aside:empty,
|
||||
.layout:has(.git-board) > .aside { display: none; }
|
||||
|
||||
.rail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -255,11 +239,9 @@ h1 {
|
||||
.sidebar { flex: 1; }
|
||||
.aside { border-left: 1px solid var(--rule); background: var(--panel-2); }
|
||||
|
||||
/* The question column does not scroll: the CARD does.
|
||||
A long question used to push Previous / Next below the fold, so the way on
|
||||
disappeared exactly when the question was big enough to need it. The card is
|
||||
the only thing here that shrinks, so it takes the squeeze and scrolls its own
|
||||
contents while its frame, and the pager under it, stay put. */
|
||||
/* The question column does not scroll: the CARD does, so a long question
|
||||
never pushes Previous / Next below the fold. The card alone shrinks and
|
||||
scrolls its contents; its frame and the pager stay put. */
|
||||
.main {
|
||||
padding: 24px 28px;
|
||||
overflow: hidden;
|
||||
@@ -269,29 +251,25 @@ h1 {
|
||||
}
|
||||
.main > * { width: 100%; max-width: min(var(--card-width), 100%); margin-left: auto; margin-right: auto; }
|
||||
/* The card is the column's only framed child: a page holds ONE, with notes
|
||||
and lulls folded into it as sections. It takes the squeeze and scrolls its
|
||||
own contents while its frame, and the pager under it, stay put. */
|
||||
and lulls folded in as sections. */
|
||||
.main > .card {
|
||||
flex: 0 1 auto;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
scrollbar-gutter: stable;
|
||||
padding-right: 32px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
/* The dashboard's menu and the launching pane play by the card's rule too:
|
||||
they are not .card, but they are the column's whole contents, so they take
|
||||
the squeeze and scroll themselves while the column frame stays put. Without
|
||||
this the catalog is clipped at the fold with no way to reach it. */
|
||||
/* The dashboard menu and launching pane follow the card's rule: they are the
|
||||
column's whole contents, and without it the catalog is clipped at the fold. */
|
||||
.main > .dash, .main > .launching, .main > .dash-confirm, .main > .waiting-pane {
|
||||
flex: 0 1 auto;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
scrollbar-gutter: stable;
|
||||
padding-right: 32px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
/* The agent setup page is the column's whole contents too, and its agent list
|
||||
runs past the fold, so it scrolls itself like the menu above. */
|
||||
/* The agent setup page is the column's whole contents too; it scrolls itself. */
|
||||
.main > .setup-screen {
|
||||
flex: 0 1 auto;
|
||||
min-height: 0;
|
||||
@@ -299,32 +277,27 @@ h1 {
|
||||
overscroll-behavior: contain;
|
||||
scrollbar-gutter: stable;
|
||||
}
|
||||
/* Its parts keep their height: the agent list clips its own overflow, so left
|
||||
to shrink it would be cut at the fold instead of scrolling. */
|
||||
/* Its parts keep their height: the agent list clips its overflow, so a shrink
|
||||
would cut it at the fold. */
|
||||
.main > .setup-screen > * { flex-shrink: 0; }
|
||||
|
||||
/* The column itself never scrolls; the card does. The git board is the one
|
||||
exception, below: its card sits in the board's card slot, so the column
|
||||
takes the scroll there and card and board flow through it at natural height. */
|
||||
/* The column never scrolls; the card does. Exception, below: on the git board
|
||||
the column scrolls and card and board flow at natural height. */
|
||||
.main > .card:not(.is-primary) { flex-shrink: 100; min-height: 104px; }
|
||||
.main > .card.is-primary { flex-shrink: 1; min-height: 0; }
|
||||
/* A card with a growing answer box takes the column's full height above the
|
||||
pager, and still scrolls its own contents. app.js sizes the box to fill it. */
|
||||
pager (app.js sizes the box). */
|
||||
.main > .card.is-primary.has-grow { flex: 1 1 auto; }
|
||||
/* More below the fold (app.js markMore): the bottom edge fades, so a card
|
||||
cut by the window never reads as finished. */
|
||||
/* More below the fold (app.js markMore): the bottom edge fades. */
|
||||
.main > .card.has-more {
|
||||
-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
|
||||
mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
|
||||
}
|
||||
.pager { flex: none; }
|
||||
|
||||
/* A document is read top to bottom and has no pinned furniture, so it goes back
|
||||
to being an ordinary scrolling column. */
|
||||
/* The tail the column no longer carries: a document IS the scroll, so it wants
|
||||
room after its last line. The question column does not, because the pager is
|
||||
pinned to the bottom of it and anything under the pager is dead space the
|
||||
card could have been scrolling through. */
|
||||
/* A document is an ordinary scrolling column with no pinned furniture, so it
|
||||
wants room after its last line; the question column does not (space under
|
||||
the pager is dead space). */
|
||||
.main.is-doc { display: block; overflow-y: auto; padding-bottom: 40px; }
|
||||
|
||||
/* ------------------------------------------------------------ sidebar */
|
||||
@@ -332,11 +305,6 @@ h1 {
|
||||
.rail-group { margin-bottom: 22px; }
|
||||
|
||||
.rail-title {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.07em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-3);
|
||||
margin: 0 0 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -354,7 +322,7 @@ h1 {
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
font: inherit;
|
||||
font-size: 13.5px;
|
||||
font-size: var(--fs-md);
|
||||
padding: 7px 9px;
|
||||
border-radius: 0;
|
||||
cursor: pointer;
|
||||
@@ -362,9 +330,8 @@ h1 {
|
||||
}
|
||||
.rail-item:hover:not(:disabled) { background: var(--panel-2); color: var(--ink); }
|
||||
.rail-item:disabled { cursor: default; }
|
||||
/* The dashboard lists every skill in the rail; the ones the selected spec
|
||||
rules out should read as out of reach at a glance, not as one more link. */
|
||||
.rail-item.is-unavailable { opacity: 0.35; cursor: not-allowed; }
|
||||
/* Skills the selected spec rules out read as out of reach, not as links. */
|
||||
.rail-item.is-unavailable { opacity: 0.5; cursor: not-allowed; }
|
||||
.rail-item.is-unavailable .rail-mark { color: var(--ink-3); }
|
||||
.rail-item[aria-current="true"] {
|
||||
background: var(--accent-soft);
|
||||
@@ -373,13 +340,12 @@ h1 {
|
||||
box-shadow: inset 2px 0 0 var(--accent);
|
||||
}
|
||||
|
||||
.rail-mark { flex: none; width: 15px; text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
|
||||
.rail-mark { flex: none; width: 15px; text-align: center; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 1px; }
|
||||
.rail-mark.done { color: var(--ok); }
|
||||
.rail-mark.staged { color: var(--stage); font-weight: 700; }
|
||||
|
||||
/* Echoes the center pane's "Suggested" pill, which can scroll out of view;
|
||||
the dot keeps the call-out visible while just scanning the rail. The
|
||||
title grows to push the dot flush with the row's right edge. */
|
||||
/* Echoes the center pane's "Suggested" pill, which can scroll out of view.
|
||||
The title grows to push the dot to the row's right edge. */
|
||||
.rail-item > span:not(.rail-mark):not(.rail-suggested-dot) { flex: 1 1 auto; }
|
||||
.rail-suggested-dot {
|
||||
flex: none;
|
||||
@@ -392,42 +358,29 @@ h1 {
|
||||
.rail-item.is-suggested:not([aria-current="true"]) { color: var(--ink); }
|
||||
.rail-mark.open { color: var(--accent); }
|
||||
|
||||
/* The session's own page, above the topic groups. It names the state it is
|
||||
-- PAUSED, SESSION ENDED -- in the same small caps the group titles use,
|
||||
because it is a peer of theirs, not another question in the list. */
|
||||
.rail-end-label {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.07em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
/* The session's own page, above the topic groups: a peer of them. */
|
||||
|
||||
.rail-empty { color: var(--ink-3); font-size: 13px; font-style: italic; }
|
||||
|
||||
/* -------------------------------------------------------------- aside */
|
||||
|
||||
.aside h2 {
|
||||
font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
|
||||
color: var(--ink-3); margin: 0 0 12px;
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
|
||||
.msg {
|
||||
border-radius: 8px; padding: 10px 13px; margin-bottom: 9px; font-size: 13.5px;
|
||||
border-radius: var(--radius-md); padding: 10px 13px; margin-bottom: 9px; font-size: var(--fs-md);
|
||||
background: var(--panel); border: 1px solid var(--rule);
|
||||
}
|
||||
.msg.you { background: var(--stage-soft); border-color: transparent; }
|
||||
.msg.staged { border-style: dashed; border-color: var(--stage); background: transparent; }
|
||||
.msg-who {
|
||||
font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
|
||||
color: var(--ink-3); margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px;
|
||||
margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px;
|
||||
}
|
||||
|
||||
.msg-who .sent-wait { display: inline-flex; align-items: center; gap: 6px; }
|
||||
|
||||
.aside-empty { color: var(--ink-3); font-size: 13px; font-style: italic; }
|
||||
|
||||
/* The note box takes whatever height the panel has left, never under 160px.
|
||||
Scoped here so the page-wide box minimum still holds everywhere else. */
|
||||
/* The note box takes the panel's leftover height, min 160px (scoped here). */
|
||||
.aside { display: flex; flex-direction: column; }
|
||||
.aside > .field { flex: 1 0 auto; display: flex; flex-direction: column; min-height: 0; }
|
||||
.aside .md-host { flex: 1 1 auto; min-height: 160px; resize: vertical; }
|
||||
@@ -440,26 +393,20 @@ h1 {
|
||||
|
||||
.attach-row { display: flex; align-items: center; margin: -4px 0 6px -13px; }
|
||||
.attach-row.is-under { margin: 6px 0 4px -13px; }
|
||||
/* .btn on the chip's rule: pieces.css loads later, and .btn.tiny's bottom
|
||||
margin would otherwise lift the chip off the row's center line. */
|
||||
.attach-row .btn.suggest-chip { margin: 0 0 0 auto; }
|
||||
.attach-row .suggest-nudge { margin-left: auto; }
|
||||
.attach-row .suggest-nudge + .suggest-chip { margin-left: 9px; }
|
||||
.msg .suggest-tag {
|
||||
display: inline-block; margin-bottom: 4px;
|
||||
background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line);
|
||||
}
|
||||
.msg .suggest-tag { margin-bottom: 4px; }
|
||||
.attach-tray { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
|
||||
.attach-thumb {
|
||||
position: relative;
|
||||
width: 72px; height: 72px; margin: 0;
|
||||
border: 1px solid var(--rule); border-radius: 8px;
|
||||
border: 1px solid var(--rule); border-radius: var(--radius-md);
|
||||
overflow: hidden; background: var(--panel);
|
||||
flex: none;
|
||||
}
|
||||
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||
/* The picture in a thumbnail is a button that opens the picview, with the
|
||||
tray's round X in its corner and the upload state laid over it. */
|
||||
/* The thumbnail picture is a button that opens the picview. */
|
||||
.attach-open {
|
||||
display: block;
|
||||
width: 100%;
|
||||
@@ -469,14 +416,14 @@ h1 {
|
||||
background: none;
|
||||
cursor: zoom-in;
|
||||
}
|
||||
.attach-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
|
||||
.attach-open:focus-visible { outline: 2px solid var(--focus); outline-offset: calc(var(--focus-offset) * -1); }
|
||||
.attach-thumb.is-uploading .attach-open,
|
||||
.attach-thumb.is-failed .attach-open { cursor: default; }
|
||||
.attach-remove {
|
||||
position: absolute; top: 3px; right: 3px; z-index: 2;
|
||||
width: 20px; height: 20px; padding: 0;
|
||||
display: grid; place-items: center;
|
||||
font: 700 14px/1 var(--sans);
|
||||
font: 700 var(--fs-md)/1 var(--sans);
|
||||
color: var(--ink); background: var(--panel);
|
||||
border: 1px solid var(--rule-2); border-radius: 50%;
|
||||
cursor: pointer; opacity: 0.9;
|
||||
@@ -489,9 +436,9 @@ h1 {
|
||||
}
|
||||
.attach-overlay.failed {
|
||||
background: color-mix(in srgb, var(--panel) 88%, transparent);
|
||||
color: var(--ink-2); font-size: 10.5px; font-weight: 600; text-align: center;
|
||||
color: var(--ink-2); font-size: var(--fs-2xs); font-weight: 600; text-align: center;
|
||||
}
|
||||
.attach-overlay.failed .btn.tiny { margin: 0; padding: 1px 6px; font-size: 10.5px; }
|
||||
.attach-overlay.failed .btn.xs { padding: 1px 6px; font-size: var(--fs-2xs); }
|
||||
.attach-chip {
|
||||
width: 180px;
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
@@ -503,26 +450,24 @@ h1 {
|
||||
}
|
||||
.attach-chip-text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
|
||||
.attach-chip-badge {
|
||||
padding: 0 5px; border-radius: 4px;
|
||||
font: 700 10px/1.5 var(--sans); letter-spacing: 0.04em; font-variant: small-caps;
|
||||
padding: 0 5px; border-radius: var(--radius-xs);
|
||||
font: 700 var(--fs-2xs)/1.5 var(--sans); letter-spacing: 0.04em; font-variant: small-caps;
|
||||
color: var(--ink); background: var(--accent-soft);
|
||||
}
|
||||
.attach-chip-name {
|
||||
max-width: 100%;
|
||||
overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
|
||||
font-size: 12.5px; font-weight: 600; color: var(--ink);
|
||||
font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
|
||||
}
|
||||
.attach-chip-size { color: var(--ink-2); font-size: 11.5px; }
|
||||
.attach-link { color: inherit; text-decoration: none; border-radius: 8px; }
|
||||
.attach-chip-size { color: var(--ink-2); font-size: var(--fs-xs); }
|
||||
.attach-link { color: inherit; text-decoration: none; border-radius: var(--radius-md); }
|
||||
.attach-link:hover .attach-thumb, .attach-link:focus-visible .attach-thumb { border-color: var(--accent); }
|
||||
.attach-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
/* The same hover border a linked thumbnail gets, for a thumbnail whose own
|
||||
button opens the picview. */
|
||||
.attach-link:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
/* Same hover border as a linked thumbnail. */
|
||||
.attach-thumb:has(.attach-open:hover) { border-color: var(--accent); }
|
||||
|
||||
/* The full-screen picture preview: the whole viewport, the picture contained
|
||||
in it, on a near-black backdrop in both themes (a picture is judged against
|
||||
dark, whatever the page's theme), so its colors are fixed, not tokens. */
|
||||
/* Full-screen picture preview on a near-black backdrop in both themes (a
|
||||
picture is judged against dark), so its colors are fixed, not tokens. */
|
||||
.modal.picview {
|
||||
inset: 0;
|
||||
width: 100vw;
|
||||
@@ -562,7 +507,7 @@ h1 {
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
color: #fff;
|
||||
font: 600 28px/1 var(--sans);
|
||||
font: 600 var(--fs-h1)/1 var(--sans);
|
||||
cursor: pointer;
|
||||
}
|
||||
.picview-step.is-prev { grid-column: 1; }
|
||||
@@ -579,37 +524,34 @@ h1 {
|
||||
gap: 16px;
|
||||
padding: 12px 16px 20px;
|
||||
}
|
||||
.picview-count { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, 0.8); }
|
||||
.picview-count { margin: 0; font-size: var(--fs-md); color: rgba(255, 255, 255, 0.8); }
|
||||
.btn.picview-close { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
|
||||
.btn.picview-close:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
|
||||
|
||||
.msg.pending { border-style: dashed; border-color: var(--stage); background: transparent; }
|
||||
.ask-row .attach-chip { padding-right: 10px; }
|
||||
|
||||
.footer-held { margin-top: 3px; color: var(--ink-2); font-size: 12.5px; }
|
||||
.footer-held { margin-top: 3px; color: var(--ink-2); font-size: var(--fs-sm); }
|
||||
|
||||
/* ------------------------------------------------------------- footer */
|
||||
|
||||
/* Three columns: summary, where, actions. Equal side tracks keep the middle
|
||||
centered on the bar, and because they are tracks rather than an overlay, a
|
||||
long summary wraps and a wide actions block nudges the center over instead
|
||||
of either running underneath it. The middle track gives way first: it can
|
||||
shrink to an ellipsis, the summary and Send never do. */
|
||||
centered; a long summary wraps and wide actions nudge the center instead of
|
||||
overlapping. The middle gives way first (ellipsis), summary and Send never. */
|
||||
.footer {
|
||||
display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: 18px;
|
||||
padding: 13px 20px;
|
||||
background: var(--panel);
|
||||
border-top: 1px solid var(--rule);
|
||||
}
|
||||
.footer-summary { min-width: 200px; font-size: 13.5px; color: var(--ink-2); }
|
||||
.footer-summary { min-width: 200px; font-size: var(--fs-md); color: var(--ink-2); }
|
||||
.footer-summary strong { color: var(--ink); }
|
||||
/* Where this session is running: the workspace label, centered on the bar. A
|
||||
click opens the Workspace dialog. The notification pill sits over the same
|
||||
spot and covers it while it shows. */
|
||||
/* The workspace label, centered on the bar; a click opens the Workspace
|
||||
dialog. The notification pill covers it while it shows. */
|
||||
.footer-where {
|
||||
max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||
padding: 2px 6px; border: 0; background: none;
|
||||
font: inherit; font-size: 12px; color: var(--ink-3);
|
||||
font: inherit; font-size: var(--fs-xs); color: var(--ink-3);
|
||||
cursor: pointer;
|
||||
}
|
||||
.footer-where:hover { text-decoration: underline; }
|
||||
@@ -620,9 +562,8 @@ h1 {
|
||||
display: inline-block; width: 7px; height: 7px; margin-left: 6px;
|
||||
border-radius: 50%; background: var(--warn); vertical-align: 1px;
|
||||
}
|
||||
.footer-where:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
|
||||
/* One line, so the grid sizes this track to the whole row and takes the room
|
||||
from the middle instead of folding Send in two. */
|
||||
.footer-where:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
|
||||
/* One line, so the track takes room from the middle instead of folding Send. */
|
||||
.footer-actions { display: flex; gap: 10px; align-items: center; grid-column: 3; justify-self: end; white-space: nowrap; }
|
||||
/* The dashboard: no summary, no Send, just the workspace label. */
|
||||
.footer.is-dash .footer-summary,
|
||||
@@ -631,24 +572,22 @@ h1 {
|
||||
.footer.is-dash-done .footer-actions { display: none; }
|
||||
.footer.is-loop-idle .footer-summary,
|
||||
.footer.is-loop-idle .footer-actions { visibility: hidden; }
|
||||
.hint { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
|
||||
/* A label, not a sentence: the full reason rides in the hint's tooltip, and
|
||||
the dock already carries the ticking clock this would otherwise repeat. */
|
||||
.hint { font-size: var(--fs-sm); color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
|
||||
/* A label; the full reason rides in the tooltip. */
|
||||
.hint-text { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; }
|
||||
|
||||
kbd {
|
||||
font: 11.5px var(--mono);
|
||||
font: var(--fs-xs) var(--mono);
|
||||
background: var(--panel-2);
|
||||
border: 1px solid var(--rule-2);
|
||||
border-bottom-width: 2px;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--radius-xs);
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ waiting */
|
||||
|
||||
/* Laid out like the starting screen, so when a session goes from one to the
|
||||
other Planny stays put and only the words under him change. */
|
||||
/* Laid out like the starting screen, so Planny stays put between them. */
|
||||
.waiting-pane {
|
||||
max-width: 560px;
|
||||
margin: 4vh auto 0 !important;
|
||||
@@ -658,10 +597,9 @@ kbd {
|
||||
gap: 12px;
|
||||
justify-items: center;
|
||||
}
|
||||
.waiting-pane h2 { font: 600 23px/1.3 var(--serif); color: var(--ink); margin: 0; }
|
||||
.waiting-pane h2 { font: 600 var(--fs-h1)/1.3 var(--serif); color: var(--ink); margin: 0; }
|
||||
.waiting-pane p { max-width: 70ch; margin: 0; }
|
||||
/* The words that open the live task view (the phase-file tab on a build):
|
||||
bold in the highlight color, a button that reads as part of the sentence. */
|
||||
/* Words that open the live task view: a button styled as part of the sentence. */
|
||||
.waiting-jump {
|
||||
font: inherit;
|
||||
font-weight: 700;
|
||||
@@ -672,9 +610,8 @@ kbd {
|
||||
}
|
||||
button.waiting-jump { cursor: pointer; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
|
||||
button.waiting-jump:hover { text-decoration-color: var(--accent); }
|
||||
/* Once the work is under way Planny steps back a size, and the ring in
|
||||
front of the stage name carries the "still going" signal instead. */
|
||||
.waiting-pane .pose-stage { height: 130px; transition: height 0.35s ease; }
|
||||
/* Once work is under way Planny shrinks and the ring carries "still going". */
|
||||
.waiting-pane .pose-stage { height: 130px; transition: height var(--dur-3); }
|
||||
.waiting-pane h2 .waiting-spin { display: inline-block; width: 16px; height: 16px; vertical-align: 1px; margin-right: 10px; }
|
||||
|
||||
.spinner {
|
||||
@@ -686,9 +623,8 @@ button.waiting-jump:hover { text-decoration-color: var(--accent); }
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
|
||||
/* The footer's "waiting on the agent" tell. Same ring, sized to sit on a line
|
||||
of text. It inherits the reduced-motion exception below, which is deliberate:
|
||||
a frozen spinner reads as a broken app, which is the opposite of the point. */
|
||||
/* The footer's "waiting on the agent" ring, line-sized. It keeps spinning under
|
||||
reduced motion on purpose: a frozen spinner reads as a broken app. */
|
||||
.spinner.tiny {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
@@ -697,23 +633,21 @@ button.waiting-jump:hover { text-decoration-color: var(--accent); }
|
||||
flex: none;
|
||||
}
|
||||
|
||||
/* The same ring again, in front of Planny's line while the agent has the
|
||||
ball. Inline so it sits on the first line of a wrapped sentence. The
|
||||
[hidden] rule is needed because display here outranks the browser's own. */
|
||||
/* The ring in front of Planny's line, inline on a wrapped sentence's first
|
||||
line. [hidden] is needed because display here outranks the browser's. */
|
||||
.dock-spin { display: inline-block; vertical-align: -2px; margin-right: 6px; }
|
||||
.dock-spin[hidden] { display: none; }
|
||||
|
||||
.robot { font: 12px/1.25 var(--mono); color: var(--ink-3); white-space: pre; margin: 0 0 16px; }
|
||||
.robot { font: var(--fs-xs)/1.25 var(--mono); color: var(--ink-3); white-space: pre; margin: 0 0 16px; }
|
||||
|
||||
/* ------------------------------------------------------------ arrival */
|
||||
|
||||
/* The beat when new questions land. Covers the whole page, says what just
|
||||
happened, and leaves by itself in under two seconds. Built from the page's
|
||||
own tokens so it follows the theme and the chosen highlight color. */
|
||||
/* The beat when new questions land: covers the page and leaves by itself in
|
||||
under two seconds. Uses page tokens, so it follows theme and highlight. */
|
||||
.arrival {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 50;
|
||||
z-index: var(--z-overlay);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background: color-mix(in srgb, var(--bg) 72%, transparent);
|
||||
@@ -725,18 +659,15 @@ button.waiting-jump:hover { text-decoration-color: var(--accent); }
|
||||
|
||||
.arrival-box { text-align: center; padding: 24px; max-width: min(640px, 100vw - 32px); }
|
||||
|
||||
.rail-end-label { color: inherit; }
|
||||
.arrival-kicker {
|
||||
margin: 0 0 10px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.14em;
|
||||
text-transform: uppercase;
|
||||
color: var(--accent);
|
||||
animation: arrival-rise 0.45s 0.05s ease-out both;
|
||||
}
|
||||
|
||||
/* The words themselves are the effect: they sweep in on a band of the
|
||||
highlight color, the way a page turns, rather than anything spinning. */
|
||||
/* The words sweep in on a band of the highlight color, nothing spinning. */
|
||||
.arrival-title {
|
||||
margin: 0;
|
||||
font: 600 clamp(38px, 7vw, 64px)/1.05 var(--serif);
|
||||
@@ -757,7 +688,7 @@ button.waiting-jump:hover { text-decoration-color: var(--accent); }
|
||||
height: 3px;
|
||||
width: 96px;
|
||||
margin: 14px auto 0;
|
||||
border-radius: 99px;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--accent);
|
||||
transform-origin: center;
|
||||
animation: arrival-draw 0.5s 0.45s ease-out both;
|
||||
@@ -765,14 +696,14 @@ button.waiting-jump:hover { text-decoration-color: var(--accent); }
|
||||
|
||||
.arrival-what {
|
||||
margin: 16px 0 0;
|
||||
font-size: 17px;
|
||||
font-size: var(--fs-lg);
|
||||
font-weight: 600;
|
||||
color: var(--ink-2);
|
||||
animation: arrival-rise 0.45s 0.35s ease-out both;
|
||||
}
|
||||
.arrival-more {
|
||||
margin: 4px 0 0;
|
||||
font-size: 13.5px;
|
||||
font-size: var(--fs-md);
|
||||
color: var(--ink-3);
|
||||
animation: arrival-rise 0.45s 0.45s ease-out both;
|
||||
}
|
||||
@@ -791,16 +722,13 @@ button.waiting-jump:hover { text-decoration-color: var(--accent); }
|
||||
|
||||
|
||||
/* A question that arrived while the person was typing, until it is opened. */
|
||||
.rail-new {
|
||||
flex: none;
|
||||
align-self: flex-start;
|
||||
margin-top: 2px;
|
||||
padding: 0 6px;
|
||||
border-radius: 999px;
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: .04em;
|
||||
text-transform: uppercase;
|
||||
background: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
}
|
||||
.rail-new { flex: none; align-self: flex-start; margin-top: 2px; }
|
||||
|
||||
/* A warning stays until dismissed or replaced: its close button, at the end of the line. */
|
||||
.banner .banner-dismiss { margin-left: 10px; padding: 2px; border: 0; background: none; color: inherit; cursor: pointer; vertical-align: middle; }
|
||||
.banner .banner-dismiss svg { width: 14px; height: 14px; display: block; }
|
||||
.banner .banner-dismiss:focus-visible { outline: 2px solid var(--focus); outline-offset: var(--focus-offset); }
|
||||
|
||||
/* The home and Subagents buttons name themselves beside their icons, as Notebook does; the narrow strip keeps the icons alone. */
|
||||
.home-btn .topbar-label, .subagents-btn .topbar-label { margin-left: 6px; font-size: var(--fs-sm); line-height: 1; }
|
||||
.btn.home-btn { gap: 0; }
|
||||
@@ -1,8 +1,7 @@
|
||||
/* tokens.css: Colors, type, sizes and the light and dark themes: the variables every other file reads. */
|
||||
|
||||
/* Plan2Code Console.
|
||||
Light by default, dark when the system asks. No external fonts: the page must
|
||||
work offline and under a CSP with no 'unsafe-inline'. */
|
||||
/* Light by default, dark when the system asks. No external fonts: the page
|
||||
must work offline under a CSP with no 'unsafe-inline'. */
|
||||
|
||||
:root {
|
||||
--bg: #f6f3ee;
|
||||
@@ -10,7 +9,7 @@
|
||||
--panel-2: #fbf9f6;
|
||||
--ink: #1d1a17;
|
||||
--ink-2: #5d564d;
|
||||
/* Same hue as before, darkened to 4.56:1 on --bg (WCAG AA for body text). */
|
||||
/* 4.56:1 on --bg (WCAG AA body text). */
|
||||
--ink-3: #756e62;
|
||||
--rule: #e4ddd1;
|
||||
--rule-2: #cfc6b6;
|
||||
@@ -20,41 +19,92 @@
|
||||
--accent-line: #9ab4d3;
|
||||
--ok: #2f6b45;
|
||||
--ok-soft: #e4f0e8;
|
||||
--stage: #9a6a12;
|
||||
--stage: #8f620f;
|
||||
--stage-soft: #fbf0d8;
|
||||
--warn: #9c3327;
|
||||
--warn-soft: #fbe7e3;
|
||||
/* Text on a --warn fill. */
|
||||
--warn-ink: #ffffff;
|
||||
--focus: #1f6feb;
|
||||
/* Not a color, so the dark blocks need no copy. */
|
||||
--focus-offset: 2px;
|
||||
/* Rank colors for low / mid / high badges (a helper's strength and effort). */
|
||||
--lvl-0: #5b6472;
|
||||
--lvl-0-soft: #e8eaee;
|
||||
--lvl-1: #23716a;
|
||||
--lvl-1-soft: #e1f1ee;
|
||||
--lvl-2: #9a6a12;
|
||||
--lvl-2: #8f620f;
|
||||
--lvl-2-soft: #fbf0d8;
|
||||
--lvl-3: #7a3fa8;
|
||||
--lvl-3-soft: #f1e7f8;
|
||||
--shadow: 0 1px 2px rgba(29, 26, 23, 0.05), 0 8px 24px rgba(29, 26, 23, 0.06);
|
||||
/* A soft accent halo for the things that want noticing: the update banner
|
||||
and an enabled Send. Built from --accent, so a picked accent glows too. */
|
||||
/* Three elevations: cards, popovers, dialogs. --shadow stays for the games. */
|
||||
--shadow-1: 0 1px 2px rgba(29, 26, 23, 0.05), 0 8px 24px rgba(29, 26, 23, 0.06);
|
||||
--shadow-2: 0 2px 4px rgba(29, 26, 23, 0.08), 0 12px 28px rgba(29, 26, 23, 0.14);
|
||||
--shadow-3: 0 24px 64px rgb(0 0 0 / 0.22);
|
||||
--shadow: var(--shadow-1);
|
||||
/* Accent halo for the update banner and an enabled Send; follows --accent. */
|
||||
--glow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 12px color-mix(in srgb, var(--accent) 35%, transparent);
|
||||
/* Sticky footer shadow, dialog dim, and form control fill (sunken). */
|
||||
--shadow-up: 0 -4px 14px rgba(29, 26, 23, 0.07);
|
||||
--scrim: rgba(29, 26, 23, 0.45);
|
||||
--field: #fbf9f6;
|
||||
--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
--serif: "Iowan Old Style", Charter, Georgia, Cambria, serif;
|
||||
--serif: "Iowan Old Style", Charter, Cambria, Georgia, serif;
|
||||
--mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
|
||||
/* Shape: xs chips and focus rings, sm small controls, md inputs and rows,
|
||||
--radius cards and dialogs. */
|
||||
--radius-xs: 4px;
|
||||
--radius-sm: 6px;
|
||||
--radius-md: 8px;
|
||||
--radius: 10px;
|
||||
--radius-pill: 999px;
|
||||
/* Layers (local 0/1/2 stacking keeps its literal). The skip link outranks the
|
||||
arrival overlay so a keyboard user can still see it. */
|
||||
--z-sticky: 5;
|
||||
--z-pop: 40;
|
||||
--z-wake: 45;
|
||||
--z-toast: 46;
|
||||
--z-overlay: 50;
|
||||
--z-menu: 60;
|
||||
/* Spacing steps, for new work only. */
|
||||
--sp-1: 4px;
|
||||
--sp-2: 8px;
|
||||
--sp-3: 12px;
|
||||
--sp-4: 16px;
|
||||
--sp-5: 24px;
|
||||
--sp-6: 32px;
|
||||
/* 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;
|
||||
--lh-tight: 1.25;
|
||||
--lh-ui: 1.4;
|
||||
--lh-body: 1.55;
|
||||
/* Motion. */
|
||||
--dur-1: 120ms;
|
||||
--dur-2: 200ms;
|
||||
--dur-3: 350ms;
|
||||
--ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
|
||||
--ease-spring: cubic-bezier(0.3, 1.6, 0.5, 1);
|
||||
}
|
||||
/* The card-width presets. These must agree with CARD_WIDTHS in palette.js,
|
||||
which validates the saved choice and paints data-width on first load. */
|
||||
/* Card-width presets: must agree with CARD_WIDTHS in palette.js. */
|
||||
:root[data-width="narrow"] { --card-width: 720px; }
|
||||
:root[data-width="wide"] { --card-width: 1080px; }
|
||||
:root[data-width="ultrawide"] { --card-width: 1440px; }
|
||||
|
||||
/* Dark is written twice on purpose, and the duplication is the whole mechanism.
|
||||
The first copy follows the system unless the person has explicitly asked for
|
||||
light; the second is the explicit ask. Without the `:not()` a system-dark
|
||||
browser would win over someone who chose light in the settings panel. */
|
||||
/* 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
|
||||
system-dark browser would override a chosen light. */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--bg: #171513;
|
||||
@@ -62,7 +112,7 @@
|
||||
--panel-2: #262220;
|
||||
--ink: #f0ece5;
|
||||
--ink-2: #b6afa3;
|
||||
--ink-3: #8b8376;
|
||||
--ink-3: #9a9285;
|
||||
--rule: #332e29;
|
||||
--rule-2: #46403a;
|
||||
--accent: #619fe5;
|
||||
@@ -75,6 +125,7 @@
|
||||
--stage-soft: #332a17;
|
||||
--warn: #f0897a;
|
||||
--warn-soft: #34201d;
|
||||
--warn-ink: #1a0f0d;
|
||||
--lvl-0: #a9b1bf;
|
||||
--lvl-0-soft: #262a31;
|
||||
--lvl-1: #6cc4b8;
|
||||
@@ -84,8 +135,14 @@
|
||||
--lvl-3: #c49bea;
|
||||
--lvl-3-soft: #2a2035;
|
||||
--focus: #6aa3ff;
|
||||
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
|
||||
--shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
|
||||
--shadow-2: 0 4px 8px rgba(0, 0, 0, 0.45), 0 14px 32px rgba(0, 0, 0, 0.45);
|
||||
--shadow-3: 0 24px 64px rgb(0 0 0 / 0.55);
|
||||
--shadow-up: 0 -1px 0 var(--rule-2), 0 -6px 18px rgba(0, 0, 0, 0.5);
|
||||
--scrim: rgba(0, 0, 0, 0.6);
|
||||
--field: #1b1816;
|
||||
--glow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +152,7 @@
|
||||
--panel-2: #262220;
|
||||
--ink: #f0ece5;
|
||||
--ink-2: #b6afa3;
|
||||
--ink-3: #8b8376;
|
||||
--ink-3: #9a9285;
|
||||
--rule: #332e29;
|
||||
--rule-2: #46403a;
|
||||
--accent: #619fe5;
|
||||
@@ -108,6 +165,7 @@
|
||||
--stage-soft: #332a17;
|
||||
--warn: #f0897a;
|
||||
--warn-soft: #34201d;
|
||||
--warn-ink: #1a0f0d;
|
||||
--lvl-0: #a9b1bf;
|
||||
--lvl-0-soft: #262a31;
|
||||
--lvl-1: #6cc4b8;
|
||||
@@ -117,11 +175,24 @@
|
||||
--lvl-3: #c49bea;
|
||||
--lvl-3-soft: #2a2035;
|
||||
--focus: #6aa3ff;
|
||||
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
|
||||
--shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
|
||||
--shadow-2: 0 4px 8px rgba(0, 0, 0, 0.45), 0 14px 32px rgba(0, 0, 0, 0.45);
|
||||
--shadow-3: 0 24px 64px rgb(0 0 0 / 0.55);
|
||||
--shadow-up: 0 -1px 0 var(--rule-2), 0 -6px 18px rgba(0, 0, 0, 0.5);
|
||||
--scrim: rgba(0, 0, 0, 0.6);
|
||||
--field: #1b1816;
|
||||
--glow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
|
||||
|
||||
/* Georgia, the Windows serif, has only old-style figures and ignores lining-nums
|
||||
(checked in Chrome on Windows), so Cambria sits ahead of it in --serif. */
|
||||
h1, h2, h3, .md-h, .dash-title, .git-branch, .git-step-title { font-variant-numeric: lining-nums; text-wrap: balance; }
|
||||
.launch-title, .arrival-title { text-wrap: balance; }
|
||||
.md-p, .card .prompt { text-wrap: pretty; }
|
||||
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
|
||||
|
||||
html, body { height: 100%; }
|
||||
|
||||
@@ -129,7 +200,7 @@ body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--ink);
|
||||
font: 15px/1.55 var(--sans);
|
||||
font: var(--fs-base)/var(--lh-body) var(--sans);
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr auto;
|
||||
min-height: 100vh;
|
||||
@@ -137,8 +208,21 @@ body {
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--focus);
|
||||
outline-offset: 2px;
|
||||
border-radius: 4px;
|
||||
outline-offset: var(--focus-offset);
|
||||
border-radius: var(--radius-xs);
|
||||
}
|
||||
|
||||
/* The one small-caps label: every selector here is an eyebrow. Own rules add
|
||||
only margin, color or a deliberate difference (posters widen spacing to 0.14em). */
|
||||
.dash-group-title, .spec-chip-state, .handoff-preview-label, .block-tag,
|
||||
.handoff-label, .git-step-kicker, .git-table th, .help-row dt,
|
||||
.lessons-fix-label, .card-kicker, .note-kicker, .option-group, .answered-head,
|
||||
.pager-kicker, .modal-ranges legend, .rail-title, .rail-end-label, .aside h2,
|
||||
.msg-who, .arrival-kicker, .welcome-kicker {
|
||||
font: 700 var(--fs-2xs)/1.3 var(--sans);
|
||||
letter-spacing: 0.07em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-3);
|
||||
}
|
||||
|
||||
.skip {
|
||||
@@ -148,14 +232,12 @@ body {
|
||||
background: var(--panel);
|
||||
color: var(--ink);
|
||||
padding: 10px 16px;
|
||||
z-index: 50;
|
||||
z-index: var(--z-menu);
|
||||
border-radius: 0 0 var(--radius) 0;
|
||||
}
|
||||
.skip:focus { left: 0; }
|
||||
|
||||
/* Pin each region to its own row rather than relying on order: the banner
|
||||
is fixed now and never a grid item, but keeping the rows explicit means a
|
||||
future element that hides the same way cannot shuffle the tracks. */
|
||||
/* Explicit rows, so a future element hidden the same way cannot shuffle tracks. */
|
||||
.topbar { grid-row: 1; }
|
||||
.layout { grid-row: 2; }
|
||||
.footer { grid-row: 3; }
|
||||
|
||||
@@ -36,10 +36,10 @@ export const STRENGTHS = Object.freeze(["balanced", "thrifty", "best", "session"
|
||||
export const DEFAULT_STRENGTH = "balanced";
|
||||
// The line under the dialog's strength radios for the picked one.
|
||||
export const STRENGTH_HELP = Object.freeze({
|
||||
balanced: "Each helper gets the strength its job needs: light for lookups, stronger for reviews and design work.",
|
||||
balanced: "Each subagent gets the strength its job needs: light for lookups, stronger for reviews and design work.",
|
||||
thrifty: "One step lighter everywhere to save cost; reviews stay at standard or above.",
|
||||
best: "The strongest model and high effort for everything except lookups.",
|
||||
session: "Helpers run on whatever your session uses; nothing is set for them.",
|
||||
session: "Subagents run on whatever your session uses; nothing is set for them.",
|
||||
});
|
||||
// What a reported helper may say it actually ran with.
|
||||
export const HELPER_STRENGTHS = Object.freeze(["light", "standard", "strongest", "inherit"]);
|
||||
|
||||
@@ -30,12 +30,23 @@ const NARROW = "(max-width: 720px)";
|
||||
// `panels` the element holding one child per tab marked data-tab="<id>".
|
||||
// `beforeSelect(from, to)` returning false, or a Promise of false, holds the
|
||||
// switch; `onSelect(id)` runs after one.
|
||||
export function wireTabs({ tabs, list, panels, prefix, tabClass, renderTab, beforeSelect, onSelect }) {
|
||||
export function wireTabs({ tabs, list, panels, prefix, tabClass, renderTab, beforeSelect, onSelect, groupStart, groupClass = "tab-group" }) {
|
||||
const tabId = (id) => `${prefix}-tab-${id}`;
|
||||
const panelId = (id) => `${prefix}-panel-${id}`;
|
||||
let selected = null;
|
||||
|
||||
for (const t of tabs) {
|
||||
// A group heading: text only, never a tab stop, so the arrow keys skip it
|
||||
// (they walk `tabs`, not the list's children).
|
||||
const heading = groupStart ? groupStart(t.id) : null;
|
||||
if (heading) {
|
||||
const head = document.createElement("div");
|
||||
head.className = groupClass;
|
||||
head.setAttribute("role", "presentation");
|
||||
head.dataset.before = t.id;
|
||||
head.textContent = heading;
|
||||
list.appendChild(head);
|
||||
}
|
||||
const btn = document.createElement("button");
|
||||
btn.type = "button";
|
||||
btn.className = tabClass;
|
||||
@@ -60,15 +71,44 @@ export function wireTabs({ tabs, list, panels, prefix, tabClass, renderTab, befo
|
||||
panel.hidden = true;
|
||||
}
|
||||
|
||||
// The tabs a filter has not hidden, in order: what the arrow keys walk.
|
||||
const shown = () => tabs.filter((t) => !document.getElementById(tabId(t.id)).hidden);
|
||||
|
||||
list.addEventListener("keydown", (e) => {
|
||||
const current = tabs.findIndex((t) => tabId(t.id) === e.target.id);
|
||||
const walk = shown();
|
||||
const current = walk.findIndex((t) => tabId(t.id) === e.target.id);
|
||||
if (current < 0) return;
|
||||
const n = tabKeyTarget(e.key, current, tabs.length);
|
||||
const n = tabKeyTarget(e.key, current, walk.length);
|
||||
if (n < 0) return;
|
||||
e.preventDefault();
|
||||
select(tabs[n].id, { focus: true });
|
||||
select(walk[n].id, { focus: true });
|
||||
});
|
||||
|
||||
// Hides the tabs `keep(tab)` refuses, and a group heading once none of its
|
||||
// tabs is left. Returns how many tabs are still shown. The selected tab's
|
||||
// panel stays up either way.
|
||||
function filter(keep) {
|
||||
let count = 0;
|
||||
// One tab stop at a time: the selected tab's, or, when the filter hides it,
|
||||
// the first one still shown, so the list stays reachable by keyboard.
|
||||
for (const t of tabs) document.getElementById(tabId(t.id)).tabIndex = -1;
|
||||
for (const t of tabs) {
|
||||
const on = !keep || Boolean(keep(t));
|
||||
document.getElementById(tabId(t.id)).hidden = !on;
|
||||
if (on) count++;
|
||||
}
|
||||
// A heading belongs to the run of tabs from its own to the next heading.
|
||||
const heads = [...list.querySelectorAll("." + groupClass)];
|
||||
heads.forEach((head, i) => {
|
||||
const from = tabs.findIndex((t) => t.id === head.dataset.before);
|
||||
const next = heads[i + 1] ? tabs.findIndex((t) => t.id === heads[i + 1].dataset.before) : tabs.length;
|
||||
head.hidden = !tabs.slice(from, next).some((t) => !document.getElementById(tabId(t.id)).hidden);
|
||||
});
|
||||
const stop = tabs.find((t) => t.id === selected && !document.getElementById(tabId(t.id)).hidden) || shown()[0];
|
||||
if (stop) document.getElementById(tabId(stop.id)).tabIndex = 0;
|
||||
return count;
|
||||
}
|
||||
|
||||
const narrow = matchMedia(NARROW);
|
||||
const orient = () => list.setAttribute("aria-orientation", narrow.matches ? "horizontal" : "vertical");
|
||||
orient();
|
||||
@@ -99,5 +139,5 @@ export function wireTabs({ tabs, list, panels, prefix, tabClass, renderTab, befo
|
||||
return true;
|
||||
}
|
||||
|
||||
return { select, current: () => selected };
|
||||
return { select, filter, shown, current: () => selected };
|
||||
}
|
||||
Loaded 100 of 103 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user