patchwise-agent-studio / docs /design /UI-REVIEW-2.md
EnergyVenom's picture
Astra: regression catalogue, runner robustness, idempotent Agent Studio contract, key-screen design (2182ef729b22)
152e0c1 verified
|
Raw History Blame Contribute Delete
15.8 kB
> **Historical record.** This page describes the product as it was when it was written, under an earlier name, and is not kept up to date. For the current system (Astra) read [DESIGN_SYSTEM.md](../DESIGN_SYSTEM.md) for the UI, and [ARCHITECTURE.md](../ARCHITECTURE.md), [DEPLOYMENT.md](../DEPLOYMENT.md), [RUNBOOK.md](../RUNBOOK.md), [REMOTE_RUNNER.md](../REMOTE_RUNNER.md) and [SECURITY.md](../SECURITY.md).
# UI review 2: review-1 fixes and step 3 (Team board)
Reviewed:
- `a8cc565` (review-1 must-fixes);
- `6af409a` (review-1 should-fixes, including deviation 7);
- `b659cd4` (step 3, Team board).
They are checked against `UI-REDESIGN.md` and `UI-REVIEW-1.md`. Sources:
- screenshots in `shots/review1-fixes/*` (46) and `shots/step3/*` (27);
- code: `pages/TeamBoard.tsx` and the API's LLM call records (`coworker/llm/router.py`, `RunDetail.llm_calls`).
I did not edit product code.
## Review-1 status
| Item | Status | Evidence |
|---|---|---|
| M1 dark primary buttons | **Fixed** | `readiness-laptop-dark`, `run-judge-desktop-dark`: the filled buttons are light pills |
| M2 phone run top bar | **Fixed** | `run-approve-phone-light`: 2 rows, a More menu, no Ask in the top bar |
| M3 panel tab by run state | **Fixed** | Judge opens Steps on the failing scenario; a finished run opens Report |
| M4 no failed-screen link for quick simulations | **Fixed** | "Show the steps" in its place |
| S1 two-row top bar | **Fixed, but crowded** | see R2-S1 |
| S2 one-row detail header | **Fixed** | `detail-activity-*` |
| S3 focus ring | **Fixed** | no black ring on load |
| S4 phone composer | **Fixed** | icon toggle, full-width input |
| S5 `/runs/new` panel folded | **Fixed** | `new-run-desktop-dark`: 44px strip |
| S6 sheet surface | **Fixed** | `*-sheet-phone-dark` |
| S7 brand hyphen | **Fixed** | "Patch Testing / Co-worker" |
| S8 consultant agent names, short timestamps | **Fixed** | Activity list and feed |
| Deviation 7 (dock/panel) | **Accepted as built** | |
---
## Must-fix
### R2-M1. Honesty: agent cards claim an AI model even when built-in rules did the work (lead's observation c)
- **Where:** every Team board screenshot, for example `board-after-run-desktop-light`. On a run where no model was connected, the cards
still say:
- "External AI model" for Research, Synthesizer and Test designer;
- "Local AI model" for Data planner, Script builder, Self-heal and Failure analysis.
Also the card avatars are tinted by engine, and `/agents` shows "External AI model" on the agent list.
- **Why it is wrong:** principle 4 of the spec (honesty) is broken. `TeamBoard.tsx` labels each card with `ENGINE_WORDS[agent.engine]`,
which is the engine the agent is *designed* for (`agents.ts`), not what ran. A consultant reading "External AI model" will assume
client-facing AI work happened. This is my spec's fault too: section 3.2 said "engine label in consultant words" without saying
"actual".
- **Fix:** the label must come from the run's own LLM call records. No new endpoint is needed: `GET /api/runs/{id}` already returns
`llm_calls`, one record per call:
```text
{node, task, route, provider, model, fallback, ...}
```
- `route` is `stub` (built-in rules), `local` or `frontier`.
- `fallback` is non-null when a model failed and the router fell back.
1. Add a pure helper `agentEngineOnRun(node, llmCalls, agentDef)` in `agents.ts` (unit-tested). It returns
`{ kind, words, detail? }`:
| Agent / records on this run | `words` on the card | Tooltip `detail` |
|---|---|---|
| human gate | "You" | — |
| design engine `deterministic`, no records | "Built-in rules" | — |
| AI-capable agent, finished, **no records** | "Built-in rules (no AI model used)" | "This agent can use an AI model, but none was called on this test run." |
| records, all `route === 'stub'`, none with `fallback` | "Built-in rules (no AI model on)" | "No AI model was connected when this ran. Settings › AI models." |
| records with `route === 'stub'` and a `fallback` | "Built-in rules (the AI model did not answer)" | the first `fallback` text, max 160 characters |
| any `route === 'local'` | "Local AI model · <model>" | "<n> call(s) to <provider> <model>. Your data stayed in your environment." |
| any `route === 'frontier'` | "External AI model · <model>" | "<n> call(s) to <provider> <model>. Only public or redacted content was sent." |
| mixed `local` and `frontier` | "Local and external AI models" | per-route counts |
| not started / not needed | no engine line at all | "Can use: <design engine words>" |
2. Card footer (`.fpt-agent-foot`): replace `ENGINE_WORDS[agent.engine]` with `words`. Give the footer `title={detail}` and add a
visually hidden copy of the detail for screen readers.
3. Avatar tone follows the **actual** kind:
- mint = built-in rules;
- blue = local model;
- lav = external model;
- amber = you.
A finished AI-capable agent that used built-in rules shows mint, not lav.
4. While an agent is **running** and has no records yet, show "Working" with no engine claim. Records arrive with the node's result.
The run detail query is already polled; refetch it when the node finishes.
5. **Coordinator header**: add a second line, "AI on this run: none (built-in rules only)" or "AI on this run: local model <model> ·
external model <model> (<n> calls)". Use `llm_calls_count` and the routes. On a quick simulation with no calls, the line reads
"AI on this run: none". The line links to Settings › AI models for admins.
6. **`/agents` (static team page)**: label the card footer "Designed for: <engine words>". Add a right-aligned "Now:" value from
`GET /api/config` (or `/api/llm/settings` for admins): "Now: built-in rules (no model connected)" / "Now: Local AI model <model>".
The page already shows "Serving now: plain code, no LLM" in the detail pane; use that same source. The words "Frontier LLM",
"Local LLM" and "Deterministic" in the right-hand Workflow list become "External AI model", "Local AI model", "Built-in rules"
(consultant words); the technical words go in the tooltip.
7. Add a unit test: a run with `llm_calls: []` renders no card containing "AI model" except the "(no AI model used)" wording.
A run with one `local` record for `triage` renders "Local AI model · <model>" on the Failure analysis card only.
### R2-M2. At 1440 with the panel open the board scrolls sideways, and columns 5 and 6 look cut off (lead's observation a)
- **Where:** `board-after-run-desktop-*`, `board-waiting-decision-desktop-*`, `board-during-desktop-light`. "Analyse" is clipped at the
panel edge and "Report" is invisible. There is no scroll affordance, so it reads as broken.
- **Why it is wrong:** spec section 3.2 sized the columns by **viewport** (6 columns at >= 1280px). The board actually lives in the
center column, which is about 700px wide when the sidebar and panel are open. My spec bug; fix it by sizing from the container.
- **Fix:** no horizontal scrolling on the board at any width.
- Put `container-type: inline-size; container-name: board;` on the board root (`[data-testid="run-workflow"]`). Electron and all
supported browsers handle container queries.
- Layout by the board's own width:
- `@container board (min-width: 1060px)`: 6 columns, `grid-template-columns: repeat(6, minmax(160px, 1fr))`.
- `@container board (min-width: 520px) and (max-width: 1059.98px)`: 3 columns x 2 rows,
`grid-template-columns: repeat(3, minmax(160px, 1fr))`. Phases 1-3 sit on the first row, 4-6 on the second.
- below 520px: 1 column (as now on phone).
- Remove `overflow-x: auto` and the arrow separators between phases in grid modes. Show the phase number badges only; the reading
order is 1 to 6.
- In the 6-column mode keep the arrows only if they fit, as 16px glyphs in the gap.
- At 1440 with sidebar and panel open (board about 690px) the result is 3 x 2 with every card fully visible. With the panel folded
(board about 1110px) it is 6 columns.
- The phase columns use `align-items: start` (no equal-height stretching across rows) so short columns do not leave tall empty boxes.
- Acceptance: screenshots at 1440 with the panel open and folded, 1100 (rail), 834 tablet and 390 phone show no horizontally clipped
phase.
### R2-M3. "Synthesizer" breaks mid-word, "Synthesize / r" (lead's observation b)
- **Where:** `board-after-run-desktop-light`, `board-waiting-decision-desktop-dark`, `board-during-desktop-light`. The narrow cards
(about 128px) also wrap "Test designer", "Data planner" and "Script builder" onto two lines next to the avatar.
- **Fix:**
- On the agent name: `word-break: normal; overflow-wrap: normal; hyphens: manual;`. The name may take two lines but only at spaces.
- Card min width is 160px (guaranteed by R2-M2).
- The avatar shrinks to 24px.
- The "YOU" tag moves to the card's top-right corner instead of under the name.
Check every one of the 15 names at 160px: none may break inside a word.
---
## Should-fix
### R2-S1. The run top bar is crowded at 1440 with the panel open
- **Where:** `run-judge-desktop-dark`, `board-waiting-decision-desktop-dark`. The title is truncated to "Procure-to-Pay · 17 O…", the
chip to "Waiting for your failure re", the sub-line to "Quick simul…".
- **Fix:**
1. Title priority: `flex: 0 1 auto; min-width: min(50%, 320px)`. It may truncate only after the chip has shrunk.
2. The chip uses its short form whenever its full form does not fit: "Waiting for you" (amber), "Testing", "Finished", "Paused",
"Stopped". Keep the full wording ("Waiting for your failure review") in `aria-label` and `title`. Implement it with a container query
on the top bar (`@container topbar (max-width: 760px)`) and two spans, so nothing is measured in JS.
3. When the top bar is under 760px, "Cancel test run" moves out of the bar into the "All details" menu as the last item (red, with the
same `run.control` check). "Resume" stays visible, because it is the action a stopped run needs.
### R2-S2. A paused (interrupted) run is shown in red as "Stopped here"
- **Where:** `board-stopped-run-*`. The run status is `interrupted`, but:
- the NextStep banner is red "Paused";
- Scout shows a red ✕ "Stopped here";
- the Coordinator border is red.
- **Spec:** the 3.1.2 state table says `interrupted` is **amber** ("paused, can resume"). Red is only for `failed` and `killed`.
Cancelled is grey.
- **Fix:**
- For `interrupted`, the agent that was running shows an amber pause icon and the words "Paused here". The card text reads "It was
working when the test run paused." The Coordinator border and the NextStep banner are amber. The banner title reads "Paused: you can
carry on".
- Keep red for `failed` / `killed`, grey for `cancelled`.
- Coordinator wording: "This test run is paused. Carry on from where it stopped." It uses the existing Resume button.
`RUN_STATUS_WORDS.interrupted` already says "paused, can resume".
### R2-S3. On the Team view the action is given twice
- **Where:** `board-waiting-decision-desktop-*`. The NextStep banner ("Your review: judge the failures" + "Open failure review") and the
Coordinator card ("Waiting for you: decide on the failed scenarios" + "Open failure review") say the same thing one above the other.
- **Fix:** on the Team view only, do not render `NextStep`; the Coordinator card is the action. `next-step` stays on every other detail
view. No test uses `next-step` on the Team view. The run-level "Finished: Not ready" message moves into the Coordinator's second line
for completed runs: "All steps finished in 46 s. Result: Not ready."
### R2-S4. Phone view switcher: the active tab is off-screen
- **Where:** `board-after-run-phone-dark`. The row shows "Conversation, Scenarios, Failures, Te…" and the active "Team" pill is cut off.
- **Fix:** on mount and when the tab changes, call `activeTab.scrollIntoView({ inline: 'center', block: 'nearest' })` on the switcher row.
Add 24px fade masks on the row edges (`mask-image: linear-gradient(...)`) as the scroll affordance. Apply this everywhere the row
scrolls.
### R2-S5. The Steps tab shows a lone spinner while loading
- **Where:** `board-waiting-decision-desktop-dark`, panel Steps showing only a spinner.
- **Spec:** section 3 requires a skeleton (3 rows, `aria-busy`) for loading, never a bare spinner. If the scenario cannot be loaded in
10 s, show an error line with "Try again".
---
## Nice
- **N1.** The panel's Excel tab (admin) renders "Scripts (0): 0 existing, 0 generated drafts" as a large heading (`board-during-desktop-light`).
Render `RunScripts` compact in the panel: a 14px/600 title, and the empty state "No automation scripts for this test run" instead of an
empty table header.
- **N2.** Each Coordinator header counter ("15 of 15 done · 0 waiting for you · 0 stopped") should hide its zero parts: "15 of 15 done".
- **N3.** In the 6-column mode the "A failed scenario is tried once more" note sits at the bottom of a tall Test column. Put it directly
under the Test runner card.
- **N4.** The Activity feed still shows raw coordinator kinds ("approve cases", "status waiting_approval", "gate approve_cases"). Map them
to words: "Waiting for your scenario review", "Your review recorded by admin". Keep the raw values in the tooltip.
- **N5.** `/agents`: the breadcrumb "Home › Main workspace ›" is left over from the old page; replace it with "Settings › Advanced". The
"Run the team" button should read "New test run" (it starts a run).
---
## Verdicts on the stated deviations
| # | Deviation | Verdict | Note |
|---|---|---|---|
| 1 | "What it did" sentences come from the counts each agent reports | **Accept** | The sentences read well ("Chose 79 scenarios", "Ran the scenarios · 1 failing", "Nothing needed repairing"). When an agent reports no usable count, fall back to the `STEP_WORDS` past-tense sentence, never to a field dump. |
| 2 | The quiet timer uses the run's last event time | **Accept** | It matches the spec's intent (no event for the run). The legend line "No news for 1 min" is right for quick simulations. |
| 3 | No screenshot during a full browser run and no real failed-agent card (the failed card is unit-tested; low RAM) | **Accept, with a condition** | Before step 4 is signed off, provide one screenshot of the failed-agent card at 1440 and 390, light and dark. Render the board with a fixture of events containing a node `error` (for example a dev-only route behind `import.meta.env.DEV`, or a Vitest + Playwright component screenshot). No browser run is needed. |
| a | Lead: columns 5 and 6 cut off at 1440 | **Must-fix** | R2-M2 |
| b | Lead: "Synthesize / r" | **Must-fix** | R2-M3 |
| c | Lead: cards show the engine an agent can use, not what ran | **Must-fix** | R2-M1. The card must state what actually ran on that run, from `RunDetail.llm_calls`. |
## Spec corrections I am making through this review
The developer should treat these as amendments to `UI-REDESIGN.md`:
- **3.2:** the engine label is the engine **used on this run** (R2-M1 table), not the design engine. Column count is decided by the
**board's container width** (R2-M2), not the viewport.
- **2.5:** the run top bar uses short chip words and moves "Cancel test run" into "All details" under 760px (R2-S1).
- **3.1.2 states:** `interrupted` is amber everywhere, including the board (R2-S2).