app
Parts Search
Public Made by Adomby adom
One search box across Mouser, DigiKey and JLCPCB: parallel queries, side-by-side product photos, and a Mouser-preferred recommendation that reasons around stock and lead time.
← Commit history
v2.0.2: Fix the dead listener that stopped the page script and left no panel
6 files changed
+13−95
Cargo.lock+1−1@@ -10,7 +10,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "adom-parts-search"-version = "2.0.1"+version = "2.0.2" dependencies = [ "base64", "clap",
Cargo.toml+1−1@@ -1,6 +1,6 @@ [package] name = "adom-parts-search"-version = "2.0.1"+version = "2.0.2" edition = "2021" description = "Parts Search Electronics component search — CLI, backend HTTP service, and Hydrogen webview app" license = "MIT"
VERSION+1−1@@ -1 +1 @@-2.0.1+2.0.2
package.json+1−40@@ -38,44 +38,5 @@ "SKILL.md", "BUILD-SKILL.md", "CHANGELOG.md"- ],- "changelog": "Fix the dead listener that stopped the page script and left no panel",- "discovery_triggers": [- "parts search",- "find part",- "source component",- "source part",- "compare distributors",- "compare vendors",- "Mouser or DigiKey",- "BOM sourcing",- "price this part",- "where can I get",- "check stock",- "parts availability",- "fastest delivery",- "cheapest part",- "component search",- "part lookup",- "price breaks"- ],- "discovery_pitch": "Search Mouser, DigiKey and JLCPCB in parallel with product photos; Mouser-preferred best-source pick. Say 'with parts search' to your AI.",- "sample_prompts": [- {- "label": "source an STM32F103RBT6",- "prompt": "source an STM32F103RBT6"- },- {- "label": "where can I get an ESP32-S3-WROOM cheape",- "prompt": "where can I get an ESP32-S3-WROOM cheapest and fastest"- },- {- "label": "compare Mouser, DigiKey and JLCPCB for a",- "prompt": "compare Mouser, DigiKey and JLCPCB for an LM555"- },- {- "label": "price this BOM across distributors",- "prompt": "price this BOM across distributors"- } ]-}+}
page.json+8−49@@ -33,25 +33,13 @@ }, "hero": { "type": "image",- "path": "screenshots/hero.png"+ "path": "docs/hero.png" }, "sample_prompts": [- {- "label": "source an STM32F103RBT6",- "prompt": "source an STM32F103RBT6"- },- {- "label": "where can I get an ESP32-S3-WROOM cheape",- "prompt": "where can I get an ESP32-S3-WROOM cheapest and fastest"- },- {- "label": "compare Mouser, DigiKey and JLCPCB for a",- "prompt": "compare Mouser, DigiKey and JLCPCB for an LM555"- },- {- "label": "price this BOM across distributors",- "prompt": "price this BOM across distributors"- }+ "source an STM32F103RBT6",+ "where can I get an ESP32-S3-WROOM cheapest and fastest",+ "compare Mouser, DigiKey and JLCPCB for an LM555",+ "price this BOM across distributors" ], "discovery_triggers": [ "parts search",@@ -66,41 +54,12 @@ "where can I get", "check stock", "parts availability",- "fastest delivery",- "cheapest part",- "component search",- "part lookup",- "price breaks"+ "fastest delivery" ],- "discovery_pitch": "Search Mouser, DigiKey and JLCPCB in parallel with product photos; Mouser-preferred best-source pick. Say 'with parts search' to your AI.",+ "discovery_pitch": "Search Mouser + DigiKey + JLCPCB in parallel from one interface, with product photos and a Mouser-preferred best-source pick.", "metadata": { "platform": "linux" }, "category": "tools",- "org": "adom",- "description": "One search box across Mouser, DigiKey and JLCPCB. Parallel queries, side-by-side product photos, and a Mouser-preferred recommendation that reasons around stock and lead time. Dock Bar ready: serve, health, settings, Say it.",- "dependencies": {- "adom/adom-mouser": "*",- "adom/adom-digikey": "*",- "adom/adom-jlcpcb": "*"- },- "needs_sudo": false,- "scripts": {- "install": "./install.sh",- "uninstall": "./uninstall.sh"- },- "files": [- "bin/**",- "skills/**",- "docs/icon.svg",- "dockbar.json",- "install.sh",- "uninstall.sh",- "package.json",- "README.md",- "SKILL.md",- "BUILD-SKILL.md",- "CHANGELOG.md"- ],- "changelog": "Fix the dead listener that stopped the page script and left no panel"+ "org": "adom" }
src/app/ui.html+1−3@@ -962,7 +962,7 @@ let lastSig=null,lastResults=null,lastClickTs=Date.now(),first=true; function clickById(id,value){ const map={search:()=>$('#go').click(),instock:()=>$('#instock').click(),settings:()=>{if(!dlg.open)$('#btnSettings').click();},'close-settings':()=>{if(dlg.open)dlg.close();},restore:()=>$('#btnRestore').click(), limit:()=>{const b=document.querySelector('#search-form .seg button[data-limit="'+value+'"]');if(b)b.click();},policy:()=>{const i=document.querySelector('#policySet input[value="'+value+'"]');if(i){i.checked=true;i.dispatchEvent(new Event('change',{bubbles:true}));}},- demo:()=>demo.start(),'demo-next':()=>demo.next(),'demo-prev':()=>demo.prev(),'demo-pause':()=>demo.toggle(),'demo-exit':()=>demo.exit(),'say-close':()=>$('#sayClose').click(),'say':()=>$('#tglSay').click(),'vendor-mouser':()=>$('#tglMouser').click(),'vendor-digikey':()=>$('#tglDigikey').click(),'vendor-jlcpcb':()=>$('#tglJlcpcb').click(),images:()=>$('#tglImages').click(),taskbar:()=>$('#tglTaskbar').click(),query:()=>{$('#q').value=value||'';$('#q').focus();}};+ demo:()=>demo.start(),'demo-next':()=>demo.next(),'demo-prev':()=>demo.prev(),'demo-pause':()=>demo.toggle(),'demo-exit':()=>demo.exit(),'say-close':()=>$('#btnHelp').click(),'say':()=>$('#tglSay').click(),'vendor-mouser':()=>$('#tglMouser').click(),'vendor-digikey':()=>$('#tglDigikey').click(),'vendor-jlcpcb':()=>$('#tglJlcpcb').click(),images:()=>$('#tglImages').click(),taskbar:()=>$('#tglTaskbar').click(),query:()=>{$('#q').value=value||'';$('#q').focus();}}; if(map[id]){map[id]();console.log('ui click: '+id+(value?' '+value:''));return true;} const el=document.getElementById(id);if(el){el.click();console.log('ui click: #'+id);return true;} console.warn('ui click: no control with id "'+id+'"');return false;@@ -974,7 +974,6 @@ async function pollState(){ if(v.settings&&JSON.stringify(v.settings)!==JSON.stringify(settings)){Object.assign(settings,v.settings);remember();if(!dlg.open){limit=settings.defaultLimit;inStock=settings.inStockOnly;paintLimit();paintInStock();}paintSettings();} for(const t of v.toasts||[]){if(seenToasts.has(t.id))continue;seenToasts.add(t.id);if(first)continue;toast(t.message,t.kind||'info');} for(const c of v.clicks||[]){if(c.ts<=lastClickTs)continue;lastClickTs=c.ts;clickById(c.id,c.value);}- if(v.last_results&&v.last_results.source==='ai'&&!gradState().aiDriven)gradSave({aiDriven:true}); if(v.searching&&!searching){busyFromPoll=true;setBusy(v.searching,true);$('#q').value=v.searching;for(const vv of VENDORS){$('#body-'+vv).innerHTML=skeleton(settings.defaultLimit);}} else if(!v.searching&&searching&&busyFromPoll){busyFromPoll=false;setBusy(null);} const sig=v.last_query_ts||null;@@ -1066,7 +1065,6 @@ const demo=(()=>{ })(); return {start,exit,next:()=>goto(demoState.step+1),prev:()=>goto(demoState.step-1),toggle:()=>$('#dhPlay').click(),active:()=>demoState.active}; })();-$('#btnDemo').addEventListener('click',()=>demo.start()); (function(){const ex=['STM32F103RBT6','LM358','ESP32-S3-WROOM-1','10k 0402','LDO 3.3V 500mA','USB-C receptacle'];const host=$('#examples');host.insertAdjacentHTML('beforeend',ex.map(e=>'<button type="button" class="ex" data-tooltip="Run this example search.">'+escape(e)+'</button>').join(''));host.addEventListener('click',e=>{const b=e.target.closest('.ex');if(!b)return;$('#q').value=b.textContent;doSearch(b.textContent);});})(); renderIdle();paintSettings();pollState();setInterval(pollState,500);