FEAT: improve conversation history loading for long sessions#371
FEAT: improve conversation history loading for long sessions#371ivnnv wants to merge 2 commits intositeboon:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis pull request adds four new localization keys for a "load all messages" feature across English and Chinese locale files. The additions include messages for loading all messages, a loading indicator, completion notification, and a performance warning for large message sets. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b1bd8fb to
c3ce3fc
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/components/ChatInterface.jsx`:
- Around line 4390-4469: When starting loadAllMessages, capture a session-bound
identifier (e.g., const currentSessionId = selectedSession?.id and
currentSessionProvider = sessionProvider) and before applying any state updates
or clearing flags (setSessionMessages, setHasMoreMessages, setTotalMessages,
setMessagesOffset, setVisibleMessageCount, setAllMessagesLoaded,
setLoadAllJustFinished, setShowLoadAllOverlay, and refs like
allMessagesLoadedRef/current and isLoadingMoreRef) verify the captured
id/provider still matches selectedSession/id and sessionProvider; if it doesn't,
abort/return early and do not mutate state. Optionally implement an
AbortController tied to the request and call abort when selectedSession changes,
but at minimum add the session-id check before the response handling, catch
block, and finally block so late responses cannot overwrite a newly selected
session.
c3ce3fc to
2fe0f0c
Compare
Scrolling up through long conversations requires many "load more" cycles. This adds a "Load all messages" floating button that fetches the entire conversation history in one shot. - Floating overlay pill appears after each batch finishes loading, persists 2s - Shows loading spinner while fetching all messages - Shows green "All messages loaded" confirmation for 1s before disappearing - Preserves scroll position when bulk-loading (no viewport jump) - Ref-based guards prevent scroll handler from re-fetching after load-all - Performance warning shown; "Scroll to bottom" resets visible cap - Clean state reset on session switch - i18n keys for en and zh-CN Note: default page size (20) and visible cap (100) are unchanged. These could be increased in a follow-up or made configurable via settings.
9ad7563 to
91aa94b
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
f7a7eb9 to
947d931
Compare
Fixes #386
Scrolling up through long conversations requires many "load more" cycles. This adds a "Load all messages" floating button that fetches the entire conversation history in one shot.
Updated to work with the new TypeScript component architecture from #374 (the big refactor). Changes are now across the modular hooks/views:
useChatSessionState.ts- core load-all logic, state, refs, timersChatInterface.tsx- prop wiringChatMessagesPane.tsx- floating overlay UI, performance warning bannerDEMO:
feat-load-all-messages.mov
Note: default page size (20) and visible cap (100) are unchanged. These could be increased in a follow-up or made configurable via settings.
Summary by CodeRabbit