Skip to content

refactor: use direct registry API call for server detail page#490

Merged
peppescg merged 1 commit intomainfrom
feat/all-registries-merge
Apr 13, 2026
Merged

refactor: use direct registry API call for server detail page#490
peppescg merged 1 commit intomainfrom
feat/all-registries-merge

Conversation

@peppescg
Copy link
Copy Markdown
Collaborator

@peppescg peppescg commented Apr 13, 2026

Summary

Screenshot 2026-04-13 at 15 37 00 Screenshot 2026-04-13 at 16 53 15
  • Replace the multi-registry Promise.all fan-out in the server detail page with a single direct API call to /registry/{registryName}/v0.1/servers/{serverName}/versions/{version}
  • Thread the registryName from the catalog list page to the detail page via a URL query parameter, eliminating unnecessary API calls
  • Fall back to fetching the default registry when the query param is absent (e.g. direct URL navigation)
  • Remove the unused CATALOG_ALL_REGISTRIES constant and "All registries" select option

Test plan

  • Unit tests updated and passing (21/21)
  • TypeScript type-check passes
  • Biome lint passes
  • Navigate to a server detail page from the catalog — verify server name, description, and tools load correctly
  • Navigate directly to a server detail URL (without ?registryName=) — verify fallback works

Made with Cursor

Replace the multi-registry Promise.all fan-out with a single direct API
call to /registry/{registryName}/v0.1/servers/{serverName}/versions/{version}.

The registry name is now threaded from the catalog list page to the
detail page via a query parameter, avoiding unnecessary API calls.
Falls back to fetching the default registry when the query param is
missing (e.g. direct URL navigation).

Also removes the unused CATALOG_ALL_REGISTRIES constant and the
"All registries" select option that was no longer needed.

Made-with: Cursor
Copilot AI review requested due to automatic review settings April 13, 2026 14:45
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Apr 13, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the catalog server detail flow to avoid multi-registry fan-out by carrying the selected registryName from the catalog list into the detail page (via query param) and using a single direct registry API call, with a fallback to the default registry for direct URL navigation.

Changes:

  • Remove the “All registries” option/constant and treat registry selection as a concrete registry name.
  • Append ?registryName= when navigating from the catalog list to a server detail page.
  • Update the server detail server-action to resolve the registry (query param or default) and issue a single direct API request.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/app/catalog/hooks/use-catalog-filters.ts Drops the “all registries” sentinel and stores a concrete registryName filter value.
src/app/catalog/constants.ts Removes the unused CATALOG_ALL_REGISTRIES constant.
src/app/catalog/components/servers.tsx Adds registryName prop and includes it in the pushed detail URL query param.
src/app/catalog/components/servers-wrapper.tsx Ensures a concrete registry name is passed down to filters and server list (fallback to first registry).
src/app/catalog/components/server-filters.tsx Removes “All registries” SelectItem and updates placeholder text.
src/app/catalog/components/tests/servers.test.tsx Updates tests to pass the new required registryName prop.
src/app/catalog/[repoName]/[serverName]/[version]/page.tsx Reads registryName from searchParams and passes it into getServerDetails.
src/app/catalog/[repoName]/[serverName]/[version]/not-found.tsx Adjusts layout wrapper classes (removes redundant padding).
src/app/catalog/[repoName]/[serverName]/[version]/actions.ts Resolves registry via query param or default and performs a single direct registry API call.

@peppescg peppescg self-assigned this Apr 13, 2026
@peppescg peppescg merged commit 965fd1f into main Apr 13, 2026
15 checks passed
@peppescg peppescg deleted the feat/all-registries-merge branch April 13, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants