Files
autodoc/app/capture-worker-preload.js
Iisyourdad a0b69f8cc7
Template tests / tests (push) Successful in 1m50s
Rearchitect click capture: strict click-time frames, off-main-process recorder, exact marker coordinates
Implements the architecture change from ai_prompts/prompt3.md:

- New app/click-frames.js: shared timestamped frame ring + strict
  click-to-frame pairing (never a frame whose grab started after the
  click); legacy slack behavior kept behind capture.strictClickFrames=false.
- New stream capture backend (app/stream-backend.js + hidden worker
  window): per-display desktop media streams sampled into ring buffers
  and PNG-encoded entirely off the main process, so click delivery is
  never starved by capture work. Auto-degrades to the legacy in-process
  frame loop when streams cannot start or the worker stops answering.
- Clicks are paired with their frame at event time (eager pairing in
  enqueueClickCapture); only the storing is serialized, so slow encodes
  cannot skew later clicks in a fast burst.
- Linux watcher: restored event-time root coordinates from
  xinput test-xi2 and merge raw/regular twin events structurally.
- Replaced the 40ms time debounce with source-aware duplicate
  suppression: fast legitimate clicks are never dropped.
- New app/coords.js: physical-to-DIP conversion with multi-monitor and
  scale-factor handling; Windows keeps screenToDipPoint.
- STEPFORGE_CLICK_SELFTEST end-to-end hook: 3/3 clicks become steps via
  the stream backend with 0.00% marker offset on this host.
- Tests rewritten/added: strict selection, coords, stream backend,
  Linux coordinate parsing, twin merge, burst clicking (126 passing).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:33:31 -05:00

18 lines
533 B
JavaScript

'use strict';
const { contextBridge, ipcRenderer } = require('electron');
/**
* Bridge for the hidden capture-worker window. The worker only ever talks to
* the StreamCaptureBackend in the main process: commands in (start streams,
* frame requests), events out (stream health, PNG-encoded frames).
*/
contextBridge.exposeInMainWorld('captureWorkerBridge', {
onCommand(fn) {
ipcRenderer.on('capture-worker:command', (_event, msg) => fn(msg));
},
send(msg) {
ipcRenderer.send('capture-worker:event', msg);
},
});