← Commit history

1.3.8: always-fresh dock launch (no skip_if pin; install-or-update every click) + Try it returns as copy-to-clipboard with a confirming toast (zero /ai-threads calls; staging stays dormant)

John Lauer ·6bdf652c11 ·1mo ago ·parent c92375a
3 files changed +25−9
Cargo.lock+1−1
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-chip-fetcher"-version = "1.3.7"+version = "1.3.8" dependencies = [  "anyhow",  "clap",
Cargo.toml+1−1
@@ -1,6 +1,6 @@ [package] name = "adom-chip-fetcher"-version = "1.3.7"+version = "1.3.8" edition = "2021" description = "Crawls the web on your behalf to gather everything about the chips you care about (datasheet, symbol, footprint, 3D, stock) into one library, by driving Chrome via pup." 
src/ui/index.html+23−7
@@ -703,7 +703,18 @@ const $id = id => document.getElementById(id); function escapeHtml(s) { return String(s == null ? '' : s).replace(/[&<>"']/g, m => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'})[m]); } // Relative paths so the page works behind /proxy/<port>/ and inside a webview. const API_BASE = location.pathname.replace(/index\.html$/, '').replace(/\/$/, '');-const TRY_IT_PARKED = true; // ship-night posture: Say it is copy-only until the ah typing-path fix is certified+const TRY_IT_PARKED = true; // ship-night posture: no /ai-threads calls; Try it copies instead (John's ruling, 2026-08-23)+async function copyText(t) {+  try { await navigator.clipboard.writeText(t); return true; }+  catch (e) {+    try {+      const ta = document.createElement('textarea');+      ta.value = t; ta.style.position = 'fixed'; ta.style.opacity = '0';+      document.body.appendChild(ta); ta.select();+      const ok = document.execCommand('copy'); ta.remove(); return ok;+    } catch (e2) { return false; }+  }+} const DASH = '\u2014'; // the data sentinel inventory.rs emits for "unknown"; never shown to a person const isPhone = () => matchMedia('(hover: none)').matches || window.innerWidth < 720; @@ -1041,13 +1052,18 @@ async function buildSay() {     b.setAttribute('data-tooltip', 'Copy this phrase to your clipboard, then paste it to your AI.');     b.innerHTML = '&ldquo;' + escapeHtml(p).replace(/chip ?fetcher|\bcf\b/gi, m => '<em>' + m + '</em>') + '&rdquo;';     b.onclick = async () => { try { await navigator.clipboard.writeText(p); cfToast('Copied: ' + p, { type: 'ok' }); } catch (e) { cfToast('Could not copy: ' + e.message, { type: 'err' }); } };-    // TRY_IT_PARKED (ship night 2026-08-23, dock-bar thread): the Try it path-    // POSTs /ai-threads/run-prompt, and tonight ah parks its AI Threads backend-    // until intent AND the typing path has an unverified crash fix, so one-    // click could crash the app the user is standing in. Copy-only until the-    // all-clear; flip the flag to bring Try it back.-    if (TRY_IT_PARKED) { item.appendChild(b); list.appendChild(item); continue; }     const t = document.createElement('button'); t.className = 'say-try'; t.type = 'button'; t.textContent = 'Try it';+    if (TRY_IT_PARKED) {+      // John's ruling (2026-08-23): no live AI-thread staging for now, but the+      // button stays, copies the prompt, and SAYS SO in a toast. The staging+      // branch below stays dormant for the all-clear.+      t.setAttribute('data-tooltip', 'Copies this phrase to your clipboard; paste it into any AI thread.');+      t.onclick = async () => {+        if (await copyText(p)) cfToast('Copied to clipboard. Paste it into any AI thread.', { type: 'ok' });+        else cfToast('Could not reach the clipboard. Select the phrase and copy it by hand.', { type: 'err' });+      };+      item.appendChild(b); item.appendChild(t); list.appendChild(item); continue;+    }     t.setAttribute('data-tooltip', "Stage this phrase in this app's AI thread. It is not sent; you press Enter there.");     t.onclick = async () => {       t.disabled = true;