nuxt / nuxters

https://nuxters.nuxt.com
MIT License
133 stars 17 forks source link

Lost pagination state #67

Closed rrd108 closed 1 month ago

rrd108 commented 2 months ago

steps for reproduction

  1. On the nuxters website if you click show more at the end of the first 100 nuxters,
  2. then click on a developer to see the details
  3. and go back to the the main page

You will again see only the first 100 nuxters. Pagination state is lost.

shinGangan commented 2 months ago

Hi @rrd108 🖐️

I understand that the ideal and reality you were looking for are as follows. Is it right?

ideal:

  1. Click the "show more" button
  2. Displayed up to 200th
  3. Go to a specific developer's page
  4. Click the "back to homepage" button to return to the original page
  5. Displayed up to 200th

actual:

  1. Displayed up to 100th instead of 200th
rrd108 commented 2 months ago

Exactly

https://github.com/nuxt/nuxters/blob/main/components/home/HomeContributors.vue limit should be saved to a store / storage.

shinGangan commented 2 months ago

I think there are several solutions.

  1. Retain limit even if page transition occurs ・This is probably the story that @rrd108 is proposing.
  2. Hold limit. At the same time, I would like to improve useFetch('/api/contributors') to narrow down the API response. ・eg. useFetch('/api/contributors', { query: { limit } }) ・For many users, acquiring all Nuxters is not necessary, so consider the server load and would like to introduce limit query (or param body).
shinGangan commented 2 months ago

I think this issue is a proposal for a new feature.

I would like to ask @Atinux for your opinion. (if the assignment is wrong, I would appreciate it if you could give me an additional mention 🙏).

My opinion

I agree with this proposal. This is a good suggestion considering the users.

Atinux commented 2 months ago

I agree we can do better.

What about being able to display the Nuxter card as a modal when clicking on the user instead?

maximepvrt commented 2 months ago

Use history.back() if previous page is homepage ?

Atinux commented 2 months ago

I think it won't solve the pagination issue