← Commit history

Thread Tiles direct transition: a thread window's button goes straight from the default Chrome identity to the thread name tile with no intermediate AUMID and no category wait, and the favicon overlay paints only after the thread stamp settles so it cannot latch the pre-thread button.

John Lauer ·17a9d97083 ·2mo ago ·parent 2c895f5
4 files changed +32−7
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.167",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.167/adom-bridge-puppeteer-v2.0.167.zip",-  "sha256": "8a3f7a8139c587676a5fde82eea83b4b1d87ff073acf2fe957aacd6166ec742d",-  "size": 910448,+  "version": "2.0.168",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.168/adom-bridge-puppeteer-v2.0.168.zip",+  "sha256": "8e3565bcbe9cb0dee50b06e8f56f4d8369582805c3ccb972ad6a7bb6fb50c868",+  "size": 911166,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.167+2.0.168
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.167",+  "version": "2.0.168",   "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+26−1
@@ -3967,6 +3967,11 @@ async function stampPupIdentity(sessionId, opts) {     // wins here; GROUPED mode keeps the stable pinnable Adom.Pup.     const grouped = pupSettings().taskbarGrouping === 'grouped';     const sess = sessions.get(sessionId);+    // v2.0.168: pre-registration stamps (no session yet => owner unknowable) are SKIPPED in Thread+    // Tiles mode — they could only mint an intermediate per-session id the button would transition+    // through, violating the direct CfT -> thread-tile rule. The registered-session stamp follows+    // within a beat and carries the real thread identity.+    if (!sess && pupSettings().threadTiles === 'on') return false;     // v1.9.52 — DO NOT stamp a transient ".plain" identity for a window that is merely still LOADING.     // A freshly-opened window sits on about:blank for a beat (category null -> "plain"), then lands on     // its real URL (category web/wiki/app). The old code stamped ".plain" during that beat, which@@ -3979,7 +3984,13 @@ async function stampPupIdentity(sessionId, opts) {     // attached — so the menu resolves on the first click. A genuinely category-less window (a page     // that never leaves about:blank) still gets "plain" after a few attempts so it is never unbranded.     const rawCat = pupCategory(sessionId);-    if (!grouped && !rawCat) {+    // v2.0.168 THREAD TILES DIRECT TRANSITION (John: "you should be going direct from the standard+    // CfT taskbar icon to your ai-thread name icon — no intermediate AUMID"). A thread-eligible+    // window's identity does not depend on the page category at all, so do NOT wait for the category+    // to settle (and never mint a pre-registration intermediate id, below) — stamp the thread AUMID+    // as the FIRST and ONLY identity the button ever transitions to.+    const _threadEligible = pupSettings().threadTiles === 'on' && sess && (sess.owner || sess._ownerThread);+    if (!grouped && !rawCat && !_threadEligible) {       const hasRealUrlLoading = (sess && (sess.tabs || []).some(t => {         try { const u = t.page && t.page.url(); return u && !/^(about:blank|chrome|edge|devtools):/i.test(u); } catch (e) { return false; }       }));@@ -4137,6 +4148,10 @@ async function stampPupIdentity(sessionId, opts) {       if (!sess) _earlyStamped.set(sessionId, appId);   // v2.0.25: pre-registration stamp — see above       if (sess && prevAppId !== appId) {         sess._curAppId = appId;+        // v2.0.168: timestamp a landed THREAD stamp — the overlay paint waits a settle beat after+        // this so the shell finishes moving the window onto the thread button before any+        // SetOverlayIcon call can latch the button association (the 2.0.167 regression).+        if (appId.startsWith(`${PUP_APP_ID}.thread.`)) sess._threadStampAt = Date.now();         // v2.0.7: freeze the identity at this first real stamp — no re-stamp on later category changes.         if (!_dashInfra && !grouped) sess._frozenAppId = appId;         // v1.9.245: the stamp DESTROYED and RECREATED the taskbar button, so whatever overlay was@@ -5627,6 +5642,16 @@ async function applyAppOverlay(session, sessionId) {   // the tile" was the stale category BUTTON ART (the ab icon-handle cache bug, fixed in 2.0.166), not   // the overlay. The overlay is a small corner badge; the name stays readable. On a grouped thread   // button Windows shows the overlay of the most recently updated window in the group — acceptable.+  // v2.0.168 THE LATCH GUARD (the 2.0.167 regression): SetOverlayIcon on a window still wearing the+  // DEFAULT CfT identity latches the shell's button association, and the thread stamp that follows+  // never moves the window to its thread button. So for a thread-eligible window the overlay paints+  // ONLY once the thread appId has landed, plus a settle beat for the shell to finish the move.+  // No 30s-grace fallback here — painting the pre-thread button is exactly the latch that breaks the+  // direct CfT -> thread-tile transition (John's rule).+  if (pupSettings().threadTiles === 'on' && session && (session.owner || session._ownerThread)) {+    if (!(session._curAppId || '').startsWith(`${PUP_APP_ID}.thread.`)) return false;+    if (!session._threadStampAt || (Date.now() - session._threadStampAt) < 5000) return false;+  }   // v1.9.281 THE RESURRECTION GUARD (found by ralph: a reaped session's badge kept reappearing).   // applyAppOverlay is reached from several deferred setTimeout retries (favicon retry, post-nav,   // heal) that CAPTURE the session object. If the window closed in the meantime, those late calls