fix(connections): use canonical app_name for connection display titles#3090
fix(connections): use canonical app_name for connection display titles#3090
Conversation
Connection cards, group headers, detail page headers, and breadcrumbs now derive the display name from the stable app_name slug (e.g. "google-gmail" → "Google Gmail") instead of the first instance's mutable title. This prevents user-renamed instances from polluting catalog cards and group titles. Instance-specific names still appear in the instances panel and binding selector where they belong. Also adds icon fallbacks (item.icon, item.image, item.logo) for non-store registry items in the connections catalog and add-connection dialog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Release OptionsSuggested: Patch ( React with an emoji to override the release type:
Current version:
|
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
There was a problem hiding this comment.
1 issue found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/mesh/src/web/components/details/connection/index.tsx">
<violation number="1" location="apps/mesh/src/web/components/details/connection/index.tsx:579">
P2: Adding a new custom connection instance can produce stacked numeric suffixes like `Name (2) (3)` because the base title is no longer normalized before appending the next index.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
The home connections dialog was passing an empty set for addedConnectionIds (so everything looked un-added) and a no-op for onAdd (so clicking Add did nothing). Now loads all org connections to mark existing ones as Added, and closes the dialog after a new connection is installed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/mesh/src/web/components/chat/input.tsx">
<violation number="1" location="apps/mesh/src/web/components/chat/input.tsx:324">
P2: `useConnections()` is called unconditionally in `ChatInput`, causing unnecessary connections loading in chat views where the connections banner/modal is not used.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Strip trailing (N) suffix from getConnectionDisplayTitle result before appending the next instance number, fixing "Name (2) (3)" stacking for custom connections without app_name. - Move useConnections and AddConnectionDialog into HomeConnectionsDialog, which only mounts when showConnectionsBanner is true, so connections are not fetched unconditionally in all chat views. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The slug-to-title conversion ("vercel-mcp" → "Vercel Mcp") was lossy
and couldn't preserve correct casing for acronyms like MCP or API.
Instead, strip auto-generated instance suffixes (1-6 char parenthesized
suffixes) from the original connection title which preserves the correct
casing from install time.
For groups, pick the shortest stripped title among all instances so
user-renamed instances don't pollute the group title. Also extracts
HomeConnectionsDialog to avoid unconditional useConnections() in
ChatInput, and prevents stacked numeric suffixes when adding instances.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use title when it matches app_name slug (preserves casing like "Vercel MCP"), fall back to slug-to-title only when the instance was renamed. For groups, scan all instances to find one with the original title before falling back. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The exact slugify match failed when the registry title ("Vercel") was
shorter than app_name ("vercel-mcp"). Now checks word-boundary prefixes
in both directions so "Vercel" matches "vercel-mcp" and preserves the
original casing instead of falling back to the lossy slug conversion.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/mesh/src/shared/utils/group-connections.ts">
<violation number="1" location="apps/mesh/src/shared/utils/group-connections.ts:29">
P1: Prefix matching is too permissive and classifies many user-renamed titles as original, so renamed instance names can still leak into catalog/header display titles.</violation>
<violation number="2" location="apps/mesh/src/shared/utils/group-connections.ts:49">
P2: Custom connections now lose user-provided title suffixes because the function strips trailing `(…)` even when `app_name` is missing.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| connection: ConnectionEntity, | ||
| ): string { | ||
| const stripped = connection.title.replace(INSTANCE_SUFFIX_RE, ""); | ||
| if (!connection.app_name) return stripped; |
There was a problem hiding this comment.
P2: Custom connections now lose user-provided title suffixes because the function strips trailing (…) even when app_name is missing.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/mesh/src/shared/utils/group-connections.ts, line 49:
<comment>Custom connections now lose user-provided title suffixes because the function strips trailing `(…)` even when `app_name` is missing.</comment>
<file context>
@@ -1,25 +1,91 @@
- const slug = connection.app_name.replace(/^@[^/]+\//, "");
- return slug.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
+ const stripped = connection.title.replace(INSTANCE_SUFFIX_RE, "");
+ if (!connection.app_name) return stripped;
+
+ if (isOriginalTitle(slugify(stripped), connection.app_name)) {
</file context>
| if (!connection.app_name) return stripped; | |
| if (!connection.app_name) return connection.title; |
Instead of complex slug matching, simply look up the correct display title from the registry items that are already loaded. Adds buildRegistryTitleMap() which maps app_name → registry display title, and passes it to groupConnections(). Connected cards now show the exact same name as the store catalog. Falls back to suffix-stripped connection title for custom connections or when registry data is unavailable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Store the canonical display name (baseName from registry) in connection metadata at creation time so the detail page header and breadcrumb can show the correct name even after a user renames the instance. getConnectionDisplayTitle now checks metadata.displayName first. Clone operations propagate metadata to new instances. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
What is this contribution about?
Connection cards, group headers, detail page headers, and breadcrumbs were deriving the display name from the first instance's mutable
titlefield. When a user renamed an instance (e.g. "Google Gmail" → "Google Gmail adsfadsfa"), that renamed name would propagate everywhere — catalog cards, group titles, and the detail header.The fix introduces
getConnectionDisplayTitle()which derives the canonical name from the stableapp_nameslug ("google-gmail"→"Google Gmail") for registry-installed connections. Custom connections (noapp_name) continue using their user-set title. Instance-specific names still appear where they belong: the instances panel, the settings sheet, and the binding selector.Also adds icon fallbacks (
item.icon,item.image,item.logo) for non-store registry items in the connections catalog and add-connection dialog.Screenshots/Demonstration
Before: renaming an instance to "Google Gmail adsfadsfa" caused that name to show in the catalog card and detail header.
After: catalog cards and headers always show "Google Gmail" (from
app_name); instance names only appear in the instances list.How to Test
Review Checklist
Summary by cubic
Uses registry catalog titles and a stored
metadata.displayNamefor connection display names, stripping auto-generated suffixes so cards, group headers, detail headers, and breadcrumbs stay stable and correctly cased. The home connections dialog now marks existing apps as Added, closes on Add, and only mounts/fetches when opened.buildRegistryTitleMap(app_name→ catalog title); fallback togetConnectionDisplayTitle(checksmetadata.displayName, then strips 1–6 char parenthesized suffixes).metadata.displayNameat install; use it for headers/breadcrumbs; clone/add flows copy it.item.icon,item.image,item.logo).Written for commit 0de74e8. Summary will update on new commits.