Skip to content

Workbench: see and test every OpenBot Desktop and app screen in any state - #2030

Draft
dustywusty wants to merge 60 commits into
mainfrom
dustywusty/feat-ui-view-renderer
Draft

dustywusty wants to merge 60 commits into
mainfrom
dustywusty/feat-ui-view-renderer

Conversation

@dustywusty

@dustywusty dustywusty commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What this is

A workbench that shows every OpenBot Desktop setup window and every app screen, in any state, in a normal browser tab. You can change the state by hand, play a timed run, see a grid, and get layout warnings. People find install bugs before customers do, and agents get the same tools from a CLI.

Start it: cd desktop && bun run workbench, then open the link it prints. The README is desktop/workbench/README.md.

How it works

  • The workbench loads the real code. The setup window comes from desktop/src, and the app comes from app/src. Nothing under desktop/src or app/src changes, except that setupLayout.browser.test.ts now uses the shared fake. Two tests make sure that nothing of the workbench gets into a shipped build.
  • The Tauri native side is a fake that you control. It is one fake for the setup window, for the desktop bridge in the app, and for the existing setup layout browser test, so they cannot drift. Registry tests keep its 87 commands, 7 events and 37 page commands in step with the TypeScript and Rust code.
  • The app's API is a fake built from the MSW handlers that Orval generates from api/openapi.yaml. A scene's own answers win, then a few hand-written handlers for calls outside the spec, then the generated handlers. A request with no answer fails workbench:check. The CopilotKit agent stream and the app's sockets are fakes that run steps can write to.
  • A page clock runs each frame. You can play, pause, step and seek, at ¼× to Max. The same link gives the same frame every time. Tests compare text, element boxes and screenshot bytes.

What you can do

  • 13 timed runs of the install flow and the other desktop windows, 38 setup states, and 15 app scenes (Home, an update offered, a conversation with tool calls, Settings for the AI model, usage data, This computer and Move to OpenBot Cloud, onboarding, signed out, and the connection lost).
  • Set any native answer, API answer, event, stream or socket message from the panels. The link keeps your changes.
  • A 4px grid, an inspector, and live layout warnings for elements that move, are cut off or go outside the window. Hover a warning to jump to its moment and see the move.
  • Comment mode (press C): click an element or drag an area, write what you want, and copy a prompt for an agent. The prompt has the component, the source line, the boxes and spacing, and the command that shows the same frame.
  • Import a customer's troubleshooting log as a scene: bun run workbench:import <file>. Imported logs stay in a gitignored folder.
  • For agents: workbench:shot (a PNG and a JSON report), workbench:check (plays every scene and fails on a missing click target, a stalled run or an unanswered request), and workbench:critique (impeccable design-review folders for one scene or all of them).
  • CI runs the workbench browser tests and workbench:check in the desktop browser job.

What the workbench found (not fixed here; separate tickets)

Setup window:

  • The step number disagrees between screens: "Step 3 of 4" on Account, then "Step 1 of 4" on Finishing setup.
  • The "Installing OpenBot in the background" row jumps 157 px and 222 px between steps on a Mac, and 257 px and 100 px on Windows.
  • "Step 2 of 4" jitters 7–13 px about every 10 s during a slow download.
  • The legends "Where OpenBot runs" and "Model provider" are cut off.
  • In the Claude sign-in, the Continue button and the background row move 25–93 px six times.
  • The "Local software" card inside the Anthropic panel is intended (ProviderPicker.test.tsx:340). Decide if it stays.

App:

  • After "Update and restart", the banner shows "Downloading…" with no progress for up to 60 s, because install_update never resolves on success. The same banner says "ready to install" and "Downloading…" at once.
  • The AI model dialog jumps about 18 px when the refusal alert shows.
  • Settings → This computer moves a lot while it loads (the whole page by 945 px).
  • On onboarding at 1000×800, "Ask in plain words…" is 36 px below the window.

Existing on main (not from this PR):

  • "a build with OpenBot Cloud on opens on Cloud's sign-in" in setupLayout.browser.test.ts failed about 2 runs in 5 on main; this PR fixes its cause (see below).

Calls made without Dusty (please check)

  • The workbench is a second Vite entry in desktop/ on port 3021, and the app has its own on 3023 behind it, same-origin under /__app. --port, WORKBENCH_PORT and WORKBENCH_APP_PORT change them.
  • One fake native side: the setup layout browser test moved to it with no assertion change (88 pass, 697 expect() calls, the same as before). The unit tests keep their own mocks.
  • The Mac/Windows choice also changes the user agent and the Windows answers. A Windows machine answers no Podman plan, as machine_size::plan does for WSL.
  • Install runs are written by hand and typed against the window's own types. They do not force a bug to show. Each one's order and text were compared with the native code and a real log, with no personal data.
  • Layout warnings: a move of more than 2 px, a group that moves together becomes one "whole page" warning, and a heading change does NOT hide moves, because rows that stay on screen across a step change are the real bugs.
  • App scenes start from what a Desktop install sees: no plan required, no company sign-in, no personal AI. The generated mocks' random extras would push every screen down.
  • In "still" motion, Motion's own clock moves forward a millionth of a millisecond per task while the page clock stands still. Without this, late-mounted Motion elements stayed at opacity 0.
  • An app frame is ready only when it is quiet (no request or route load in flight and no DOM change for two frames, capped at 3 s), so request times do not depend on the seek path.
  • The shared server keeps its config until restarted by hand and runs in its own process group, with leases, so one user stopping it does not stop it for the others.
  • workbench:check covers committed scenes only. Imported customer logs are skipped unless --include-imported.
  • The look: the system sans-serif on a flat ground, with glass panels, after an impeccable critique (24/40 before). The bottom drawer the critique suggested was left out to keep the layout.
  • .github/hooks/impeccable.json in the worktree comes from installing impeccable and is not part of this PR.

Root causes found on the way

  • Browser test files failed when run together, which is how CI runs them. Bun 1.3.14 closes a closed Chromium's pipe file descriptors a second time when it collects garbage. The next Chromium in the same process then loses its DevTools pipe, exits, and Playwright waits until every later file times out. The browser tests now share one Chromium per process that is never closed.
  • The "OpenBot Cloud sign-in" one-line check in setupLayout.browser.test.ts failed about 2 runs in 5, on main too. It measured while the window's entrance animation still had a 1e-5 px translate left, so a 22 px line read as 22.000015 px. The test now waits for the animation to end (10 of 10 runs pass).
  • Motion elements stayed at opacity 0 in "still" motion. Motion draws a change only when its time has moved on, and its time is the paused page clock.
  • App frames were "ready" before the app drew, and a seek could shift timers the app started. Readiness now waits for the frame to be quiet.

Tests

CI on the final commit b4ed5ee6 (runs/45077021677): every check passes (20 pass, 0 fail; the rest skip by path). This includes:

  • tests, all 5 shards, with the new unit tests under the root happy-dom preload.
  • app (real browser, desktop setup window): the setup layout test, every workbench and app browser test together, workbench:check on every committed scene, and the app shipped-build guard.
  • app (real browser, WebKit) and verify. An earlier run failed the WebKit sidebar test, which was flaky on main at that time (main job 137346083661 failed, main's next run passed). It passes here.

Also run on the branch:

  • Unit tests: desktop 439+, app 89, root 528, 0 fail. Typecheck clean in desktop and app. Biome clean on new files.
  • Three full-branch reviews (2 blockers, 2 major and 9 minor; then 5 minor; then 2 minor), all fixed and checked. Two impeccable reviews (a critique of the page, and a motion review on recorded frames, re-recorded twice) applied.
  • The branch merged main three times while CI was red. Main's own changes to the Move to OpenBot Cloud states and the Claude plan sign-in are ported into the shared fake and the scenes.

…bench share

Every command and event the desktop window uses, in one registry that a test keeps in step
with the window. A control object answers each command (a value, never, a problem, a delay or
a script), sends events, and logs every call. The setup layout test's per-state answers are
ported here as typed code.
A Vite config that serves the real window on port 3021 against the fake native side, a page
clock, the window frame with a 4px grid and an inspector, layout checks, the theme switch for
the frame, and the run, command, event, call and warning panels. A test makes sure that none
of it reaches the shipped build.
The test's own scripted native side (FAKE_CORE, FAKE_EVENT) moves to src/fakeNative, so the
test and the workbench use one fake and cannot drift. No assertion changed: 88 pass, 697
expect() calls, as before.
…te in the link

The workbench page shows the real setup window in a Mac or Windows frame at any size, theme
and zoom, with a 4px grid and an inspector. Every state the layout test knows is a scene. The
link holds the scene, the window settings and the answers. The frame runs on a page clock.
Hand-written runs of a real install, typed against the window's own types: a Mac, Windows, a
slow download, a step that fails, a slow sign-in, a relaunch with an update, and a Claude plan
sign-in. A run step can emit an event, set or settle an answer, click, or type. Seeking stops at
each run step, so a link gives the same frame every time, and a run stops at its end with a note
that the real window hands over to OpenBot there.
Press C or Comment, click an element or drag a box around an area, say what you want, and
Copy as prompt. The prompt names the element, its React components and the source line it is
drawn at (through the served module's source map), its box, gaps, grid offset and styles, the
scene, time and window, and the command that shoots the same frame. An area gets its elements
and a spacing summary.
…rnings

The right panel sets any command's answer (kept in the link), lists every native call and sends
any event. Under the window, layout warnings list each element that moved more than 2 px, was
cut off or left the window, with the time and the cause; a click seeks to it. The fake records
how each call ended, so the handover note shows only when show_openbot succeeded.
…g logs

workbench:check plays every scene to its end and fails when a run step cannot find its button or
field, or a run stalls. CI runs it and the workbench browser tests in the desktop browser job.
workbench:import turns a customer's troubleshooting file into a scene: its [step] rows at their
real times, and what failed on the last row. Imported scenes stay in a gitignored folder.
…tting down windows

Six timed runs beside the install runs: Status stop and start, Status while an update runs, a
relaunch where the person starts the update, the move to OpenBot Cloud and a move that fails and
is tried again, and Shutting down to its end. Payloads use the native side's own wording.
…action, and Import a log

Runs play at ¼× and ½× as well. Each click and type a run makes shows a marker on its target,
and Pause at each action stops before it with the target outlined. An imported troubleshooting
log appears in the scene list, and a file can be imported in the page. Groups of elements that
move together show as one warning. The fake's move failure uses the native side's sentence.
Imported troubleshooting logs are local and approximate, so workbench:check skips them unless
--include-imported is given. The screenshot CLI loads them from disk.
… done

Each user of ensureServer takes a lease; the server stops when no live lease remains, and never
when a person started it by hand. A start lock keeps two users from starting two servers.
WORKBENCH_PORT gives a separate port when isolation is needed.
A row that stays on screen while the step changes (the background install row moving 157 px and
222 px on a first run) is a real layout bug, so a new heading no longer hides moves. Elements that
move together still show as one warning for the whole page.
The contract the desktop and app halves share, the Desktop page commands the app calls (checked
against the Rust side), the Desktop page scripts read from the Rust source, the click and type
helpers in a file with no imports, which scene follows a handover or a handback, and a scene
list, window frame and settings panel that take app scenes.
An in-page fetch answers the app's /api calls from the scene's answers, hand-written handlers and
the generated MSW handlers. The CopilotKit agent stream and the app's sockets are fakes that run
steps can write to. The app's Desktop bridge runs on the shared native fake. The app gets its own
workbench Vite config, a preboot for storage, theme and motion, and the Desktop page scripts read
from Rust. The link holds API answers and app settings, a scene catalog joins both halves, and new
panels list requests, set API answers and send stream and socket events.
…r behind the proxy

The signed-in person and organization are API answers a scene can change. Desktop page commands
have defaults typed by the app's own types. Every generated MSW handler file feeds the fake API,
and hand-written handlers answer the calls outside the spec. App runs drive the frame on the page
clock with a seeded random. The workbench server starts the app's server on 3023 and serves it
same-origin under /__app, and stops it with itself. The fake fetch passes non-API requests through
untouched.
The page loads the scene catalog (desktop scenes and app scenes from the app server) and shows
app scenes in a browser or desktop host. The app frame boots the page clock, the fake API, agent
stream, sockets and the Desktop bridge before the real app runs, with the Desktop page scripts the
native side would add. The first app scene is Home with Bots.
The frame said it had booted before the app's modules loaded, so the page seeked and showed a
blank window while the app waited on a paused clock. A boot module after main.tsx now marks the
frame ready when the root gets its first child. A browser test opens Home with Bots in the
workbench and expects its text.
For an app scene the page shows the Desktop commands, the requests the app made, the API answers
a person can set, and the stream and socket events to send. Layout warnings also check after
requests and stream or socket events. The CLI shoots app scenes and its check fails on a request
with no answer or an error in the app. Comment prompts name the route and host. Browser tests pin
the app frame and its determinism; a guard keeps the workbench out of the shipped app. The whole
window shows above the warnings.
The frame was ready only once the app drew, but the page keeps the clock paused until the frame is
ready, so a first screen behind a delayed answer or a retry never drew. After a quiet stretch of
real time with nothing drawn, the frame now says it booted and the page walks the clock.
… handover cards

App scenes for Home with and without Bots, an update offered, a conversation in the middle of a
run with tool calls, onboarding, signed out and the connection lost. At the end of a setup run the
page offers to open the app scene that follows; an app that hands back to setup offers the setup
scene it goes to.
The AI model row as set, changed to an API key, and refused by the provider; Share usage data on,
turned off, and turned off on this computer. Runs can click switches, menu items, options and
checkboxes.
The signed-in session also answers no plan required, no company sign-in and no personal AI, so
the generated mocks' made-up trial bar and sections no longer push every screen down 40 px. A
request waiting on a set answer names that answer, so nothing calls it missing while it waits.
Route chunks and fetches finish on real time, so a seek could move the clock before the app drew
and shift timers it started (a connection check at 8.0 s on one path and 8.5 s on another). Each
seek stop now waits until no request or route load is in flight and the page stops changing for
two frames, with a 3 s cap. Request times are the same on every seek path.
…user

bun run workbench --port <n> or WORKBENCH_PORT picks the page's port, and WORKBENCH_APP_PORT the
app server's; a busy port fails with one line. The shared server dropped mid-run for two reasons:
Vite restarted it whenever its config or an import changed, and it ran in its starter's process
group, so stopping the starter stopped it for everyone. It now keeps its config until restarted by
hand and runs in its own group.
…arnings

Motion draws a value change only when its time has moved on, and its time is the page clock. With
the clock standing still, every change after the first at that time stayed undrawn, so headings
and rows entered at opacity 0 and stayed there. Motion's time now moves forward a millionth of a
millisecond per task while the clock stands still. Screen-reader-only labels are no longer
flagged as cut off or moved.
The lavender-gray ground with its blur circles, glass panels, Plus Jakarta Sans and Spline Sans
Mono, and the token spacing and radii, with a dark variant built from the same tokens. Only the
page around the window changes; the window and its contents are drawn as the app draws them.
The desktop browser job writes the app config, runs the app frame, determinism and CLI browser
tests, walks the app scenes in workbench:check, and builds the app with the workbench guard on.
Settings, This computer in the Desktop window (an update found and a worker's memory changing) and
in a browser, and Move to OpenBot Cloud from Settings, which hands back to the setup window.
Warnings keep the element's box before and after. Hovering a warning seeks to its time and draws
where the element was, where it went and an arrow labelled with the distance; a cut-off shows the
hidden part and an outside warning the part past the window. A click keeps the mark. Scene rows
are one line.
…ents

For a scene at a time, or every scene with --all, it saves the frame, its elements and warnings,
and a prompt that starts /impeccable critique (or audit, layout, typeset, clarify, polish) on the
screen's main source file. The prompt tells the agent to re-render with workbench:shot, because a
plain page has none of the scene's state.
…, and plain fonts

Comment prompts for app scenes carry the route the app shows now and the host. The browser bar
follows the app's own navigation. The handback card has real buttons, scene titles show in full on
hover, and the page drops the web fonts and the tinted ground.
…mode

The page uses the system sans-serif on a flat ground, with clearer controls, a selected scene you
can see, a labelled Window panel, one-line requests and readable helper text, from an impeccable
critique. Scenes can be filtered and folded by group, panels resized, and the page driven by keys.
Fit zoom shows the whole window. bun run workbench lands on the workbench. Comment mode can ask
for an impeccable critique, audit, layout, typeset, clarify or polish of the picked part, and
Critique this screen asks for the whole frame.
Bun 1.3.14 closes a closed Chromium's pipe file descriptors again when it collects garbage, so the
next Chromium in the same process lost its DevTools pipe, exited, and Playwright waited until every
later file timed out. The browser tests now share one Chromium per process that is never closed,
with explicit hook time limits, a Vite cache folder per port, NODE_ENV=development so Vite's
dependency hash matches, and the generated app config no longer watched. A frame that reloads
while the page waits on it no longer hangs the wait.
…their target

CI builds the app with the workbench guard before the Docker steps leave root-owned files. Stopping
and reusing the shared server happen under one lock, and stopping it stops the app server it
started. The critique browser test runs in CI. Action markers follow their target or go away at
every speed, the paused Next marker follows zoom and panel changes, a jump back to a warning keeps
the last frame on screen instead of replaying the run in view, and the warnings list keeps its rows
under the pointer.
…n check, and visible clicks

The Cloud sign-in one-line check measured while the window's entrance animation still had a
1e-5 px translate left, so a 22 px line read as 22.000015 px and failed about 2 runs in 5 (on main
too). It now waits for the animation to end. A click or type marker whose target leaves keeps a
500 ms ghost where it was, so the cause of each change is seen. During a jump back the cover keeps
the theme, title bar and cards of the last frame. CLIs release their lease on a reused server, an
app server that is still starting is stopped too, and the CI Docker steps run with --init.
…stay readable

While the pointer is in the warnings list, a jump keeps the rows it shows and mutes the ones the
run does not have; the new set shows when the pointer leaves. A click or type ghost holds full
strength for most of its half second and fades in the last 150 ms, with a quiet outlined label
that sits inside its box when it fits, so it does not hide the new screen's text.
…o restart

The page merged the kept warning rows at its own time, which still held the old window's time for
one render after a seek back while the new window had no warnings yet, so the list went empty. It
now merges at the time of the window's last check, and the watch starts again when the frame
reloads. An edit to the workbench Vite config now prints the notice to restart by hand.
…d a settled shot before the jump back

- A DOM test whose msw server listened while happy-dom was registered left msw's
  responses built on that file's happy-dom Response, so later files read empty
  bodies (app/workbench/api on CI shard 3). The preload puts them back on the
  platform's Response before each test; msw-realm.test.ts covers it.
- The workbench's fake native states use plain scene titles, and its copy of
  the native Podman pause offer is allowed where that word is.
- The motion test takes the window's shot once it settled instead of after a
  fixed 300 ms, and logs where a frame changed.
The one conflict was setupLayout.browser.test.ts: this branch moved the fake
native side out of the test into desktop/src/fakeNative/states.ts, and main
changed it in the test (#2029, #2032). Main's changes are in states.ts now:
the 20.2 GB footprint, the move result's removedBytes and diskGainedBytes,
the #move-done-held and #move-first states (both in STATE_NAMES, so both are
workbench scenes), #move-first's held update and __fake.finishUpdate. The
workbench's Moved result has the new shape too. Main's new tests stay as main
wrote them.
setupLayout.browser.test.ts conflicted again on the fake native side, which
this branch keeps in desktop/src/fakeNative/states.ts. Main's #move-done-ai
(connectAi on the move result) is in states.ts and STATE_NAMES now, and main's
new assertions stay in the test. The app's new sign-in redirect commands are
listed as not yet in Desktop's desktop_page.rs, so the registry check still
holds both ways.
Main's #2036 registers the sign-in redirect commands in desktop_page.rs, so
they move into PAGE_COMMANDS. The app frame's fake has no default for them
yet: refused, the app falls back to a paste or a code.
…red within a pixel, and room for --all --check

- install-anthropic-plan follows main's #2036: once the address is open the
  window waits for the browser, and finish_claude_sign_in answers with nothing
  typed or pressed. The determinism test now checks the wait and that the run
  goes on to Finishing setup; runner.test.ts keeps the type step covered.
- The motion test compares the still with the window within a pixel. CI's
  renderer drew the still's text a little differently (2.2% of pixels, spread
  over the whole window) while a replay showing through still measures 6% to
  99%; the bound stays 2%.
- --all --check took 299 s on CI against its 300 s limit; it has 900 s now.
…at differs

Compared within a pixel, CI's still still differs from its window by 2.1%,
inside the card and only where motion is allowed, so it is not anti-aliasing.
A replay showing through measures 6.4% to 99.7%, so the bound is 5%. A frame
past 2% logs both shots, cut to where they differ, to find the cause.
The test wanted every row back after a seek to 0:10, and failed on CI with 9
of 10: a 0:00 move from the window's first layout that the replay did not
find again, which the list drops by design. It now checks that every row from
0:10 on stays, muted until the replay finds it, and that found rows are not
muted. A merge that empties the list still fails it.

The still's 2% on CI, from the logged shots: its text is drawn with other
anti-aliasing than the window's composited card, and its progress fill is
further on. Nothing of the replay shows.
workbench:check now also writes findings.json: every layout warning and
run problem of every committed scene, with the element's component chain
and source file, merged into findings (findings.ts). Each move gets a
class: shift under hand and jitter are bugs; moves after an input, on a
new screen, while a screen loads or a late load shift are expected.

The workbench server serves the newest findings.json and runs the check
in the background with progress. /workbench/findings/ lists the findings
(expected moves hidden by default) and plays each one in the real
workbench page with its warning marked. The workbench takes mark= and
embed=1 links. CI keeps findings.json as an artifact.
setupLayout.browser.test.ts: main's #2049 added a "stopped" move to the
test's own inline fake. On this branch that fake lives in
src/fakeNative/states.ts, so the stopped move (OpenBot Cloud's own
reason, kind move-stopped) and its #move-stopped state go there.
…xpected moves

Cut off now needs a box with hidden overflow that hides more than 2 px of
the element's own text (its line boxes against the clip box). An ellipsis
or a line clamp, on the element or on the box that cuts it, is on purpose
and does not count; nor does text that overflows with overflow visible, or
text in a box that scrolls. Outside the window now leaves out an element
that the page's own scroll brings into view (not one fixed to the window).

The Layout warnings list under the window classifies moves with the same
rules as the findings (classifyMoves, splitWarnings, isExpected in
findings.ts). It shows jitter, shift under hand, cut off and outside; the
expected moves are behind "Show expected moves (N)". Each move row names
its class, and the hover still jumps for every row.

workbench:check: cut off 4 -> 0, outside 1 -> 0, jitter 4, expected 235.
Port #2051's move-failed-detail answer into desktop/src/fakeNative/states.ts, with the native Upload wording the fake already uses.
…s scene

The workbench drew the Mac lights 12 px in, not where macOS puts them, so it could not see a page jammed against them. titleBar.ts now holds the real box (TRAFFIC_LIGHTS 20,31 in main.rs, tao's inset_traffic_lights, AppKit's 12 px circles 8 px apart, middle 32.5 px down; checked against Dusty's capture at scale 1.0), and WindowFrame draws the lights there, over the page.

The new Spacing check (spacing.ts, read from the page by layoutWatch.ts) runs on every check of every scene for a Mac Desktop window: nothing and no panel edge within 8 px of the buttons, the buttons fit and centre in a rail column, and they share the row beside them. It is a new finding class, shown by default on the warnings strip and the Findings page with its rule and why.

The app-settings-connections scene (Settings → Connections, personal edition, dark) reproduces Dusty's case: the inset panel under the zoom button, the buttons 11 px right of the 72 px column's middle, and the panel's corner beside them.
…twork address

The server told the app frame apart by the Sec-Fetch-Dest: iframe header, but browsers send
Sec-Fetch headers only to secure origins. http://localhost is one; http://<LAN address> is not, so
over the office network the frame got the desktop window's page and stayed blank. Without the
header, an HTML navigation whose Referer is the workbench page or an app page on the same host is
now the frame.
…ress

navigator.clipboard exists only in a secure context, and http://<LAN address> is not one, so
Copy link, Copy as prompt and Critique this screen failed for anyone using the shared address.
copyText uses navigator.clipboard where it exists and otherwise copies through a hidden, focused
text area with document.execCommand("copy"). A refused copy of the link now shows a notice.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant