Repository navigation
feat(integrations): searchable lazy-loaded repo and channel pickers - #73
Conversation
Add cursor-based GitHub repository paging in the github service and two GET endpoints, /api/integrations/github/repositories and /api/integrations/slack/channels, that return a page plus the next cursor so the settings UI can lazy-load endless lists instead of fetching everything on render.
Replace the flat, all-at-once repository and channel lists with a search palette. Linked items stay compact on the card; a picker dialog lazy-loads pages via TanStack Query infinite scroll, filters as you type, and assigns the selection to a team. Drops the blocking discovery from the settings loader so the page no longer waits on GitHub or Slack to render.
There was a problem hiding this comment.
pulkitxm has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
📝 WalkthroughWalkthroughAdds paginated GitHub and Slack discovery APIs, a shared searchable integration picker, and picker-based repository/channel linking. Settings data now loads persisted linked entities, with updated panel integration and tests. ChangesIntegration picker flow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
actor Admin
participant IntegrationsPanel
participant IntegrationPicker
participant DiscoveryAPI
participant IntegrationService
Admin->>IntegrationsPanel: Open repository or channel picker
IntegrationsPanel->>IntegrationPicker: Render searchable picker
IntegrationPicker->>DiscoveryAPI: Fetch paginated items
DiscoveryAPI->>IntegrationService: Query GitHub or Slack
IntegrationService-->>DiscoveryAPI: Return items and cursor
DiscoveryAPI-->>IntegrationPicker: Return validated page
Admin->>IntegrationPicker: Select item and team
IntegrationPicker-->>IntegrationsPanel: Submit selected item and team
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
pulkitxm has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
🧹 Nitpick comments (3)
apps/web/src/features/settings/integration-picker.tsx (2)
108-110: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the shared interaction helper for row hover instead of a raw
hover:*class.The selectable row applies
hover:bg-surface-2directly. Prefer the centralized hover/focus helpers fromapps/web/src/lib/interaction.ts(e.g.cardHover/surfaceHover) so hover background transitions stay consistent with the shared duration/easing tokens and respectprefers-reduced-motion.Based on learnings: selectable card/row border/background hover behavior should use the shared interaction helpers (
cardHover/surfaceHover) rather than raw Tailwindhover:*classes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/features/settings/integration-picker.tsx` around lines 108 - 110, Update the selectable row class in the integration picker to use the shared cardHover or surfaceHover helper from interaction.ts instead of the raw hover:bg-surface-2 utility, while preserving the existing selected, linked, disabled, and border styling.Source: Learnings
62-67: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueOptional: reset
teamIdwhen the dialog closes.The close effect clears
search,selectedId, andsubmitting, but a previously chosenteamIdpersists across open/close cycles, so reopening pre-selects the last team rather than the default. Consider resetting it here for a consistent initial state.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/features/settings/integration-picker.tsx` around lines 62 - 67, Update the close-handling useEffect to also reset teamId when the dialog is closed, alongside search, selectedId, and submitting, so each reopening starts with the default team selection.apps/web/src/features/settings/integrations-panel.tsx (1)
198-210: 🎯 Functional Correctness | 🔵 Trivial | ⚖️ Poor tradeoffOptional: search only matches already-loaded pages.
IntegrationPickerfiltersitemsclient-side, and the discovery APIs take no search term, so typing a query only matches repositories/channels already paged in. For large installations, a match on a not-yet-fetched page won't appear until the user scrolls/loads more. If server-side search is intended per the PR summary, consider forwarding the search term to the endpoint; otherwise this is an acceptable known limitation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/features/settings/integrations-panel.tsx` around lines 198 - 210, Update the repository search flow around useRepositorySearch and IntegrationPicker so the active search term is forwarded to the discovery endpoint and results are filtered server-side rather than only across query.data pages already loaded. Preserve the existing linkedIds and PickerItem mapping behavior for returned repositories; if server-side search is not supported, explicitly retain this as a documented limitation instead of changing unrelated pagination logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/web/src/features/settings/integration-picker.tsx`:
- Around line 108-110: Update the selectable row class in the integration picker
to use the shared cardHover or surfaceHover helper from interaction.ts instead
of the raw hover:bg-surface-2 utility, while preserving the existing selected,
linked, disabled, and border styling.
- Around line 62-67: Update the close-handling useEffect to also reset teamId
when the dialog is closed, alongside search, selectedId, and submitting, so each
reopening starts with the default team selection.
In `@apps/web/src/features/settings/integrations-panel.tsx`:
- Around line 198-210: Update the repository search flow around
useRepositorySearch and IntegrationPicker so the active search term is forwarded
to the discovery endpoint and results are filtered server-side rather than only
across query.data pages already loaded. Preserve the existing linkedIds and
PickerItem mapping behavior for returned repositories; if server-side search is
not supported, explicitly retain this as a documented limitation instead of
changing unrelated pagination logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1d5cc526-daa5-4426-b5a4-3507ac39eeff
📒 Files selected for processing (10)
apps/web/src/app/api/integrations/github/repositories/route.tsapps/web/src/app/api/integrations/slack/channels/route.tsapps/web/src/features/settings/integration-picker.test.tsxapps/web/src/features/settings/integration-picker.tsxapps/web/src/features/settings/integrations-data.tsapps/web/src/features/settings/integrations-panel.test.tsxapps/web/src/features/settings/integrations-panel.tsxapps/web/src/features/settings/use-integration-lists.tspackages/services/src/github/app.test.tspackages/services/src/github/app.ts
Replace the flat repo/channel lists with a searchable, lazy-loaded picker so GitHub repositories and Slack channels can be endless and mapped to a team from one place.
Verification
Backend adds cursor-paged GitHub repo listing plus GET /api/integrations/github/repositories and /api/integrations/slack/channels; the client uses TanStack Query infinite scroll and the settings loader no longer blocks on GitHub or Slack to render.