Skip to content

Add infinite scroll to inbox contacts list#19339

Merged
ornicar merged 8 commits intolichess-org:masterfrom
realJimJin:inbox-infinite-scroll
Feb 8, 2026
Merged

Add infinite scroll to inbox contacts list#19339
ornicar merged 8 commits intolichess-org:masterfrom
realJimJin:inbox-infinite-scroll

Conversation

@realJimJin
Copy link
Contributor

Backend:

  • Add moreContacts method in MsgApi.scala for cursor-based pagination
  • Add /inbox/contacts route with before timestamp parameter
  • Add moreContacts controller method in Msg.scala

Frontend:

  • Add loadMoreContacts network function
  • Add loadingContacts and canGetMoreContacts state in MsgCtrl
  • Add loadMoreContacts method for lazy loading
  • Add scroll event listener to contacts container
  • Add loading spinner CSS

Closes #11985

realJimJin and others added 4 commits February 6, 2026 14:46
Backend:
- Add moreContacts method in MsgApi.scala for cursor-based pagination
- Add /inbox/contacts route with before timestamp parameter
- Add moreContacts controller method in Msg.scala

Frontend:
- Add loadMoreContacts network function
- Add loadingContacts and canGetMoreContacts state in MsgCtrl
- Add loadMoreContacts method for lazy loading
- Add scroll event listener to contacts container
- Add loading spinner CSS

Closes lichess-org#11985
@ornicar ornicar force-pushed the inbox-infinite-scroll branch from 6cb21df to 614352b Compare February 6, 2026 21:35
@ornicar
Copy link
Collaborator

ornicar commented Feb 6, 2026

That looks good but there's a problem when loading a conversation from page > 1. The conversation XHR response contains the first page of conversations, ensuring that the current one is included:
https://github.com/lichess-org/lila/blob/inbox-infinite-scroll/app/controllers/Msg.scala#L40-L40
https://github.com/lichess-org/lila/blob/inbox-infinite-scroll/app/controllers/Msg.scala#L112-L112

It replaces the list of conversations, reverting the pagination to page 1.

ornicar and others added 4 commits February 6, 2026 22:53
next 2 lines do the same thing
When opening a conversation from page > 1, preserve the existing
paginated contacts list instead of replacing it with the server's
page 1 response. Merge new contacts into the existing list.

Also remove redundant moreContacts controller method since home()
already handles the before param.
@ornicar ornicar merged commit 9c16e22 into lichess-org:master Feb 8, 2026
9 checks 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.

/inbox left-side convo list infinite scroll

2 participants