# Mouse Back/Forward capture driver

AI-assisted; verified with the tests and tools listed above.

All state is synthetic. The drivers create fresh T3 homes and real replay-agent threads through the app CLI. They do not copy an installed T3 database. Both sides use the same driver, light theme, and fixed viewport. Mouse Back/Forward presses are trusted Chromium CDP input, not dispatched JavaScript events.

## Web scenario

Use a checkout of current main for the runner. Install with `vp i`, apply `scenario-setup.patch`, and put `panel-thumb-navigation.e2e.ts` in `scripts/scenarios/`. The patch attaches the scenario browser to a fixed CDP endpoint because the runner's mouse fixture exposes primary-button presses only.

Start `node browser-launcher.mjs "$RUNNER_CHECKOUT"` in a separate terminal. Then run:

```sh
T3CODE_DEV_SEED=0 vp run scenarios:prove scripts/scenarios/panel-thumb-navigation.e2e.ts \
  --base 52da4e50987714059e197d400e0c17f0913ae230 \
  --head bddf033ec0f44723d7cc733bb393a22966751f87
```

The scenario has one test and accumulates only the broken behavior before its final assertion, allowing both commits to complete every interaction. It follows links through three locally served pages, checks the actual addon-padding hit target and focus during mouse-down, presses Back/Forward over the address bar and active Browser tab, repeats over Diff content/tab/context menu, and checks main-chat navigation. It captures the actual app and records the interaction. A successful proof exits 0 because base fails and head passes. Upload the reviewed captures and scenario with `ghdrop upload`.

## Desktop hosted wrapper

Use separate base and head checkouts at the commits above. In each, run `vp i`, then `vp run --filter=@t3tools/desktop build:bundle` and `node apps/desktop/node_modules/electron/install.js`. The bundle task avoids the unrelated browser-import helper, which requires development headers.

Run the identical saved driver once for each checkout:

```sh
headless-desktop node desktop-driver.mjs "$BASE_CHECKOUT" before-desktop
headless-desktop node desktop-driver.mjs "$HEAD_CHECKOUT" after-desktop
```

The driver starts the built real Electron app with its own T3 home, Chromium profile, and synthetic local website. It completes onboarding and seeds two real replay-agent threads. It follows links in a native webview and tests addon padding and the device-toolbar padding inside the fixed HostedBrowserWebview wrapper, then checks main-chat Back. The main window is 1280 by 840. Every still requires two identical screenshots 500 ms apart. ffmpeg records the same scripted interaction on the virtual display. Captions beginning “Capture driver” are evidence annotations; the underlying UI is unchanged.

Each invocation writes a new timestamped directory next to the driver, with PNGs, `interaction.mp4`, and `observations.json`. The application and recording process close in `finally`. A baseline was rebuilt by rerunning the same saved driver on fresh state; the head was likewise rerun for confirmation.
