incubator-answer icon indicating copy to clipboard operation
incubator-answer copied to clipboard

Pagination and Total Answer Count Loading Issue on Question Details Page

Open bosenger opened this issue 1 year ago • 4 comments

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 avatar Nov 24 '23 04:11 bosenger

Working on fix this bug...

bosenger avatar Nov 24 '23 04:11 bosenger

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.

shuashuai avatar Nov 28 '23 10:11 shuashuai

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.

bosenger avatar Nov 30 '23 06:11 bosenger

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

shuashuai avatar Dec 19 '23 07:12 shuashuai