current mode steps delay fix

3clyp50 committed Jan 22, 2026 at 09:25 UTC 2afd2f077fe115568eac6a05c30dc9db75a429b5
1 file changed +9 -3
webui/components/messages/process-group/process-group-store.js
+9 -3
@@ -221,12 +221,18 @@ const model = {
221 // Only expand the last step in an active group
222 shouldExpand = step === lastActiveStep || step.contains(lastActiveStep);
223 }
224 - step.classList.toggle("step-expanded", shouldExpand);
224
226 - // Clear user-pinned flag when mode changes
227 - if (!shouldExpand) {
225 + // IMPORTANT: Only EXPAND steps here, never collapse them during streaming.
226 + // Collapsing is handled by the timeout mechanism in messages.js to avoid
227 + // fighting with the scheduled delays. We only force-collapse when mode is "collapsed".
228 + if (shouldExpand) {
229 + step.classList.add("step-expanded");
230 + } else if (mode === "collapsed") {
231 + // In collapsed mode, force all steps closed
232 + step.classList.remove("step-expanded");
233 step.removeAttribute("data-user-pinned");
234 }
235 + // In "current" mode: don't remove step-expanded - let timeout handle it
236 });
237
238 // Apply to error groups