[object Object]

← back to Wallco Ai

curator A7: extreme-adjustment bake guard — require a confirming second click for wild sat/bri/con before POST

45280b3493ba8bbd8fc587c3266f4f8f994da8ed · 2026-05-31 22:44:27 -0700 · Steve Abrams

Files touched

Diff

commit 45280b3493ba8bbd8fc587c3266f4f8f994da8ed
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun May 31 22:44:27 2026 -0700

    curator A7: extreme-adjustment bake guard — require a confirming second click for wild sat/bri/con before POST
---
 YOLO_BACKLOG_2026-05-31.md       |  3 ++-
 public/admin/cactus-curator.html | 13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/YOLO_BACKLOG_2026-05-31.md b/YOLO_BACKLOG_2026-05-31.md
index a6f14cb..7f2808b 100644
--- a/YOLO_BACKLOG_2026-05-31.md
+++ b/YOLO_BACKLOG_2026-05-31.md
@@ -21,7 +21,7 @@ Self-contained in `public/admin/cactus-curator.html` — zero `server.js` risk,
 - [x] **A4 · Apply filter to family-stack images** — `--img-adjust` now covers #bbstack img — — the `--img-adjust` filter currently hits `#grid img` + `#modal img`; extend to `#bbstack img` so the by-base colorway stack previews the adjustment too.
 - [x] **A5 · Per-card Bake from grid** — browser-verified (card #53856 bake btn; decide btns still data-a-only; neutral guard fires no-POST) — — a hover "⤓ Bake" affordance on each card that bakes the current adjustment for that design without opening the modal (reuses `bakeAdjustment`).
 - [x] **A6 · Copy-filter-CSS dev aid** — browser-verified (copies `filter: …;`, ✓ copied feedback) — — a tiny "copy CSS" button that copies the current `filter:` string to clipboard (useful for porting the look elsewhere).
-- [ ] **A7 · Bake confirmation guard** — when baking, if the adjustment is extreme (e.g. saturate >2× or brightness <0.5×), show a one-line "looks extreme — bake anyway?" inline confirm before POSTing, to avoid accidental wild bakes.
+- [x] **A7 · Bake confirmation guard** — browser-verified (sat 2.01× → first click arms, no POST; 4s disarm) — — when baking, if the adjustment is extreme (e.g. saturate >2× or brightness <0.5×), show a one-line "looks extreme — bake anyway?" inline confirm before POSTing, to avoid accidental wild bakes.
 - [ ] **A8 · Reset-all + keyboard** — `0` key (when panel open) resets to neutral; `[`/`]` nudge the focused slider; document in the panel's note line.
 
 ## Parked-for-Steve (created by the loop as items arise)
@@ -41,3 +41,4 @@ TICK · TIMESTAMP · ITEM · STATUS · COMMIT
 - T4 · 2026-05-31 21:15 · A4 family-stack filter · done · (commit below)
 - T5 · 2026-05-31 21:37 · A5 per-card bake · done · (commit below)
 - T6 · 2026-05-31 22:10 · A6 copy-filter-CSS · done · (commit below)
+- T7 · 2026-05-31 22:42 · A7 extreme-bake guard · done · (commit below)
diff --git a/public/admin/cactus-curator.html b/public/admin/cactus-curator.html
index 9b43aa5..b286bd1 100644
--- a/public/admin/cactus-curator.html
+++ b/public/admin/cactus-curator.html
@@ -1087,6 +1087,19 @@ async function bakeAdjustment(id, btn){
     else { const o=btn.textContent; btn.textContent='set 🎨 Adjust first'; setTimeout(()=>{btn.textContent=o;},1600); }
     return;
   }
+  // A7 — extreme-adjustment guard: require a second click to confirm a wild bake.
+  // (low saturation / B&W is intentional, so only HIGH sat + extreme bri/con flag.)
+  const av = window.ccAdjust.values();
+  const extreme = (av.sat/127 > 1.9) || (av.bri/127 < 0.5) || (av.bri/127 > 1.7) || (av.con/100 > 1.6) || (av.con/100 < 0.45);
+  if (extreme && !btn._bakeArmed){
+    btn._bakeArmed = true;
+    const o = btn.textContent;
+    btn.textContent = '⚠ extreme — click again';
+    if (msg){ msg.style.color='#ffd98a'; msg.textContent='That adjustment is strong — click Bake again within 4s to confirm.'; }
+    btn._disarm = setTimeout(function(){ btn._bakeArmed=false; btn.textContent=o; if(msg && /strong/.test(msg.textContent||'')) msg.textContent=''; }, 4000);
+    return;
+  }
+  btn._bakeArmed = false; if (btn._disarm) clearTimeout(btn._disarm);
   const orig = btn.textContent; btn.disabled = true; btn.textContent = 'Baking…';
   if (msg){ msg.style.color='var(--mut)'; msg.textContent=''; }
   try{

← ab93f20 curator A6: 'Copy CSS' button — copies current filter string  ·  back to Wallco Ai  ·  curator A8: panel-scoped keyboard shortcuts (0=reset, [ ]=nu 2dffa4a →