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

Pagination and Total Answer Count Loading Issue on Question Details Page #651

Open
bosenger opened this issue Nov 24, 2023 · 4 comments
Open
Labels
bug Something isn't working

Comments

@bosenger
Copy link

Describe the bug
There is a pagination issue on the answer list within the question details page. The total count of answers and the pagination list fail to load correctly. The pagination is constantly set to 1, and the total count of answers matches the number on a single page. This bug occurs across all devices and operating systems, and is independent of the browser and its version.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the question details page.
  2. Observe the answer list section.
  3. Notice that the pagination is always set to 1, regardless of the number of answers.
  4. Observe that the total count of answers is equal to the number of answers on one page, indicating a failure in loading the correct total.

Expected behavior
The expected behavior is that the answer list should correctly load with appropriate pagination. The total count of answers should reflect the actual number of answers available, and pagination should adjust accordingly, allowing users to navigate through multiple pages if necessary.

Screenshots
Not applicable.

Platform (please complete the following information):

  • Device: All (e.g. Desktop, Mobile)
  • OS: All (e.g. macOS, Windows, iOS, Android)
  • Browser: All (e.g. Chrome, Safari, Firefox)
  • Version: All_versions
@bosenger bosenger added the bug Something isn't working label Nov 24, 2023
@bosenger
Copy link
Author

Working on fix this bug...

@shuashuai
Copy link
Member

First of all, thanks for your contribution!

Answers are not paged because current technology would cause performance degradation if the url of an answer was accessed directly, so given that there aren't many answers yet, there is no paging.

eg: When you visit this answer link: https://meta.answer.dev/questions/D13i/E14i;We need to display the answer with id=E14i. If the answer is not on the current page,performance will be affected! Therefore, paging has not been used here.

@bosenger
Copy link
Author

I understand what you mean, thank you for the explanation.
In the situation you described, there indeed exists such an issue, and perhaps we can improve it in this way:

  • if the Q&A in the link exists on the first page of the answer list, then we can simply scroll to the corresponding position;
  • if the answer is not on the first page, then we can add a 'Related Answer' section at the front of the answer list to directly load and display this answer, avoiding the need to handle subsequent pagination issues;
  • whether to name this section 'Related Answer' can be further considered.

In our use of 'answer', the number of user answers has already exceeded 20, so directly removing the pagination feature would cause users to be unable to view more answers.

@shuashuai
Copy link
Member

We will consider the solution you mentioned, and more discussion is needed on exactly how to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants