fix(orchestrator): keep polling while text stays selected

The hub page skipped every 10 s state poll while any text was selected, so operator rows that operator.py run had closed stayed on screen until the selection ended (2026-11-12: no /api/state from 09:29 to 09:54 while the CLI closed 19 rows). A selection now holds the poll back for at most 20 s, and returning to the window reloads at once.

🎯 Fix: 90 %
💥 Break: 3 %
💸 Cost: 100 %
⏱️ Time: 100 %
🛡️ Security: 100 %
🏆 Score: 87
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-12 10:20:31 +00:00
1 parent fd8fc08603
commit 07d28a62c6
3 files changed
+71 -1

No files matched your search

+6 -1
View File
@@ -30,8 +30,13 @@
}
}
const SELECTION_HOLD = 20000;
let selectedSince = 0;
function refresh() {
if (!ui.busy && !ui.playing && !document.hidden && String(window.getSelection()).length === 0) {
const selected = String(window.getSelection()).length > 0;
selectedSince = selected ? selectedSince || Date.now() : 0;
if (!ui.busy && !ui.playing && !document.hidden && (!selected || Date.now() - selectedSince >= SELECTION_HOLD)) {
load();
}
}