Skip to content

fix: keep runner list sorting across pages, make page size configurable - #39161

Draft
bircni wants to merge 1 commit into
go-gitea:mainfrom
bircni:enhance/runner-list-pagination
Draft

fix: keep runner list sorting across pages, make page size configurable#39161
bircni wants to merge 1 commit into
go-gitea:mainfrom
bircni:enhance/runner-list-pagination

Conversation

@bircni

@bircni bircni commented Aug 28, 2026

Copy link
Copy Markdown
Member

The runner management page (repo / org / user / admin) lost the active
sort and search filter when switching pages: the paginator was never
given the request query params, so page links were bare ?page=N. The
page size was also hard-coded to 100.

  • Carry the query params onto the paginator so sort, filter and page
    size persist across pages.
  • Add a "per page" selector next to the search box (25 / 50 / 100 / 200,
    default 100), driven by a validated limit query param.
image

@bircni bircni added the backport/v1.27 This PR should be backported to Gitea 1.27 label Aug 28, 2026
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 28, 2026
@bircni bircni changed the title enhance: keep runner list sorting across pages, make page size configurable fix: keep runner list sorting across pages, make page size configurable Aug 28, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 28, 2026
@lunny

lunny commented Aug 28, 2026

Copy link
Copy Markdown
Member

Move. it to the bottom near the pages?

htmlDoc := NewHTMLParser(t, resp.Body)

// the chosen page size is reflected in the per-page selector
assert.Positive(t, htmlDoc.Find(`.dropdown .menu a.item.active[href*="limit=25"]`).Length())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, the active is abused. active doesn't mean selected, you can take a look at the source code.

Second, I really doubt about the value of such TestActionsRunnerListPagination test. It only queries some links on the page loosely, while the links are all built by framework AddParamFromRequest and QueryBuild. I don't see what kind of regression bugs the test would catch in the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we need this first: refactor: pagination/pager - #39162

Then the page links are always correct. It doesn't make sense to keep testing all the links again and again for all pages.

@wxiaoguang
wxiaoguang marked this pull request as draft August 29, 2026 05:45
@wxiaoguang wxiaoguang removed the backport/v1.27 This PR should be backported to Gitea 1.27 label Aug 29, 2026
@wxiaoguang

Copy link
Copy Markdown
Contributor

Simple backport: fix: add missing query parameters on runner list page - #39163

Comment on lines +38 to +41
// runnersPageSizes are the selectable "runners per page" values on the runner management page.
var runnersPageSizes = []int{25, 50, 100, 200}

const runnersDefaultPageSize = 100

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also comes a question: what benefits does the "selectable items per page" bring?

Isn't it "the more the better" in most cases?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what do you suggest? showing always all?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean maybe a default 50 or 100 is good enough? No need to make it "selectable". We never did so on other pages. If we'd really like to make the "limit" selectable, we need a plan to consider all pages.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just annoyed me yesterday as I have 102 runners 😂

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could agree 100 seems too many ...

So reduce it to 50?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's too less...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I misunderstood. Maybe you mean you need a large limit to see all?


From UI/UX perspective, I don't see why a list should show too many items, it exceeds human processing capabilities. When the list is large, usually it needs to support "search" or "filter".

And, Gitea already has a lot of config options under [ui] [ui.admin] [ui.user] etc, some preference settings are stored in local storage, etc. There were also discussions about "adding per-user setting", etc.


So overall there are already many different approaches. If we don't have a plan, and the problem is trivial, I'd prefer to keep things simple until we a design which is universally applicable to most pages, instead of ad-hoc "improvements"

@wxiaoguang wxiaoguang Aug 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I also have a question: now you have 102 runners and would like to add "limit=200", then some days later, if you have 202 or 1002 runners, would you add "limit=300/500/2000" then?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree - maybe instead of having a lot of config options for pagination we could add one global which triggers for all.
Just an idea...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 1 This PR needs approval from one additional maintainer to be merged. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants