From ff443de2468093c098d0deb29836ec93e150c266 Mon Sep 17 00:00:00 2001 From: mjkatgithub Date: Sat, 28 Feb 2026 13:51:50 +0100 Subject: [PATCH 1/2] Enhance chat message list with infinite scroll and viewport preservation - Introduce IntersectionObserver to detect scroll events for reaching the top and bottom of the message list. - Add new props for loading states and viewport management, including `loadingNewer`, `centerOnMessageId`, and `preserveViewportOnPrepend`. - Implement logic to emit events when the top or bottom of the message list is reached, allowing for dynamic loading of messages. - Refactor message loading logic to support windowed message display based on read anchors and user interactions. - Update unit tests to cover new scrolling behavior and viewport preservation features. --- app/components/Chat/MessageList.vue | 207 ++++++++++++++++-- app/pages/chat.vue | 201 +++++++++++++++-- app/utils/chatTimeline.ts | 58 +++++ tests/integration/utils/chatTimeline.spec.ts | 18 +- .../unit/components/Chat/MessageList.spec.ts | 86 +++++++- tests/unit/utils/chatTimeline.spec.ts | 36 ++- 6 files changed, 569 insertions(+), 37 deletions(-) diff --git a/app/components/Chat/MessageList.vue b/app/components/Chat/MessageList.vue index f655e29..5cc4d31 100644 --- a/app/components/Chat/MessageList.vue +++ b/app/components/Chat/MessageList.vue @@ -1,5 +1,5 @@