← Commit history

Dashboard taskbar strip now shows the teal pup tile for every pup window (matching the real taskbar) instead of Chrome's exe logo for un-stamped windows; add a Regenerate All Overlay Icons header button that re-runs the from-scratch overlay algorithm on every window and reports which windows drifted

John Lauer ·3560f9a780 ·3mo ago ·parent 7a02804
4 files changed +51−12
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "1.9.297",-  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.297/adom-bridge-puppeteer-v1.9.297.zip",-  "sha256": "aec7b25e90a15ed661f4d24af704877e8390d3cd80974d187dbcd1dfa4292961",-  "size": 721334,+  "version": "1.9.298",+  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.298/adom-bridge-puppeteer-v1.9.298.zip",+  "sha256": "d3052b81f0da0c1fae5f66d75f7dcd9303a3bcd1c563d78cc09242eb455ed0c6",+  "size": 722783,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-1.9.297+1.9.298
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "1.9.297",+  "version": "1.9.298",   "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. browser_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. browser_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, browser_alert_window posts a native toast whose click focuses the window, browser_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-desktop",   "author": "Adom Inc.",
src/server.js+45−6
@@ -8631,16 +8631,22 @@ async function dashboardSnapshot() {     // dev-skills/pup-aumid-decisions). This branch remains ONLY to truthfully model windows that     // were stamped before the revert - the AUMID property lives on the window until it closes, so     // those really do keep their own taskbar buttons. New windows never enter it.-    let baseIcon;+    // v1.9.298 (John, holding up a photo of the real taskbar next to the dashboard: "why is the list+    // of icons in the pup dashboard not matching what's in the windows taskbar?"). He is right, and+    // this was the miss: EVERY pup window on the real taskbar wears the teal pup TILE (measured, at+    // full resolution — not one Chrome-logo pup button exists). But the dashboard drew un-stamped+    // profiles with /dashboard/baseicon, which ExtractAssociatedIcon's the Chrome-for-Testing EXE and+    // returns the multicolor Chrome logo. So the dashboard invented Chrome-logo buttons that the+    // taskbar never shows. The base art is the pup tile for ALL pup windows regardless of stamp state+    // — use it unconditionally so the strip matches reality by construction. (Keying still splits+    // stamped vs process-grouped windows so the tooltip/LED rollup stays truthful.)+    let baseIcon = '/dashboard/stampicon?session=' + encodeURIComponent(w.sessionId);     if (w._curAppId) {       key = 'aumid:' + w._curAppId;       label = w.sessionId;-      // The real button's art is the icon the stamp registered (teal category tile), NOT Chrome's.-      baseIcon = '/dashboard/stampicon?session=' + encodeURIComponent(w.sessionId);     } else {       key = 'chrome-process:' + w.profile;       label = 'Chrome (' + w.profile + ')';-      baseIcon = '/dashboard/baseicon?profile=' + encodeURIComponent(w.profile);     }     if (!buttons.has(key)) buttons.set(key, { key, label, kind: 'process', baseIcon, grouping: minimalTouch() ? 'minimal-touch' : grouping, windows: [], badgeSession: null, badgeAt: 0, badgeVia: null });     const btn = buttons.get(key);@@ -8843,6 +8849,7 @@ footer{color:#5c6c7a;font-size:11px;padding:8px 18px 22px}   </div>   <div class="acts2">     <button class="ibtn" id="gear" title="pup settings" aria-label="settings"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h0a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg></button>+    <button class="ibtn" data-act="regen-overlays" data-tip="Regenerate ALL overlay icons: re-scan every open window and tab and re-run the from-scratch overlay algorithm (re-resolve each window handle, re-pick the favicon, recompose + repaint the taskbar badge) and refresh these dashboard icons to match. A clean sweep to verify correctness and surface any drift." title="regenerate all overlay icons (clean sweep)" aria-label="regenerate overlays"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M23 4v6h-6"/><path d="M1 20v-6h6"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg></button>     <button class="ibtn" data-act="flash-all" title="flash every pup taskbar button (the Windows taskbar flash, accent-colored on your theme)" aria-label="flash all"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.7 21a2 2 0 0 1-3.4 0"/></svg></button>     <button class="ibtn" data-act="unflash-all" title="clear every taskbar flash" aria-label="clear taskbar flashes"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.7 21a2 2 0 0 1-3.4 0"/><line x1="3" y1="3" x2="21" y2="21"/></svg></button>     <button class="ibtn danger" data-act="close-all" data-confirm="Close ALL pup windows?" title="close every pup window" aria-label="close all windows"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button>@@ -8986,13 +8993,13 @@ function toast(msg,type){   _q('#toasts').appendChild(t);   setTimeout(()=>{t.classList.add('out');setTimeout(()=>t.remove(),350)},type==='error'?8000:4000); }-const ACTMSG={'flash':'flashed the taskbar button of','unflash':'taskbar flash cleared on','flash-all':'flashed every pup taskbar button','unflash-all':'cleared every taskbar flash','close-all':'closed all pup windows','close-window':'closed','close-tab':'closed tab in','fg':'bringing to front:','bg':'sent to background:','set-setting':'setting saved','test-caption':'sample caption shown on your screen'};+const ACTMSG={'flash':'flashed the taskbar button of','unflash':'taskbar flash cleared on','flash-all':'flashed every pup taskbar button','unflash-all':'cleared every taskbar flash','close-all':'closed all pup windows','close-window':'closed','close-tab':'closed tab in','fg':'bringing to front:','bg':'sent to background:','set-setting':'setting saved','test-caption':'sample caption shown on your screen','regen-overlays':'regenerated all overlay icons'}; async function act(p){   try{     const r=await fetch('/dashboard/action',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(p)});     const j=await r.json().catch(()=>({}));     const what=(ACTMSG[p.action]||p.action)+(p.sessionId?' '+p.sessionId:'');-    if(j.ok) toast(what+(p.action==='unflash-all'&&j.swept!=null?' ('+j.swept+' windows swept)':'')+(p.action==='flash-all'&&j.delivered!=null?' ('+j.delivered+' of '+j.n+' delivered)':''), p.action.indexOf('close')===0?'success':'info');+    if(j.ok) toast(what+(p.action==='unflash-all'&&j.swept!=null?' ('+j.swept+' windows swept)':'')+(p.action==='flash-all'&&j.delivered!=null?' ('+j.delivered+' of '+j.n+' delivered)':'')+(p.action==='regen-overlays'&&j.swept!=null?' ('+j.swept+' windows, '+j.painted+' painted, '+j.changed+' corrected)':''), p.action.indexOf('close')===0?'success':'info');     else toast(what+' failed'+(j.error?': '+j.error:''),'error');     return j;   }catch(e){toast(p.action+' failed: '+e.message,'error');}@@ -9312,6 +9319,38 @@ const server = http.createServer(async (req, res) => {           }           return done({ ok: true, n: sessions.size, delivered });         }+        if (act === 'regen-overlays') {+          // v1.9.298 (John: "give me a button to regenerate all overlay icons — a clean sweep so I can+          // verify you're doing it right, and it may help debug why they drift"). This runs the SAME+          // from-scratch computation used on load, for EVERY window, and rewrites the badge PNG the+          // dashboard reads — so the taskbar and the dashboard are both refreshed from one source. It+          // returns per-window before/after so drift is visible: a window that CHANGES here was being+          // shown wrong until the sweep, which points at whichever verb mutated it without re-triggering+          // the overlay calc (John's hypothesis — the thing we can now catch).+          const results = [];+          for (const [id, sess] of sessions) {+            if (!sess || !(sess.tabs || []).length) continue;+            const favKind = (f) => (f && f.kind) || 'none';+            const before = { hwnd: sess._hwnd || null, fav: favKind(sess._overlayFav) };+            // Clear every cache so this is a TRUE recompute, not a replay of the last cached pick, and+            // force handle re-resolution (a stale/wrong handle is the other half of the drift).+            sess._overlayFav = null; sess._faviconRetried = false; sess._noFavLogged = false;+            sess._hwnd = null; sess._appOverlay = false; sess._overlayEnforceAt = 0;+            let painted = false;+            try { painted = await applyAppOverlay(sess, id); } catch (e) {}+            const after = { hwnd: sess._hwnd || null, fav: favKind(sess._overlayFav) };+            const changed = String(before.hwnd) !== String(after.hwnd) || before.fav !== after.fav;+            results.push({ sessionId: id, painted: !!painted, favKind: after.fav,+              hwndBefore: before.hwnd, hwndAfter: after.hwnd, favBefore: before.fav, changed });+          }+          // Sweep orphan badges / stale bookkeeping so the dashboard strip is fully reconciled too.+          try { await reconcileModel('regen-overlays (dashboard button)'); } catch (e) {}+          const changed = results.filter(r => r.changed).length;+          const painted = results.filter(r => r.painted).length;+          console.log(`[regen] swept ${results.length} windows — ${painted} painted, ${changed} corrected (hwnd or favicon changed on the sweep)`);+          for (const r of results.filter(x => x.changed)) console.log(`[regen]   CORRECTED "${r.sessionId}": hwnd ${r.hwndBefore}->${r.hwndAfter}, fav ${r.favBefore}->${r.favKind}`);+          return done({ ok: true, swept: results.length, painted, changed, results });+        }         return done({ ok: false, error: 'unknown action' });       } catch (e) { return done({ ok: false, error: e.message }); }     }