[object Object]

← back to Wallco Ai

drunk-curator: make Auto-ID opt-in via header toggle (off by default — no Gemini cost on fast vote-throughs); toggle ON scans current item, OFF clears boxes, persisted in localStorage

8120fe75c412bdd29c917380d941e60579c6d6e7 · 2026-05-27 14:34:19 -0700 · Steve Abrams

Files touched

Diff

commit 8120fe75c412bdd29c917380d941e60579c6d6e7
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed May 27 14:34:19 2026 -0700

    drunk-curator: make Auto-ID opt-in via header toggle (off by default — no Gemini cost on fast vote-throughs); toggle ON scans current item, OFF clears boxes, persisted in localStorage
---
 public/admin/drunk-curator.html | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/public/admin/drunk-curator.html b/public/admin/drunk-curator.html
index ae86517..2d876f9 100644
--- a/public/admin/drunk-curator.html
+++ b/public/admin/drunk-curator.html
@@ -53,6 +53,9 @@
   <select id="coll" title="pick a line" style="background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:7px;padding:4px 9px;font-size:13px;max-width:300px;">
     <option value="">drunk samples (default)</option>
   </select>
+  <label style="display:flex;align-items:center;gap:6px;font-size:12px;color:var(--mut);cursor:pointer;user-select:none;">
+    <input type="checkbox" id="autotoggle"> 🔍 Auto-ID <span style="color:#6a737d">(Gemini ~$.003/item)</span>
+  </label>
   <div class="stats">
     <span>seen <b id="seen">0</b></span><span>🔥 hot <b id="hot">0</b></span>
     <span>👎 not <b id="not">0</b></span><span class="streak" id="streak"></span>
@@ -79,6 +82,7 @@ const ADMIN=new URLSearchParams(location.search).get('admin');
 const CATEGORY=new URLSearchParams(location.search).get('category')||'';
 const q=s=>ADMIN?(s+(s.includes('?')?'&':'?')+'admin='+encodeURIComponent(ADMIN)):s;
 let QUEUE=[], i=0, hot=0, not=0, streak=0;
+let autoIdOn = localStorage.getItem('drunk_autoid')==='1';   // Auto-ID is OPT-IN (off by default — saves Gemini cost)
 function fmtDate(iso){ if(!iso)return''; try{return new Date(iso).toLocaleString(undefined,{month:'short',day:'numeric',hour:'numeric',minute:'2-digit'});}catch{return iso;} }
 function flash(e){ const f=$('#flash'); f.textContent=e; f.classList.add('show'); setTimeout(()=>f.classList.remove('show'),250); }
 function render(){
@@ -102,7 +106,7 @@ function render(){
     <div class="prompt" onclick="this.classList.toggle('open')">${(d.prompt||'').replace(/</g,'&lt;').slice(0,240)}</div>
     <div class="btns"><button class="hot" onclick="decide('hot')">🔥 HOT</button><button class="fix" onclick="decide('fix')">🔧 Fix</button><button class="not" onclick="decide('not')">🗑 Trash</button><button class="extract" onclick="extract()">✂️ Extract</button></div>
     <div class="hint">🔥/→ hot · 🔧/F fix · 🗑/← trash · ✂️/E extract opaque motif → elements · dotted = auto-detected errors</div>`;
-  autoIdCurrent();   // fetch + overlay the auto-detected error boxes for this item
+  if(autoIdOn) autoIdCurrent();   // opt-in: only scan when the Auto-ID toggle is on
 }
 
 // Auto-detect error regions for the current item and overlay dotted boxes on the
@@ -175,6 +179,13 @@ async function loadCollections(){
   }catch{}
 }
 if(CATEGORY) $('#lineName').textContent=CATEGORY;
+// Auto-ID toggle (opt-in): scan the current item when turned on, clear boxes when off.
+const _autoTog=$('#autotoggle'); _autoTog.checked=autoIdOn;
+_autoTog.addEventListener('change',()=>{
+  autoIdOn=_autoTog.checked; localStorage.setItem('drunk_autoid', autoIdOn?'1':'0');
+  if(autoIdOn){ autoIdCurrent(); }
+  else { const b=$('#eboxes'); if(b) b.innerHTML=''; document.getElementById('scanning')?.remove(); }
+});
 loadCollections();
 (async function(){ const r=await fetch(q('/api/admin/drunk/list'+(CATEGORY?'?category='+encodeURIComponent(CATEGORY):''))); QUEUE=(await r.json()).items||[]; render(); })();
 </script>

← a1070fe drunk-curator Hot-or-Not: auto-ID dotted error boxes overlai  ·  back to Wallco Ai  ·  Task 31: circular-padding is now the DEFAULT for all seamles 899e7fd →