Skip to content

fix: Add pagination for search-event#1544

Merged
minghay merged 3 commits intomasterfrom
event-search-pagination
Jan 21, 2026
Merged

fix: Add pagination for search-event#1544
minghay merged 3 commits intomasterfrom
event-search-pagination

Conversation

@yk634
Copy link
Copy Markdown
Contributor

@yk634 yk634 commented Jan 15, 2026

Context

Currently, event search fetches all matching events at once.
In our environment, this can mean retrieving tens of thousands of records from the database, which may cause excessive load on both the API server and the UI.

In addition, when search results are rendered, the UI triggers one API request per displayed event to fetch its corresponding build status.
As more events become visible during scrolling, these requests are executed repeatedly.

If a user scrolls quickly (for example, dragging the scrollbar directly to the bottom), this behavior can result in a large number of build-status API calls being executed in a short period of time, leading to unnecessary load and potential performance degradation.

Objective

This PR introduces infinite scroll with pagination (10 items per page) for event search.

Instead of fetching all matching events at once, search results are loaded incrementally as the user scrolls.
This limits the number of events rendered at a time and reduces the number of per-event build-status API calls triggered during scrolling.

As a result:

  • Database and API server load are reduced
  • UI performance becomes more stable
  • Excessive build-status API calls caused by rapid scrolling are avoided

References

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

minghay
minghay previously approved these changes Jan 20, 2026
@minghay
Copy link
Copy Markdown
Contributor

minghay commented Jan 20, 2026

@yk634 You can consider making the loading more graphical by adding in style

          .loading-more {
            display: flex;
            height: 4rem;
            justify-content: center;
            align-items: center;

            svg {
              color: colors.$sd-running
            }
          }

and changing the template text from Loading more... to

          <FaIcon
            @icon="spinner"
            @fixedWidth="true"
            @prefix="fa"
            @spin="true"
            @flip="false"
            @size="2x"
          />

which will generate the spinner as follows:
Screenshot 2026-01-20 at 14-50-43 minghay_various Events

@minghay minghay merged commit 93a42df into master Jan 21, 2026
2 checks passed
@minghay minghay deleted the event-search-pagination branch January 21, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants