← Commit history

The pencil hit area becomes a user-tunable slider (John: 8px too small, 160 too big, let me pick): new floatyHitPx setting, 6 to 120 px slider under the toolbar family in the pup dashboard Settings, default 24. It live-applies: the versioned injection guard now includes the px value, so moving the slider re-injects the floaty on every open page instantly, tear-down and rebuild, no reloads. Built so John can feel each size and report the best default

John Lauer ·28393ad836 ·2mo ago ·parent 5146990
4 files changed +26−13
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.89",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.89/adom-bridge-puppeteer-v2.0.89.zip",-  "sha256": "d521a2bcef3c19709cf0ed76abf3a3fd1e5bf672636a64b82968debd28280115",-  "size": 836438,+  "version": "2.0.90",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.90/adom-bridge-puppeteer-v2.0.90.zip",+  "sha256": "4703e56f1174551b967d1666332e19500e3fea2ebb4e22f584a50e4364a35e57",+  "size": 836771,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.89+2.0.90
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.89",+  "version": "2.0.90",   "description": "Drives a browser ALREADY on the machine \u2014 installed Chrome, else Microsoft Edge (every Windows PC ships with Edge) \u2014 launched with a FRESH isolated profile, so the common case has NO ~150 MB Chrome-for-Testing download and it never touches the user's real tabs/logins. Binds its local server to LOOPBACK (127.0.0.1) only, so no Windows Firewall 'allow Node through the firewall' prompt ever pops. Chrome for Testing is fetched only as a LAST RESORT if the machine has no Chromium browser at all. SPAWN-VERIFIED fallback: pup tries each detected browser (Chrome \u2192 Edge \u2192 CfT) and actually launches it, falling through to the next if one won't start (and handling browsers like Edge that relaunch onto another PID), so a corrupt/partial install never hard-fails an open. The browser that launches is cached as the default (persisted across restarts) so it isn't re-probed each time. On spawn the bridge SELF-WARMS: detects browsers + disk, and only if the box has no Chrome/Edge and no cached CfT does it background-fetch CfT so the first open is instant. pup_use pins a specific browser (chrome | edge | cft | auto); {browser:'chrome',install:true} downloads & installs REAL Google Chrome (user-scoped, no admin) on an Edge-only box. pup_readiness (READ-ONLY) reports which browser will be used + the full candidate list + the default + free disk. Every failure returns a specific errorCode + _hint (chrome_install_no_disk, chrome_download_network, chrome_install_permission, chrome_stable_not_detected, \u2026). Launches with FULL browser permissions by default for full debug (strictPermissions:true opts out). Headful automation: open/close windows+tabs, navigate, screenshot, eval JS, record. pup is a GENERIC, non-profile browser only \u2014 every session is a fresh isolated Chrome/Edge process, never the user's real signed-in browser; profile defaults to sessionId. To drive the user's REAL Chrome/Edge (their profile, cookies, SSO), use the Adom browser EXTENSION's nbrowser_* verbs \u2014 a separate bridge, not pup's job. macOS (v1.9.74+): full parity with mac-native mechanics \u2014 background-by-default is the app-level hide (windows stay drivable/screenshottable while hidden), raise/lower map to unhide+activate/hide, pup_alert_window posts a native toast whose click focuses the window, pup_use {browser:'chrome',install:true} installs Chrome from the official dmg, and taskbar identity/badging remains Windows-only.",   "homepage": "https://wiki.adom.inc/adom/adom-bridge",   "author": "Adom Inc.",
src/server.js+20−7
@@ -699,7 +699,8 @@ function attachTab(session, sessionId, page, { makeActive = true, opener = 'user     // toolbar instantly, client-side, with zero bridge round-trip (John: it was laggy).     try { page.evaluateOnNewDocument(ANNOTATE_OVERLAY_JS).catch(() => {}); page.evaluate(ANNOTATE_OVERLAY_JS).catch(() => {}); } catch (e) {}     if (pupSettings().tbFloatyPencil !== 'off') {-      try { page.evaluateOnNewDocument(FLOATY_JS).catch(() => {}); page.evaluate(FLOATY_JS).catch(() => {}); } catch (e) {}+      const fj = floatyJs();+      try { page.evaluateOnNewDocument(fj).catch(() => {}); page.evaluate(fj).catch(() => {}); } catch (e) {}     }   }   try { page.evaluateOnNewDocument(PUP_DEEP_HELPERS).catch(() => {}); } catch (e) {}@@ -3079,7 +3080,7 @@ function pupSettings() {   D.jlDashboard = 'on';   D.jlAnnotate = 'on';   // v2.0.49   // v2.0.50 (plan: interactive surface): caption bar baked under captures; toolbar extension family-  D.annCaptionBar = 'on'; D.toolbarExtension = 'on'; D.tbOwnerBadge = 'on'; D.tbSnipHotkey = 'on'; D.tbFloatyPencil = 'on';+  D.annCaptionBar = 'on'; D.toolbarExtension = 'on'; D.tbOwnerBadge = 'on'; D.tbSnipHotkey = 'on'; D.tbFloatyPencil = 'on'; D.floatyHitPx = 24;   // v1.9.293 (John): the 'NOT foregrounded by Adom' caption is now OFF by default. He is right that   // input-timing cannot reliably tell his own raises (click / alt+tab / window click) from a rare   // JS raise - and Windows blocks most background foreground-steals anyway, so the case it exists@@ -5658,14 +5659,18 @@ function _stageExtDir(srcName, dstName) { // popup works), so the floaty rides pup's own guaranteed injection rail instead (the owner-chip // pattern). Clicking sets window.__pupFloatyClick; the 4s enforcer sweep picks it up and starts // annotate on THAT tab. Zero extension dependency for discoverability.+function floatyJs() {+  const px = Math.max(6, Math.min(200, Number(pupSettings().floatyHitPx) || 24));+  return FLOATY_JS.replace(/__HITPX__/g, String(px));+} const FLOATY_JS = `(() => {   // v2.0.89: VERSIONED guard. evaluateOnNewDocument scripts from every prior bridge process stay   // registered on long-lived pages and run oldest-first, so a plain boolean guard let the OLDEST   // floaty win forever (John kept seeing the big hover zone after reloads). The newest module now   // tears down any elder and rebuilds.   if (window !== window.top) return;-  if (window.__pupFloatyV === '${BRIDGE_VERSION}') return;-  window.__pupFloatyV = '${BRIDGE_VERSION}'; window.__pupFloaty = true;+  if (window.__pupFloatyV === '${BRIDGE_VERSION}:__HITPX__') return;+  window.__pupFloatyV = '${BRIDGE_VERSION}:__HITPX__'; window.__pupFloaty = true;   var _oldHost = document.getElementById('__pup_floaty'); if (_oldHost) _oldHost.remove();   function add() {     if (!document.body) { setTimeout(add, 400); return; }@@ -5699,7 +5704,7 @@ const FLOATY_JS = `(() => {     addEventListener('mousemove', function (e) {       if (pinned) return;       var hr = host.getBoundingClientRect();-      var inCorner = e.clientX > innerWidth - 8 && e.clientY < 8;   // v2.0.88 (John): a TINY corner target, ~6px, nowhere near dashboard buttons — jam the cursor into the literal corner to summon the pencil+      var inCorner = e.clientX > innerWidth - __HITPX__ && e.clientY < __HITPX__;   // v2.0.90: user-tunable corner target (floatyHitPx slider in Settings)       var onHost = shown && e.clientX >= hr.left - 8 && e.clientX <= hr.right + 8 && e.clientY >= hr.top - 8 && e.clientY <= hr.bottom + 8;       if (inCorner || onHost) reveal(); else if (shown) tuck();     }, { passive: true });@@ -10358,6 +10363,7 @@ const SETTINGS_DEF=[  {k:'tbOwnerBadge',l:'',d:'Per-tab colored badge on the toolbar icon showing which AI thread owns the window.',dep:'toolbarExtension',subtgl:1},  {k:'tbSnipHotkey',l:'',d:'Alt+Shift+A starts annotate (red pen) on the current pup window.',dep:'toolbarExtension',subtgl:1},  {k:'tbFloatyPencil',l:'',d:'The tiny pencil in each page\'s upper-right corner: one click starts annotate. Applies to newly loaded pages.',dep:'toolbarExtension',subtgl:1},+ {k:'floatyHitPx',l:'',d:'Pencil corner hit area (px): how big the invisible top-right target is that reveals the pencil. Applies to open pages immediately.',slider:[6,120,2],dep:'tbFloatyPencil'},  {k:'fgWatch',l:'20s foreground watch',d:'For 20s after a window opens or navigates in the background, watch whether something (JavaScript, Chrome, a focus change) brings it to the foreground, and caption that it was not Adom. Never moves the window.'},  {k:'fgCaption',l:'Caption on AI foreground',d:'When an AI brings a window to your screen, show its stated reason as an on-screen caption. The AI is always forced to give a reason; this shows it to you.'},  {k:'fgCaptionMs',l:'',d:'',slider:[500,5000,250],dep:'fgCaption',test:1},@@ -10688,7 +10694,9 @@ const server = http.createServer(async (req, res) => {             titleTag: ['on', 'off'], titlePrefix: ['on', 'off'],           };           const key = String(a.key || ''); let val = a.value;-          if (key === 'fgCaptionMs') {+          if (key === 'floatyHitPx') {+            val = Math.max(6, Math.min(200, Number(val) || 24));+          } else if (key === 'fgCaptionMs') {             val = Math.max(500, Math.min(5000, Number(val) || 2000));           } else if (!ALLOWED[key] || !ALLOWED[key].includes(val)) {             return done({ ok: false, error: 'unknown setting or value' });@@ -10699,7 +10707,12 @@ const server = http.createServer(async (req, res) => {           // v1.9.279: a taskbar-identity setting must take effect on EXISTING windows immediately,           // not just future ones. Reconcile now re-stamps every live window to match (idempotent).           if (['aumidIcons', 'taskbarGrouping', 'aumidIconStyle'].includes(key)) reconcileModel('setting ' + key).catch(() => {});-          if (['jumpLists', 'jlViewTasks', 'jlCloseAll', 'jlDashboard', 'jlAnnotate'].includes(key)) refreshAllJumplists().catch(() => {});   // v1.9.320: OFF clears the menu, ON/sub re-commits+          if (['jumpLists', 'jlViewTasks', 'jlCloseAll', 'jlDashboard', 'jlAnnotate'].includes(key)) refreshAllJumplists().catch(() => {});+          // v2.0.90: the pencil hit-area slider live-applies — re-inject the floaty on every open+          // page (the versioned guard includes the px value, so a change tears down and rebuilds).+          if (key === 'floatyHitPx' || key === 'tbFloatyPencil') {+            (async () => { try { const fj = floatyJs(); for (const [, s6] of sessions) for (const t6 of (s6.tabs || [])) { try { await Promise.race([t6.page.evaluate(fj), new Promise(r => setTimeout(r, 1200))]); } catch (e) {} } } catch (e) {} })();+          }   // v1.9.320: OFF clears the menu, ON/sub re-commits           if (key === 'ownerChip') applyOwnerChipSetting(val === 'on').catch(() => {});           return done({ ok: true, settings: pupSettings() });         }