mode switch bugfix

3clyp50 committed Jan 22, 2026 at 08:54 UTC fdfdd45419256ad95d1a67d55f435a14f397f572
2 files changed +8 -4
webui/index.js
+1
@@ -334,6 +334,7 @@ export async function poll() {
334 );
335 }
336 afterMessagesUpdate(response.logs);
337 + processGroupStore.applyModeSteps();
338 }
339
340 lastLogVersion = response.log_version;
webui/js/messages.js
+7 -4
@@ -1558,9 +1558,13 @@ function addProcessStep(group, id, type, heading, content, kvps, timestamp = nul
1558 // Toggle step (store directly modifies DOM - single source of truth)
1559 processGroupStore.toggleStep(groupId, id);
1560
1561 - // Clear user-pinned flag when manually toggling
1562 - // (allows auto-collapse to work again on next expansion)
1563 - step.removeAttribute("data-user-pinned");
1561 + // If manually expanded, set pinned flag to prevent auto-collapse
1562 + // If collapsed, remove it
1563 + if (step.classList.contains("step-expanded")) {
1564 + step.setAttribute("data-user-pinned", "true");
1565 + } else {
1566 + step.removeAttribute("data-user-pinned");
1567 + }
1568 });
1569
1570 step.appendChild(stepHeader);
@@ -2077,7 +2081,6 @@ function createStepActionButtons(stepElement) {
2081 }
2082 });
2083
2080 - btnContainer.appendChild(btn);
2084 return btnContainer;
2085 }
2086