← Commit history

Alt+Shift+V keyboard shortcut for the wiki view toggle, John's ask, mirroring annotate's Alt+Shift+A: a new pup-view command in the toolbar extension (0.2.7) posts pup_wiki_set_view with the new view:toggle mode, which flips whatever the window currently shows so the hotkey needs no state. The popup's Switch-view row now shows the kbd hint. Since 2.0.132 the flip is an in-place tab reload either direction, so the hotkey is instant: no relaunch, no resize.

John Lauer ·2aae56f5af ·2mo ago ·parent efffca6
7 files changed +29−13
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.138",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.138/adom-bridge-puppeteer-v2.0.138.zip",-  "sha256": "0ed0668a9f22107d9b7d5afc0aa9088e8a0255cd44d40029c8058dab24d7284f",-  "size": 890493,+  "version": "2.0.139",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.139/adom-bridge-puppeteer-v2.0.139.zip",+  "sha256": "bb1f6937ef35f4be7bf43b09cde69ddf7a7148029d193fb5d02bb83b22cd05e9",+  "size": 890906,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.138+2.0.139
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.138",+  "version": "2.0.139",   "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/extension/manifest.json+7−1
@@ -1,7 +1,7 @@ {   "manifest_version": 3,   "name": "Adom Pup",-  "version": "0.2.6",+  "version": "0.2.7",   "description": "Toolbar for Adom Pup browser windows: annotate, snip, view toggle, dashboard, owner info. Thin trigger surface - the pup bridge is the engine.",   "action": {     "default_popup": "popup.html",@@ -27,6 +27,12 @@         "default": "Alt+Shift+A"       },       "description": "Annotate this page (red pen)"+    },+    "pup-view": {+      "suggested_key": {+        "default": "Alt+Shift+V"+      },+      "description": "Switch this wiki page between the logged-in and public view"     }   },   "icons": {
src/extension/popup.html+1−1
@@ -64,7 +64,7 @@     <div class="sep"></div>     <button class="row" data-act="view">       <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="12" cy="12" r="8"/><path d="M12 4a8 8 0 0 1 0 16z" fill="currentColor" stroke="none"/></svg>-      <span id="viewLabel">Switch to public view</span></button>+      <span id="viewLabel">Switch to public view</span><span class="kbd">Alt Shift V</span></button>     <button class="row" data-act="dashboard">       <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><rect x="4" y="4" width="7" height="7" rx="1.5"/><rect x="13" y="4" width="7" height="7" rx="1.5"/><rect x="4" y="13" width="7" height="7" rx="1.5"/><rect x="13" y="13" width="7" height="7" rx="1.5"/></svg>       Open pup dashboard</button>
src/extension/worker.js+8−3
@@ -72,16 +72,21 @@ chrome.tabs.onUpdated.addListener((tabId, info, tab) => { });  chrome.commands.onCommand.addListener(async (command) => {-  if (command !== 'pup-snip') return;+  if (command !== 'pup-snip' && command !== 'pup-view') return;   const found = await findPort();   if (!found) return;   const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });   if (!tab || !tab.url) return;   // v2.0.60: resolve server-side by ANY tab URL (the 2.0.58 popup fix; the hotkey had the same   // main-page-only matching bug — the reason snip "never worked" from the keyboard)+  // v0.2.7: Alt+Shift+V toggles the wiki view — pup resolves the current view server-side+  // (view:"toggle"), so the hotkey needs no state.+  const payload = command === 'pup-view'+    ? { command: 'pup_wiki_set_view', args: { _tabUrl: tab.url, view: 'toggle', caller: { aiThread: 'user-toolbar' } } }+    : { command: 'pup_annotate', args: { _tabUrl: tab.url, tool: 'pen', caller: { aiThread: 'user-toolbar' } } };   await fetch(`http://127.0.0.1:${found.port}/command`, {     method: 'POST',-    headers: { 'content-type': 'application/json', 'x-adom-caller-thread': 'user-toolbar', 'x-adom-caller-reason': 'Ctrl+Shift+A annotate hotkey' },-    body: JSON.stringify({ command: 'pup_annotate', args: { _tabUrl: tab.url, tool: 'pen', caller: { aiThread: 'user-toolbar' } } }),+    headers: { 'content-type': 'application/json', 'x-adom-caller-thread': 'user-toolbar', 'x-adom-caller-reason': command === 'pup-view' ? 'Alt+Shift+V view-toggle hotkey' : 'Alt+Shift+A annotate hotkey' },+    body: JSON.stringify(payload),   }).catch(() => {}); });
src/server.js+7−2
@@ -11866,7 +11866,7 @@ const server = http.createServer(async (req, res) => {             V('pup_close_tab', 'Close a tab.', { sessionId: 'required str', tabId: 'optional str (default active)' }, 15, { sessionId: 'work' }),             V('pup_close_window', 'Close a window/session (its tabs go too).', { sessionId: 'required str' }, 20, { sessionId: 'work' }),             V('pup_window_info', 'Everything about ONE pup window as JSON — owner AI thread, container, profile, tabs, age, last agent action, and the window\'s hwnd (for desktop_screenshot_window when you need the browser chrome in frame). For an AI caller this is a PURE DATA query: nothing is drawn on the user\'s screen. Visual surfaces are user-initiated only — a jump-list click shows the native taskbar caption, a toolbar-popup click shows the in-page floaty card. showCaption:true opts an AI caller into the caption ONLY when the user asked to have the window identified on screen. Read-only, never owner-gated.', { sessionId: 'optional str', showCaption: 'optional bool — draw the ~12s taskbar caption too; ONLY when the user asked to see which window this is' }, 15, {}),-            V('pup_wiki_set_view', 'Flip a WIKI pup window between the logged-in and public view IN PLACE: every wiki tab reloads with the server-side ?view=public param appended (public) or stripped (authed) — adom/wiki#126 renders the request exactly as a signed-out visitor while the session stays untouched, so there is no relaunch, no cookie wipe, no profile switch (the legacy jar relaunch survives only as a fallback for servers that ignore the param). This is the callback for the per-window taskbar jump-list task (WINDOWS ONLY) — a USER-initiated action. AI threads should NOT call this; pass wikiView:"authed"|"public" on pup_open_window instead.', { sessionId: 'required str', view: 'required "authed"|"public"' }, 45, { sessionId: 'wiki-bmv080', view: 'authed' }),+            V('pup_wiki_set_view', 'Flip a WIKI pup window between the logged-in and public view IN PLACE: every wiki tab reloads with the server-side ?view=public param appended (public) or stripped (authed) — adom/wiki#126 renders the request exactly as a signed-out visitor while the session stays untouched, so there is no relaunch, no cookie wipe, no profile switch (the legacy jar relaunch survives only as a fallback for servers that ignore the param). This is the callback for the per-window taskbar jump-list task (WINDOWS ONLY) — a USER-initiated action. AI threads should NOT call this; pass wikiView:"authed"|"public" on pup_open_window instead.', { sessionId: 'required str', view: 'required "authed"|"public"|"toggle" — toggle flips whatever the window currently shows (the Alt+Shift+V hotkey form)' }, 45, { sessionId: 'wiki-bmv080', view: 'authed' }),             V('pup_navigate', 'Navigate the active tab to a URL.', { sessionId: 'required str', url: 'required str' }, 45, { sessionId: 'work', url: 'https://example.com' }),             V('pup_back', 'History back.', { sessionId: 'required str' }, 20, { sessionId: 'work' }),             V('pup_forward', 'History forward.', { sessionId: 'required str' }, 20, { sessionId: 'work' }),@@ -13192,12 +13192,17 @@ const server = http.createServer(async (req, res) => {         // is brought on-screen. Not meant for AI threads (they pass wikiView on pup_open_window).         case 'pup_wiki_set_view': {           const sessionId = args.sessionId;-          const view = args.view === 'authed' ? 'authed' : 'public';           if (!sessionId || !sessions.has(sessionId)) { sendJSON(res, { success: false, error: `Session "${sessionId}" not found` }); return; }           const session = sessions.get(sessionId);           let url = null; try { url = session.page.url() || null; } catch (e) {}           if (!url || !isAdomUrl(url)) { sendJSON(res, { success: false, error: 'wiki view toggle applies only to Adom (adom.inc) URLs', output: JSON.stringify({ ok: false, url }) }); return; }           const curView = session._wikiView === 'authed' ? 'authed' : 'public';+          // v2.0.139 (John: "add a shortcut key like annotate has"): view:"toggle" flips whatever+          // the window currently shows — the Alt+Shift+V hotkey's form, since the extension can't+          // know the current view. Explicit "authed"/"public" behave as before.+          const view = args.view === 'toggle'+            ? (curView === 'authed' ? 'public' : 'authed')+            : (args.view === 'authed' ? 'authed' : 'public');           const owner = session.owner || null;           const publicProfile = session._publicProfile || sessionId;           if (curView === view) {