fix(dashboard): guard capabilities/tool-groups SSE handlers against in-progress edits

- Add 'capabilities-section' and 'tool-groups-section' to
  MANAGED_SECTION_IDS so operatorIsTyping() covers them too
- applyCapabilitiesChanged and applyToolGroupsChanged skip re-render
  when the operator has focus inside the section, preventing the
  table from being torn down under an in-progress checkbox edit.
  Tab-activation re-fetch is the recovery path for any missed event.
This commit is contained in:
iris 2026-06-05 10:29:24 +02:00 committed by mara
commit f174c5d32c

View file

@ -1233,11 +1233,15 @@ window.marked = marked;
function applyCapabilitiesChanged(ev) { function applyCapabilitiesChanged(ev) {
const root = $('capabilities-section'); const root = $('capabilities-section');
if (!root) return; if (!root) return;
// Skip re-render while operator has a checkbox focused in this
// section — the tab-activation re-fetch is the recovery path.
if (root.contains(document.activeElement)) return;
renderCapabilities(root, ev); renderCapabilities(root, ev);
} }
function applyToolGroupsChanged(ev) { function applyToolGroupsChanged(ev) {
const root = $('tool-groups-section'); const root = $('tool-groups-section');
if (!root) return; if (!root) return;
if (root.contains(document.activeElement)) return;
renderToolGroups(root, ev); renderToolGroups(root, ev);
} }
@ -3457,6 +3461,8 @@ window.marked = marked;
'rebuild-queue-section', 'rebuild-queue-section',
'reminders-section', 'reminders-section',
'schedules-section', 'schedules-section',
'capabilities-section',
'tool-groups-section',
]; ];
// <details> sections that should survive a refresh need a stable // <details> sections that should survive a refresh need a stable
// `data-restore-key` attribute. snapshotOpenDetails walks managed // `data-restore-key` attribute. snapshotOpenDetails walks managed