Add new settings for page number control #10420

Open
opened 2025-11-02 09:06:57 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @yp05327 on GitHub (Mar 12, 2023).

Feature Description

Reported by @hiifong

In https://github.com/go-gitea/gitea/pull/22937, we added pagination for user dashboard, but it broke the definition of FeedPagingNum in the document:
image
We need to add new settings for the page number control to avoid too many pages in user dashboard, as if there are too many records, it will be very slow to load the page.

Screenshots

No response

Originally created by @yp05327 on GitHub (Mar 12, 2023). ### Feature Description Reported by @hiifong In https://github.com/go-gitea/gitea/pull/22937, we added pagination for user dashboard, but it broke the definition of `FeedPagingNum` in the document: ![image](https://user-images.githubusercontent.com/18380374/224545634-6f1729c9-6f14-4b10-8079-fb13a7e75481.png) We need to add new settings for the page number control to avoid too many pages in user dashboard, as if there are too many records, it will be very slow to load the page. ### Screenshots _No response_
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 09:06:57 -06:00
Author
Owner

@brechtvl commented on GitHub (Mar 12, 2023):

It's not clear to me how FEED_PAGING_NUM is broken, as far as I can tell that still correctly controls the number of activities on each page?

I can see that counting the total number of activities for the purpose of the "Last" button could be slow. Two potential solutions:

  • Just hide the "Last" button for the activity feed, it's not important to be able to navigate to the last page for this case.
  • Add a mechanism like ?page=last which counts the total activities only after clicking "Last", so it doesn't affect typical dashboard page views.
@brechtvl commented on GitHub (Mar 12, 2023): It's not clear to me how `FEED_PAGING_NUM` is broken, as far as I can tell that still correctly controls the number of activities on each page? I can see that counting the total number of activities for the purpose of the "Last" button could be slow. Two potential solutions: * Just hide the "Last" button for the activity feed, it's not important to be able to navigate to the last page for this case. * Add a mechanism like `?page=last` which counts the total activities only after clicking "Last", so it doesn't affect typical dashboard page views.
Author
Owner

@yp05327 commented on GitHub (Mar 12, 2023):

In source code, it is defined as the number of feeds on each page, but in the document on each page is not mentioned.
So user may take it for the total number of all items.

ps:
At first, @hiifong reported the last page button is too slow.
Then @lunny said we have settings to control the total display count.
Then someone said maybe FeedPagingNum can control it , as the document said we can control the number of items that are displayed in home feed.
But it didn't work as FeedPagingNum should have a default vaule 20.
Then I found that in https://github.com/go-gitea/gitea/pull/22937, FeedPagingNum which can control the toltal display count in old versions, has been changed to control the number of items on each page.

@yp05327 commented on GitHub (Mar 12, 2023): In source code, it is defined as the number of feeds on each page, but in the document `on each page` is not mentioned. So user may take it for the total number of all items. ps: At first, @hiifong reported the last page button is too slow. Then @lunny said we have settings to control the total display count. Then someone said maybe `FeedPagingNum` can control it , as the document said we can control the number of items that are displayed in home feed. But it didn't work as `FeedPagingNum` should have a default vaule 20. Then I found that in https://github.com/go-gitea/gitea/pull/22937, `FeedPagingNum` which can control the toltal display count in old versions, has been changed to control the number of items `on each page`.
Author
Owner

@brechtvl commented on GitHub (Mar 12, 2023):

Ah, to me it makes sense to just update the description to say "on one page" then since that's what the other *_PAGING_NUM settings do and still effectively the same as before for the first page.

Personally I think hiding the "Last" button would be preferable to capping the number of activities, since "Last" would be quite arbitrary then.

@brechtvl commented on GitHub (Mar 12, 2023): Ah, to me it makes sense to just update the description to say "on one page" then since that's what the other `*_PAGING_NUM` settings do and still effectively the same as before for the first page. Personally I think hiding the "Last" button would be preferable to capping the number of activities, since "Last" would be quite arbitrary then.
Author
Owner

@lunny commented on GitHub (Mar 12, 2023):

Maybe we should only display Prev and Next buttons, because it's meaningless to go to some page.

@lunny commented on GitHub (Mar 12, 2023): Maybe we should only display `Prev` and `Next` buttons, because it's meaningless to go to some page.
Author
Owner

@hiifong commented on GitHub (Mar 13, 2023):

In source code, it is defined as the number of feeds on each page, but in the document on each page is not mentioned. So user may take it for the total number of all items.

ps: At first, @hiifong reported the last page button is too slow. Then @lunny said we have settings to control the total display count. Then someone said maybe FeedPagingNum can control it , as the document said we can control the number of items that are displayed in home feed. But it didn't work as FeedPagingNum should have a default vaule 20. Then I found that in #22937, FeedPagingNum which can control the toltal display count in old versions, has been changed to control the number of items on each page.

home page loading time screenshot
TQ%KT}S217J@R)SHPCUNB(F

@hiifong commented on GitHub (Mar 13, 2023): > In source code, it is defined as the number of feeds on each page, but in the document `on each page` is not mentioned. So user may take it for the total number of all items. > > ps: At first, @hiifong reported the last page button is too slow. Then @lunny said we have settings to control the total display count. Then someone said maybe `FeedPagingNum` can control it , as the document said we can control the number of items that are displayed in home feed. But it didn't work as `FeedPagingNum` should have a default vaule 20. Then I found that in #22937, `FeedPagingNum` which can control the toltal display count in old versions, has been changed to control the number of items `on each page`. home page loading time screenshot ![TQ%KT}S217J@R)SHPCUNB(F](https://user-images.githubusercontent.com/89133723/224599463-a5ddf922-b953-4d72-9fcc-4b219b52287a.jpg)
Author
Owner

@Zettat123 commented on GitHub (Mar 13, 2023):

@hiifong Could you please add the index in https://github.com/go-gitea/gitea/issues/21611#issuecomment-1451113252 and test if the index could improve the page loading time?

@Zettat123 commented on GitHub (Mar 13, 2023): @hiifong Could you please add the index in https://github.com/go-gitea/gitea/issues/21611#issuecomment-1451113252 and test if the index could improve the page loading time?
Author
Owner

@yp05327 commented on GitHub (Mar 14, 2023):

Ah, to me it makes sense to just update the description to say "on one page" then since that's what the other *_PAGING_NUM settings do and still effectively the same as before for the first page.

As we have no version control for the old document, maybe we need to wait until the new document being finished to change the description?

@yp05327 commented on GitHub (Mar 14, 2023): > Ah, to me it makes sense to just update the description to say "on one page" then since that's what the other *_PAGING_NUM settings do and still effectively the same as before for the first page. As we have no version control for [the old document](https://docs.gitea.io/en-us/), maybe we need to wait until the new document being finished to change the description?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10420