Skip to content

fix(add-connection-dialog): connections list missing pagination/infinite scroll #2852

@viktormarinho

Description

@viktormarinho

Problem

AddConnectionDialogContent in apps/mesh/src/web/components/details/virtual-mcp/add-connection-dialog.tsx fetches connections with useConnections({ searchTerm }) which returns at most 100 items (single page from useCollectionList). For orgs with >100 connections:

  • The "Connected" tab silently misses connections beyond the first page
  • groupConnections() grouping may be incomplete if instances of the same app are split across pages

Context

Found during the server-side connection filtering work (#2849). This is a pre-existing issue — useCollectionList only fetches a single page and has no infinite scroll support.

The catalog tab in the same dialog already has infinite scroll via useInfiniteScroll + registryDiscovery.loadMore.

Suggested fix

Quick: exclude VIRTUAL server-side + bump pageSize for this call. Covers most orgs.

Proper: add cursor-based pagination / infinite scroll to useCollectionList (or use MCP client directly with increasing offsets), then wire it up like the catalog tab already does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions