mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-10-07 12:58:49 +08:00
Rename Integrations nav item to MCP Directory (#371)
* Rename sidebar integrations link to MCP Directory Co-authored-by: openhands <openhands@all-hands.dev> * fix: translation --------- Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: hieptl <hieptl.developer@gmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
openhands
hieptl
parent
b48a9094d1
commit
951ca0af24
@@ -67,14 +67,15 @@ vi.mock("#/components/features/backends/backend-selector", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("#/components/features/sidebar/sidebar-conversation-list", () => ({
|
||||
SidebarConversationList: () => <div data-testid="sidebar-conversation-list" />,
|
||||
SidebarConversationList: () => (
|
||||
<div data-testid="sidebar-conversation-list" />
|
||||
),
|
||||
}));
|
||||
|
||||
vi.mock("#/hooks/use-settings-nav-items", () => ({
|
||||
useSettingsNavItems: () => [],
|
||||
}));
|
||||
|
||||
|
||||
function renderSidebar(currentPath: string) {
|
||||
const value: NavigationContextValue = {
|
||||
currentPath,
|
||||
@@ -101,7 +102,12 @@ describe("Sidebar", () => {
|
||||
window.localStorage.clear();
|
||||
});
|
||||
|
||||
it.each([["/conversations"], ["/automations"], ["/automations/abc-123"], ["/settings"]])(
|
||||
it.each([
|
||||
["/conversations"],
|
||||
["/automations"],
|
||||
["/automations/abc-123"],
|
||||
["/settings"],
|
||||
])(
|
||||
"keeps the sidebar's default top padding on %s so spacing stays consistent with the conversations page",
|
||||
(currentPath) => {
|
||||
renderSidebar(currentPath);
|
||||
@@ -122,6 +128,17 @@ describe("Sidebar", () => {
|
||||
expect(settingsToggle.className).toMatch(/(^|\s)text-\[#8C8C8C\](\s|$)/);
|
||||
});
|
||||
|
||||
it("labels the MCP nav item as MCP Directory instead of Integrations", () => {
|
||||
renderSidebar("/mcp");
|
||||
|
||||
expect(screen.getByRole("link", { name: "SIDEBAR$MCP_DIRECTORY" })).toBe(
|
||||
screen.getByTestId("sidebar-mcp-link"),
|
||||
);
|
||||
expect(
|
||||
screen.queryByRole("link", { name: "SIDEBAR$INTEGRATIONS" }),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("toggles between expanded and collapsed states and persists the choice", () => {
|
||||
const { unmount } = renderSidebar("/conversations");
|
||||
|
||||
@@ -170,6 +187,7 @@ describe("Sidebar", () => {
|
||||
"sidebar-conversations-link",
|
||||
"sidebar-automations-link",
|
||||
"sidebar-skills-link",
|
||||
"sidebar-mcp-link",
|
||||
"sidebar-settings-toggle",
|
||||
]) {
|
||||
const link = screen.getByTestId(testId);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
// The sidebar MCP entry must not use the ambiguous "Integrations" label.
|
||||
// Lock this down at translation.json because the test i18next mock returns keys.
|
||||
describe("SIDEBAR$MCP_DIRECTORY label", () => {
|
||||
const translationPath = path.join(
|
||||
__dirname,
|
||||
"../../src/i18n/translation.json",
|
||||
);
|
||||
const translation = JSON.parse(
|
||||
fs.readFileSync(translationPath, "utf-8"),
|
||||
) as Record<string, Record<string, string>>;
|
||||
|
||||
it('uses "MCP Directory" (not "Integrations") in English', () => {
|
||||
expect(translation.SIDEBAR$MCP_DIRECTORY).toBeDefined();
|
||||
expect(translation.SIDEBAR$MCP_DIRECTORY.en).toBe("MCP Directory");
|
||||
expect(translation.SIDEBAR$MCP_DIRECTORY.en).not.toBe("Integrations");
|
||||
});
|
||||
});
|
||||
@@ -229,7 +229,7 @@ export function Sidebar() {
|
||||
/>
|
||||
<SidebarNavLink
|
||||
to="/mcp"
|
||||
label={t(I18nKey.SIDEBAR$INTEGRATIONS)}
|
||||
label={t(I18nKey.SIDEBAR$MCP_DIRECTORY)}
|
||||
testId="sidebar-mcp-link"
|
||||
disabled={linkDisabled}
|
||||
collapsed={collapsed}
|
||||
|
||||
+16
-16
@@ -11831,22 +11831,22 @@
|
||||
"tr": "Yetenekler",
|
||||
"uk": "Навички"
|
||||
},
|
||||
"SIDEBAR$INTEGRATIONS": {
|
||||
"en": "Integrations",
|
||||
"ja": "連携",
|
||||
"zh-CN": "集成",
|
||||
"zh-TW": "整合",
|
||||
"ko-KR": "통합",
|
||||
"no": "Integrasjoner",
|
||||
"ar": "التكاملات",
|
||||
"de": "Integrationen",
|
||||
"fr": "Intégrations",
|
||||
"it": "Integrazioni",
|
||||
"pt": "Integrações",
|
||||
"es": "Integraciones",
|
||||
"ca": "Integracions",
|
||||
"tr": "Entegrasyonlar",
|
||||
"uk": "Інтеграції"
|
||||
"SIDEBAR$MCP_DIRECTORY": {
|
||||
"en": "MCP Directory",
|
||||
"ja": "MCPディレクトリ",
|
||||
"zh-CN": "MCP 目录",
|
||||
"zh-TW": "MCP 目錄",
|
||||
"ko-KR": "MCP 디렉토리",
|
||||
"no": "MCP-katalog",
|
||||
"ar": "دليل MCP",
|
||||
"de": "MCP-Verzeichnis",
|
||||
"fr": "Répertoire MCP",
|
||||
"it": "Directory MCP",
|
||||
"pt": "Diretório MCP",
|
||||
"es": "Directorio MCP",
|
||||
"ca": "Directori MCP",
|
||||
"tr": "MCP Dizini",
|
||||
"uk": "Каталог MCP"
|
||||
},
|
||||
"MCP$PAGE_DESCRIPTION": {
|
||||
"en": "Add Model Context Protocol servers to expand what your agent can do. Click any server below to install it.",
|
||||
|
||||
Reference in New Issue
Block a user