← Commit history

2.12.3: Library-first send bar with caret menu

John Lauer ·b7dbab2f27 ·1mo ago ·parent 6c4938f
6 files changed +38−22
Cargo.lock+1−1
@@ -10,7 +10,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"  [[package]] name = "adom-lbr"-version = "2.12.2"+version = "2.12.3" dependencies = [  "altium-codec",  "anyhow",
Cargo.toml+1−1
@@ -1,6 +1,6 @@ [package] name = "adom-lbr"-version = "2.12.2"+version = "2.12.3" edition = "2021" description = "adom-lbr generator / EDA translator: the canonical adom-lbr JSON is the hub, with native converters to Altium (.SchLib/.PcbLib/.IntLib), EAGLE/Fusion (.lbr), and KiCad. Altium output is written natively — no Altium needed at conversion time." 
VERSION+1−1
@@ -1 +1 @@-2.12.2+2.12.3
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "adom-lbr",-  "version": "2.12.2",+  "version": "2.12.3",   "type": "app",   "description": "adom-lbr \u2014 the EDA library translator. Bring a component in from any supported EDA tool and convert it to any other (KiCad \u21c4 Altium \u21c4 EAGLE/Fusion) through one canonical adom-lbr JSON \u2014 symbol + footprint + 3D + pin\u2194pad map. Altium is written natively (no Altium needed). Includes the adom-lbr Manager: browse wiki components and view symbol/footprint/3D + the per-EDA layer stackup.",   "dependencies": {},
page.json+9−12
@@ -1,8 +1,8 @@ {   "slug": "adom-lbr",-  "version": "2.12.2",+  "version": "2.12.3",   "type": "app",-  "description": "adom-lbr — the EDA library translator. Bring a component in from any supported EDA tool and convert it to any other (KiCad ⇄ Altium ⇄ EAGLE/Fusion) through one canonical adom-lbr JSON — symbol + footprint + 3D + pin↔pad map. Altium is written natively (no Altium needed). Includes the adom-lbr Manager: browse wiki components and view symbol/footprint/3D + the per-EDA layer stackup.",+  "description": "adom-lbr \u2014 the EDA library translator. Bring a component in from any supported EDA tool and convert it to any other (KiCad \u21c4 Altium \u21c4 EAGLE/Fusion) through one canonical adom-lbr JSON \u2014 symbol + footprint + 3D + pin\u2194pad map. Altium is written natively (no Altium needed). Includes the adom-lbr Manager: browse wiki components and view symbol/footprint/3D + the per-EDA layer stackup.",   "dependencies": {},   "tags": [     "eda",@@ -52,24 +52,21 @@   ],   "files": [     "bin/**",-    "assets/**",     "SKILL.md",-    "skills/**",     "README.md",     "install.sh",     "uninstall.sh",-    "screenshots/**",-    "dockbar.json"+    "screenshots/**"   ],-  "discovery_pitch": "Convert electronic-component symbols + footprints between any two EDA tools — KiCad, Altium (written natively, no Altium needed), and EAGLE/Fusion — through one canonical adom-lbr JSON, silk/courtyard/fab layers preserved. Plus a Manager to browse and inspect any wiki part.",+  "discovery_pitch": "Convert electronic-component symbols + footprints between any two EDA tools \u2014 KiCad, Altium (written natively, no Altium needed), and EAGLE/Fusion \u2014 through one canonical adom-lbr JSON, silk/courtyard/fab layers preserved. Plus a Manager to browse and inspect any wiki part.",   "sample_prompts": [     {       "prompt": "Convert this KiCad symbol and footprint to an Altium SchLib and PcbLib",-      "label": "KiCad → Altium"+      "label": "KiCad \u2192 Altium"     },     {       "prompt": "Import this Altium footprint into the adom-lbr JSON",-      "label": "Altium → JSON"+      "label": "Altium \u2192 JSON"     },     {       "prompt": "Bundle this part into a single Altium IntLib",@@ -77,15 +74,15 @@     },     {       "prompt": "Convert this Altium SchLib and PcbLib to a KiCad symbol and footprint",-      "label": "Altium → KiCad"+      "label": "Altium \u2192 KiCad"     },     {       "prompt": "Export this adom-lbr JSON to a KiCad .kicad_sym and .kicad_mod",-      "label": "JSON → KiCad"+      "label": "JSON \u2192 KiCad"     },     {       "prompt": "Open the adom-lbr Manager to browse wiki components and view the layer stackup",       "label": "Browse parts"     }   ]-}\ No newline at end of file+}
src/manage.html+25−6
@@ -101,6 +101,14 @@   #sendbar .abdot{display:inline-flex;align-items:center;gap:6px;margin-left:auto;color:var(--mut)}   #sendbar .abdot i{width:8px;height:8px;border-radius:50%;background:#555;display:inline-block}   #sendbar .abdot.on i{background:var(--green);box-shadow:0 0 6px var(--green)}+  .splitgrp{position:relative;gap:0}+  .splitgrp>button:first-child{border-radius:7px 0 0 7px;border-right:none}+  .splitgrp .caret{border-radius:0 7px 7px 0;padding:5px 6px;display:inline-flex;align-items:center}+  .dropmenu{position:absolute;top:calc(100% + 6px);left:0;z-index:1200;min-width:180px;background:var(--elevated);border:1px solid var(--border);border-radius:9px;box-shadow:0 12px 32px #000a;padding:5px;display:flex;flex-direction:column;gap:2px}+  .dropmenu[hidden]{display:none}+  .dropmenu button{text-align:left;background:none;border:none;border-radius:6px;padding:7px 10px;color:var(--ink);font-size:12.5px;cursor:pointer}+  .dropmenu button:hover:not(:disabled){background:#12302f;color:var(--acc)}+  .dropmenu button:disabled{opacity:.45;cursor:not-allowed}   /* sidebar mode tabs: Projects (boards) | Parts (the whole wiki library) */   #modes{display:flex;gap:6px;padding:10px 12px 0}   #modes button{flex:1;background:#0d0f14;border:1px solid var(--edge);color:var(--mut);border-radius:8px;padding:6px 8px;font:600 12px var(--brand-heading);cursor:pointer}@@ -266,11 +274,14 @@   </header>   <nav id="sendbar" aria-label="Send the open part to your EDA tools">     <span class="lab">Send to KiCad</span>-    <div class="grp">-      <button data-send="kicad-symbol" title="Install this part's symbol on your PC and open it in KiCad's Symbol Editor">Symbol</button>-      <button data-send="kicad-footprint" title="Install the footprint (with its 3D model wired) and open the Footprint Editor">Footprint</button>-      <button data-send="kicad-3d" title="Open the part's STEP model on its footprint in KiCad's 3D viewer">3D chip</button>-      <button data-send="kicad-library" title="Install symbol + footprint + 3D and open all three: the working-library proof">Library</button>+    <div class="grp splitgrp">+      <button data-send="kicad-library" title="Install symbol + footprint + 3D and open all three: the working library. A library IS all three, so this is the one you usually want">Library</button>+      <button class="caret" id="caret-kicad" aria-haspopup="menu" aria-expanded="false" title="Less often: send just one piece"><svg viewBox="0 0 24 24" width="12" height="12" aria-hidden="true"><path fill="currentColor" d="M7 10l5 5 5-5z"/></svg></button>+      <div class="dropmenu" id="menu-kicad" role="menu" hidden>+        <button role="menuitem" data-send="kicad-symbol" title="Install this part's symbol and open it in KiCad's Symbol Editor">Just the symbol</button>+        <button role="menuitem" data-send="kicad-footprint" title="Install the footprint (with its 3D model wired) and open the Footprint Editor">Just the footprint</button>+        <button role="menuitem" data-send="kicad-3d" title="Open the part's STEP model on its footprint in KiCad's 3D viewer">Just the 3D chip</button>+      </div>     </div>     <span class="sep"></span>     <span class="lab">Send to Fusion</span>@@ -1068,8 +1079,16 @@ async function sendFusion(){   sp.step('still working — check the Fusion window');   toast('Fusion is still working; check the Fusion window',true); }-document.querySelectorAll('#sendbar button').forEach(b=>{+// caret menu: the common action is Library; single-piece sends live behind it+(function(){+  const caret=document.getElementById('caret-kicad'),menu=document.getElementById('menu-kicad');+  caret.onclick=e=>{e.stopPropagation();const open=menu.hidden;menu.hidden=!open;caret.setAttribute('aria-expanded',open?'true':'false');};+  document.addEventListener('click',e=>{if(!menu.hidden&&!menu.contains(e.target)&&e.target!==caret){menu.hidden=true;caret.setAttribute('aria-expanded','false');}});+  document.addEventListener('keydown',e=>{if(e.key==='Escape'&&!menu.hidden){menu.hidden=true;caret.setAttribute('aria-expanded','false');}});+})();+document.querySelectorAll('#sendbar button[data-send]').forEach(b=>{   b.onclick=async()=>{+    const menu=document.getElementById('menu-kicad');if(!menu.hidden){menu.hidden=true;document.getElementById('caret-kicad').setAttribute('aria-expanded','false');}     if(!currentPart){toast('Open a part first (Parts tab, or a board’s component)',true);return;}     b.dataset.busy='1';updateSendbar();     try{ b.dataset.send==='fusion-library'?await sendFusion():await sendKicad(b.dataset.send); }