Skip to content

feat(viewer): show completed agent clicks as a short pulse - #425

Merged
ElbertePlinio merged 4 commits into
mainfrom
feat/368-viewer-click-pulse
Oct 28, 2026
Merged

ElbertePlinio merged 4 commits into
mainfrom
feat/368-viewer-click-pulse

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

Agents click fast. A human who watches the native viewer sees the cursor move but cannot tell when a click happened.

A completed desktop click or double click now shows a short ember ring at the click point in the native viewer. The ring grows from 4 to 20 logical pixels and fades out in 500 ms. It is drawn only in the viewer window, clipped to the session image, under the bar, label and banner, in thumbnail, expanded and fullscreen modes. Session pixels and captures do not change. A drag shows no ring, since its release is not a click.

The pulse comes from the click itself, not from the evidence input records, because those exist only during an evidence run. click and doubleClick in packages/desktop-linux serve both the CLI and MCP. After the agent permit is released, they send a pulse request to the session's viewer host with the Xvfb identity that verified for the click. The request is written and the socket closes without waiting for a reply, so a missing, slow or stuck viewer never changes the click result or its timing. The host refuses a pulse for another Xvfb than the one its viewer shows and checks every field. It then sends {"cmd":"pulse","x","y"} to the viewer. The pulse operation grants nothing and carries no session input. The viewer ignores pulses while the human holds control or after the session ended. X moves a pointer past the session edge to the edge, and the viewer moves the ring there too.

Reviewed with sol-loop: 2 rounds with GPT-6.1 Sol (high). Round 1 found that the click waited for the host reply (up to 300 ms with a stuck host) and that an edge click showed no ring; both are fixed. Round 2 scored 8/10 with one open point, settled below.

Final review by Fable 5.1 (high), 2 rounds: approved, 9/10. Round 1 found the same reply wait in the evidence timing; it is fixed. Declined nits: the 300 ms socket timeout has no direct test because the kernel always accepts the one-line write, and the host's reply to a closed pulse socket is swallowed by its existing error handler.

Disputed: Sol round 2 noted that clicks at x or y above 32767 show no ring, while X wraps them to another point (click 32768 100 lands at 0,100). Pointer input accepts these values today and X wraps them, so the click itself lands at the wrong point, with or without this change. That input bug is #424. Drawing the ring at the wrapped point would show the wrong click as if it were intended, so the viewer shows none.

Closes #368

Requirement Verified by Scenario and edge cases Result Evidence
A completed click shows a short pulse at the click point, in the viewer only Rust unit tests, CLI test with real Xvfb and xdotool, live viewer test, QA Click, double click, drag; click refused by a human lease; click whose xdotool fails; pulse while controlling and after session end; thumbnail and expanded One ring per click and double click; none for drag, refused or failed clicks desktop-click-pulse.test.ts, native-viewer-live.test.ts, 02, 03, 04 screenshots, results.txt
Pulses use verified session coordinates Host tests, Rust tests, QA Wrong Xvfb pid or start ticks; bad fields; point past the edge; letterbox and scale mapping Wrong display gets operation-failed, bad fields invalid-request; edge click rings at the corner native-viewer-host.test.ts, pulse.rs tests, 09-expanded-edge-click-pulse.png
App pixels and model captures do not change Live viewer test, QA Session captures during and after the ring Same decoded pixel hash before and after; no ember pixels in session captures native-viewer-live.test.ts, 05 and 06 screenshots, results.txt
A viewer never slows the click Host test Host that accepts the socket and never reads; no viewer Pulse returns well under 250 ms (299 ms before the fix); no viewer under 300 ms native-viewer-host.test.ts
Ring ends and clears Rust tests, QA 1 s after a click No ember pixels left 08-expanded-after-pulse.png, pulse.rs tests
Release note Pending docs/releases/UNRELEASED.md was reset after 0.7.1 while this was in review Tracked in #416 this PR

Release note for the next version: "The native viewer shows a short ember ring where an agent click or double click lands, so you can see each click happen. The ring is drawn only in the viewer window; session pixels and screenshots do not change. (#368)"

QA ran on a private host Xvfb (:368) with WAYLAND_DISPLAY unset, a CLI-created 1280x800 session, watch, and CLI desktop click, double-click and drag. The script, log and screenshots are in ~/.pickforge/investigations/368/.

Follow-ups: #424 pointer input accepts points off the screen, and X wraps values above 32767.

Checks on 922212d (this branch merged with main): cargo fmt, clippy with -D warnings and cargo test -p pickforge-viewer; bun run build, typecheck, lint; bun run test:coverage with the CI environment variables (191 files, 3418 tests passed, 4 skipped); PickCheck against main (no violations). Focused pulse, viewer, takeover and security suites (317 tests) and the live viewer test passed after the review fixes.

A completed desktop click or double click asks the session's native viewer
host for a pulse at the click point, on the Xvfb that verified for the
click. The host forwards it as a pulse command, and the viewer draws a
short ember ring in its own window only. Session pixels and captures do
not change. A missing or slow viewer never changes the click result.

Closes #368
A click no longer waits for the viewer host to reply to its pulse. The
request is written and the socket closes, so a stuck host cannot delay the
click or its evidence timing.

X moves a pointer past the session edge to the edge, so the viewer now
moves a pulse point there too instead of dropping it.
@ElbertePlinio
ElbertePlinio merged commit 9c47f3b into main Oct 28, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the feat/368-viewer-click-pulse branch October 28, 2026 23:15
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.

viewer: show completed agent clicks as a short pulse

1 participant