Keyboard shortcuts designed for efficient agent testing #30

Closed
opened 2026-09-15 00:27:06 -04:00 by cmoriarty · 1 comment
Owner

I read that shopify engineers are designing their applications to have very robust keyboard control so agents can run UI tests quickly and headlessly. Lets implement it in braid, and see if there are any efficiency gains in doing UI testing driven by keyboard control. Or perhaps it will imrpove scripting of UI tests. Or both?

Here is the article if you want to reference:
https://shopify.engineering/back-to-native

I read that shopify engineers are designing their applications to have very robust keyboard control so agents can run UI tests quickly and headlessly. Lets implement it in braid, and see if there are any efficiency gains in doing UI testing driven by keyboard control. Or perhaps it will imrpove scripting of UI tests. Or both? Here is the article if you want to reference: https://shopify.engineering/back-to-native
Author
Owner

Shipped in #58 (commit c88c254) and archived as openspec/changes/archive/2026-09-26-keyboard-commands-and-fast-tests. The behaviour is specified in openspec/specs/keyboard-commands.

What shipped

  • Every console action is a named command with keys: g r / g i / g m / g s (runs, inbox, inference, settings), n (new run), ] / [ (next and previous run), j/k or ↓/↑ (steps), g a (the step the run is on), t / v / d / r (transcript, review, details, redo), Y (accept a failed step), h (thinking), a (subagents), i (composer), S / R (stop and resume the run). Esc closes the lens, then leaves the step, then the run.
  • A command is available exactly when its button is on screen. Redo and Stop open their confirmations. Keys never fire while you type or while a dialog is open.
  • ? opens a sheet built from the same command table the keys use, so it can't drift from them.
  • window.braid exposes commands(), run(id) and state(), so an agent can drive the console and check the result without reading the page.

Is it more efficient? Yes. e2e/keyboard.spec.ts runs the same six-move tour both ways: 94 ms by keys against 255 ms by clicks on its own, and 241–360 ms against 595–617 ms with other specs running. That's roughly 2–3× in Playwright. An agent driving a browser through tool calls saves more, because one key press or braid.run replaces a page read plus a find plus a click. It also simplifies scripting: specs can assert on braid.state() instead of on the DOM.

Shipped in #58 (commit c88c254) and archived as `openspec/changes/archive/2026-09-26-keyboard-commands-and-fast-tests`. The behaviour is specified in `openspec/specs/keyboard-commands`. **What shipped** - Every console action is a named command with keys: `g r` / `g i` / `g m` / `g s` (runs, inbox, inference, settings), `n` (new run), `]` / `[` (next and previous run), `j`/`k` or ↓/↑ (steps), `g a` (the step the run is on), `t` / `v` / `d` / `r` (transcript, review, details, redo), `Y` (accept a failed step), `h` (thinking), `a` (subagents), `i` (composer), `S` / `R` (stop and resume the run). `Esc` closes the lens, then leaves the step, then the run. - A command is available exactly when its button is on screen. Redo and Stop open their confirmations. Keys never fire while you type or while a dialog is open. - `?` opens a sheet built from the same command table the keys use, so it can't drift from them. - `window.braid` exposes `commands()`, `run(id)` and `state()`, so an agent can drive the console and check the result without reading the page. **Is it more efficient?** Yes. `e2e/keyboard.spec.ts` runs the same six-move tour both ways: 94 ms by keys against 255 ms by clicks on its own, and 241–360 ms against 595–617 ms with other specs running. That's roughly 2–3× in Playwright. An agent driving a browser through tool calls saves more, because one key press or `braid.run` replaces a page read plus a find plus a click. It also simplifies scripting: specs can assert on `braid.state()` instead of on the DOM.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cmoriarty/braid#30
No description provided.