feat(webui): the Triage drawer, the instance owner reads Triage's state, health and transcript from the top bar (#1873) #1984

Merged
jason.woltje merged 3 commits from triage-drawer into refactor 2026-11-16 21:31:52 +00:00
Owner

What changes

The instance owner can open Triage from the top bar of the Console. Nobody else gets the entry, the markup or a request to /api/triage.

With this change Triage still does not start in production. No model route is set, so the drawer shows the state and the health snapshot, and the message box is off with the reason.

  • Drawer. One page-level drawer over any page. It shows the state line (no route, over cap, running, stopped), the health snapshot with "not read" shown as that, the transcript with replies marked, and cards as plain text with no Run button.
  • Send. The box shows only when the Console can send and the read allows it. Every answer has plain words: 202, 409, 429 with its time, 400, 403, 503. A draft is kept after every answer that is not 202. Nothing is sent twice.
  • Poll. Every 4 s, only while the drawer is open. A poll does not touch the draft, and a reader who has scrolled up stays on the same line.
  • Text only. Every server value goes in through textContent, after a cleaner removes control, format, separator and default-ignorable characters.
  • Workflows. Save on an add form where only the state changed now keeps the form and says the step is not added. The step role picker does not offer triage.

How

  • packages/webui/src/public/display.js (+293), shell.css (+51), workflows.js (+9 -4). No server change, no new route, no schema.
  • The drawer is in display.js because the server serves a fixed file map, so a new file would have needed a server change.

Tests

  • New triage-drawer-browser.test.mjs, 15 tests, and 2 new tests in workflows-browser.test.mjs. Each assertion failed before its change.
  • Lane run on cb80b2b8a: 197 webui files, one at a time, 1634 pass, 0 fail, 4 skipped (org-quick-live).
  • Lead check on cb80b2b8a: 11 files (the triage, workflows, agent drawer, workspace and shell tests), 169 pass, 0 fail.

Review

Two rounds by fresh claude-opus-5-5 reviewers. Round 1 asked for changes (1 P2, 3 P3), all fixed. The re-check approved with 4 small notes. Three are fixed in the last commit, which no reviewer has read; it is 17 lines of display.js plus tests.

Left for later

  • packages/webui/src/cli.mjs:208 builds the workflows template list without the system-only filter, so the read still lists triage. The client hides it. The server should drop it.
  • bus.js:2249 focuses the page heading when the first render ends. A drawer opened before then loses focus, and Esc does not close it until the reader clicks back in.
  • From #/dashboard a sent message takes 2 clicks.
  • The model route and daily cap store, the CLI door, run records, Run buttons.
## What changes The instance owner can open Triage from the top bar of the Console. Nobody else gets the entry, the markup or a request to `/api/triage`. With this change Triage still does not start in production. No model route is set, so the drawer shows the state and the health snapshot, and the message box is off with the reason. - **Drawer.** One page-level drawer over any page. It shows the state line (no route, over cap, running, stopped), the health snapshot with "not read" shown as that, the transcript with replies marked, and cards as plain text with no Run button. - **Send.** The box shows only when the Console can send and the read allows it. Every answer has plain words: 202, 409, 429 with its time, 400, 403, 503. A draft is kept after every answer that is not 202. Nothing is sent twice. - **Poll.** Every 4 s, only while the drawer is open. A poll does not touch the draft, and a reader who has scrolled up stays on the same line. - **Text only.** Every server value goes in through `textContent`, after a cleaner removes control, format, separator and default-ignorable characters. - **Workflows.** Save on an add form where only the state changed now keeps the form and says the step is not added. The step role picker does not offer `triage`. ## How - `packages/webui/src/public/display.js` (+293), `shell.css` (+51), `workflows.js` (+9 -4). No server change, no new route, no schema. - The drawer is in `display.js` because the server serves a fixed file map, so a new file would have needed a server change. ## Tests - New `triage-drawer-browser.test.mjs`, 15 tests, and 2 new tests in `workflows-browser.test.mjs`. Each assertion failed before its change. - Lane run on cb80b2b8a: 197 webui files, one at a time, 1634 pass, 0 fail, 4 skipped (`org-quick-live`). - Lead check on cb80b2b8a: 11 files (the triage, workflows, agent drawer, workspace and shell tests), 169 pass, 0 fail. ## Review Two rounds by fresh claude-opus-5-5 reviewers. Round 1 asked for changes (1 P2, 3 P3), all fixed. The re-check approved with 4 small notes. Three are fixed in the last commit, which no reviewer has read; it is 17 lines of `display.js` plus tests. ## Left for later - `packages/webui/src/cli.mjs:208` builds the workflows template list without the system-only filter, so the read still lists `triage`. The client hides it. The server should drop it. - `bus.js:2249` focuses the page heading when the first render ends. A drawer opened before then loses focus, and Esc does not close it until the reader clicks back in. - From `#/dashboard` a sent message takes 2 clicks. - The model route and daily cap store, the CLI door, run records, Run buttons.
jason.woltje added 3 commits 2026-11-16 21:31:49 +00:00
The drawer reads GET /api/triage only while open. A poll keeps the draft and the reader's scroll place.
Every field is set as text. Cards show the command with no Run button, and the dropped count.
The send box shows only when config triageSend and the read's send are both true. It names each
answer in plain words, never resends, and keeps the draft after a refusal.
Workflows: Save with only the state changed in an add form says the step is not added yet and keeps
the form. The step picker no longer offers the system-only triage template.
The test helper opens the drawer after the page's first render has focused its heading, as a person
would. A drawer opened before that loses focus to the heading (bus.js); that is left as a follow-up.
jason.woltje merged commit cb80b2b8a8 into refactor 2026-11-16 21:31:52 +00:00
Sign in to join this conversation.