From 8142dd4ab18810de7aea0f02297f30803bfbd3e8 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 14 Sep 2026 04:26:38 +0200 Subject: [PATCH] fix: the assistant no longer drags the view to the end while an answer streams The reader can start at the top of a long answer and scroll at their own pace; the per-token and on-completion jumps to the bottom are gone, which also stops a finger on the screen fighting the auto-scroll. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU --- public/js/clinicalAssistant.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/js/clinicalAssistant.js b/public/js/clinicalAssistant.js index d1895ad4..a4bf0758 100644 --- a/public/js/clinicalAssistant.js +++ b/public/js/clinicalAssistant.js @@ -545,8 +545,11 @@ import { // assistant is still working — drawing a figure, completing a cut-off // reply. It now sits above the partial answer until the answer is done. showStreamStatus(bubble, streamStatus); - var wrap = document.getElementById('assistant-messages'); - if (wrap) wrap.scrollTop = wrap.scrollHeight; + // The view stays where the reader left it while the answer streams in. + // It used to be dragged to the bottom on every render, so the reader + // could not start at the top of a long answer, and a finger on the + // screen fought the auto-scroll. The answer grows below the fold; the + // reader scrolls into it at their own pace. } function handleEvent(type, data) { @@ -950,8 +953,8 @@ import { ''; row.appendChild(actions); } - var wrap = document.getElementById('assistant-messages'); - if (wrap) wrap.scrollTop = wrap.scrollHeight; + // No jump to the end when the answer completes either: the reader may be + // partway through it. messages.push({ role: 'assistant', content: content, sources: sources || [] }); row.dataset.messageIndex = String(messages.length - 1); updateConversationBudget();