diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-09 04:19:36 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-09 04:19:36 +0000 |
| commit | 02851c000399a0a9fa1cee3a6d6695de00661dab (patch) | |
| tree | 9bd8f322131cc67daf56ca2f9503424efe145fd8 | |
| parent | 288c698c4c21090d99e9e99ada06335ec03c2a42 (diff) | |
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 <dialog> or task-panel
- poll() checks isUserEditing() before calling destructive renders
| -rw-r--r-- | web/app.js | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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()) { |
