Skip to content

feat(onboarding): Dual-query SCM repo selector with pagination#112427

Closed
jaydgoss wants to merge 2 commits intojaygoss/vdy-46-scm-repo-pagination-befrom
jaygoss/vdy-46-scm-repo-pagination-fe
Closed

feat(onboarding): Dual-query SCM repo selector with pagination#112427
jaydgoss wants to merge 2 commits intojaygoss/vdy-46-scm-repo-pagination-befrom
jaygoss/vdy-46-scm-repo-pagination-fe

Conversation

@jaydgoss
Copy link
Copy Markdown
Member

@jaydgoss jaydgoss commented Apr 7, 2026

Wire the SCM repo selector to use paginated browsing and server-side search, replacing the previous single-query approach that required the user to type before any repos appeared.

Two independent query paths:

  • Browse (no search): useInfiniteApiQuery with paginate=true fires on mount. The first page (25 repos) appears immediately. Additional pages load on demand as the user scrolls near the bottom of the dropdown (prefetched 200px before the end via ScmVirtualizedMenuList).

  • Search (user types): Standard useQuery with accessibleOnly=true for server-side filtering. Debounced at 200ms. Accurate results guaranteed since the backend fetches all installation repos and filters locally.

The hook switches between browse and search results based on whether debouncedSearch is set. Clearing the search input returns to the cached browse results.

Also adds makeVirtualizedMenuList(onNearBottomRef) factory to support prefetch-on-scroll without needing to pass custom props through react-select's strict type system. The existing consumer in scmPlatformFeatures.tsx continues to use ScmVirtualizedMenuList directly.

PR 2 of 2 -- stacked on #112426 (backend pagination)

Refs VDY-46

@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 7, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 7, 2026
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-be branch from 1e5937d to fce1f2e Compare April 7, 2026 23:35
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-fe branch from 799ce60 to 6a95b26 Compare April 7, 2026 23:35
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-be branch from fce1f2e to ae08ef3 Compare April 7, 2026 23:51
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-fe branch from 6a95b26 to e54c6a5 Compare April 7, 2026 23:51
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-be branch from ae08ef3 to 8fc7ad5 Compare April 7, 2026 23:56
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-fe branch from e54c6a5 to f5bd813 Compare April 7, 2026 23:56
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-be branch from 8fc7ad5 to abe3be7 Compare April 8, 2026 00:06
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-fe branch from f5bd813 to 8f8edbc Compare April 8, 2026 00:06
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-be branch from abe3be7 to c135b8f Compare April 8, 2026 00:16
@jaydgoss jaydgoss force-pushed the jaygoss/vdy-46-scm-repo-pagination-fe branch from 8f8edbc to 46a8711 Compare April 8, 2026 00:16
Switch useScmRepoSearch to a dual-query approach:
- Browse (no search): uses useInfiniteApiQuery with paginate=true,
  auto-fetches all pages in background via useFetchAllPages. First
  page appears instantly.
- Search (user types): uses server-side search with accessibleOnly=true
  for accurate results.

Also adds ScmVirtualizedMenuList for rendering performance with large
repo lists.

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

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant