# SnapShots on GNOME 46

Environment for all captures: Ubuntu 24.04.4 LTS, GNOME Shell 46.0, Mutter 46.2, xdg-desktop-portal 1.18.4, xdg-desktop-portal-gnome 46.2, Electron 44.10.1. Real nested Wayland GNOME Shell inside headless-desktop; software rendering. Desktop 1440 x 900; app content 1100 x 780; light theme. The portal has zero GlobalShortcuts interfaces.

Base: [167d41c094](https://github.com/pingdotgg/t3code/commit/167d41c09449d2e7554d663bae78646a4ff300fb)
Head: [af33d6a38a](https://github.com/pingdotgg/t3code/commit/af33d6a38af0b51f1001d41c7110e3f340bf708c)

Each app and its bundled extension came from its own checkout. Each desktop session used isolated XDG directories and a fresh T3 home; no live database or imported history. The bundled extension was placed in the isolated extension directory before starting GNOME, then enabled with GNOME's own D-Bus API, simulating the required installation/login prerequisite. Extension installation and logout UI are not part of these recordings.

## Shared reproduction

1. Open Settings > SnapShots, with SnapShots off and default shortcut.
2. Turn it on, reach Shortcut, record Ctrl+Shift+Y, click Save and finish.
3. If the wizard closes, reopen Manage capture to inspect the saved chord.
4. Capture the shortcut result. Base: GlobalShortcuts interface error, Done disabled. Head: no error, Done enabled.
5. Click Done when available, otherwise Finish later. Base switches off; head remains on.
6. Send Ctrl+Shift+Y through xdotool into the focused nested desktop. Base captures nothing. Head verifies the chord and creates a 111053-byte PNG. Because the common starting state has no project, the head displays 'Snapshot taken, but no project is available' and queues it.

Supplemental head-only check: add the synthetic 'Snapshot demo' project through the app CLI. The queued capture attaches to the draft; open SnapShots settings and trigger the chord again. A second capture attaches. attached-capture.png shows the two attachments, cropped above the agent controls to exclude private operational metadata. No turn was sent.

All stills were saved only when two screenshots 500ms apart were identical. Both recordings were inspected through extracted frames. The observed JSON files contain the actual desktop bridge state and pending capture metadata, not test assertions.

## Drivers

Build each checkout with `vp i` and `vp run build:desktop:bundle`. Install Electron with `node node_modules/electron/install.js` from apps/desktop. Required system packages include GNOME Shell, xdg-desktop-portal-gnome, PipeWire, Xvfb, ffmpeg, xdotool and ImageMagick.

Start each side with:

```
headless-desktop bash desktop-run.sh "$CHECKOUT" "$SESSION_OUTPUT" "$ELECTRON_BINARY"
node prepare.mjs "$CHECKOUT"
```

Wait for the Electron remote debugging endpoint on port 19321 before preparing. Select the app's preview in GNOME's initial overview (the outer desktop click at 800,450), then:

```
node drive.mjs "$CHECKOUT" "$CAPTURE_OUTPUT" "$SESSION_OUTPUT"
```

The driver waits for the shortcut recorder to install its listener before typing. It uses the named SnapShots setup dialog to distinguish it from the enclosing Settings dialog. Stop a session by creating its `stop` file, and wait for its processes to exit before starting the other side on the same debugging port.

For the supplemental check, create an empty git repository, then run from the head checkout:

```
node apps/server/src/bin.ts project add "$DEMO_DIRECTORY" --title 'Snapshot demo' --base-dir "$SESSION_OUTPUT/t3-home"
node capture-draft.mjs "$CHECKOUT" "$CAPTURE_OUTPUT" "$SESSION_OUTPUT"
```

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