Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(agent-canvas): replace dead Tailwind classes with theme tokens in MCP surfaces (#17604)

Harsh Kashyapdc5967a9bf7b
diff --git a/__tests__/components/features/launch/plugin-launch-plugin-section.test.tsx b/__tests__/components/features/launch/plugin-launch-plugin-section.test.tsx
new file mode 100644
index 0000000000..3efad1c84b
--- /dev/null
+++ b/__tests__/components/features/launch/plugin-launch-plugin-section.test.tsx
@@ -0,0 +1,30 @@
+import { render, screen } from "@testing-library/react";
+import { describe, it, expect, vi } from "vitest";
+import { PluginLaunchPluginSection } from "#/components/features/launch/plugin-launch-plugin-section";
+import { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types";
+
+function renderSection(plugin: PluginSpec) {
+ return render(
+ <PluginLaunchPluginSection
+ plugin={plugin}
+ originalIndex={0}
+ isExpanded={false}
+ onToggle={vi.fn()}
+ getPluginDisplayName={(p) => p.source}
+ onParameterChange={vi.fn()}
+ />,
+ );
+}
+
+describe("PluginLaunchPluginSection", () => {
+ it("highlights the header button on hover with the mid-surface hover token", () => {
+ renderSection({
+ source: "github:owner/repo",
+ parameters: { apiKey: "test-key" },
+ });
+
+ const button = screen.getByTestId("plugin-section-0");
+ expect(button).toHaveClass("hover:bg-interactive-hover");
+ expect(button).not.toHaveClass("hover:bg-tertiary");
+ });
+});
diff --git a/__tests__/components/features/mcp-page/install-server-modal.test.tsx b/__tests__/components/features/mcp-page/install-server-modal.test.tsx
index 685dea8070..1d394d4c2c 100644
--- a/__tests__/components/features/mcp-page/install-server-modal.test.tsx
+++ b/__tests__/components/features/mcp-page/install-server-modal.test.tsx
@@ -414,6 +414,42 @@ describe("InstallServerModal", () => {
});
});
+ it("styles the OAuth info box with theme surface and text tokens", async () => {
+ const entry: MarketplaceEntry = {
+ id: "synthetic-oauth",
+ name: "Synthetic OAuth",
+ description: "Synthetic OAuth entry.",
+ docsUrl: "https://example.com/docs",
+ iconBg: "#000000",
+ connectionOptions: [
+ {
+ id: "oauth",
+ provider: "mcp",
+ transport: {
+ kind: "shttp",
+ url: "https://mcp.example.com/mcp",
+ },
+ auth: {
+ strategy: "oauth2",
+ oauth: { clientAuthentication: "none" },
+ },
+ },
+ ],
+ };
+
+ renderWith(
+ <InstallServerModal existingServers={[]} entry={entry} onClose={vi.fn()} />,
+ );
+
+ const box = await screen.findByTestId("mcp-install-oauth-info");
+ expect(box).toHaveClass("bg-tertiary");
+ expect(box).not.toHaveClass("bg-base-tertiary");
+
+ const text = box.querySelector("p");
+ expect(text).toHaveClass("text-text-secondary");
+ expect(text).not.toHaveClass("text-secondary-light");
+ });
+
it("installs header-field remote servers with tagged header auth", async () => {
const entry = {
id: "datadog-style",
diff --git a/src/components/features/launch/plugin-launch-plugin-section.tsx b/src/components/features/launch/plugin-launch-plugin-section.tsx
index 76607dc12a..429af2a150 100644
--- a/src/components/features/launch/plugin-launch-plugin-section.tsx
+++ b/src/components/features/launch/plugin-launch-plugin-section.tsx
@@ -39,7 +39,7 @@ export function PluginLaunchPluginSection({
<button
type="button"
onClick={onToggle}
- className="flex w-full items-center justify-between px-4 py-3 text-left hover:bg-base-tertiary rounded-t-lg cursor-pointer"
+ className="flex w-full items-center justify-between px-4 py-3 text-left hover:bg-interactive-hover rounded-t-lg cursor-pointer"
data-testid={`plugin-section-${originalIndex}`}
>
<Typography.Text className="text-base font-normal">
diff --git a/src/components/features/mcp-page/install-server-modal.tsx b/src/components/features/mcp-page/install-server-modal.tsx
index 817b920f30..c2f2a957d9 100644
--- a/src/components/features/mcp-page/install-server-modal.tsx
+++ b/src/components/features/mcp-page/install-server-modal.tsx
@@ -535,9 +535,9 @@ export function InstallServerModal({
{oauthMode ? (
<div
data-testid="mcp-install-oauth-info"
- className="flex flex-col gap-2 p-3 rounded-lg border border-border bg-base-tertiary"
+ className="flex flex-col gap-2 p-3 rounded-lg border border-border bg-tertiary"
>
- <p className="text-sm text-secondary-light">
+ <p className="text-sm text-text-secondary">
{t(I18nKey.MCP$OAUTH_CONNECT_INFO)}
</p>
<p className="text-xs text-tertiary-alt">
diff --git a/src/components/features/mcp-page/mcp-toolbar.tsx b/src/components/features/mcp-page/mcp-toolbar.tsx
index 253508838e..5c979b0599 100644
--- a/src/components/features/mcp-page/mcp-toolbar.tsx
+++ b/src/components/features/mcp-page/mcp-toolbar.tsx
@@ -58,7 +58,7 @@ export function McpToolbar({
onClick={() => onSearchChange("")}
aria-label={t(I18nKey.MCP$SEARCH_CLEAR)}
data-testid="mcp-search-clear"
- className="mr-2 p-1 rounded text-tertiary-alt hover:text-content-1 cursor-pointer"
+ className="mr-2 p-1 rounded text-tertiary-alt hover:text-content cursor-pointer"
>
<X className="h-4 w-4" aria-hidden />
</button>