← Commit history

Stop applying the taskbar identity twice in Thread Tiles mode: when the thread name tile has not finished rendering, defer the stamp and the registry write instead of branding the thread AUMID with the generic pup icon first, so a window transitions once, straight from the default Chrome icon to its thread name tile.

John Lauer ·fd3eacf6ff ·2mo ago ·parent 475d7fc
4 files changed +26−9
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.175",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.175/adom-bridge-puppeteer-v2.0.175.zip",-  "sha256": "9879df972b7689f3bbb97ca220d154bf6d7d3a1cb8eee85cadb1ed3c34a6f84b",-  "size": 916756,+  "version": "2.0.176",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.176/adom-bridge-puppeteer-v2.0.176.zip",+  "sha256": "0264ead13743346110d66c0e5e1a5ecf57688827eb300cf5eb3e2e613c292e2d",+  "size": 917270,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.175+2.0.176
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.175",+  "version": "2.0.176",   "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−3
@@ -4098,7 +4098,20 @@ async function stampPupIdentity(sessionId, opts) {           if (!_rp) { outer: for (const [, s2] of sessions) { for (const t2 of (s2.tabs || [])) { if (t2 && t2.page) { _rp = t2.page; break outer; } } } }           if (_rp) { try { const r = await renderThreadTileIco(_rp, _tn); if (r) _tp = r; } catch (e) { console.log(`[thread-tile] stamp render err: ${e.message}`); } }         }-        try { if (fs.existsSync(_tp)) _stampIcon = _tp; } catch (e) {}+        // v2.0.176 (John: "why do you apply the aumid TWICE? the generic icon, then the ai-thread+        // name icon — that seems overkill"). He was right: _stampIcon defaults to the generic/category+        // pup tile, so if the name tile had not finished rendering yet, the thread AUMID got stamped+        // with the GENERIC icon and the real tile arrived on a LATER stamp — two visible identity+        // changes for one window. There is no reason to ever stamp a thread identity without its+        // tile: bail and let the retry stamp once, when the art is ready. Until then the window+        // simply keeps Chrome's own icon, which is honest (pup has not claimed it yet) and is the+        // single transition John asked for: default Chrome -> thread name tile, nothing in between.+        let _tileReady = false; try { _tileReady = fs.existsSync(_tp) && fs.statSync(_tp).size > 100; } catch (e) {}+        if (!_tileReady) {+          console.log(`[thread-tile] "${sessionId}" stamp DEFERRED — tile for "${_tn}" not rendered yet (no generic-icon placeholder stamp)`);+          return false;+        }+        _stampIcon = _tp;         _stampName = String(_tn);         // v2.0.166 THE STALE-HANDLE TRAP: ab caches icon HANDLES by cacheKey for its process         // lifetime ("ab holds the icon handles for its process lifetime"). An unversioned key meant@@ -4240,9 +4253,13 @@ async function registerPupAumid(appId, sessionId) {       if (!_rp) { outer2: for (const [, s2] of sessions) { for (const t2 of (s2.tabs || [])) { if (t2 && t2.page) { _rp = t2.page; break outer2; } } } }       if (threadName && _rp) {         const tile = await renderThreadTileIco(_rp, threadName);-        if (tile) iconPath = tile;+        // v2.0.176: never brand a thread AUMID with the GENERIC pup icon (see stampPupIdentity) —+        // that placeholder is exactly the first of the two icon applies John flagged. No tile yet =+        // register nothing; the stamp defers too, and both land once when the art is ready.+        if (!tile) { console.log(`[thread-tile] register DEFERRED for "${threadName}" — tile not ready`); return; }+        iconPath = tile;         displayName = String(threadName);   // the taskbar hover/label reads the thread name too-      }+      } else if (threadName) { return; }   // thread window, no page to draw with yet — wait, don't placeholder     } catch (e) { console.log(`[thread-tile] register error: ${e.message}`); }   }   // v1.9.44: write IconResource FIRST, before the button can possibly exist. AD's registration does