fix(mcp): remove Figma remote preset and open management (#6399)

* feat(mcp): configure OAuth client names in management

* fix(mcp): use a short OAuth callback for Figma

* fix(mcp): narrow catalog changes and remove Figma remote

* test(mcp): drop unpublished Figma remote compatibility contract

* fix(webui): align MCP catalog skeleton with card body
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-23 01:15:14 +08:00
1 parent 6a358a1e91
commit 06f3981962
11 files changed
+108 -52

No files matched your search

+19 -9
View File
@@ -149,26 +149,36 @@ const unbrandedPlugin: McpPresetInfo = {
};
function AppsFixture() {
const noop = () => {};
const managing = parameters.has("manage");
const [actions, setActions] = useState<unknown[]>([]);
const presets: McpPresetInfo[] = managing ? [{
name: "design", display_name: "Design MCP", category: "design", description: "Read design context",
docs_url: "", transport: "streamableHttp", auth: "oauth", requires: "", note: "",
install_supported: true, installed: false, configured: false, available: true,
status: "not_installed", required_fields: [], connection_summary: "https://design.example/mcp", source: "preset",
}] : [
unbrandedPlugin,
{ ...unbrandedPlugin, name: "test-mcp", display_name: "Test MCP", source: "builtin", logo_url: "/missing-app-icon.svg" },
{ ...unbrandedPlugin, name: "brand-example", display_name: "Brand Example", source: "builtin", brand_color: "#5E6AD2" },
];
return <main className="mx-auto max-w-4xl p-6"><AppsCatalogSettings
cliApps={{ apps: [], installed_count: 0 }}
mcpPresets={{ presets: [
unbrandedPlugin,
{ ...unbrandedPlugin, name: "test-mcp", display_name: "Test MCP", source: "builtin", logo_url: "/missing-app-icon.svg" },
{ ...unbrandedPlugin, name: "brand-example", display_name: "Brand Example", source: "builtin", brand_color: "#5E6AD2" },
], installed_count: 3 }}
cliAppsLoading={false} mcpPresetsLoading={false} query="" filter="ready"
mcpPresets={{ presets, installed_count: managing ? 0 : 3 }}
cliAppsLoading={false} mcpPresetsLoading={false} query="" filter={managing ? "mcp" : "ready"}
cliActionKey={null} mcpActionKey={null} mcpOAuthFlow={null} mcpOAuthPopupBlocked={false}
mcpOAuthCallbackUrl="" mcpOAuthCompleting={false} mcpOAuthCallbackError={null}
cliMessage={null} cliError={null} cliFocusName={null} mcpMessage={null} mcpError={null}
mcpFieldValues={{}} customMcpForm={DEFAULT_CUSTOM_MCP_FORM} mcpConfigImport=""
showBrandLogos={parameters.get("logos") !== "hidden"} requiresRestartPending={false}
onQueryChange={noop} onFilterChange={noop} onCliAction={noop} onMcpAction={noop}
onMcpOAuthConnect={noop} onMcpOAuthCancel={noop} onMcpOAuthOpen={noop}
onQueryChange={noop} onFilterChange={noop} onCliAction={noop}
onMcpAction={(action, name, values) => setActions((prev) => [...prev, { action, name, values }])}
onMcpOAuthConnect={(name, reset, values) => setActions((prev) => [...prev, { action: "oauth", name, reset, values }])}
onMcpOAuthCancel={noop} onMcpOAuthOpen={noop}
onMcpOAuthCallbackUrlChange={noop} onMcpOAuthComplete={noop} onDismissStatus={noop}
onBackToChat={noop} onMcpFieldChange={noop} onCustomMcpFormChange={noop}
onMcpConfigImportChange={noop} onSaveCustomMcp={noop} onImportMcpConfig={noop}
onMcpToolsChange={noop}
/></main>;
/>{managing && <output data-testid="mcp-actions">{JSON.stringify(actions)}</output>}</main>;
}
if (parameters.get("case") === "skeleton-additions") installSkeletonPreviewApi();
if (parameters.get("case") === "idle-compaction") installIdleCompactionApi();
+30
View File
@@ -0,0 +1,30 @@
import { expect, test } from "@playwright/test";
for (const width of [390, 1100]) {
test(`MCP body opens management without connecting at ${width}px`, async ({ page }) => {
await page.setViewportSize({ width, height: 850 });
await page.goto("/browser/fixture.html?case=apps&manage");
const actions = page.getByTestId("mcp-actions");
const body = page.getByRole("button", { name: "Design MCP", exact: true });
const dialog = page.getByRole("dialog", { name: "Design MCP", exact: true });
await body.click();
await expect(dialog).toBeVisible();
await expect(dialog.getByRole("tab", { name: "Overview" })).toHaveAttribute("aria-selected", "true");
await expect(actions).toHaveText("[]");
await dialog.getByRole("button", { name: "Close", exact: true }).click();
await expect(dialog).not.toBeVisible();
await body.focus();
await page.keyboard.press(width === 390 ? "Enter" : "Space");
await expect(dialog).toBeVisible();
await expect(actions).toHaveText("[]");
await dialog.getByRole("button", { name: "Close", exact: true }).click();
await expect(dialog).not.toBeVisible();
await page.getByRole("button", { name: "Connect Design MCP" }).click();
await expect(dialog.getByRole("tab", { name: "Connection", exact: true })).toHaveAttribute("aria-selected", "true");
await expect(actions).toHaveText("[]");
await dialog.getByRole("button", { name: "Connect", exact: true }).click();
await expect(actions).toHaveText(JSON.stringify([{
action: "oauth", name: "design", reset: false, values: { use_proxy: "false" },
}]));
});
}
+6 -3
View File
@@ -52,14 +52,17 @@ for (const width of [390, 1440]) {
await page.goto(fixture(surface));
const loaded = page.locator(loadedSelector).first();
const row = await box(loaded);
const icon = await box(surface === "channels" ? loaded.locator('[data-testid^="channel-logo"]') : loaded.locator(":scope > :first-child"));
const icon = await box(surface === "channels" ? loaded.locator('[data-testid^="channel-logo"]')
: loaded.locator(surface === "apps" ? ":scope > :first-child > :first-child" : ":scope > :first-child"));
const title = await box(loaded.locator("h3"));
const action = width === 1440 || surface !== "skills" ? await box(loaded.locator(":scope > :last-child")) : null;
await page.goto(fixture(surface, true));
const skeleton = status(page).locator(loadingSelector).first();
sameBox(await box(skeleton), row);
sameBox(await box(skeleton.locator(":scope > :first-child")), icon);
const placeholder = await box(skeleton.locator(":scope > :nth-child(2) [class*='bg-muted-foreground']").first());
sameBox(await box(skeleton.locator(surface === "apps" ? ":scope > :first-child > :first-child" : ":scope > :first-child")), icon);
const placeholder = await box(skeleton.locator(surface === "apps"
? ":scope > :first-child > :nth-child(2) [class*='bg-muted-foreground']"
: ":scope > :nth-child(2) [class*='bg-muted-foreground']").first());
expect(placeholder.x).toBe(title.x);
expect(placeholder.y + placeholder.height / 2).toBe(title.y + title.height / 2);
if (action) sameBox(await box(skeleton.locator(":scope > :last-child")), action);