Skip to content

fix(connections): use canonical app_name for connection display titles#3090

Open
rafavalls wants to merge 8 commits intomainfrom
rafavalls/fix-connection-naming
Open

fix(connections): use canonical app_name for connection display titles#3090
rafavalls wants to merge 8 commits intomainfrom
rafavalls/fix-connection-naming

Conversation

@rafavalls
Copy link
Copy Markdown
Collaborator

@rafavalls rafavalls commented Apr 9, 2026

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 title field. 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 stable app_name slug ("google-gmail""Google Gmail") for registry-installed connections. Custom connections (no app_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

  1. Install a registry connection (e.g. Google Gmail)
  2. Rename the instance to something custom via the settings sheet
  3. Go back to the Connections catalog — card should still show "Google Gmail"
  4. Click through to the detail page — header and breadcrumb should show "Google Gmail"
  5. The instances panel should show the custom name you set

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by cubic

Uses registry catalog titles and a stored metadata.displayName for 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.

  • Bug Fixes
    • Connected cards/groups: use buildRegistryTitleMap (app_name → catalog title); fallback to getConnectionDisplayTitle (checks metadata.displayName, then strips 1–6 char parenthesized suffixes).
    • Persist canonical title in metadata.displayName at install; use it for headers/breadcrumbs; clone/add flows copy it.
    • Prevent stacked suffixes when creating/cloning by stripping before appending.
    • Add icon fallbacks in catalog and add-connection dialog (item.icon, item.image, item.logo).
    • Home connections dialog: loads org connections to mark Added, closes after Add, only mounts when the banner/dialog is visible.

Written for commit 0de74e8. Summary will update on new commits.

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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Release Options

Suggested: Patch (2.254.1) — based on fix: prefix

React with an emoji to override the release type:

Reaction Type Next Version
👍 Prerelease 2.254.1-alpha.1
🎉 Patch 2.254.1
❤️ Minor 2.255.0
🚀 Major 3.0.0

Current version: 2.254.0

Note: If multiple reactions exist, the smallest bump wins. If no reactions, the suggested bump is used (default: patch).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

🧪 Benchmark

Should we run the Virtual MCP strategy benchmark for this PR?

React with 👍 to run the benchmark.

Reaction Action
👍 Run quick benchmark (10 & 128 tools)

Benchmark will run on the next push after you react.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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.

rafavalls and others added 4 commits April 10, 2026 08:16
- 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>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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;
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 10, 2026

Choose a reason for hiding this comment

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

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>
Suggested change
if (!connection.app_name) return stripped;
if (!connection.app_name) return connection.title;
Fix with Cubic

rafavalls and others added 2 commits April 10, 2026 09:09
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants