Conversation
static/gsApp/views/seerAutomation/onboarding/hooks/seerOnboardingContext.tsx
Show resolved
Hide resolved
fb1a520 to
0f67b66
Compare
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Show resolved
Hide resolved
static/gsApp/views/seerAutomation/onboarding/hooks/seerOnboardingContext.tsx
Outdated
Show resolved
Hide resolved
0f67b66 to
f3b1628
Compare
static/gsApp/views/seerAutomation/onboarding/hooks/seerOnboardingContext.tsx
Show resolved
Hide resolved
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Outdated
Show resolved
Hide resolved
2d82360 to
894837a
Compare
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Show resolved
Hide resolved
894837a to
01695aa
Compare
c0a3324 to
1310781
Compare
1310781 to
b7de238
Compare
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Show resolved
Hide resolved
…fault infinite select fn
static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx
Show resolved
Hide resolved
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
| const lowerCase = searchTerm?.toLowerCase() ?? ''; | ||
| if (lowerCase) { | ||
| return sortedRepositories.filter(repository => | ||
| repository.name.toLowerCase().includes(lowerCase) |
There was a problem hiding this comment.
Infinite query not invalidated after repository mutations
Medium Severity
After bulk repository settings updates, only individual repository queries are invalidated via getRepositoryWithSettingsQueryKey, but the infinite query created by organizationRepositoriesInfiniteOptions is not invalidated. This causes the repository list to show stale settings data (like enabledCodeReview status) until the page is refreshed or the cache expires. The old useFetchSequentialPages implementation didn't need invalidation because it stored data in component state, but React Query caches require explicit invalidation.
There was a problem hiding this comment.
This is true, we have the weird mutationData stuff in there now to overcome this.
I'll revisit once #108798 is merged and we have faster rendering cycles.
| // return a.status.localeCompare(b.status); | ||
| // } | ||
| return 0; | ||
| }), |
There was a problem hiding this comment.
Select function recreated on every render
Low Severity
The select function passed to useInfiniteQuery is defined inline without memoization, causing it to be recreated on every render. This forces the select function to re-run on every render even when the underlying data hasn't changed, performing expensive operations like uniqBy, filter, toSorted, and flatMap unnecessarily. This is particularly problematic when auto-fetching multiple pages, as each page fetch triggers additional re-renders.
Additional Locations (1)
There was a problem hiding this comment.
this fn depends on sort, so that's something to revisit.
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/onboarding/hooks/seerOnboardingContext.tsx
Show resolved
Hide resolved
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> | ||
|
|
||
| {hasData ? null : <LoadingIndicator mini />} |
There was a problem hiding this comment.
Loading spinner persists when results are empty
Medium Severity
The hasData variable (derived from repositories.length > 0) is used to control the mini LoadingIndicator, but it reflects data presence rather than loading state. When loading completes with zero results (e.g., a search term that matches nothing), hasData remains false, so the spinner shows permanently alongside the "No repositories found" message. The isLoading and isLoadingMore props are already available in RepoTable but aren't used for this check.


This brings in useInfiniteApiQuery to replace useFetchSequentialPages inside of useOrganizationRepositoriesWithSettings
The idea is that this will be a better foundation to use to continue to iterate on the pages that load up lists of repos (there's a seer wizard step, and also the org settings page).
I believe that the new system is a bit slower to run on orgs that have 1,000's of repos. It's because we're loading and rendering each chunk of data using react to trigger the next chunk. I like it better however because we return a proper
queryResultobject that useQuery knows how to keep track of. The benefit is that we can re-fetch the data instead of it being cached inside the state inside useFetchSequentialPages. Also, I'm following up with virtual rendering which will counteract the re-render penalty.