Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
78614f2
Desktop workbench: one fake native side the browser test and the work…
dustywusty Nov 22, 2026
33985e7
Desktop workbench: the parts of the page
dustywusty Nov 22, 2026
5ba1063
Desktop: the setup layout test runs on the shared fake native side
dustywusty Nov 22, 2026
1531490
Desktop workbench: the page, the scenes from the test states, and sta…
dustywusty Nov 22, 2026
aca0045
Desktop workbench: seven install runs you can play, pause, step and seek
dustywusty Nov 22, 2026
2b5649e
Desktop workbench: name an element's component and build a change req…
dustywusty Nov 22, 2026
5882261
Desktop workbench: Comment mode copies a change request for an agent
dustywusty Nov 22, 2026
91f4cc3
Desktop workbench: command, call and event panels, and live layout wa…
dustywusty Nov 22, 2026
f93842c
Desktop workbench: a run check for CI, and scenes from troubleshootin…
dustywusty Nov 22, 2026
8a865b5
Desktop workbench: runs for the Status, update, Move to Cloud and Shu…
dustywusty Nov 22, 2026
a9bd160
Desktop workbench: slower speeds, visible bot actions, pause at each …
dustywusty Nov 22, 2026
2549bd8
Desktop workbench: the run check covers committed scenes only
dustywusty Nov 22, 2026
f8971a3
Desktop workbench: the shared server stops only when its last user is…
dustywusty Nov 22, 2026
86f08c0
Desktop workbench: report moves across screen changes
dustywusty Nov 22, 2026
6e53793
Desktop workbench: README
dustywusty Nov 22, 2026
9d79514
Workbench: the shared ground for app scenes
dustywusty Nov 22, 2026
e31ed1f
Workbench: the fakes and panels for app scenes
dustywusty Nov 22, 2026
32b8170
Workbench: session, page defaults, handlers, runner and the app serve…
dustywusty Nov 22, 2026
da515dd
Workbench: app scenes in the page, and the app frame's boot
dustywusty Nov 22, 2026
72f2795
Workbench: an app frame is ready only after the app has drawn
dustywusty Nov 22, 2026
d88fae1
Workbench: app panels, warnings, CLI, prompts and tests for app scenes
dustywusty Nov 22, 2026
8c959e5
Workbench: an app frame whose first screen waits on a timer still boots
dustywusty Nov 22, 2026
e3cdfaa
Workbench: Home, update, conversation and account app scenes, and the…
dustywusty Nov 22, 2026
376f751
Workbench: Settings scenes for the AI model and Share usage data
dustywusty Nov 22, 2026
bdef85e
Workbench: app scenes start from what a Desktop install sees
dustywusty Nov 22, 2026
fef1496
Workbench: an app frame is ready only when it is quiet
dustywusty Nov 22, 2026
5224831
Workbench: choose the ports, and keep the shared server up for every …
dustywusty Nov 22, 2026
439b747
Workbench: Motion draws on a still clock, and hidden labels are not w…
dustywusty Nov 22, 2026
d6f4c77
Workbench: the CopilotKit look for the workbench page
dustywusty Nov 22, 2026
c7b0183
Workbench: CI runs the app scenes
dustywusty Nov 22, 2026
6e0b724
Workbench: README for both halves, and a test that the first app scen…
dustywusty Nov 22, 2026
c0b3a57
Workbench: This computer and Move to OpenBot Cloud app scenes
dustywusty Nov 22, 2026
d39f428
Workbench: hover a layout warning to jump to it and see the move
dustywusty Nov 22, 2026
090247d
Workbench: workbench:critique writes impeccable design reviews for ag…
dustywusty Nov 22, 2026
49f8fc2
Workbench: app comments name the live route, the browser bar shows it…
dustywusty Nov 22, 2026
7de5e4e
Workbench: a plain, faster page, and impeccable reviews from Comment …
dustywusty Nov 22, 2026
f374e75
Workbench: the browser test files pass when CI runs them together
dustywusty Nov 22, 2026
7e2e558
Workbench: fixes from the first full review, and markers that follow …
dustywusty Nov 22, 2026
6a58494
Workbench: fixes from the second full review, a reliable Cloud sign-i…
dustywusty Nov 22, 2026
35b80fa
Workbench: warning rows stay put under the pointer, and click ghosts …
dustywusty Nov 22, 2026
b28548f
Workbench: a jump back keeps the warning list, and config edits say t…
dustywusty Nov 22, 2026
ec3d45e
Tests: msw answers stay readable across files, plain scene titles, an…
dustywusty Nov 22, 2026
0396c93
Merge origin/main into dustywusty/feat-ui-view-renderer
dustywusty Nov 22, 2026
a07e523
Merge origin/main into dustywusty/feat-ui-view-renderer
dustywusty Nov 22, 2026
254bc3f
Merge origin/main into dustywusty/feat-ui-view-renderer
dustywusty Nov 22, 2026
f94fe35
Workbench: the Claude plan scene finishes on its own, the still compa…
dustywusty Nov 22, 2026
91450b4
Workbench motion test: bound the still's difference at 5%, and log wh…
dustywusty Nov 22, 2026
8314b16
Workbench motion test: a seek back keeps every row after the new time
dustywusty Nov 22, 2026
b4ed5ee
Merge remote-tracking branch 'origin/main' into dustywusty/feat-ui-vi…
dustywusty Nov 22, 2026
daf3101
Workbench: a Findings page for every finding of the check
dustywusty Nov 23, 2026
2cfb9d1
Merge origin/main into dustywusty/feat-ui-view-renderer
dustywusty Nov 23, 2026
dc1ffbd
Workbench: cut off counts only hidden text; the warnings list hides e…
dustywusty Nov 23, 2026
35afbfd
Merge origin/main into dustywusty/feat-ui-view-renderer
dustywusty Nov 23, 2026
855bb45
Workbench: true Mac window buttons, a Spacing check, and a Connection…
dustywusty Nov 23, 2026
63fb7a1
Merge remote-tracking branch 'origin/main' into dustywusty/feat-ui-vi…
dustywusty Nov 23, 2026
ef5eb8e
Workbench: the app frame loads when the workbench is opened by its ne…
dustywusty Nov 23, 2026
ea38d7d
Workbench: copy works when the workbench is opened by its network add…
dustywusty Nov 23, 2026
6fe603d
Merge origin/main into feat-ui-view-renderer
dustywusty Nov 23, 2026
74e5406
Allow the image list's file name in the fake's Start detail, and form…
dustywusty Nov 23, 2026
4fa0307
Merge origin/main into feat-ui-view-renderer
dustywusty Nov 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,10 @@ jobs:

# The desktop setup window's, for the same reason as the list above: the AI step's form holding
# still while the install behind it comes and goes. It bundles the window from the desktop's own
# dependencies. One file, so it is its own job rather than one of the list's workers. In the
# image, as above.
# dependencies. A few files, so it is its own job rather than one of the list's workers. In the
# image, as above. The workbench's app scenes run here too: the real app (app/) in the workbench's
# app frame, on the fake Desktop bridge and the fake API. The app needs its generated config before
# its workbench server starts, and a full build of the app must hold nothing of the workbench.
app-browser-desktop:
name: app (real browser, desktop setup window)
needs: changes
Expand All @@ -449,13 +451,41 @@ jobs:
- run: bun install --frozen-lockfile
- run: bun install --frozen-lockfile
working-directory: desktop
- run: bun run generate:app-config
# A full build of the app holds nothing of the workbench. On the runner, not in the image, and
# before the image's steps: those run as root, and Vite writes its bundled config into
# app/node_modules/.vite-temp, so after them that folder is root's and this build, as the
# runner's user, fails with EACCES.
- run: OPENBOT_APP_BUILD_GUARD=1 bun test app/workbench/shippedBuild.test.ts
# `--init` on both image steps: tini is PID 1 and reaps the orphans. Without it, bun is PID 1,
# and an app server whose workbench server exited stays a zombie that still answers
# `kill(pid, 0)`, so each stop waits out its time limits.
- run: |
docker run --rm --ipc=host \
docker run --rm --init --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE/desktop" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 \
"$PLAYWRIGHT_IMAGE" \
bun test src/setupLayout.browser.test.ts
bun test src/setupLayout.browser.test.ts workbench/determinism.browser.test.ts workbench/layoutWatch.browser.test.ts workbench/shot.browser.test.ts workbench/appFrame.browser.test.ts workbench/appDeterminism.browser.test.ts workbench/appShot.browser.test.ts workbench/critique.browser.test.ts workbench/motion.browser.test.ts workbench/findings.browser.test.ts
# The workbench's run check: every scene's run walked to its end, failing on a step that has
# nothing to click or type into, or a run that stalls. It walks the app scenes too, and fails
# on an app request that has no answer or an error in the app.
- run: |
docker run --rm --init --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE/desktop" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
"$PLAYWRIGHT_IMAGE" \
bun run workbench:check
# Every layout warning and run problem of the check, merged into findings: open it in the
# workbench's Findings page, or read it. Also when the check failed, since that is when it
# helps most.
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: ${{ !cancelled() }}
with:
name: workbench-findings
path: desktop/workbench-shots/check/findings.json
if-no-files-found: warn
retention-days: 14

# The suite in shards, one runner each, so the run takes as long as its slowest shard rather than
# as long as every file one after another. `bun test --shard` does the split, cut by the per-file
Expand Down
3 changes: 2 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"prebuild": "bun run --cwd .. generate:app-config",
"predev": "bun run --cwd .. generate:app-config",
"pretypecheck": "bun run --cwd .. generate:app-config",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"workbench": "bun run --cwd .. generate:app-config && bun --bun node_modules/vite/bin/vite.js --config vite.workbench.config.ts"
},
"dependencies": {
"@ag-ui/core": "1.0.2",
Expand Down
28 changes: 28 additions & 0 deletions app/tests/msw-realm.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { expect, test } from "bun:test";
import { GlobalRegistrator } from "@happy-dom/global-registrator";
import { getResponse, HttpResponse, http } from "msw";
import { setupServer } from "msw/node";

// tests/preload.ts puts msw's responses back on the platform's Response before each test. Without
// that, a server that listened while happy-dom was registered leaves them on that DOM's Response
// for every file after it, and their bodies read empty.
test("a server listens and closes while happy-dom is registered", async () => {
GlobalRegistrator.register();
try {
const server = setupServer();
server.listen({ onUnhandledRequest: "bypass" });
server.close();
} finally {
await GlobalRegistrator.unregister();
}
});

test("after it, msw still answers with the platform's Response", async () => {
const response = await getResponse(
[http.get("http://127.0.0.1/a", () => HttpResponse.json({ a: 1 }))],
new Request("http://127.0.0.1/a"),
);
expect(response).toBeInstanceOf(Response);
expect(response?.headers.get("content-type")).toBe("application/json");
expect(await response?.json()).toEqual({ a: 1 });
});
19 changes: 19 additions & 0 deletions app/tests/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ import { setCurrentOrganization } from "../src/lib/organizations/current";
setCurrentOrganization("default");
beforeEach(() => setCurrentOrganization("default"));

/*
* msw's `HttpResponse` extends its `FetchResponse`, and `setupServer().listen()` re-parents that
* class onto whatever `Response` is global at the time; `close()` puts back the one it found then.
* A DOM test that listens while happy-dom is registered leaves every later file's `HttpResponse`
* built on that file's happy-dom `Response`, whose window is gone: its `json()` reads an empty body
* ("JSON Parse error: Unexpected EOF" in app/workbench/api on a CI shard, passing on its own). So
* before each test, a `FetchResponse` that is not on the global `Response` (a listening server put
* it there) goes back on the platform's, as a test file run alone has it.
*/
const PLATFORM_RESPONSE = globalThis.Response;
const FETCH_RESPONSE = Object.getPrototypeOf(
(await import("msw")).HttpResponse,
) as typeof Response;
beforeEach(() => {
if (Object.getPrototypeOf(FETCH_RESPONSE) === globalThis.Response) return;
Object.setPrototypeOf(FETCH_RESPONSE, PLATFORM_RESPONSE);
Object.setPrototypeOf(FETCH_RESPONSE.prototype, PLATFORM_RESPONSE.prototype);
});

GlobalRegistrator.register();
/* `@base-ui/utils` is not a dependency of this package; the react package that owns it is. */
await import("@base-ui/react/dialog");
Expand Down
8 changes: 7 additions & 1 deletion app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
"jsx": "react-jsx",
"lib": ["ES2024", "DOM", "DOM.Iterable"]
},
"include": ["src", "tests", "vite.config.ts"]
"include": [
"src",
"tests",
"vite.config.ts",
"workbench",
"vite.workbench.config.ts"
]
}
156 changes: 156 additions & 0 deletions app/vite.workbench.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
// Workbench only. The shipped build uses vite.config.ts and never this file.
// Port 3023, behind the workbench server on 3021, which proxies /__app/ to it. WORKBENCH_APP_PORT
// and WORKBENCH_PORT change the two ports; the desktop workbench sets both when it starts this one.
import { readFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import tailwindcss from "@tailwindcss/vite";
import { tanstackRouter } from "@tanstack/router-plugin/vite";
import react from "@vitejs/plugin-react";
import { defineConfig, type Plugin } from "vite";
import { noConfigRestart } from "../desktop/workbench/noConfigRestart";
import {
appPort,
busyPortMessage,
workbenchPort,
} from "../desktop/workbench/server";
import { routeCodeSplittingOptions } from "./vite.config";
import { readDesktopPageScripts } from "./workbench/rustScripts";

// The ports, the busy-port message and the no-restart plugin are the desktop workbench's own, so
// the two servers never disagree on a port or a message.
const WORKBENCH_PORT = workbenchPort(process.env.WORKBENCH_PORT);
// The desktop workbench sets WORKBENCH_APP_PORT when it starts this server.
const APP_PORT = appPort(process.env.WORKBENCH_APP_PORT, WORKBENCH_PORT);

// A busy port ends the run with one line, not a stack.
function busyPort(): Plugin {
return {
name: "workbench-busy-port",
apply: "serve",
configureServer(server) {
const listen = server.listen.bind(server);
server.listen = async (...args) => {
try {
return await listen(...args);
} catch (error) {
if (/already in use/.test(String((error as Error)?.message))) {
console.error(busyPortMessage(APP_PORT, "app"));
process.exit(1);
}
throw error;
}
};
},
};
}

const appDir = fileURLToPath(new URL(".", import.meta.url));
const repoRoot = path.resolve(appDir, "..");

const MAIN_TAG = '<script type="module" src="/src/main.tsx"></script>';
const BOOT_TAGS = [
'<script type="module" src="/workbench/clockBoot.ts"></script>',
'<script type="module" src="/workbench/frameBoot.ts"></script>',
MAIN_TAG,
'<script type="module" src="/workbench/appBoot.ts"></script>',
].join("\n ");

// The page clock and the fakes boot before the app's own entry, and the preboot runs before the
// app's inline theme script, so the first paint already uses the scene's storage and theme. The
// last module, after the entry, tells the page that the frame booted once the app drew in #root.
function workbenchHtml(): Plugin {
const preboot = readFileSync(
path.join(appDir, "workbench", "preboot.js"),
"utf8",
);
return {
name: "workbench-html",
transformIndexHtml: {
order: "pre",
handler(html) {
if (!html.includes(MAIN_TAG)) {
throw new Error(
"Workbench: app/index.html no longer loads /src/main.tsx as the workbench expects.",
);
}
return {
html: html.replace(MAIN_TAG, BOOT_TAGS),
tags: [
{ tag: "script", children: preboot, injectTo: "head-prepend" },
],
};
},
},
};
}

const DESKTOP_PAGES = "virtual:workbench-desktop-pages";
const RESOLVED_DESKTOP_PAGES = `\0${DESKTOP_PAGES}`;

// The scripts OpenBot Desktop runs in the app's page, read from the Rust source.
function desktopPages(): Plugin {
return {
name: "workbench-desktop-pages",
resolveId(id) {
return id === DESKTOP_PAGES ? RESOLVED_DESKTOP_PAGES : null;
},
load(id) {
if (id !== RESOLVED_DESKTOP_PAGES) return null;
return `export const DESKTOP_PAGE_SCRIPTS = ${JSON.stringify(readDesktopPageScripts(repoRoot))};`;
},
};
}

export default defineConfig({
root: appDir,
base: "/__app/",
// A dependency cache for each app port: an app server on another port (another workbench run in
// this checkout) never optimizes the dependencies again in the folder this one serves them from.
cacheDir: path.join(
appDir,
"node_modules",
".vite-workbench",
String(APP_PORT),
),
clearScreen: false,
plugins: [
busyPort(),
noConfigRestart(),
workbenchHtml(),
desktopPages(),
tanstackRouter({
autoCodeSplitting: true,
codeSplittingOptions: routeCodeSplittingOptions,
}),
react(),
tailwindcss(),
],
resolve: {
alias: {
"@": path.resolve(appDir, "src"),
},
},
define: {
__OPENBOT_APP_VERSION__: JSON.stringify(""),
},
server: {
host: "127.0.0.1",
port: APP_PORT,
strictPort: true,
hmr: { clientPort: WORKBENCH_PORT },
fs: { allow: [repoRoot] },
// Each app server start runs generate:app-config, which writes this file again. Watched, every
// other app server of this checkout hot-updated its open frames in the middle of their runs.
watch: { ignored: ["**/src/lib/generated/application-config.ts"] },
},
optimizeDeps: {
entries: [
"index.html",
"src/routes/**/*.tsx",
"workbench/frameBoot.ts",
"workbench/scenes/index.ts",
],
include: ["msw", "motion/react"],
},
});
Loading
Loading