From d7ec05686a09580f9ffd99f6ef26385aed8eb02c Mon Sep 17 00:00:00 2001 From: qer Date: Thu, 18 Jun 2026 20:12:21 +0800 Subject: [PATCH] feat(web): add scroll-up lazy loading for older session messages and fix new-messages pill (#893) * feat(web): add scroll-up lazy loading for older session messages * fix(web): keep new-messages pill above the composer dock * fix(web): observe top sentinel after DOM flush in ChatPane * fix(web): avoid eager lazy-load on open and suppress pill during history prepend * fix(web): gate scroll-key watcher and skip scroll restore on session switch * fix(web): restore scroll position from stable top anchor when prepending history * fix(web): preserve new-message pill during history lazy load * fix(web): resolve lint regressions in lazy load tests * fix(web): harden session lazy-load retry and scroll restore * fix(web): treat same-turn history prepends as non-bottom updates --- .changeset/web-session-lazy-loading.md | 5 + apps/kimi-web/src/App.vue | 4 + apps/kimi-web/src/components/ChatPane.vue | 155 +++++++++++++++++- .../src/components/ConversationPane.vue | 142 ++++++++++++++-- .../src/composables/useKimiWebClient.ts | 80 +++++++++ .../src/i18n/locales/en/conversation.ts | 2 + .../src/i18n/locales/zh/conversation.ts | 2 + apps/kimi-web/test/chatpane-lazy-load.test.ts | 82 +++++++++ .../test/conversation-pane-follow.test.ts | 139 +++++++++++++++- .../useKimiWebClient-session-cache.test.ts | 28 ++++ 10 files changed, 620 insertions(+), 19 deletions(-) create mode 100644 .changeset/web-session-lazy-loading.md create mode 100644 apps/kimi-web/test/chatpane-lazy-load.test.ts diff --git a/.changeset/web-session-lazy-loading.md b/.changeset/web-session-lazy-loading.md new file mode 100644 index 000000000..46ca754f4 --- /dev/null +++ b/.changeset/web-session-lazy-loading.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Add scroll-up lazy loading for older messages in the web chat session view, and fix the "new messages" pill overlapping the composer dock. diff --git a/apps/kimi-web/src/App.vue b/apps/kimi-web/src/App.vue index 032ee2331..de1c63040 100644 --- a/apps/kimi-web/src/App.vue +++ b/apps/kimi-web/src/App.vue @@ -1026,6 +1026,10 @@ function openPr(url: string): void { :file-reload-key="client.activeSessionId.value" :session-loading="client.sessionLoading.value" :compaction="client.compaction.value" + :has-more-messages="client.hasMoreMessages.value" + :loading-more="client.loadingMoreMessages.value" + :loading-more-error="client.loadMoreMessagesError.value" + :load-older-messages="client.loadOlderMessages" :workspace-name="client.visibleWorkspace.value?.name" :workspace-root="client.visibleWorkspace.value?.root ?? client.status.value.cwd" :git-diff-stats="client.gitDiffStats.value" diff --git a/apps/kimi-web/src/components/ChatPane.vue b/apps/kimi-web/src/components/ChatPane.vue index e28a0ac4d..898776e3b 100644 --- a/apps/kimi-web/src/components/ChatPane.vue +++ b/apps/kimi-web/src/components/ChatPane.vue @@ -1,6 +1,6 @@