ref(repos): Refactor Settings > Seer > Repos to use virtual rendering#108798
ref(repos): Refactor Settings > Seer > Repos to use virtual rendering#108798
Conversation
…fault infinite select fn
920fbec to
e27bec5
Compare
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Show resolved
Hide resolved
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Outdated
Show resolved
Hide resolved
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Outdated
Show resolved
Hide resolved
08f1ee6 to
788adc0
Compare
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Outdated
Show resolved
Hide resolved
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Outdated
Show resolved
Hide resolved
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Outdated
Show resolved
Hide resolved
|
pr title could use some help |
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Outdated
Show resolved
Hide resolved
|
the checkbox to select all rows (or any checkbox) seems to select all for a second then unselect them all |
| fetchNextPageRepositories, | ||
| isFetchingNextPageRepositories, | ||
| ]); | ||
|
|
There was a problem hiding this comment.
Initialization runs with only first page of data
High Severity
The initialization effect at line 125 checks isRepositoriesFetching (which is isFetching from useInfiniteQuery) to decide when to initialize the code review map and RCA repos. The old useFetchSequentialPages kept isFetching: true until ALL pages were fetched in a single async loop. With useInfiniteQuery + the auto-fetch useEffect, isFetching briefly goes false after the first page completes — before fetchNextPage() is called. During this gap, the initialization effect runs with only the first page of data and sets hasInitializedCodeReviewMap.current = true, permanently preventing re-initialization when subsequent pages load. Organizations with more than 100 repos will have incomplete initial state for code review and root cause analysis settings.
Additional Locations (1)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| </InputGroup> | ||
| ); | ||
| })} | ||
| </VirtualInner> |
There was a problem hiding this comment.
Virtual rows may overlap without dynamic measurement
Medium Severity
The virtualizer uses a fixed estimateSize of 60px without measureElement or a height constraint on rows. Each row contains a Stack with at least two lines of text (repo name + URL) and a trigger cell with one div per trigger. These rows can exceed 60px in height, but the next row's translateY is calculated assuming exactly 60px, causing visible overlap. Every other useVirtualizer usage in the codebase passes virtualizer.measureElement as a ref to rendered items for accurate positioning.
Additional Locations (1)
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Show resolved
Hide resolved
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableHeader.tsx
Show resolved
Hide resolved
| const maxHeight = scrollBodyHeight | ||
| ? isAnySelected | ||
| ? SELECTED_ROW_HEIGHT + scrollBodyHeight | ||
| : scrollBodyHeight | ||
| : undefined; |
There was a problem hiding this comment.
Bug: The virtualized table's maxHeight is calculated once and doesn't update when the header's height changes dynamically, resulting in an incorrect scrollable area size.
Severity: MEDIUM
Suggested Fix
The height measurement should be re-triggered whenever the header's layout changes. This can be done by using a ResizeObserver on the header element to detect size changes and re-run the measurement. Alternatively, move the measurement logic into a useEffect hook that depends on state variables affecting the header's size, such as isAnySelected and isAllSelected.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location:
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx#L254-L258
Potential issue: The `maxHeight` for the virtualized table body is calculated once when
the component mounts by measuring the `top` position of the `ScrollableBody`. This
measurement becomes stale when the header's height changes, which occurs when a
`FullGridAlert` is displayed after a user selects items. The height measurement logic
within the `setScrollBodyRef` callback is not re-executed when the header layout
changes. This results in the `ScrollableBody` having an incorrect height, which can lead
to improper scroll behavior or the table extending beyond its intended bounds.
There was a problem hiding this comment.
this is true, but it's ok for now, we're getting better and better as we go.


Update & improve the rendering of
<SeerRepoTable>which is visible on at the path/settings/seer/repos/Depends on #108295