Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to handle pages of messages in admin panel #503

Open
ZavenArra opened this issue Mar 14, 2022 · 3 comments
Open

need to handle pages of messages in admin panel #503

ZavenArra opened this issue Mar 14, 2022 · 3 comments
Assignees
Labels
good first issue Good for newcomers size: small Simple change tool: Messaging Relates to the Messaging tool type: enhancement New feature or request

Comments

@ZavenArra
Copy link
Contributor

ZavenArra commented Mar 14, 2022

base query should load 10-20 most recent messages for each handle - new logic in API
subsequent scroll upward should load messages in pages

  1. arrive at tool and load current handles w/ conversations
  2. load message list for each handle/conversation
  3. implement paging as user scrolls upward

account and handle?
conversation/thread/something
with?

additional question about paging for survey responses..

@nmcharlton nmcharlton added the tool: Messaging Relates to the Messaging tool label Mar 28, 2022
@nmcharlton nmcharlton added type: enhancement New feature or request good first issue Good for newcomers size: small Simple change labels Jan 27, 2023
@pranavkparti
Copy link
Contributor

The current API simply returns all the messages for a handle, which are then sorted and grouped into threads/conversations. These threads (stored in the context) are displayed in the messaging inbox.
For pagination/infinite scroll, the sorting/grouping would need to take place at the backend itself.

@sleddd
Copy link

sleddd commented May 18, 2023

Just testing a bit, I noticed you can limit the messages with calls to the api using the limit and offset query parameters. Here is an example: '/messaging/message?handle=admin&limit=10&offset=10'. This gives you 10 messages from the 10th message.

@nmcharlton I am happy to work on this! I will try to get this done later today or by Thursday of next week.

@sleddd
Copy link

sleddd commented May 19, 2023

@pranavkparti and @ZavenArra - @pranavkparti You were right, you do need to sort those on the backend first. You have to return the messages grouped by the "to" and "from" handle and not just the user handle like it is now. The API should probably have an endpoint that will let you pull messages for a single conversation ( i.e. from 'admin' and to 'handle@test' instead of from 'admin' OR to 'admin' ) or maybe use the parent_id field? Otherwise, the best you can do is infinite load from the array of messages. I did do this. That way, if you fix the API, it will be easy to add the additional fetch. In the meantime, it will infinite load/render which means it will render faster at only 10 initial items per conversation. One big problem - the scrollToBottom keeps interfering with the first initial scrollUp.@pranavkparti Would you be able to look into it and maybe see if it is obvious to you where the issue is? I have my code at https://github.com/sleddd/treetracker-admin-client/tree/messaging-infinite-scroll - I did not want to officially pull request until it was ready.

The commit to look at is: sleddd@c76f638

@shravan562
Copy link

Hy can you please assig this to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers size: small Simple change tool: Messaging Relates to the Messaging tool type: enhancement New feature or request
Projects
No open projects
Status: No status
Development

No branches or pull requests

5 participants