[object Object]

← back to Desktop Dotbar

debounce dropdown auto-close (2 ticks); login autostart via LaunchAgent

ead5ad7ada49fb138237cb5182e2555597255f61 · 2026-09-15 18:27:31 -0700 · Steve

Files touched

Diff

commit ead5ad7ada49fb138237cb5182e2555597255f61
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Sep 15 18:27:31 2026 -0700

    debounce dropdown auto-close (2 ticks); login autostart via LaunchAgent
---
 public/index.html | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/public/index.html b/public/index.html
index b4a9d4e..2b011fb 100644
--- a/public/index.html
+++ b/public/index.html
@@ -49,7 +49,7 @@
   <div id="panel"></div>
 <script>
 const BAR_H = 48, PANEL_H = 360;
-let openColor = null, data = null;
+let openColor = null, data = null, _miss = 0;
 
 async function fetchDots(){ try { const r = await fetch('/api/dots'); return await r.json(); } catch { return null; } }
 
@@ -113,7 +113,10 @@ async function tick(){
   if (!d) return;
   data = d;
   // if the open color went to zero, close it
-  if (openColor && !data.groups.some(g=>g.color===openColor && g.count>0)) { openColor=null; resize(false); }
+  // close an open dropdown only after its color is empty for 2 ticks (debounce live churn)
+  if (openColor && !data.groups.some(g=>g.color===openColor && g.count>0)) {
+    if (++_miss >= 2) { openColor=null; resize(false); _miss=0; }
+  } else { _miss = 0; }
   renderBar(); renderPanel();
 }
 

← ca97694 Gate dbg() debug.log writes behind DOTBAR_DEBUG=1 to prevent  ·  back to Desktop Dotbar  ·  TK-11794: pulse the 4 needs-Steve dots on the bar; green/pin aa5dd2c →