pipecd icon indicating copy to clipboard operation
pipecd copied to clipboard

Deployment traces page cannot load traces beyond initial 50 entries (infinite scroll not invoked & "More" button inverted)

Open harshalsp07 opened this issue 1 month ago • 0 comments

What happened:

When viewing the Deployment Trace page (/traces) in an environment with more than 50 deployment traces, only the first 50 entries are displayed. When scrolling down to the bottom of the list, subsequent traces are not fetched automatically, and there is no "More" button visible to load them manually.

Looking into web/src/components/deployment-trace-page/index.tsx, there are two related issues causing this:

  1. Infinite scroll trigger doesn't execute: In the useEffect listening for inView:

    useEffect(() => {
      if (inView && hasMore && isFetching === false) {
        fetchMoreDeploymentTraces; // <-- missing () invocation
      }
    }, [fetchMoreDeploymentTraces, hasMore, inView, isFetching]);
    

    fetchMoreDeploymentTraces is referenced as a bare expression statement rather than being invoked as a function (fetchMoreDeploymentTraces()), so reaching the sentinel at the end of the scroll container never triggers the next page fetch.

  2. Manual "More" button visibility condition is inverted:

    {!hasMore && (
      <Button
        color="primary"
        variant="outlined"
        size="large"
        fullWidth
        onClick={handleMoreClick}
        disabled={isFetching}
      >
        {UI_TEXT_MORE}
        {isFetching && <SpinnerIcon />}
      </Button>
    )}
    

    The manual fallback button is rendered on {!hasMore && ...} instead of {hasMore && ...}. When hasMore is true, the button is hidden; when hasMore is false (no more records exist), the button is shown.

Because of both bugs occurring together, any trace history past the first page is completely unreachable in the UI.

What you expected to happen:

  • When scrolling down to the bottom of the list and hasMore is true, the next batch of deployment traces should load automatically using fetchMoreDeploymentTraces().
  • If manual loading is provided as a fallback or secondary option, the "More" button should appear when there are more items to fetch (hasMore), not when there are none left (!hasMore).

How to reproduce it:

  1. Have or mock a project with >50 deployment traces.
  2. Navigate to the Traces page (/traces).
  3. Scroll down past the 50th item to the bottom of the list.
  4. Notice that no additional network request is dispatched and no "More" button is displayed.

Screenshot:

Deployment traces page stuck after entry 50

Environment:

  • piped version: N/A (UI issue)
  • control-plane version: master (60faf25a0b318cdb78bfd5cc067949e8be551aae)
  • Others: Tested on Chrome / Linux

Possible Solution:

In web/src/components/deployment-trace-page/index.tsx:

  1. Invoke the function:
    - fetchMoreDeploymentTraces;
    + fetchMoreDeploymentTraces();
    
  2. Invert the condition for the manual button:
    - {!hasMore && (
    + {hasMore && (
    

harshalsp07 avatar Oct 29 '26 14:10 harshalsp07