From 0dac40579b9d30f50692bd9e319d2eac23766d2f Mon Sep 17 00:00:00 2001 From: mssssss123 <824186479@qq.com> Date: Sat, 5 Sep 2026 12:59:25 +0800 Subject: [PATCH 1/3] fix(ui): preserve stream reading position and deduplicate live status --- ui/e2e/fixtures/streaming-scroll.html | 2 + ui/e2e/fixtures/streaming-scroll.jsx | 73 ++++++ ui/e2e/streaming-scroll.config.mjs | 18 ++ ui/e2e/streaming-scroll.spec.mjs | 105 ++++++++ ui/src/components/chat-v2/ChatInterfaceV2.tsx | 17 +- ui/src/components/chat-v2/MessageRowV2.tsx | 58 +---- .../chat-v2/MessagesPaneV2.render.test.tsx | 22 +- ui/src/components/chat-v2/MessagesPaneV2.tsx | 146 ++++++----- .../components/chat-v2/ProcessTrace.test.tsx | 10 +- ui/src/components/chat-v2/ProcessTrace.tsx | 48 +--- .../chat-v2/StreamingScrollViewport.tsx | 25 ++ .../SubagentDetailMessageFlow.render.test.tsx | 12 +- .../chat-v2/SubagentDetailMessageFlow.tsx | 69 ++--- ui/src/components/chat-v2/ThinkingBlock.tsx | 50 ++++ .../chat-v2/processGrouping.streaming.test.ts | 35 +++ .../chat-v2/processGrouping.test.ts | 8 +- ui/src/components/chat-v2/processGrouping.ts | 31 ++- .../chat-v2/useChatHistorySearch.ts | 45 +++- .../components/chat-v2/useTypewriter.test.tsx | 60 +++++ ui/src/components/chat-v2/useTypewriter.ts | 104 ++++---- .../chat/hooks/useChatComposerState.ts | 2 +- .../components/chat/hooks/useChatMessages.ts | 3 +- .../chat/hooks/useChatSessionState.spec.ts | 7 + .../chat/hooks/useChatSessionState.ts | 240 ++++++++---------- .../chat/hooks/useScrollFollow.test.tsx | 139 ++++++++++ .../components/chat/hooks/useScrollFollow.ts | 208 +++++++++++++++ ui/src/components/chat/types/types.ts | 1 + ui/src/components/chat/utils/messageKeys.ts | 1 + .../chat/view/subcomponents/Markdown.tsx | 4 +- ui/src/i18n/locales/en/chat.json | 3 + ui/src/i18n/locales/zh-CN/chat.json | 3 + .../useSessionStore.renderKeys.test.tsx | 44 ++++ ui/src/stores/useSessionStore.ts | 43 +++- 33 files changed, 1167 insertions(+), 469 deletions(-) create mode 100644 ui/e2e/fixtures/streaming-scroll.html create mode 100644 ui/e2e/fixtures/streaming-scroll.jsx create mode 100644 ui/e2e/streaming-scroll.config.mjs create mode 100644 ui/e2e/streaming-scroll.spec.mjs create mode 100644 ui/src/components/chat-v2/StreamingScrollViewport.tsx create mode 100644 ui/src/components/chat-v2/ThinkingBlock.tsx create mode 100644 ui/src/components/chat-v2/processGrouping.streaming.test.ts create mode 100644 ui/src/components/chat-v2/useTypewriter.test.tsx create mode 100644 ui/src/components/chat/hooks/useScrollFollow.test.tsx create mode 100644 ui/src/components/chat/hooks/useScrollFollow.ts create mode 100644 ui/src/stores/useSessionStore.renderKeys.test.tsx diff --git a/ui/e2e/fixtures/streaming-scroll.html b/ui/e2e/fixtures/streaming-scroll.html new file mode 100644 index 000000000..f79b89fc8 --- /dev/null +++ b/ui/e2e/fixtures/streaming-scroll.html @@ -0,0 +1,2 @@ + +