Skip to content

feat: infinite scroll for chat messages#171

Merged
SudiptaPaul-31 merged 1 commit into
Lumina-eX:mainfrom
walexjnr:feat/infinite-scroll-chat-messages
May 30, 2026
Merged

feat: infinite scroll for chat messages#171
SudiptaPaul-31 merged 1 commit into
Lumina-eX:mainfrom
walexjnr:feat/infinite-scroll-chat-messages

Conversation

@walexjnr
Copy link
Copy Markdown
Contributor

Summary

Completes the infinite scroll implementation for chat messages by wiring the missing props (isLoadingMore, irstMessageId) from useMessages into ChatWindow, which then passes them to MessageList.

What was missing

ChatWindow was only forwarding messages, onLoadMore, isLoading, and hasMore to MessageList. The two props that control scroll-position restoration and the loading spinner during pagination - isLoadingMore and irstMessageId - were not being passed, so the feature was incomplete.

Changes

  • src/components/ChatWindow.tsx - destructure isLoadingMore and irstMessageId from useMessages and forward them to MessageList

No changes to useMessages or MessageList were needed; the logic was already correct.

Behaviour

  • Scrolling to the top triggers IntersectionObserver ? calls loadMoreMessages ? fetches older messages
  • Scroll position is restored to the first previously-visible message after load (via irstMessageId + scrollIntoView)
  • Spinner shown at the top while older messages are loading (isLoadingMore)
  • Duplicate loads prevented by loadingRef guard in useMessages

closes #151

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@walexjnr Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@SudiptaPaul-31 SudiptaPaul-31 merged commit c565fdb into Lumina-eX:main May 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinite Scroll for Chat Messages

2 participants