← Commit history

adom-verified: verification log collapsed by default (click to expand)

John Lauer ·ff30363653 ·15d ago ·parent 7acd92d
3 files changed +8−5
package.json+1−1
@@ -2,7 +2,7 @@   "slug": "component-widgets",   "title": "Component Widgets",   "type": "app",-  "version": "1.1.14",+  "version": "1.1.15",   "description": "Reusable component-page widgets for pinouts, thermal vias, molecule relationships, reviewed chip outlines and image-first LOD caches with an optional zoom-driven 3D preview.",   "license": "MIT",   "dependencies": {},
page.json+1−1
@@ -4,7 +4,7 @@   "type": "app",   "title": "Component Widgets",   "brief": "Reusable component widgets for pinouts, thermal vias, molecule relationships, reviewed chip outlines and lightweight four-level LOD cache listings.",-  "version": "1.1.14",+  "version": "1.1.15",   "visibility": {     "public": true   },
widgets/verified-widget.js+6−3
@@ -135,7 +135,7 @@           return `<span class="file ${ok ? 'ok' : f.state === 'checking' || un ? '' : 'bad'}" title="${un ? 'could not be fetched to check; ' : ''}sha256 ${esc(h)}">${ok ? '✓' : f.state === 'checking' ? '…' : un ? '?' : '!'} ${esc(p)}</span>`;         }).join('');         const vars = (e.variants || ['*']).map(v => v === '*' ? 'all variants' : v).join(', ');-        return `<details class="entry ${esc(e.status)}"${e === entries[0] ? ' open' : ''}><summary>+        return `<details class="entry ${esc(e.status)}"><summary>             <span class="date">${fmtDate(e.date)}</span><span class="who">${esc(e.by && e.by.name)}</span>             <span class="title">${esc(e.title)}</span>${badge}</summary>           <div class="body"><div class="meta">${(e.scope || []).map(s => `<span class="chip">${esc(SCOPE[s] || s)}</span>`).join('')}<span class="for">for ${esc(vars)}</span></div>@@ -148,7 +148,10 @@           <div class="h">${headline}${d.part ? ` <span class="part">${esc(d.part)}</span>` : ''}</div>           <div class="sub">${sub}</div><div class="scopes">${scopeChips}${open.length ? `<span class="chip warn">${open.length} open item${open.length === 1 ? '' : 's'}</span>` : ''}</div></div></div>         ${varRows}-        <div class="logh">Verification log</div><div class="log">${log || '<div class="empty">no entries</div>'}</div>`);+        <details class="logwrap"${this._logOpen ? ' open' : ''}><summary class="logh">Verification log <span class="logn">${entries.length} record${entries.length === 1 ? '' : 's'}${open.length ? ` · ${open.length} open` : ''}</span></summary>+        <div class="log">${log || '<div class="empty">no entries</div>'}</div></details>`);+      const lw = this.shadowRoot.querySelector('details.logwrap');   // collapsed by default; keep the reader's choice across re-renders+      if (lw) lw.addEventListener('toggle', () => { this._logOpen = lw.open; });     }      _paint(inner) { this.shadowRoot.innerHTML = `<style>${this._css()}</style><div class="card">${inner}</div>`; }@@ -178,7 +181,7 @@       .vn{color:var(--dim);font-size:12px;margin:2px 0 6px}       .vs{display:flex;flex-wrap:wrap;gap:4px}       .mini{font-size:11px;padding:1px 6px;border-radius:6px}.mini.ok{background:var(--okbg);color:var(--ok)}.mini.none{background:var(--warnbg);color:var(--warn)}-      .logh{font:700 16px/1.2 var(--display);margin:16px 0 6px}+      .logh{font:700 16px/1.2 var(--display);margin:16px 0 6px;cursor:pointer}.logn{font:500 13px var(--prose);color:var(--dim);margin-left:6px}details.logwrap>summary{list-style:revert}       .entry{border:1px solid var(--line);border-radius:10px;background:var(--panel);margin:6px 0}       .entry.open{border-color:color-mix(in srgb,var(--warn) 55%,transparent)}       summary{cursor:pointer;list-style:none;display:flex;gap:10px;align-items:center;padding:9px 12px;flex-wrap:wrap}