From 7505fcb55dd1dda8d91062779387ed8a629e79de Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 24 Nov 2026 19:08:38 +0000 Subject: [PATCH] fix(hub): keep only text fields focused across inbox redraws MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit keepTyping() held any focused input with an aria-label, so a checkbox the operator just ticked in the inbox went through setSelectionRange after the redraw. Chromium and Firefox throw InvalidStateError there and the rest of drawInbox() never ran. Only fields with a text selection are held now. 🎯 Fix: 95 % 💥 Break: 2 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 93 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 --- orchestrator/templates/page-dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchestrator/templates/page-dialog.js b/orchestrator/templates/page-dialog.js index 467c0ff..313f53d 100644 --- a/orchestrator/templates/page-dialog.js +++ b/orchestrator/templates/page-dialog.js @@ -11,7 +11,7 @@ */ function keepTyping(root, draw) { const field = document.activeElement; - const held = field && field.tagName === "INPUT" && root.contains(field) && field.getAttribute("aria-label") ? [field.getAttribute("aria-label"), field.selectionStart, field.selectionEnd] : null; + const held = field && field.tagName === "INPUT" && typeof field.selectionStart === "number" && root.contains(field) && field.getAttribute("aria-label") ? [field.getAttribute("aria-label"), field.selectionStart, field.selectionEnd] : null; draw(); const again = held && [...root.querySelectorAll("input")].find((node) => node.getAttribute("aria-label") === held[0]); if (again && document.activeElement !== again) {