From bb0934158f46a0d035c5d9e1687e506f5a4a45a5 Mon Sep 17 00:00:00 2001 From: egagofur Date: Sun, 22 Nov 2026 23:18:05 +0700 Subject: [PATCH 01/31] chore(studio): phase-1 tokens, redesign design doc and plan Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 +- core/local-workflow-studio.md | 4 + docs/audit/studio-2026-11-22.md | 92 +++++ .../plans/2026-11-22-studio-redesign.md | 215 ++++++++++++ .../2026-11-22-studio-redesign-design.md | 119 +++++++ lib/studio-server.js | 2 +- studio/app.js | 49 ++- studio/index.html | 3 +- studio/styles.css | 320 ++++++++++-------- studio/tokens.css | 100 ++++++ tests/studio-design-tokens.test.js | 56 +++ tests/studio-detail.test.js | 12 +- tests/studio-n8n-acceptance.test.js | 3 +- tests/studio-v22-acceptance.test.js | 4 +- tests/v110-first-run.test.js | 2 +- 15 files changed, 820 insertions(+), 164 deletions(-) create mode 100644 docs/audit/studio-2026-11-22.md create mode 100644 docs/superpowers/plans/2026-11-22-studio-redesign.md create mode 100644 docs/superpowers/specs/2026-11-22-studio-redesign-design.md create mode 100644 studio/tokens.css create mode 100644 tests/studio-design-tokens.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f538b0..5110700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ All notable changes to this project are documented here. Versions follow [Semant ## Unreleased -_No changes yet._ +- **Changed:** Workflow Studio redesign, phase 1 (`docs/audit/studio-2026-11-22.md`). The AEL orange brand replaces the green accent; green now means passed only. All colours come from `studio/tokens.css` (light warm-paper theme following the OS, dark ink theme), 133 one-off colours are gone, cards use the blog's soft shadow and radii, and type uses Geist when installed. Motion follows Emil Kowalski's rules: custom ease-out, press feedback, hover only with a mouse, visible focus, four loops instead of eight, and reduced motion that keeps fades. Mobile: square logo, single-row stage rail, no stray dashes. +- **Fixed:** the Goal dialog of a frozen Run shows its task, objective and acceptance criteria instead of an empty field; "Current step" points at the next ready stage (Maker after the freeze) instead of the passed Goal; the token chip says "not recorded" instead of "unknown / 50000". ## 2.17.0 - 2026-11-22 diff --git a/core/local-workflow-studio.md b/core/local-workflow-studio.md index ae9a284..0f4f05b 100644 --- a/core/local-workflow-studio.md +++ b/core/local-workflow-studio.md @@ -14,6 +14,10 @@ The server rejects non-local `Host` headers. Static assets are bundled in the np Studio watches one project root — the working directory where it was launched. The header shows that root. `status --json` and `run --json` include `studioUrl` when a Studio process for that root is alive. That field identifies the running Studio; it is tokenless and returns 401 without a session. Do not write the session token to disk or into agent-visible output. Open the browser session from the tokenized URL printed by `ael studio`. +## Look and feel + +Studio follows the AEL brand: orange (`--brand: #fc6404`) for actions and the live state, green only for passed, on warm paper in light mode or ink in dark mode. The theme follows the operating system (`prefers-color-scheme`); `data-theme="light|dark"` on `` overrides it. All colours live in `studio/tokens.css`; `styles.css` uses tokens only (tested). Type is Geist and Geist Mono when installed, with system fallbacks (no remote fonts). Motion: panels ease out in 220ms and close in 180ms, buttons press to `scale(0.97)`, hover effects apply only with a mouse, and the only loops are the active edge flow, the live dot and the running spinner. Reduced motion keeps fades and removes movement. + ## Real-time sync Studio does not poll `/api/live` on a timer. One `RunWatcher` per process recursively watches `.ai-engineering-loop/runs/` and `current.json`. On a change it re-reads only the changed artifact and pushes a typed event on `GET /api/events` (SSE). diff --git a/docs/audit/studio-2026-11-22.md b/docs/audit/studio-2026-11-22.md new file mode 100644 index 0000000..9c19dbe --- /dev/null +++ b/docs/audit/studio-2026-11-22.md @@ -0,0 +1,92 @@ +# Workflow Studio audit — 2026-11-22 + +Scope: `npx ai-engineering-loop studio` at v2.17.0 (`studio/index.html`, `studio/styles.css`, `studio/app.js`, served by `lib/studio-server.js`). Audit only; nothing changed. Lens: Emil Kowalski's design-engineering rules (motion, press feedback, tokens, cohesion), plus brand fit and basic accessibility. Evidence: a demo Run (frozen Goal, T1) viewed at 1440×900 and 375×812, and a scan of the CSS and JS. + +## Verdict + +Studio works, but it does not look like AEL. The brand is orange (`#FC6404`) on ink and warm paper with Geist; Studio is a green-accented (`#28ad00`) dark-only dashboard with 133 one-off hex colours, 11 font sizes and eight looping keyframe animations. A token-first redesign is cheaper than patching. + +## Brand reference (from `work/blog` diagrams and the sharing deck) + +| Role | Value | Source | +|---|---|---| +| Brand / primary | `#FC6404` | `diagram.css --orange`, deck `ORANGE` | +| Brand highlight → deep | `#FCAA72` → `#FC6404` → `#E75C04` → `#833301` | the orange "bot" gradient | +| Ink | `#16171A` (text, dark surface) | `--ink` | +| Paper | `#F4F3F0` / `#F2F1EE`, card `#FFFFFF` | `--bg`, deck | +| Muted | `#8B8A86` | `--muted` | +| Success (status only) | `#29AB00` | `--green` | +| Danger | `#E5484D` | `--red` | +| Type | Geist, Geist Mono (eyebrows, ids, numbers) | `diagram.css` | +| Shape | 22px cards, pills 999px, soft shadow `0 1px 2px /.04, 0 8px 24px /.05` | `diagram.css` | + +## Findings + +### 1. Brand and tokens + +| Before | After | Why | +| --- | --- | --- | +| `--accent:#28ad00` (green) as the only brand colour; 68 more literal greens (`#91dc7c`, `#83db69`, `#28ad0080`…) | `--brand:#FC6404` for action and identity; green only as `--ok` for passed states | Green reads as "success" everywhere, so every button looks like a status. The product brand is orange. | +| 269 hex literals, 133 unique, outside `:root` | ~20 semantic tokens (`--surface-1..3`, `--ink`, `--muted`, `--line`, `--brand`, `--brand-soft`, `--ok`, `--warn`, `--danger`, `--focus`) and nothing else | One place to theme; dark and light come for free. | +| `color-scheme:dark` only; 0 `prefers-color-scheme` rules | Light theme on warm paper (`#F4F3F0`) as the default for blog parity, dark on ink as the alternative, both from the same tokens | The blog, slides and README are light-first; Studio is the only dark-only surface. | +| `font: 13px Inter` with no font loaded | Geist + Geist Mono (self-hosted in `studio/`, no CDN; Studio must work offline) | Inter is not installed on most machines, so it falls back to the system font; brand type is Geist. | +| 11 font sizes (8–32px), 9 text nodes under 11px on mobile | 5-step scale (11, 13, 15, 20, 28) and Geist Mono 11px for eyebrows | 8–9px monospace labels are hard to read and noisy. | +| Mixed radii: 3, 4, 5, 6, 7, 8, 10, 28px | 6px controls, 12px panels, 22px cards, 999px pills | Matches the blog shape language. | + +### 2. Motion (Emil checklist) + +| Before | After | Why | +| --- | --- | --- | +| `transition: transform .18s ease` on library, inspector and execution panel | `transform 220ms var(--ease-out)` with `--ease-out: cubic-bezier(0.23,1,0.32,1)`; exit 180ms | Built-in `ease` is weak; panels should start fast. Exit faster than enter. | +| `.output-add{transition:.12s}` (implicit `all`) | `transition: transform 150ms var(--ease-out), opacity 150ms var(--ease-out)` | Never `all`; name the properties. | +| Buttons: hover colour only, 2 `:active` rules in the whole file | `button:active{transform:scale(0.97)}` with `transform 160ms var(--ease-out)` | Press feedback makes the UI feel like it heard the click. | +| Hover styles with no `@media (hover:hover) and (pointer:fine)` (0 uses) | Gate hover effects behind that query | Touch devices get sticky hover on tap. | +| 8 looping keyframes at once: `flow`, `agent-pulse`, `presence-pulse`, `active-pulse`, `running-node`, `node-breathe`, `activity-orbit`, `node-mark-spin` | One live signal: the active edge flow plus a single breathing dot on the running node; everything else static | A monitoring view seen all day must not shimmer; motion should only mean "this is live". | +| `freeze-pop`: ❄ from `scale(2.4) rotate(-25deg)` over 700ms | A one-time 200ms `scale(0.96)→1` + opacity, or a brand-orange "Frozen" pill with no motion | Rare event, but 700ms with a spin is decorative; keep it short and grounded. | +| Panels slide in from 380px off-screen with no opacity | `translateX(12px)` + `opacity:0` → `0` | Shorter travel feels faster; nothing should fly across the canvas. | +| Reduced motion kills all animation with `.001ms !important` | Keep opacity and colour fades; remove only movement and loops | Reduced motion means gentler, not none. | + +### 3. Layout and components + +| Before | After | Why | +| --- | --- | --- | +| Live view "Timeline": stage labels (`TASK RECEIVED…RUN COMPLETE`) dumped as a plain list next to a grouped event list | One vertical timeline: time (mono) · stage pill · message | Today it reads as two unrelated lists. | +| Stage rail shows a lone "—" under every pending stage | Show the stage status only when known; empty means pending | Dashes look like missing data. | +| Mobile 375px: the stage rail wraps 3 + 3, the logo "A" is squeezed to an oval, the repo path truncates to "/.." | Horizontal scroll rail (or a compact "Stage 2 of 6" bar) on narrow screens; fixed-size mark; hide the path behind a menu | Layout breaks at phone width. | +| Runs view: unstyled browser `` for search, no page heading | Styled search field with the panel tokens, "Runs" heading, empty state with the next command | First impression of history looks unfinished. | +| Wiring view: neutral cards, green loop group, green "Passed" check | Brand-orange loop group outline and running state; green kept for the passed check only | Same brand rule as above. | +| Dialogs: 4px radius, `box-shadow:14px 14px 0 #0d0d0f` (hard offset), checkout nodes `6px 6px 0` | Soft shadow from the blog (`0 1px 2px…, 0 8px 24px…`), 12px radius | Two shadow languages in one app. | +| Status colours are bare text colours (`#91dc7c` mono labels everywhere) | Pills (dot + label) like the blog `.pill` | Consistent, scannable status. | + +### 4. Bugs found while auditing + +| Where | What happens | Expected | +| --- | --- | --- | +| Goal dialog on a frozen Run | The objective field is empty with the placeholder "Improve Workflow Studio canvas"; the frozen objective and ACs are not shown. A "Reason for unfreezing" label has no field next to it. | Read-only view of the frozen Goal (objective, ACs with Fail-if lines, as in `goal show --human`), and the reason field only after "Unfreeze…". | +| Live "Current step" | Shows `goal · goal-contract — Stage 01 · Passed` while the Run is `GOAL_FROZEN` and the next step is Maker | Current step should be the next ready stage (Maker), with Goal shown as passed. | +| Budget line | "TOKENS unknown / 50000" and "host reports no usage" | Hide the meter until usage exists, or say "No usage recorded yet". | + +### 5. Accessibility + +| Before | After | Why | +| --- | --- | --- | +| 2 `outline:none` rules, focus styles on only some controls (8 `:focus-visible`) | One global `:focus-visible{outline:2px solid var(--focus);outline-offset:2px}` | Keyboard users need focus on every control. | +| 3 tap targets under 32px on mobile; canvas toolbar buttons ~28px | 40px minimum on touch (`@media (pointer:coarse)`) | Fingers miss small targets. | +| Contrast of `#6c746e` / `#73737c` labels on `#1c211d` | Use `--muted` only; check 4.5:1 for text under 18px | Several labels fall below AA. | + +### 6. Code structure + +- `studio/app.js` is one 128 KB file with 231 functions, 30 `innerHTML` writes and 35 inline `style.` writes. `styles.css` is 241 minified lines. +- Suggested split for the refactor, still no build step and no dependencies (CommonJS server, plain browser modules): `studio/tokens.css`, `studio/base.css`, `studio/components/*.css`, and ES modules `studio/js/{live,runs,wiring,goal,events,api}.js` loaded with `
- A - - — - live: … - No active run - + +

AEL Studio

+

Loading projects…

+
-
-
- -
    - -
    -
    -
    -
    -
    -

    Timeline

    -
      -
      -
      - -