diff --git a/mateclaw-ui/src/composables/chat/useChat.ts b/mateclaw-ui/src/composables/chat/useChat.ts index 9da575e3..b90a6910 100644 --- a/mateclaw-ui/src/composables/chat/useChat.ts +++ b/mateclaw-ui/src/composables/chat/useChat.ts @@ -2060,7 +2060,7 @@ export function useChat(options: UseChatOptions): UseChatReturn { && (m.status === 'generating' || m.status === 'awaiting_approval') ) if (existingAsst) { - updateMessage(existingAsst.id, { + updateMessage(existingAsst.id as string, { ...existingAsst, content: '', contentParts: [], diff --git a/mateclaw-ui/src/composables/chat/useStickToBottom.ts b/mateclaw-ui/src/composables/chat/useStickToBottom.ts index 278bc9fe..b08d44a4 100644 --- a/mateclaw-ui/src/composables/chat/useStickToBottom.ts +++ b/mateclaw-ui/src/composables/chat/useStickToBottom.ts @@ -127,9 +127,11 @@ export function useStickToBottom( } // 处理滚动事件 - const handleScroll = () => { - if (!scrollRef.value) return - if (isScrolling) { + const handleScroll = () => { + if (!scrollRef.value) return + if (isScrolling) { + // User scrolled up during a programmatic scroll — release the lock so the + // view stops snapping back to the bottom. const currentScrollTop = scrollRef.value.scrollTop if (currentScrollTop < lastScrollTop) { isScrolling = false @@ -138,7 +140,7 @@ export function useStickToBottom( } lastScrollTop = scrollRef.value.scrollTop return - } + } const element = scrollRef.value const currentScrollTop = element.scrollTop