From 02851c000399a0a9fa1cee3a6d6695de00661dab Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 9 Mar 2026 04:19:36 +0000 Subject: web: skip task list re-render when dialog or panel is open Prevents periodic poll from clearing the task panel, open modals, or inline edit forms while the user is interacting with them. - isUserEditing() now also detects any open or task-panel - poll() checks isUserEditing() before calling destructive renders --- web/app.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web') diff --git a/web/app.js b/web/app.js index 3ff4809..95fce38 100644 --- a/web/app.js +++ b/web/app.js @@ -219,6 +219,11 @@ export function isUserEditing(activeEl = (typeof document !== 'undefined' ? docu if (tag === 'INPUT' || tag === 'TEXTAREA') return true; if (activeEl.isContentEditable) return true; if (activeEl.closest('[role="dialog"]') || activeEl.closest('dialog')) return true; + // Also block re-renders when any modal/panel is open, even without focus. + if (typeof document !== 'undefined') { + if (document.querySelector('dialog[open]')) return true; + if (document.getElementById('task-panel')?.classList.contains('open')) return true; + } return false; } @@ -811,6 +816,7 @@ async function handleStartNextTask(btn) { async function poll() { try { const tasks = await fetchTasks(); + if (isUserEditing()) return; renderTaskList(tasks); renderActiveTaskList(tasks); if (isRunningTabActive()) { -- cgit v1.2.3