🙌 OpenHands: AI-Driven Development
Customize extensions UI and polish automations experience (#739)
FraterCCCLXIII9626fc92ab49
diff --git a/__tests__/api/automation-handlers.test.ts b/__tests__/api/automation-handlers.test.tsindex 34a1592d48..6990ede195 100644--- a/__tests__/api/automation-handlers.test.ts+++ b/__tests__/api/automation-handlers.test.ts@@ -103,6 +103,27 @@ describe("Automation MSW Handlers", () => {});});+ describe("POST /api/automation/v1/:id/dispatch", () => {+ it("creates a pending run for an existing automation", async () => {+ const id = MOCK_AUTOMATIONS_RESPONSE.automations[0].id;+ const res = await fetch(`/api/automation/v1/${id}/dispatch`, {+ method: "POST",+ });+ const data = await res.json();++ expect(res.status).toBe(201);+ expect(data.status).toBe("PENDING");+ });++ it("returns 404 for non-existent automation", async () => {+ const res = await fetch("/api/automation/v1/non-existent-id/dispatch", {+ method: "POST",+ });++ expect(res.status).toBe(404);+ });+ });+describe("GET /api/automation/v1/:id/runs", () => {it("returns automation runs", async () => {const id = MOCK_AUTOMATIONS_RESPONSE.automations[0].id;diff --git a/__tests__/api/automation-service.test.ts b/__tests__/api/automation-service.test.tsindex aae43e8053..a7e89820b4 100644--- a/__tests__/api/automation-service.test.ts+++ b/__tests__/api/automation-service.test.ts@@ -11,15 +11,15 @@ import type { Backend } from "#/api/backend-registry/types";// Use vi.hoisted to define mocks that will be available during vi.mock hoistingconst {mockGet,- mockPost,mockPatch,+ mockPost,mockDelete,mockCallCloudProxy,mockGetActive,} = vi.hoisted(() => ({mockGet: vi.fn(),- mockPost: vi.fn(),mockPatch: vi.fn(),+ mockPost: vi.fn(),mockDelete: vi.fn(),mockCallCloudProxy: vi.fn(),mockGetActive: vi.fn(),@@ -101,7 +101,6 @@ describe("AutomationService", () => {mockGet.mockReset();mockPatch.mockReset();mockPost.mockReset();-mockDelete.mockReset();mockCallCloudProxy.mockReset();// Default: active backend is local. Cloud-routing tests override this.@@ -288,6 +287,26 @@ describe("AutomationService", () => {});});+ describe("dispatchAutomation", () => {+ it("posts to the dispatch endpoint for local backends", async () => {+ const run = {+ id: "run-1",+ status: "PENDING",+ conversation_id: null,+ bash_command_id: null,+ error_detail: null,+ started_at: "2026-01-01T00:00:00Z",+ completed_at: null,+ };+ mockPost.mockResolvedValue({ data: run });++ const result = await AutomationService.dispatchAutomation("1");++ expect(mockPost).toHaveBeenCalledWith("/api/automation/v1/1/dispatch");+ expect(result).toEqual(run);+ });+ });+// When the active backend is cloud the local axios instance must be// bypassed entirely; calls must route through `callCloudProxy` so the// bundled local agent-server forwards the request server-side to the@@ -375,5 +394,28 @@ describe("AutomationService", () => {});expect(mockDelete).not.toHaveBeenCalled();});++ it("dispatchAutomation forwards method POST via callCloudProxy", async () => {+ const run = {+ id: "run-1",+ status: "PENDING",+ conversation_id: null,+ bash_command_id: null,+ error_detail: null,+ started_at: "2026-01-01T00:00:00Z",+ completed_at: null,+ };+ mockCallCloudProxy.mockResolvedValue(run);++ const result = await AutomationService.dispatchAutomation("abc");++ expect(mockCallCloudProxy).toHaveBeenCalledWith({+ backend: cloudBackend,+ method: "POST",+ path: "/api/automation/v1/abc/dispatch",+ });+ expect(mockPost).not.toHaveBeenCalled();+ expect(result).toEqual(run);+ });});});diff --git a/__tests__/components/automations/add-automation-modal.test.tsx b/__tests__/components/automations/add-automation-modal.test.tsxnew file mode 100644index 0000000000..84b995af77--- /dev/null+++ b/__tests__/components/automations/add-automation-modal.test.tsx@@ -0,0 +1,103 @@+import React from "react";+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, expect, it, vi } from "vitest";+import {+ NavigationProvider,+ type NavigationContextValue,+} from "#/context/navigation-context";+import { AddAutomationModal } from "#/components/features/automations/add-automation-modal";+import { I18nKey } from "#/i18n/declaration";++vi.mock("react-i18next", () => ({+ useTranslation: () => ({+ t: (key: string) => key,+ }),+ Trans: ({+ i18nKey,+ components,+ children,+ }: {+ i18nKey: string;+ components?: Record<string, React.ReactElement>;+ children?: React.ReactNode;+ }) => {+ if (i18nKey !== I18nKey.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC) {+ return children ?? i18nKey;+ }++ return (+ <>+ Start a new conversation and tell OpenHands to{" "}+ {components?.example+ ? React.cloneElement(+ components.example,+ {},+ <>+ {components.cmd+ ? React.cloneElement(+ components.cmd,+ {},+ "Create an automation",+ )+ : null}+ {components.punct+ ? React.cloneElement(components.punct, {}, ".")+ : null}+ </>,+ )+ : null}+ </>+ );+ },+}));++function renderModal(isOpen = true) {+ const onClose = vi.fn();+ const navigation: NavigationContextValue = {+ currentPath: "/automations",+ conversationId: null,+ isNavigating: false,+ navigate: vi.fn(),+ };++ render(+ <NavigationProvider value={navigation}>+ <AddAutomationModal isOpen={isOpen} onClose={onClose} />+ </NavigationProvider>,+ );++ return { onClose };+}++describe("AddAutomationModal", () => {+ it("renders the create instructions content when open", () => {+ renderModal();++ expect(screen.getByTestId("add-automation-modal")).toBeInTheDocument();+ expect(+ screen.getByTestId("automations-create-instructions-example"),+ ).toHaveTextContent("Create an automation");+ expect(+ screen.getByTestId("automations-create-automation"),+ ).toHaveTextContent(I18nKey.AUTOMATIONS$CREATE_AUTOMATION_BUTTON);+ expect(+ screen.queryByText(I18nKey.AUTOMATIONS$EMPTY_OPTION_PLUGIN_TITLE),+ ).not.toBeInTheDocument();+ });++ it("does not render when closed", () => {+ renderModal(false);++ expect(screen.queryByTestId("add-automation-modal")).not.toBeInTheDocument();+ });++ it("calls onClose when the close button is clicked", async () => {+ const user = userEvent.setup();+ const { onClose } = renderModal();++ await user.click(screen.getByTestId("add-automation-modal-close"));++ expect(onClose).toHaveBeenCalledTimes(1);+ });+});diff --git a/__tests__/components/automations/automation-card.test.tsx b/__tests__/components/automations/automation-card.test.tsxnew file mode 100644index 0000000000..b129200ea8--- /dev/null+++ b/__tests__/components/automations/automation-card.test.tsx@@ -0,0 +1,74 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, expect, it, vi } from "vitest";+import { AutomationCard } from "#/components/features/automations/automation-card";+import type { Automation } from "#/types/automation";++vi.mock("react-i18next", () => ({+ useTranslation: () => ({ t: (key: string) => key }),+}));++vi.mock("#/context/navigation-context", () => ({+ useNavigation: () => ({ navigate: vi.fn() }),+}));++vi.mock("#/hooks/use-has-permission", () => ({+ useHasPermission: () => true,+}));++const automation: Automation = {+ id: "automation-1",+ name: "Async Standup Digest",+ prompt: "Generate an async standup digest from Slack activity.",+ enabled: true,+ trigger: { type: "cron", schedule_human: "cron" },+ created_at: "2026-01-01T00:00:00Z",+ updated_at: "2026-01-01T00:00:00Z",+};++describe("AutomationCard", () => {+ it("uses the shared extension module interactive class without a resting border", () => {+ render(+ <AutomationCard+ automation={automation}+ onToggle={vi.fn()}+ onRunNow={vi.fn()}+ onDelete={vi.fn()}+ />,+ );++ const card = screen.getByTestId("automation-card-automation-1");+ expect(card.className).toContain("extension-module-card-interactive");+ expect(card.className).not.toContain("border-[var(--oh-border)]");+ expect(card.className).not.toContain("hover:bg-surface-raised");+ expect(card.className).not.toContain("hover:ring");+ });++ it("renders a play run button and menu actions instead of a toggle switch", async () => {+ const user = userEvent.setup();++ render(+ <AutomationCard+ automation={automation}+ onToggle={vi.fn()}+ onRunNow={vi.fn()}+ onDelete={vi.fn()}+ />,+ );++ expect(+ screen.getByTestId("automation-run-now-automation-1"),+ ).toHaveTextContent("AUTOMATIONS$RUN_NOW");+ expect(screen.getByTestId("automation-run-now-automation-1")).toHaveClass(+ "h-8",+ );+ expect(screen.queryByRole("switch")).not.toBeInTheDocument();++ await user.click(+ screen.getByRole("button", { name: "AUTOMATIONS$ACTIONS_MENU" }),+ );++ expect(screen.getByText("COMMON$VIEW")).toBeInTheDocument();+ expect(screen.getAllByText("AUTOMATIONS$RUN_NOW")).toHaveLength(2);+ });+});diff --git a/__tests__/components/automations/automation-list-row.test.tsx b/__tests__/components/automations/automation-list-row.test.tsxnew file mode 100644index 0000000000..9eeeace0ce--- /dev/null+++ b/__tests__/components/automations/automation-list-row.test.tsx@@ -0,0 +1,75 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, expect, it, vi } from "vitest";+import { AutomationListRow } from "#/components/features/automations/automation-list-row";+import type { Automation } from "#/types/automation";++vi.mock("react-i18next", () => ({+ useTranslation: () => ({ t: (key: string) => key }),+}));++vi.mock("#/context/navigation-context", () => ({+ useNavigation: () => ({ navigate: vi.fn() }),+}));++vi.mock("#/hooks/use-has-permission", () => ({+ useHasPermission: () => true,+}));++const automation: Automation = {+ id: "automation-1",+ name: "GitHub PR Reviewer",+ prompt: "Review pull requests.",+ enabled: true,+ trigger: { type: "event" },+ repository: "acme/repo",+ model: "Claude",+ created_at: "2026-01-01T00:00:00Z",+ updated_at: "2026-01-01T00:00:00Z",+};++describe("AutomationListRow", () => {+ it("renders title, pills, and action icons in a table row layout", () => {+ render(+ <AutomationListRow+ automation={automation}+ onToggle={vi.fn()}+ onRunNow={vi.fn()}+ onDelete={vi.fn()}+ />,+ );++ expect(+ screen.getByTestId("automation-list-row-automation-1"),+ ).toBeInTheDocument();+ expect(screen.getByText("GitHub PR Reviewer")).toBeInTheDocument();+ expect(+ screen.getByTestId("automation-pills-automation-1"),+ ).toBeInTheDocument();+ expect(+ screen.getByTestId("automation-run-now-automation-1"),+ ).toHaveAttribute("aria-label", "AUTOMATIONS$RUN_NOW");+ expect(screen.getByTestId("automation-run-now-automation-1")).toHaveClass(+ "size-8",+ );+ });++ it("opens the actions menu without triggering row navigation handlers", async () => {+ const user = userEvent.setup();++ render(+ <AutomationListRow+ automation={automation}+ onToggle={vi.fn()}+ onRunNow={vi.fn()}+ onDelete={vi.fn()}+ />,+ );++ await user.click(+ screen.getByRole("button", { name: "AUTOMATIONS$ACTIONS_MENU" }),+ );++ expect(screen.getByText("COMMON$VIEW")).toBeInTheDocument();+ });+});diff --git a/__tests__/components/automations/automation-view-toggle.test.tsx b/__tests__/components/automations/automation-view-toggle.test.tsxnew file mode 100644index 0000000000..6fcbd5d60a--- /dev/null+++ b/__tests__/components/automations/automation-view-toggle.test.tsx@@ -0,0 +1,26 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, expect, it, vi } from "vitest";+import { AutomationViewToggle } from "#/components/features/automations/automation-view-toggle";++vi.mock("react-i18next", () => ({+ useTranslation: () => ({ t: (key: string) => key }),+}));++describe("AutomationViewToggle", () => {+ it("opens a menu from the icon trigger and switches to list view", async () => {+ const user = userEvent.setup();+ const onChange = vi.fn();++ render(<AutomationViewToggle view="grid" onChange={onChange} />);++ const trigger = screen.getByTestId("automations-view-toggle");+ expect(trigger).toHaveClass("size-9");+ expect(trigger).toHaveAttribute("aria-haspopup", "menu");++ await user.click(trigger);+ await user.click(screen.getByTestId("automations-view-toggle-list"));++ expect(onChange).toHaveBeenCalledWith("list");+ });+});diff --git a/__tests__/components/automations/create-instructions.test.tsx b/__tests__/components/automations/create-instructions.test.tsxindex fbfbe0f7e7..0026d52acd 100644--- a/__tests__/components/automations/create-instructions.test.tsx+++ b/__tests__/components/automations/create-instructions.test.tsx@@ -1,21 +1,62 @@-import { render, screen, fireEvent } from "@testing-library/react";-import { describe, it, expect, vi } from "vitest";+import React from "react";+import { render, screen, waitFor } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, it, expect, vi, beforeEach } from "vitest";import {NavigationProvider,type NavigationContextValue,} from "#/context/navigation-context";import { CreateInstructions } from "#/components/features/automations/create-instructions";import { I18nKey } from "#/i18n/declaration";+import { useConversationStore } from "#/stores/conversation-store";vi.mock("react-i18next", () => ({useTranslation: () => ({t: (key: string) => {const translations: Record<string, string> = {- [I18nKey.AUTOMATIONS$EMPTY_START_CONVERSATION]: "Start a conversation",+ [I18nKey.AUTOMATIONS$CREATE_AUTOMATION_BUTTON]: "Create Automation",+ [I18nKey.AUTOMATIONS$CREATE_AUTOMATION_PROMPT]: "Create an automation",+ [I18nKey.AUTOMATIONS$CREATE_INSTRUCTIONS_GUIDANCE]:+ "Include what the automation should do, when it should run, and where to send the results.",};return translations[key] || key;},}),+ Trans: ({+ i18nKey,+ components,+ }: {+ i18nKey: string;+ components?: Record<string, React.ReactElement>;+ }) => {+ if (i18nKey !== I18nKey.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC) {+ return i18nKey;+ }++ return (+ <>+ Start a new conversation and tell OpenHands to{" "}+ {components?.example+ ? React.cloneElement(+ components.example,+ {},+ <>+ {components.cmd+ ? React.cloneElement(+ components.cmd,+ {},+ "Create an automation",+ )+ : null}+ {components.punct+ ? React.cloneElement(components.punct, {}, ".")+ : null}+ </>,+ )+ : null}+ </>+ );+ },}));function renderCreateInstructions() {@@ -36,13 +77,21 @@ function renderCreateInstructions() {}describe("CreateInstructions", () => {- it("navigates to the home route via SPA routing when 'Start a conversation' is clicked", () => {+ beforeEach(() => {+ useConversationStore.setState({ messageToSend: null });+ });++ it("navigates to conversations with a prefilled prompt when Create Automation is clicked", async () => {+ const user = userEvent.setup();+ const setMessageToSend = vi.fn();+ useConversationStore.setState({ setMessageToSend });const { navigate } = renderCreateInstructions();- const link = screen.getByRole("link", { name: /start a conversation/i });- const clickEvent = fireEvent.click(link);+ await user.click(screen.getByTestId("automations-create-automation"));- expect(navigate).toHaveBeenCalledWith("/", { replace: false });- expect(clickEvent).toBe(false);+ expect(navigate).toHaveBeenCalledWith("/conversations");+ await waitFor(() => {+ expect(setMessageToSend).toHaveBeenCalledWith("Create an automation");+ });});});diff --git a/__tests__/components/automations/recommended-automations.test.tsx b/__tests__/components/automations/recommended-automations.test.tsxindex fa9cf4a1a0..fe60783b04 100644--- a/__tests__/components/automations/recommended-automations.test.tsx+++ b/__tests__/components/automations/recommended-automations.test.tsx@@ -185,6 +185,108 @@ describe("recommended automations", () => {).not.toBeInTheDocument();});+ it("shows a left-aligned MCP icon stack on each card", () => {+ render(+ <RecommendedAutomationsSection+ backendKind="local"+ installedServers={[]}+ onSelect={vi.fn()}+ />,+ );++ expect(+ screen.getByTestId("recommended-automation-icon-github-pr-reviewer"),+ ).toBeInTheDocument();+ expect(+ screen.getByTestId("recommended-automation-icon-research-brief-writer"),+ ).toHaveAttribute("data-layout", "overlap");+ expect(+ screen.getByTestId(+ "recommended-automation-icon-incident-retrospective-drafter",+ ),+ ).toHaveAttribute("data-layout", "quadrants");+ });++ it("renders missing MCP connect copy as a pill on the same row", () => {+ const offsetWidthDescriptor = Object.getOwnPropertyDescriptor(+ HTMLElement.prototype,+ "offsetWidth",+ );+ Object.defineProperty(HTMLElement.prototype, "offsetWidth", {+ configurable: true,+ get() {+ return 120;+ },+ });+ Object.defineProperty(HTMLElement.prototype, "clientWidth", {+ configurable: true,+ get() {+ return 2000;+ },+ });+ vi.stubGlobal(+ "ResizeObserver",+ class {+ observe() {}++ unobserve() {}++ disconnect() {}+ },+ );++ try {+ render(+ <RecommendedAutomationsSection+ backendKind="local"+ installedServers={[]}+ onSelect={vi.fn()}+ />,+ );++ const pillRow = screen.getByTestId(+ "recommended-automation-pills-research-brief-writer",+ );+ expect(pillRow).toHaveTextContent(+ "RECOMMENDED_AUTOMATIONS$MISSING_CONNECT:2",+ );+ expect(pillRow).toHaveClass("flex-nowrap");+ expect(pillRow).not.toHaveClass("flex-wrap");+ } finally {+ if (offsetWidthDescriptor) {+ Object.defineProperty(+ HTMLElement.prototype,+ "offsetWidth",+ offsetWidthDescriptor,+ );+ } else {+ Reflect.deleteProperty(HTMLElement.prototype, "offsetWidth");+ }+ Reflect.deleteProperty(HTMLElement.prototype, "clientWidth");+ vi.unstubAllGlobals();+ }+ });++ it("shows a decorative plus badge on each card without toggle behavior", () => {+ render(+ <RecommendedAutomationsSection+ backendKind="local"+ installedServers={[]}+ onSelect={vi.fn()}+ />,+ );++ const plusBadge = screen.getByTestId(+ "recommended-automation-plus-github-pr-reviewer",+ );+ expect(plusBadge.tagName).toBe("SPAN");+ expect(plusBadge).toHaveAttribute("aria-hidden", "true");+ expect(plusBadge.className).toContain("hover:bg-[var(--oh-interactive-hover)]");+ expect(+ plusBadge.querySelector('[role="switch"]'),+ ).not.toBeInTheDocument();+ });+it("selects a recommendation directly from its card", () => {const automation = AUTOMATION_CATALOG.find((item) => item.id === "github-pr-reviewer",diff --git a/__tests__/components/buttons/circle-plus-check-toggle.test.tsx b/__tests__/components/buttons/circle-plus-check-toggle.test.tsxnew file mode 100644index 0000000000..98fa27147f--- /dev/null+++ b/__tests__/components/buttons/circle-plus-check-toggle.test.tsx@@ -0,0 +1,122 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, expect, it, vi } from "vitest";+import {+ CirclePlusBadge,+ CirclePlusCheckToggle,+} from "#/components/shared/buttons/circle-plus-check-toggle";++describe("CirclePlusBadge", () => {+ it("renders a decorative plus with hover styles and tooltip", () => {+ render(+ <CirclePlusBadge testId="automation-plus" />,+ );++ const plusBadge = screen.getByTestId("automation-plus");+ expect(plusBadge.tagName).toBe("SPAN");+ expect(plusBadge).toHaveAttribute("aria-hidden", "true");+ expect(plusBadge.className).toContain("hover:bg-[var(--oh-interactive-hover)]");+ expect(plusBadge.className).not.toContain("group-hover/card");+ });+});++describe("CirclePlusCheckToggle", () => {+ it("toggles between plus and checkmark states", async () => {+ const user = userEvent.setup();+ const onToggle = vi.fn();++ const { rerender } = render(+ <CirclePlusCheckToggle+ testId="skill-toggle"+ isSelected={false}+ onToggle={onToggle}+ />,+ );++ const toggle = screen.getByTestId("skill-toggle");+ expect(toggle).toHaveAttribute("aria-checked", "false");+ expect(toggle).toHaveAttribute(+ "aria-label",+ "SETTINGS$SKILLS_ENABLE_SKILL",+ );++ await user.click(toggle);+ expect(onToggle).toHaveBeenCalledWith(true);++ rerender(+ <CirclePlusCheckToggle+ testId="skill-toggle"+ isSelected+ onToggle={onToggle}+ />,+ );++ expect(toggle).toHaveAttribute("aria-checked", "true");+ expect(toggle).toHaveAttribute(+ "aria-label",+ "SETTINGS$SKILLS_DISABLE_SKILL",+ );++ await user.click(toggle);+ expect(onToggle).toHaveBeenCalledWith(false);+ });++ it("shows a remove icon on hover when selected", async () => {+ const user = userEvent.setup();++ render(+ <CirclePlusCheckToggle+ testId="skill-toggle"+ isSelected+ onToggle={vi.fn()}+ />,+ );++ const toggle = screen.getByTestId("skill-toggle");+ expect(toggle).toHaveAttribute("data-showing-remove", "false");+ expect(toggle.className).toContain("border-white");+ expect(toggle.className).not.toContain("bg-white");++ await user.hover(toggle);+ expect(toggle).toHaveAttribute("data-showing-remove", "true");++ await user.unhover(toggle);+ expect(toggle).toHaveAttribute("data-showing-remove", "false");+ });++ it("does not show remove styling for keyboard focus alone", () => {+ render(+ <CirclePlusCheckToggle+ testId="skill-toggle"+ isSelected+ onToggle={vi.fn()}+ />,+ );++ const toggle = screen.getByTestId("skill-toggle");+ toggle.focus();++ expect(toggle).toHaveAttribute("data-showing-remove", "false");+ });++ it("stops click propagation for nested card handlers", async () => {+ const user = userEvent.setup();+ const onCardClick = vi.fn();+ const onToggle = vi.fn();++ render(+ <div role="button" tabIndex={0} onClick={onCardClick}>+ <CirclePlusCheckToggle+ testId="skill-toggle"+ isSelected={false}+ onToggle={onToggle}+ />+ </div>,+ );++ await user.click(screen.getByTestId("skill-toggle"));++ expect(onToggle).toHaveBeenCalledWith(true);+ expect(onCardClick).not.toHaveBeenCalled();+ });+});diff --git a/__tests__/components/features/mcp-page/custom-server-editor.test.tsx b/__tests__/components/features/mcp-page/custom-server-editor.test.tsxindex 5da761572d..486cbd0e4f 100644--- a/__tests__/components/features/mcp-page/custom-server-editor.test.tsx+++ b/__tests__/components/features/mcp-page/custom-server-editor.test.tsx@@ -9,6 +9,35 @@ import { ActiveBackendProvider } from "#/contexts/active-backend-context";import { CustomServerEditor } from "#/components/features/mcp-page/custom-server-editor";import { useSettings } from "#/hooks/query/use-settings";+import type { Settings } from "#/types/settings";+import type { MCPServerConfig } from "#/types/mcp-server";++const EDIT_STDIO_SERVER: MCPServerConfig = {+ id: "stdio-0",+ type: "stdio",+ name: "github",+ command: "docker",+ args: ["run", "-i", "--rm", "ghcr.io/github/github-mcp-server"],+};++function buildSettingsWithMcp(overrides: Partial<Settings> = {}): Settings {+ return {+ ...MOCK_DEFAULT_USER_SETTINGS,+ agent_settings: {+ ...MOCK_DEFAULT_USER_SETTINGS.agent_settings,+ mcp_config: {+ mcpServers: {+ github: {+ command: "docker",+ args: ["run", "-i", "--rm", "ghcr.io/github/github-mcp-server"],+ },+ },+ },+ },+ ...overrides,+ };+}+/*** Wrapper that only mounts the editor once `useSettings` has resolved.* `useAddMcpServer`'s `mutationFn` silently no-ops when settings is@@ -28,6 +57,18 @@ function EditorOnceSettingsLoaded({ onClose }: { onClose: () => void }) {);}+function EditEditorOnceSettingsLoaded({ onClose }: { onClose: () => void }) {+ const { data } = useSettings();+ if (!data) return null;+ return (+ <CustomServerEditor+ server={EDIT_STDIO_SERVER}+ existingServers={[EDIT_STDIO_SERVER]}+ onClose={onClose}+ />+ );+}+function renderWith(ui: React.ReactNode) {return render(ui, {wrapper: ({ children }) => (@@ -87,11 +128,50 @@ describe("CustomServerEditor", () => {});});+ it("closes from the top-right close button", async () => {+ const onClose = vi.fn();+ renderWith(<EditorOnceSettingsLoaded onClose={onClose} />);+ await screen.findByTestId("mcp-custom-editor");++ fireEvent.click(screen.getByTestId("mcp-custom-editor-close"));+ expect(onClose).toHaveBeenCalledTimes(1);+ });++ it("does not show delete in add mode", async () => {+ renderWith(<EditorOnceSettingsLoaded onClose={vi.fn()} />);+ await screen.findByTestId("mcp-custom-editor");++ expect(+ screen.queryByTestId("mcp-custom-editor-delete"),+ ).not.toBeInTheDocument();+ });++ it("deletes an installed server after confirmation", async () => {+ vi.spyOn(SettingsService, "getSettings").mockResolvedValue(+ buildSettingsWithMcp(),+ );+ const saveSpy = vi+ .spyOn(SettingsService, "saveSettings")+ .mockResolvedValue(true);++ const onClose = vi.fn();+ renderWith(<EditEditorOnceSettingsLoaded onClose={onClose} />);+ await screen.findByTestId("mcp-custom-editor");++ fireEvent.click(screen.getByTestId("mcp-custom-editor-delete"));+ expect(await screen.findByTestId("confirmation-modal")).toBeInTheDocument();++ fireEvent.click(screen.getByTestId("confirm-button"));++ await waitFor(() => expect(saveSpy).toHaveBeenCalledTimes(1));+ await waitFor(() => expect(onClose).toHaveBeenCalledTimes(1));+ });+it("calls onClose when the header close button is clicked", async () => {const onClose = vi.fn();renderWith(<EditorOnceSettingsLoaded onClose={onClose} />);- fireEvent.click(await screen.findByTestId("close-mcp-custom-editor"));+ fireEvent.click(await screen.findByTestId("mcp-custom-editor-close"));expect(onClose).toHaveBeenCalledTimes(1);});diff --git a/__tests__/components/features/mcp-page/install-server-modal.test.tsx b/__tests__/components/features/mcp-page/install-server-modal.test.tsxindex bfa6ac4787..56926d0e7c 100644--- a/__tests__/components/features/mcp-page/install-server-modal.test.tsx+++ b/__tests__/components/features/mcp-page/install-server-modal.test.tsx@@ -182,13 +182,13 @@ describe("InstallServerModal", () => {await waitFor(() => expect(saveSpy).toHaveBeenCalledTimes(1));});- it("calls onClose when the header close button is clicked", async () => {+ it("closes from the top-right close button", async () => {const onClose = vi.fn();const slack = MCP_MARKETPLACE.find((e) => e.id === "slack")!;renderWith(<InstallServerModal entry={slack} onClose={onClose} />);+ await screen.findByTestId("mcp-install-modal");- fireEvent.click(await screen.findByTestId("close-mcp-install-modal"));-+ fireEvent.click(screen.getByTestId("mcp-install-modal-close"));expect(onClose).toHaveBeenCalledTimes(1);});diff --git a/__tests__/components/features/mcp-page/mcp-logo-stack-badge.test.tsx b/__tests__/components/features/mcp-page/mcp-logo-stack-badge.test.tsxnew file mode 100644index 0000000000..a0cf0c94f1--- /dev/null+++ b/__tests__/components/features/mcp-page/mcp-logo-stack-badge.test.tsx@@ -0,0 +1,54 @@+import { render, screen } from "@testing-library/react";+import { describe, expect, it } from "vitest";+import { MCP_CATALOG } from "@openhands/extensions/mcps";+import { McpLogoStackBadge } from "#/components/features/mcp-page/mcp-logo-stack-badge";++function entry(id: string) {+ const match = MCP_CATALOG.find((item) => item.id === id);+ if (!match) {+ throw new Error(`Missing MCP catalog entry: ${id}`);+ }+ return match;+}++describe("McpLogoStackBadge", () => {+ it("renders a full-size badge for a single MCP", () => {+ render(+ <McpLogoStackBadge+ testId="automation-icon"+ entries={[entry("github")]}+ />,+ );++ const icon = screen.getByTestId("automation-icon");+ expect(icon).toHaveClass("h-10", "w-10");+ expect(icon).not.toHaveAttribute("data-layout");+ });++ it("overlaps two MCP logos on a shared grey square", () => {+ render(+ <McpLogoStackBadge+ testId="automation-icon"+ entries={[entry("tavily"), entry("notion")]}+ />,+ );++ const icon = screen.getByTestId("automation-icon");+ expect(icon).toHaveAttribute("data-layout", "overlap");+ expect(icon).toHaveClass("bg-surface-raised");+ });++ it("lays out three or four MCP logos in quadrants", () => {+ render(+ <McpLogoStackBadge+ testId="automation-icon"+ entries={[entry("slack"), entry("linear"), entry("notion")]}+ />,+ );++ expect(screen.getByTestId("automation-icon")).toHaveAttribute(+ "data-layout",+ "quadrants",+ );+ });+});diff --git a/__tests__/components/features/skills/get-skill-card-description.test.ts b/__tests__/components/features/skills/get-skill-card-description.test.tsnew file mode 100644index 0000000000..fce693ba5c--- /dev/null+++ b/__tests__/components/features/skills/get-skill-card-description.test.ts@@ -0,0 +1,53 @@+import { describe, expect, it } from "vitest";+import { getSkillCardDescription } from "#/components/features/skills/get-skill-card-description";+import type { SkillInfo } from "#/types/settings";++function buildSkill(overrides: Partial<SkillInfo> = {}): SkillInfo {+ return {+ name: "test",+ type: "knowledge",+ source: null,+ ...overrides,+ };+}++describe("getSkillCardDescription", () => {+ it("prefers the API description field when present", () => {+ expect(+ getSkillCardDescription(+ buildSkill({ description: "From API", content: "ignored body" }),+ ),+ ).toBe("From API");+ });++ it("reads description from YAML frontmatter in content", () => {+ const content = `---+description: SSH helper for remote hosts+name: SSH Microagent+---+# SSH Microagent++Body paragraph that should not be used first.+`;++ expect(getSkillCardDescription(buildSkill({ content }))).toBe(+ "SSH helper for remote hosts",+ );+ });++ it("falls back to the first body paragraph when no description exists", () => {+ const content = `# My Skill++First paragraph for the card.++Second paragraph.`;++ expect(getSkillCardDescription(buildSkill({ content }))).toBe(+ "First paragraph for the card.",+ );+ });++ it("returns an empty string when neither description nor content exists", () => {+ expect(getSkillCardDescription(buildSkill())).toBe("");+ });+});diff --git a/__tests__/components/features/skills/get-skill-chat-launch-message.test.ts b/__tests__/components/features/skills/get-skill-chat-launch-message.test.tsnew file mode 100644index 0000000000..8c6cdb24e0--- /dev/null+++ b/__tests__/components/features/skills/get-skill-chat-launch-message.test.ts@@ -0,0 +1,20 @@+import { describe, expect, it } from "vitest";+import {+ ADD_SKILL_EXAMPLE_COMMAND,+ ADD_SKILL_SKILL_NAME,+} from "#/constants/skills-docs";+import { getSkillChatLaunchMessage } from "#/components/features/skills/get-skill-chat-launch-message";++describe("getSkillChatLaunchMessage", () => {+ it("returns the full add-skill example command for the add-skill skill", () => {+ expect(getSkillChatLaunchMessage({ name: ADD_SKILL_SKILL_NAME })).toBe(+ ADD_SKILL_EXAMPLE_COMMAND,+ );+ });++ it("returns a slash-command prefix for other skills", () => {+ expect(getSkillChatLaunchMessage({ name: "agent-builder" })).toBe(+ "/agent-builder ",+ );+ });+});diff --git a/__tests__/components/features/skills/is-copyable-skill-source.test.ts b/__tests__/components/features/skills/is-copyable-skill-source.test.tsnew file mode 100644index 0000000000..cfea108d8b--- /dev/null+++ b/__tests__/components/features/skills/is-copyable-skill-source.test.ts@@ -0,0 +1,19 @@+import { describe, expect, it } from "vitest";+import { isCopyableSkillSource } from "#/components/features/skills/is-copyable-skill-source";++describe("isCopyableSkillSource", () => {+ it("returns false for scope labels and empty values", () => {+ expect(isCopyableSkillSource(null)).toBe(false);+ expect(isCopyableSkillSource("")).toBe(false);+ expect(isCopyableSkillSource("global")).toBe(false);+ expect(isCopyableSkillSource("agent")).toBe(false);+ });++ it("returns true for filesystem paths and URLs", () => {+ expect(isCopyableSkillSource("/skills/deno/SKILL.md")).toBe(true);+ expect(isCopyableSkillSource(".agents/skills/foo/SKILL.md")).toBe(true);+ expect(+ isCopyableSkillSource("https://github.com/example/skills"),+ ).toBe(true);+ });+});diff --git a/__tests__/components/features/skills/skill-card-pill-row.test.tsx b/__tests__/components/features/skills/skill-card-pill-row.test.tsxnew file mode 100644index 0000000000..52ce6e6b37--- /dev/null+++ b/__tests__/components/features/skills/skill-card-pill-row.test.tsx@@ -0,0 +1,40 @@+import { render, screen } from "@testing-library/react";+import { describe, expect, it, vi } from "vitest";+import {+ SKILL_CARD_PILL_CLASS,+ SkillCardPillRow,+} from "#/components/features/skills/skill-card-pill-row";++describe("SkillCardPillRow", () => {+ it("keeps pills on a single nowrap row with overflow handling", () => {+ vi.stubGlobal(+ "ResizeObserver",+ class {+ observe() {}++ disconnect() {}+ },+ );++ render(+ <SkillCardPillRow+ testId="skill-triggers-test"+ pills={[+ {+ id: "type-knowledge",+ node: <span className={SKILL_CARD_PILL_CLASS}>Trigger-based</span>,+ },+ {+ id: "trigger-ssh",+ node: <span className={SKILL_CARD_PILL_CLASS}>ssh</span>,+ },+ ]}+ />,+ );++ const row = screen.getByTestId("skill-triggers-test");+ expect(row).toHaveClass("flex-nowrap");+ expect(row).toHaveClass("overflow-hidden");+ expect(row).not.toHaveClass("flex-wrap");+ });+});diff --git a/__tests__/components/features/skills/skill-detail-modal.test.tsx b/__tests__/components/features/skills/skill-detail-modal.test.tsxnew file mode 100644index 0000000000..33c21f1e29--- /dev/null+++ b/__tests__/components/features/skills/skill-detail-modal.test.tsx@@ -0,0 +1,154 @@+import { render, screen, within, waitFor } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { beforeEach, describe, expect, it, vi } from "vitest";+import { SkillDetailModal } from "#/components/features/skills/skill-detail-modal";+import {+ ADD_SKILL_EXAMPLE_COMMAND,+ ADD_SKILL_SKILL_NAME,+} from "#/constants/skills-docs";+import { useConversationStore } from "#/stores/conversation-store";+import type { SkillInfo } from "#/types/settings";++const navigateMock = vi.fn();++vi.mock("#/context/navigation-context", () => ({+ useNavigation: () => ({+ navigate: navigateMock,+ currentPath: "/skills",+ conversationId: null,+ isNavigating: false,+ }),+ NavigationProvider: ({ children }: { children: React.ReactNode }) => children,+}));++function buildSkill(overrides: Partial<SkillInfo> = {}): SkillInfo {+ return {+ name: "deno",+ type: "knowledge",+ source: "/skills/deno/SKILL.md",+ description: "Deno runtime helper",+ triggers: ["deno"],+ version: "1.0.0",+ license: "MIT",+ compatibility: "Requires Deno 1.40+",+ metadata: { author: "OpenHands" },+ allowed_tools: ["bash"],+ is_agentskills_format: true,+ disable_model_invocation: false,+ content: "# Deno\n\nSkill body.",+ ...overrides,+ };+}++describe("SkillDetailModal", () => {+ beforeEach(() => {+ navigateMock.mockReset();+ });++ it("renders metadata fields and closes on request", async () => {+ const user = userEvent.setup();+ const onClose = vi.fn();+ const onToggle = vi.fn();+ const skill = buildSkill();++ render(+ <SkillDetailModal+ skill={skill}+ enabled+ onToggle={onToggle}+ onClose={onClose}+ />,+ );++ const modal = screen.getByTestId("skill-detail-modal");+ expect(+ within(modal).getByTestId(`skill-modal-name-${skill.name}`),+ ).toHaveTextContent(skill.name);+ expect(+ within(modal).getByTestId(`skill-modal-pill-${skill.name}-version`),+ ).toBeInTheDocument();+ expect(+ within(modal).getByTestId("skill-type-badge-knowledge"),+ ).toHaveTextContent("SETTINGS$SKILLS_TYPE_KNOWLEDGE");+ expect(+ within(modal).getByTestId(+ `skill-modal-pill-${skill.name}-metadata-author`,+ ),+ ).toHaveTextContent("OpenHands");+ expect(+ within(modal).getByTestId(`skill-modal-field-content-${skill.name}`),+ ).toHaveValue(skill.content);++ await user.click(within(modal).getByTestId("skill-detail-close"));+ expect(onClose).toHaveBeenCalled();+ });++ it("closes from the top-right close button", async () => {+ const user = userEvent.setup();+ const onClose = vi.fn();++ render(+ <SkillDetailModal+ skill={buildSkill()}+ enabled+ onToggle={vi.fn()}+ onClose={onClose}+ />,+ );++ await user.click(screen.getByTestId("skill-detail-modal-close"));+ expect(onClose).toHaveBeenCalledTimes(1);+ });++ it("opens a new chat with the add-skill command from the detail modal", async () => {+ const user = userEvent.setup();+ const onClose = vi.fn();+ const setMessageToSend = vi.fn();+ useConversationStore.setState({ setMessageToSend });++ render(+ <SkillDetailModal+ skill={buildSkill({ name: ADD_SKILL_SKILL_NAME })}+ enabled+ onToggle={vi.fn()}+ onClose={onClose}+ />,+ );++ await user.click(+ screen.getByTestId(`skill-detail-use-skill-${ADD_SKILL_SKILL_NAME}`),+ );++ expect(onClose).toHaveBeenCalled();+ expect(navigateMock).toHaveBeenCalledWith("/conversations");+ await waitFor(() => {+ expect(setMessageToSend).toHaveBeenCalledWith(ADD_SKILL_EXAMPLE_COMMAND);+ });+ });++ it("disables Use skill when the skill is turned off", async () => {+ const user = userEvent.setup();+ const setMessageToSend = vi.fn();+ useConversationStore.setState({ setMessageToSend });+ const skill = buildSkill({ name: ADD_SKILL_SKILL_NAME });++ render(+ <SkillDetailModal+ skill={skill}+ enabled={false}+ onToggle={vi.fn()}+ onClose={vi.fn()}+ />,+ );++ const useSkillButton = screen.getByTestId(+ `skill-detail-use-skill-${skill.name}`,+ );+ expect(useSkillButton).toBeDisabled();++ await user.click(useSkillButton);++ expect(navigateMock).not.toHaveBeenCalled();+ expect(setMessageToSend).not.toHaveBeenCalled();+ });+});diff --git a/__tests__/hooks/use-draft-persistence.test.tsx b/__tests__/hooks/use-draft-persistence.test.tsxindex 812b235d23..63836ec4b4 100644--- a/__tests__/hooks/use-draft-persistence.test.tsx+++ b/__tests__/hooks/use-draft-persistence.test.tsx@@ -10,9 +10,14 @@ vi.mock("#/utils/conversation-local-storage", () => ({setConversationState: vi.fn(),}));-// Mock the getTextContent utility+// Mock the chat-input utilities. The hook uses both `getTextContent`+// (to read the current contentEditable text) and `focusContentEditableAtEnd`+// (to place the caret at the end of the input after restoring a draft).+// Both need to be mocked here so the hook doesn't crash on+// `focusContentEditableAtEnd is not a function`.vi.mock("#/components/features/chat/utils/chat-input.utils", () => ({getTextContent: vi.fn((el: HTMLDivElement | null) => el?.textContent || ""),+ focusContentEditableAtEnd: vi.fn(),}));describe("useDraftPersistence", () => {diff --git a/__tests__/routes/automation-detail.test.tsx b/__tests__/routes/automation-detail.test.tsxindex e9f7cfee3a..37d6b5d78c 100644--- a/__tests__/routes/automation-detail.test.tsx+++ b/__tests__/routes/automation-detail.test.tsx@@ -118,8 +118,9 @@ describe("AutomationDetail — Edit is local-only", () => {expect(AutomationService.getAutomation).toHaveBeenCalledTimes(1);});- // Act — open the kebab menu.- await user.click(screen.getByLabelText("Automation actions"));+ // Act — open the kebab menu. The aria-label resolves to the I18n key+ // in tests because `t` is mocked to return the key itself.+ await user.click(screen.getByLabelText(I18nKey.AUTOMATIONS$ACTIONS_MENU));// Assert — Edit entry is present alongside the other actions.expect(@@ -139,7 +140,7 @@ describe("AutomationDetail — Edit is local-only", () => {});// Act- await user.click(screen.getByLabelText("Automation actions"));+ await user.click(screen.getByLabelText(I18nKey.AUTOMATIONS$ACTIONS_MENU));// Assert — Edit must not appear on cloud; Delete still does, proving// we opened the menu and didn't merely fail to render.diff --git a/__tests__/routes/automations-list.test.tsx b/__tests__/routes/automations-list.test.tsxindex facfb33d70..47175e9bc9 100644--- a/__tests__/routes/automations-list.test.tsx+++ b/__tests__/routes/automations-list.test.tsx@@ -104,8 +104,9 @@ describe("AutomationsList — Edit from the row kebab is local-only", () => {});await screen.findByText(automation.name);- // Act — open the row kebab and pick Edit.- await user.click(screen.getByLabelText("Automation actions"));+ // Act — open the row kebab and pick Edit. The aria-label resolves to+ // the I18n key in tests because `t` is mocked to return the key itself.+ await user.click(screen.getByLabelText(I18nKey.AUTOMATIONS$ACTIONS_MENU));await user.click(screen.getByRole("button", { name: I18nKey.AUTOMATIONS$EDIT }),);@@ -130,8 +131,9 @@ describe("AutomationsList — Edit from the row kebab is local-only", () => {});await screen.findByText(automation.name);- // Act — open the row kebab.- await user.click(screen.getByLabelText("Automation actions"));+ // Act — open the row kebab. The aria-label resolves to the I18n key+ // in tests because `t` is mocked to return the key itself.+ await user.click(screen.getByLabelText(I18nKey.AUTOMATIONS$ACTIONS_MENU));// Assert — Edit must not appear on cloud; Delete still does, proving the// menu actually opened and we didn't merely fail to render it.@@ -143,3 +145,25 @@ describe("AutomationsList — Edit from the row kebab is local-only", () => {).toBeInTheDocument();});});++describe("AutomationsList — view mode toggle", () => {+ it("switches saved automations from cards to table rows", async () => {+ const user = userEvent.setup();+ renderList();+ await waitFor(() => {+ expect(AutomationService.getAutomations).toHaveBeenCalledTimes(1);+ });+ await screen.findByTestId("automation-card-auto-1");++ await user.click(screen.getByTestId("automations-view-toggle"));+ await user.click(screen.getByTestId("automations-view-toggle-list"));++ expect(+ screen.queryByTestId("automation-card-auto-1"),+ ).not.toBeInTheDocument();+ expect(screen.getByTestId("automation-list-row-auto-1")).toBeInTheDocument();+ expect(window.localStorage.getItem("openhands-automations-view")).toBe(+ "list",+ );+ });+});diff --git a/__tests__/routes/mcp-page.test.tsx b/__tests__/routes/mcp-page.test.tsxindex 73f8f5f66b..cf164f52f1 100644--- a/__tests__/routes/mcp-page.test.tsx+++ b/__tests__/routes/mcp-page.test.tsx@@ -1,5 +1,5 @@import { QueryClient, QueryClientProvider } from "@tanstack/react-query";-import { render, screen, fireEvent, waitFor } from "@testing-library/react";+import { render, screen, within, fireEvent, waitFor } from "@testing-library/react";import { beforeEach, describe, expect, it, vi } from "vitest";import MCPPage from "#/routes/mcp";import SettingsService from "#/api/settings-service/settings-service.api";@@ -145,6 +145,42 @@ describe("MCPPage", () => {expect(screen.getByTestId("mcp-marketplace-empty")).toBeInTheDocument();});+ it("hides the library section when the section filter is Installed", async () => {+ vi.spyOn(SettingsService, "getSettings").mockResolvedValue(buildSettings());++ renderPage();++ await screen.findByTestId("mcp-marketplace-section");++ const filter = screen.getByTestId("mcp-section-filter");+ fireEvent.click(within(filter).getByTestId("dropdown-trigger"));+ fireEvent.click(screen.getByTestId("mcp-section-filter-installed"));++ await waitFor(() => {+ expect(+ screen.queryByTestId("mcp-marketplace-section"),+ ).not.toBeInTheDocument();+ });+ expect(screen.getByTestId("mcp-installed-empty")).toBeInTheDocument();+ });++ it("hides the installed section when the section filter is Library", async () => {+ vi.spyOn(SettingsService, "getSettings").mockResolvedValue(buildSettings());++ renderPage();++ await screen.findByTestId("mcp-installed-empty");++ const filter = screen.getByTestId("mcp-section-filter");+ fireEvent.click(within(filter).getByTestId("dropdown-trigger"));+ fireEvent.click(screen.getByTestId("mcp-section-filter-library"));++ await waitFor(() => {+ expect(screen.queryByTestId("mcp-installed-empty")).not.toBeInTheDocument();+ });+ expect(screen.getByTestId("mcp-marketplace-section")).toBeInTheDocument();+ });+it("shows a search-empty state when the query matches nothing", async () => {vi.spyOn(SettingsService, "getSettings").mockResolvedValue(buildSettings());@@ -160,6 +196,31 @@ describe("MCPPage", () => {});});+ it("opens the server editor when an installed server card is clicked", async () => {+ vi.spyOn(SettingsService, "getSettings").mockResolvedValue(+ buildSettings({+ agent_settings: {+ ...MOCK_DEFAULT_USER_SETTINGS.agent_settings,+ mcp_config: {+ mcpServers: {+ slack: {+ command: "npx",+ args: ["-y", "@zencoderai/slack-mcp-server"],+ env: { SLACK_BOT_TOKEN: "xoxb-abc", SLACK_TEAM_ID: "T01" },+ },+ },+ },+ },+ }),+ );++ renderPage();++ fireEvent.click(await screen.findByTestId("mcp-server-item"));++ expect(await screen.findByTestId("mcp-custom-editor")).toBeInTheDocument();+ });+it("deletes an installed stdio server through the confirmation modal", async () => {// Pre-install a Slack stdio server via the SDK-shaped mcp_config// the route reads from agent_settings.mcp_config.@@ -186,7 +247,7 @@ describe("MCPPage", () => {renderPage();- const deleteBtn = await screen.findByTestId("delete-mcp-server-button");+ const deleteBtn = await screen.findByTestId("mcp-installed-toggle-stdio-0");fireEvent.click(deleteBtn);const confirmBtn = await screen.findByTestId("confirm-button");@@ -200,11 +261,49 @@ describe("MCPPage", () => {expect(sent.mcp_config).toBeNull();});- it("badges Tavily as installed when the persisted mcp_config contains it", async () => {- // Tavily is now a regular stdio MCP entry (it used to claim to be- // a built-in driven by search_api_key, but that field was never- // forwarded to either backend). Installation status comes from- // the same mcp_config lookup as every other entry.+ it("shows the catalog description and command line on installed server cards", async () => {+ vi.spyOn(SettingsService, "getSettings").mockResolvedValue(+ buildSettings({+ agent_settings: {+ ...MOCK_DEFAULT_USER_SETTINGS.agent_settings,+ mcp_config: {+ mcpServers: {+ github: {+ command: "docker",+ args: [+ "run",+ "-i",+ "--rm",+ "-e",+ "GITHUB_PERSONAL_ACCESS_TOKEN",+ "ghcr.io/github/github-mcp-server",+ ],+ env: { GITHUB_PERSONAL_ACCESS_TOKEN: "github_pat_test" },+ },+ },+ },+ },+ }),+ );++ renderPage();++ const card = await screen.findByTestId("mcp-server-item");+ expect(+ within(card).getByTestId("mcp-server-description-stdio-0"),+ ).toHaveTextContent(+ "Search code, manage issues and pull requests, and inspect repos via the GitHub API.",+ );+ expect(+ within(card).getByTestId("mcp-server-detail-stdio-0"),+ ).toHaveTextContent(+ "docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server",+ );+ });++ it("shows Tavily marketplace toggle as add-only when installed", async () => {+ // Library cards always show the add (+) affordance so users can+ // install multiple instances of the same template.vi.spyOn(SettingsService, "getSettings").mockResolvedValue(buildSettings({agent_settings: {@@ -226,8 +325,8 @@ describe("MCPPage", () => {await screen.findByTestId("mcp-marketplace-card-tavily");expect(- screen.getByTestId("mcp-marketplace-installed-tavily"),- ).toBeInTheDocument();+ screen.getByTestId("mcp-marketplace-toggle-tavily"),+ ).toHaveAttribute("aria-checked", "false");expect(screen.getByTestId("mcp-installed-list")).toBeInTheDocument();});@@ -261,11 +360,9 @@ describe("MCPPage", () => {renderPage();const tile = await screen.findByTestId("mcp-marketplace-card-slack");- // The tile shows the Installed badge but the click should still- // open an add-flow modal — not jump to an edit form.expect(- screen.getByTestId("mcp-marketplace-installed-slack"),- ).toBeInTheDocument();+ screen.getByTestId("mcp-marketplace-toggle-slack"),+ ).toHaveAttribute("aria-checked", "false");fireEvent.click(tile);await screen.findByTestId("mcp-install-modal");diff --git a/__tests__/routes/skills-settings.test.tsx b/__tests__/routes/skills-settings.test.tsxindex 15d2be318e..21c1edd19c 100644--- a/__tests__/routes/skills-settings.test.tsx+++ b/__tests__/routes/skills-settings.test.tsx@@ -5,10 +5,26 @@ import { beforeEach, describe, expect, it, vi } from "vitest";import SkillsSettingsScreen from "#/routes/skills-settings";import SettingsService from "#/api/settings-service/settings-service.api";import SkillsService from "#/api/skills-service";+import {+ ADD_SKILL_DOCS_URL,+ ADD_SKILL_EXAMPLE_COMMAND,+} from "#/constants/skills-docs";import { MOCK_DEFAULT_USER_SETTINGS } from "#/mocks/handlers";import { Settings, SkillInfo } from "#/types/settings";import { ActiveBackendProvider } from "#/contexts/active-backend-context";+const navigateMock = vi.fn();++vi.mock("#/context/navigation-context", () => ({+ useNavigation: () => ({+ navigate: navigateMock,+ currentPath: "/skills",+ conversationId: null,+ isNavigating: false,+ }),+ NavigationProvider: ({ children }: { children: React.ReactNode }) => children,+}));+function buildSettings(overrides: Partial<Settings> = {}): Settings {return {...MOCK_DEFAULT_USER_SETTINGS,@@ -58,6 +74,7 @@ function renderSkillsSettingsScreen() {describe("SkillsSettingsScreen", () => {beforeEach(() => {vi.restoreAllMocks();+ navigateMock.mockReset();vi.spyOn(SettingsService, "getSettings").mockResolvedValue(buildSettings());});@@ -82,27 +99,78 @@ describe("SkillsSettingsScreen", () => {);});- it("surfaces the YAML description and a friendly type label instead of the raw source path", async () => {- // Arrange: a skill whose source is a long local filesystem path and whose- // type is the internal "knowledge" identifier.+ it("shows card subtitle text from skill content when description is omitted", async () => {+ const skill = buildSkill({+ name: "SSH Microagent",+ description: null,+ content: `---+description: Connect and run commands on remote machines over SSH.+---+# SSH Microagent++Full skill body.`,+ triggers: ["ssh"],+ });+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([skill]);++ renderSkillsSettingsScreen();+ const card = await screen.findByTestId(`skill-card-${skill.name}`);++ expect(+ within(card).getByTestId(`skill-description-${skill.name}`),+ ).toHaveTextContent("Connect and run commands on remote machines over SSH.");+ });++ it("surfaces the YAML description under the card title with the source path beneath it", async () => {const skill = buildSkill();vi.spyOn(SkillsService, "getSkills").mockResolvedValue([skill]);- // ActrenderSkillsSettingsScreen();const card = await screen.findByTestId(`skill-card-${skill.name}`);- // Assert: description is the primary subtitle, the type is rendered as- // its friendly label key, and the raw filesystem path is hidden until- // the user opens the Details disclosure.expect(within(card).getByTestId(`skill-description-${skill.name}`),).toHaveTextContent(skill.description!);+ expect(+ within(card).getByTestId(`skill-source-${skill.name}`),+ ).toHaveTextContent(skill.source!);+ expect(+ within(card).getByTestId(`skill-icon-${skill.name}`),+ ).toBeInTheDocument();expect(within(card).getByTestId("skill-type-badge-knowledge"),).toHaveTextContent("SETTINGS$SKILLS_TYPE_KNOWLEDGE");+ });++ it("copies the source path when the copy button is clicked", async () => {+ const user = userEvent.setup();+ const skill = buildSkill();+ const writeText = vi.fn().mockResolvedValue(undefined);+ vi.spyOn(navigator.clipboard, "writeText").mockImplementation(writeText);+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([skill]);++ renderSkillsSettingsScreen();+ const card = await screen.findByTestId(`skill-card-${skill.name}`);++ await user.click(+ within(card).getByTestId(`skill-copy-source-${skill.name}`),+ );++ expect(writeText).toHaveBeenCalledWith(skill.source);+ });++ it("hides the copy button when the source is a scope label instead of a path", async () => {+ const skill = buildSkill({ name: "add_repo_inst", source: "global" });+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([skill]);++ renderSkillsSettingsScreen();+ const card = await screen.findByTestId(`skill-card-${skill.name}`);++ expect(+ within(card).getByTestId(`skill-source-${skill.name}`),+ ).toHaveTextContent("global");expect(- within(card).queryByTestId(`skill-source-${skill.name}`),+ within(card).queryByTestId(`skill-copy-source-${skill.name}`),).not.toBeInTheDocument();});@@ -143,13 +211,15 @@ describe("SkillsSettingsScreen", () => {renderSkillsSettingsScreen();await screen.findByTestId("skill-card-deno");+ const filter = screen.getByTestId("skills-type-filter");+ await user.click(within(filter).getByTestId("dropdown-trigger"));await user.click(screen.getByTestId("skills-type-filter-repo"));expect(screen.queryByTestId("skill-card-deno")).not.toBeInTheDocument();expect(screen.getByTestId("skill-card-global-rules")).toBeInTheDocument();});- it("reveals license, compatibility, allowed tools, and source path when Details is expanded", async () => {+ it("opens a detail modal with full metadata when a skill card is clicked", async () => {const user = userEvent.setup();const skill = buildSkill({name: "rich",@@ -163,17 +233,65 @@ describe("SkillsSettingsScreen", () => {renderSkillsSettingsScreen();const card = await screen.findByTestId(`skill-card-${skill.name}`);+ await user.click(card);++ const modal = await screen.findByTestId("skill-detail-modal");+ expect(modal).toHaveAttribute("data-skill-name", skill.name);+ expect(+ within(modal).getByTestId(`skill-modal-pill-${skill.name}-license`),+ ).toHaveTextContent("MIT");+ expect(+ within(modal).getByTestId(`skill-modal-pill-${skill.name}-compatibility`),+ ).toHaveTextContent("Requires Python 3.11+");+ expect(+ within(modal).getByTestId(`skill-modal-pill-${skill.name}-tool-bash`),+ ).toHaveTextContent("bash");+ expect(+ within(modal).getByTestId(`skill-modal-pill-${skill.name}-tool-execute_bash`),+ ).toHaveTextContent("execute_bash");+ expect(+ within(modal).getByTestId(`skill-modal-toggle-${skill.name}`),+ ).toBeInTheDocument();+ });++ it("toggles a skill from the detail modal", async () => {+ const user = userEvent.setup();+ const skill = buildSkill({ name: "toggle-me" });+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([skill]);++ renderSkillsSettingsScreen();+ const card = await screen.findByTestId(`skill-card-${skill.name}`);+ await user.click(card);++ const modal = await screen.findByTestId("skill-detail-modal");+ expect(within(modal).getByText("SETTINGS$SKILLS_ENABLED")).toBeInTheDocument();+await user.click(- within(card).getByTestId(`skill-details-toggle-${skill.name}`),+ within(modal).getByTestId(`skill-modal-toggle-${skill.name}`),);- const details = within(card).getByTestId(`skill-details-${skill.name}`);- expect(details).toHaveTextContent("MIT");- expect(details).toHaveTextContent("Requires Python 3.11+");- expect(details).toHaveTextContent("execute_bash");+ expect(card).not.toHaveClass("opacity-70");expect(- within(card).getByTestId(`skill-source-${skill.name}`),- ).toHaveTextContent(skill.source!);+ within(card).getByTestId(`skill-toggle-${skill.name}`),+ ).toHaveAttribute("aria-checked", "false");+ expect(within(modal).getByText("SETTINGS$SKILLS_DISABLED")).toBeInTheDocument();+ });++ it("toggles a skill from the card without opening the modal", async () => {+ const user = userEvent.setup();+ const skill = buildSkill({ name: "card-toggle" });+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([skill]);++ renderSkillsSettingsScreen();+ const card = await screen.findByTestId(`skill-card-${skill.name}`);++ await user.click(within(card).getByTestId(`skill-toggle-${skill.name}`));++ expect(card).not.toHaveClass("opacity-70");+ expect(+ within(card).getByTestId(`skill-toggle-${skill.name}`),+ ).toHaveAttribute("aria-checked", "false");+ expect(screen.queryByTestId("skill-detail-modal")).not.toBeInTheDocument();});it("shows an empty-state message when no skills match the current filters", async () => {@@ -189,4 +307,43 @@ describe("SkillsSettingsScreen", () => {expect(screen.getByTestId("skills-no-match")).toBeInTheDocument();});++ it("opens the add skill modal with docs link and closes it", async () => {+ const user = userEvent.setup();+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([]);++ renderSkillsSettingsScreen();+ await screen.findByTestId("skills-add-skill-button");++ await user.click(screen.getByTestId("skills-add-skill-button"));++ const modal = await screen.findByTestId("add-skill-modal");+ expect(modal).toBeInTheDocument();+ expect(screen.getByTestId("add-skill-modal-example")).toHaveTextContent(+ "/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview",+ );+ expect(screen.getByTestId("add-skill-modal-docs-link")).toHaveAttribute(+ "href",+ ADD_SKILL_DOCS_URL,+ );++ await user.click(screen.getByTestId("add-skill-modal-dismiss"));++ expect(screen.queryByTestId("add-skill-modal")).not.toBeInTheDocument();+ });++ it("copies the example command from the add skill modal", async () => {+ const user = userEvent.setup();+ const writeText = vi.fn().mockResolvedValue(undefined);+ vi.spyOn(navigator.clipboard, "writeText").mockImplementation(writeText);+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([]);++ renderSkillsSettingsScreen();+ await user.click(await screen.findByTestId("skills-add-skill-button"));+ await screen.findByTestId("add-skill-modal");++ await user.click(screen.getByTestId("add-skill-modal-example-copy"));++ expect(writeText).toHaveBeenCalledWith(ADD_SKILL_EXAMPLE_COMMAND);+ });});diff --git a/__tests__/utils/extension-module-card-classes.test.ts b/__tests__/utils/extension-module-card-classes.test.tsnew file mode 100644index 0000000000..b5a219a69c--- /dev/null+++ b/__tests__/utils/extension-module-card-classes.test.ts@@ -0,0 +1,35 @@+import { describe, expect, it } from "vitest";+import {+ EXTENSION_MODULE_CARD_GRID_SINGLE_COLUMN_MAX_PX,+ EXTENSION_MODULE_CARD_INTERACTIVE_CLASS,+ extensionModuleCardGridClassName,+ extensionModuleCardGridContainerClassName,+ extensionModuleCardInteractiveClassName,+ extensionModuleCardSurfaceClassName,+} from "#/utils/extension-module-card-classes";++describe("extensionModuleCardInteractive class", () => {+ it("uses a dedicated CSS class for focus styling", () => {+ expect(EXTENSION_MODULE_CARD_INTERACTIVE_CLASS).toBe(+ "extension-module-card-interactive",+ );+ expect(extensionModuleCardInteractiveClassName).toBe(+ EXTENSION_MODULE_CARD_INTERACTIVE_CLASS,+ );+ });+});++describe("extensionModuleCardSurface class", () => {+ it("omits a resting border so tiles stay flush until hover", () => {+ expect(extensionModuleCardSurfaceClassName).not.toContain("border");+ });+});++describe("extensionModuleCardGrid classes", () => {+ it("uses a container query breakpoint at 600px column width", () => {+ expect(EXTENSION_MODULE_CARD_GRID_SINGLE_COLUMN_MAX_PX).toBe(599);+ expect(extensionModuleCardGridContainerClassName).toContain("@container");+ expect(extensionModuleCardGridClassName).toContain("@min-[600px]:grid-cols-2");+ expect(extensionModuleCardGridClassName).not.toContain("md:grid-cols-2");+ });+});diff --git a/__tests__/utils/table-row-classes.test.ts b/__tests__/utils/table-row-classes.test.tsnew file mode 100644index 0000000000..89e9192c4d--- /dev/null+++ b/__tests__/utils/table-row-classes.test.ts@@ -0,0 +1,15 @@+import { describe, expect, it } from "vitest";+import {+ tableCellClassName,+ tableRowHeightClassName,+ tableRowHoverClassName,+} from "#/utils/table-row-classes";++describe("tableRowClasses", () => {+ it("uses a fixed 44px row height and subtle hover token", () => {+ expect(tableRowHeightClassName).toBe("h-11");+ expect(tableCellClassName).toContain("px-3");+ expect(tableCellClassName).toContain("align-middle");+ expect(tableRowHoverClassName).toContain("hover:bg-interactive-hover-low");+ });+});diff --git a/src/components/features/automations/add-automation-modal.tsx b/src/components/features/automations/add-automation-modal.tsxnew file mode 100644index 0000000000..0cbf0d9820--- /dev/null+++ b/src/components/features/automations/add-automation-modal.tsx@@ -0,0 +1,47 @@+import { useTranslation } from "react-i18next";+import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";+import { ModalCloseButton } from "#/components/shared/modals/modal-close-button";+import { I18nKey } from "#/i18n/declaration";+import { CreateInstructionsContent } from "./create-instructions";++interface AddAutomationModalProps {+ isOpen: boolean;+ onClose: () => void;+}++export function AddAutomationModal({+ isOpen,+ onClose,+}: AddAutomationModalProps) {+ const { t } = useTranslation("openhands");++ if (!isOpen) return null;++ return (+ <ModalBackdrop+ onClose={onClose}+ aria-label={t(I18nKey.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}+ >+ <div+ data-testid="add-automation-modal"+ className="relative flex w-full max-w-lg flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary"+ >+ <ModalCloseButton+ onClose={onClose}+ testId="add-automation-modal-close"+ />+ <header className="flex-shrink-0 px-6 pb-4 pt-6">+ <h2+ id="add-automation-modal-title"+ className="pr-6 text-lg font-semibold"+ >+ {t(I18nKey.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}+ </h2>+ </header>+ <div className="px-6 pb-6">+ <CreateInstructionsContent onLaunch={onClose} />+ </div>+ </div>+ </ModalBackdrop>+ );+}diff --git a/src/components/features/automations/automation-action-button-classes.ts b/src/components/features/automations/automation-action-button-classes.tsnew file mode 100644index 0000000000..8d8274995a--- /dev/null+++ b/src/components/features/automations/automation-action-button-classes.ts@@ -0,0 +1,6 @@+export const automationIconActionButtonClassName =+ "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted transition-colors hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted";++/** Text + icon Run now control on automation grid cards (matches kebab height). */+export const automationRunNowTextButtonClassName =+ "inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 text-xs text-muted transition-colors hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted";diff --git a/src/components/features/automations/automation-card-skeleton.tsx b/src/components/features/automations/automation-card-skeleton.tsxindex d9b19840b8..a583cf28e8 100644--- a/src/components/features/automations/automation-card-skeleton.tsx+++ b/src/components/features/automations/automation-card-skeleton.tsx@@ -1,8 +1,10 @@+import { extensionModuleCardSurfaceClassName } from "#/utils/extension-module-card-classes";+export function AutomationCardSkeleton() {return (<divdata-testid="automation-card-skeleton"- className="rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-5"+ className={`${extensionModuleCardSurfaceClassName} border border-transparent p-4`}><div className="flex items-start justify-between"><div className="h-5 w-40 animate-pulse rounded bg-surface-raised" />diff --git a/src/components/features/automations/automation-card.tsx b/src/components/features/automations/automation-card.tsxindex 48ef191247..32dc80acd5 100644--- a/src/components/features/automations/automation-card.tsx+++ b/src/components/features/automations/automation-card.tsx@@ -1,24 +1,26 @@+import { useMemo } from "react";import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import type { Automation } from "#/types/automation";-import AutomationService from "#/api/automation-service/automation-service.api";-import { ToggleSwitch } from "./toggle-switch";-import { MetadataChip } from "./metadata-chip";import { KebabMenu } from "./kebab-menu";-import type { KebabMenuItem } from "./kebab-menu";import { useHasPermission } from "#/hooks/use-has-permission";import { useNavigation } from "#/context/navigation-context";-import FolderIcon from "#/icons/folder.svg?react";-import ClockIcon from "#/icons/clock.svg?react";-import SparkleIcon from "#/icons/sparkle.svg?react";-import PowerIcon from "#/icons/power.svg?react";-import DownloadIcon from "#/icons/download.svg?react";-import TrashIcon from "#/icons/trash.svg?react";-import EditIcon from "#/icons/u-edit.svg?react";+import PlayIcon from "#/icons/play.svg?react";+import { SkillCardPillRow } from "#/components/features/skills/skill-card-pill-row";+import { cn } from "#/utils/utils";+import {+ extensionModuleCardInteractiveClassName,+ extensionModuleCardSurfaceClassName,+} from "#/utils/extension-module-card-classes";+import { buildAutomationMetadataPills } from "./build-automation-pills";+import { buildAutomationMenuItems } from "./build-automation-menu-items";+import { automationRunNowTextButtonClassName } from "./automation-action-button-classes";interface AutomationCardProps {automation: Automation;onToggle: (id: string, enabled: boolean) => void;+ onRunNow: (id: string) => void;+ isRunPending?: boolean;onDelete: (id: string) => void;onEdit?: (id: string) => void;}@@ -26,6 +28,8 @@ interface AutomationCardProps {export function AutomationCard({automation,onToggle,+ onRunNow,+ isRunPending = false,onDelete,onEdit,}: AutomationCardProps) {@@ -35,93 +39,85 @@ export function AutomationCard({const scheduleLabel =automation.trigger.schedule_human || automation.trigger.type;+ const pills = useMemo(+ () => buildAutomationMetadataPills(automation, scheduleLabel),+ [automation, scheduleLabel],+ );- const menuItems: KebabMenuItem[] = [- ...(onEdit- ? [- {- label: t(I18nKey.AUTOMATIONS$EDIT),- icon: <EditIcon className="size-4" />,- onClick: () => onEdit(automation.id),- },- ]- : []),- {- label: automation.enabled- ? t(I18nKey.AUTOMATIONS$TURN_OFF)- : t(I18nKey.AUTOMATIONS$TURN_ON),- icon: <PowerIcon className="size-4" />,- onClick: () => onToggle(automation.id, automation.enabled),- },- {- label: t(I18nKey.AUTOMATIONS$DOWNLOAD_TARBALL),- icon: <DownloadIcon className="size-4" />,- onClick: () => {- AutomationService.downloadTarball(automation.id, automation.name);- },- },- {- label: t(I18nKey.AUTOMATIONS$DELETE),- icon: <TrashIcon className="size-4" />,- onClick: () => onDelete(automation.id),- variant: "danger",- },- ];+ const handleView = () => {+ navigate?.(`/automations/${automation.id}`);+ };++ const menuItems = buildAutomationMenuItems({+ automation,+ t,+ canManage,+ onRunNow,+ isRunPending,+ onView: handleView,+ onEdit,+ onToggle,+ onDelete,+ });const handleCardClick = () => {- navigate?.(`/automations/${automation.id}`);+ handleView();};return (<divrole="link"tabIndex={0}+ data-testid={`automation-card-${automation.id}`}onClick={handleCardClick}onKeyDown={(e) => {if (e.key === "Enter") handleCardClick();}}- className="cursor-pointer rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-5 transition-colors hover:border-[var(--oh-border)]"+ className={cn(+ "flex min-w-0 flex-col gap-3 overflow-hidden p-4 text-left",+ extensionModuleCardSurfaceClassName,+ extensionModuleCardInteractiveClassName,+ )}>- <div className="flex items-start justify-between">- <div className="min-w-0 flex-1">- <h3 className="truncate text-base font-semibold text-white">+ <header className="flex items-start justify-between gap-3">+ <div className="flex min-w-0 flex-1 flex-col gap-1.5">+ <h3 className="truncate text-sm font-semibold text-white">{automation.name}</h3>- <p className="mt-1 line-clamp-2 text-sm text-muted">- {automation.prompt}- </p>+ {automation.prompt ? (+ <p className="line-clamp-2 text-xs leading-relaxed text-tertiary-light">+ {automation.prompt}+ </p>+ ) : null}</div>- <div className="ml-4 flex shrink-0 items-center gap-2">- {canManage && (- <ToggleSwitch- enabled={automation.enabled}- label={`Toggle ${automation.name}`}- onToggle={() => onToggle(automation.id, automation.enabled)}- />- )}- {canManage && <KebabMenu items={menuItems} />}+ <div className="flex shrink-0 items-center gap-0.5">+ {canManage ? (+ <button+ type="button"+ data-testid={`automation-run-now-${automation.id}`}+ aria-busy={isRunPending}+ disabled={isRunPending}+ onClick={(event) => {+ event.stopPropagation();+ onRunNow(automation.id);+ }}+ className={automationRunNowTextButtonClassName}+ >+ <PlayIcon className="size-3.5 shrink-0" aria-hidden />+ {t(I18nKey.AUTOMATIONS$RUN_NOW)}+ </button>+ ) : null}+ <KebabMenu items={menuItems} /></div>- </div>+ </header>- <div className="mt-3 flex flex-wrap gap-2">- {automation.repository && (- <MetadataChip- icon={<FolderIcon className="size-3.5" />}- label={automation.repository}- />- )}- <MetadataChip- icon={<ClockIcon className="size-3.5" />}- label={scheduleLabel}+ {pills.length > 0 ? (+ <SkillCardPillRow+ pills={pills}+ testId={`automation-pills-${automation.id}`}/>- {automation.model && (- <MetadataChip- icon={<SparkleIcon className="size-3.5" />}- label={automation.model}- />- )}- </div>+ ) : null}</div>);}diff --git a/src/components/features/automations/automation-group.tsx b/src/components/features/automations/automation-group.tsxindex 5904965ed8..6f4acf8124 100644--- a/src/components/features/automations/automation-group.tsx+++ b/src/components/features/automations/automation-group.tsx@@ -1,12 +1,25 @@import type { Automation } from "#/types/automation";+import { cn } from "#/utils/utils";import { AutomationCard } from "./automation-card";+import { AutomationListRow } from "./automation-list-row";import { StatusBadge } from "./status-badge";+import {+ automationListTableClassName,+ type AutomationViewMode,+} from "./automation-view-mode";+import {+ extensionModuleCardGridClassName,+ extensionModuleCardGridContainerClassName,+} from "#/utils/extension-module-card-classes";interface AutomationGroupProps {title: string;count: number;automations: Automation[];+ view: AutomationViewMode;onToggle: (id: string, enabled: boolean) => void;+ onRunNow: (id: string) => void;+ runPendingId?: string | null;onDelete: (id: string) => void;onEdit?: (id: string) => void;}@@ -15,7 +28,10 @@ export function AutomationGroup({title,count,automations,+ view,onToggle,+ onRunNow,+ runPendingId = null,onDelete,onEdit,}: AutomationGroupProps) {@@ -24,20 +40,44 @@ export function AutomationGroup({return (<section><div className="flex items-center">- <h2 className="text-sm font-medium text-white">{title}</h2>+ <h2 className="text-base font-semibold text-foreground">{title}</h2><StatusBadge count={count} /></div>- <div className="mt-3 flex flex-col gap-3">- {automations.map((automation) => (- <AutomationCard- key={automation.id}- automation={automation}- onToggle={onToggle}- onDelete={onDelete}- onEdit={onEdit}- />- ))}- </div>+ {view === "grid" ? (+ <div className={cn("mt-3", extensionModuleCardGridContainerClassName)}>+ <div className={extensionModuleCardGridClassName}>+ {automations.map((automation) => (+ <AutomationCard+ key={automation.id}+ automation={automation}+ onToggle={onToggle}+ onRunNow={onRunNow}+ isRunPending={runPendingId === automation.id}+ onDelete={onDelete}+ onEdit={onEdit}+ />+ ))}+ </div>+ </div>+ ) : (+ <div className={cn(automationListTableClassName, "mt-3")}>+ <table className="w-full min-w-full [&>tbody>tr:first-child]:border-t-0">+ <tbody>+ {automations.map((automation) => (+ <AutomationListRow+ key={automation.id}+ automation={automation}+ onToggle={onToggle}+ onRunNow={onRunNow}+ isRunPending={runPendingId === automation.id}+ onDelete={onDelete}+ onEdit={onEdit}+ />+ ))}+ </tbody>+ </table>+ </div>+ )}</section>);}diff --git a/src/components/features/automations/automation-list-row.tsx b/src/components/features/automations/automation-list-row.tsxnew file mode 100644index 0000000000..fcb14929df--- /dev/null+++ b/src/components/features/automations/automation-list-row.tsx@@ -0,0 +1,127 @@+import { useMemo } from "react";+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import type { Automation } from "#/types/automation";+import { KebabMenu } from "./kebab-menu";+import { useHasPermission } from "#/hooks/use-has-permission";+import { useNavigation } from "#/context/navigation-context";+import PlayIcon from "#/icons/play.svg?react";+import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";+import { SkillCardPillRow } from "#/components/features/skills/skill-card-pill-row";+import { cn } from "#/utils/utils";+import { automationIconActionButtonClassName } from "./automation-action-button-classes";+import { buildAutomationMetadataPills } from "./build-automation-pills";+import { buildAutomationMenuItems } from "./build-automation-menu-items";+import {+ automationListRowClassName,+ automationListCellClassName,+} from "./automation-view-mode";++interface AutomationListRowProps {+ automation: Automation;+ onToggle: (id: string, enabled: boolean) => void;+ onRunNow: (id: string) => void;+ isRunPending?: boolean;+ onDelete: (id: string) => void;+ onEdit?: (id: string) => void;+}++export function AutomationListRow({+ automation,+ onToggle,+ onRunNow,+ isRunPending = false,+ onDelete,+ onEdit,+}: AutomationListRowProps) {+ const { navigate } = useNavigation();+ const { t } = useTranslation("openhands");+ const canManage = useHasPermission("manage_automations");++ const scheduleLabel =+ automation.trigger.schedule_human || automation.trigger.type;+ const pills = useMemo(+ () => buildAutomationMetadataPills(automation, scheduleLabel),+ [automation, scheduleLabel],+ );++ const handleView = () => {+ navigate?.(`/automations/${automation.id}`);+ };++ const menuItems = buildAutomationMenuItems({+ automation,+ t,+ canManage,+ onRunNow,+ isRunPending,+ onView: handleView,+ onEdit,+ onToggle,+ onDelete,+ });++ const handleRowClick = () => {+ handleView();+ };++ return (+ <tr+ data-testid={`automation-list-row-${automation.id}`}+ onClick={handleRowClick}+ onKeyDown={(event) => {+ if (event.key === "Enter") {+ handleRowClick();+ }+ }}+ tabIndex={0}+ className={cn(automationListRowClassName, "cursor-pointer")}+ >+ <td className={automationListCellClassName}>+ <div className="flex min-w-0 items-center gap-1.5">+ <span+ className="max-w-[40%] shrink-0 truncate text-sm font-medium text-white"+ title={automation.name}+ >+ {automation.name}+ </span>+ {pills.length > 0 ? (+ <div className="min-w-0 flex-1">+ <SkillCardPillRow+ pills={pills}+ testId={`automation-pills-${automation.id}`}+ />+ </div>+ ) : null}+ </div>+ </td>++ <td className={cn("w-0 whitespace-nowrap", automationListCellClassName)}>+ <div className="flex items-center justify-end gap-0.5">+ {canManage ? (+ <StyledTooltip+ content={t(I18nKey.AUTOMATIONS$RUN_NOW)}+ placement="top"+ >+ <button+ type="button"+ data-testid={`automation-run-now-${automation.id}`}+ aria-label={t(I18nKey.AUTOMATIONS$RUN_NOW)}+ aria-busy={isRunPending}+ disabled={isRunPending}+ onClick={(event) => {+ event.stopPropagation();+ onRunNow(automation.id);+ }}+ className={automationIconActionButtonClassName}+ >+ <PlayIcon className="size-4 shrink-0" aria-hidden />+ </button>+ </StyledTooltip>+ ) : null}+ <KebabMenu items={menuItems} />+ </div>+ </td>+ </tr>+ );+}diff --git a/src/components/features/automations/automation-view-mode.ts b/src/components/features/automations/automation-view-mode.tsnew file mode 100644index 0000000000..bdb4c3bba5--- /dev/null+++ b/src/components/features/automations/automation-view-mode.ts@@ -0,0 +1,22 @@+export type AutomationViewMode = "grid" | "list";++export const AUTOMATIONS_VIEW_MODE_STORAGE_KEY = "openhands-automations-view";++export function readStoredAutomationViewMode(): AutomationViewMode {+ if (typeof window === "undefined") {+ return "grid";+ }++ const stored = window.localStorage.getItem(AUTOMATIONS_VIEW_MODE_STORAGE_KEY);+ return stored === "list" ? "list" : "grid";+}++export function writeStoredAutomationViewMode(view: AutomationViewMode): void {+ window.localStorage.setItem(AUTOMATIONS_VIEW_MODE_STORAGE_KEY, view);+}++export {+ tableContainerClassName as automationListTableClassName,+ tableRowInteractiveClassName as automationListRowClassName,+ tableCellClassName as automationListCellClassName,+} from "#/utils/table-row-classes";diff --git a/src/components/features/automations/automation-view-toggle.tsx b/src/components/features/automations/automation-view-toggle.tsxnew file mode 100644index 0000000000..64dba89c48--- /dev/null+++ b/src/components/features/automations/automation-view-toggle.tsx@@ -0,0 +1,175 @@+import { useEffect, useLayoutEffect, useRef, useState } from "react";+import ReactDOM from "react-dom";+import { Check, Grid2x2, Rows3 } from "lucide-react";+import { useTranslation } from "react-i18next";+import { ContextMenuListItem } from "#/components/features/context-menu/context-menu-list-item";+import { I18nKey } from "#/i18n/declaration";+import { ContextMenu } from "#/ui/context-menu";+import { cn } from "#/utils/utils";+import type { AutomationViewMode } from "./automation-view-mode";++interface AutomationViewToggleProps {+ view: AutomationViewMode;+ onChange: (view: AutomationViewMode) => void;+}++const VIEW_OPTIONS: {+ value: AutomationViewMode;+ icon: typeof Grid2x2;+ labelKey: I18nKey;+ testId: string;+}[] = [+ {+ value: "grid",+ icon: Grid2x2,+ labelKey: I18nKey.AUTOMATIONS$VIEW_GRID,+ testId: "automations-view-toggle-grid",+ },+ {+ value: "list",+ icon: Rows3,+ labelKey: I18nKey.AUTOMATIONS$VIEW_LIST,+ testId: "automations-view-toggle-list",+ },+];++function ViewMenuItemContent({+ icon: Icon,+ label,+ isSelected,+}: {+ icon: typeof Grid2x2;+ label: string;+ isSelected: boolean;+}) {+ return (+ <span className="flex min-w-0 w-full items-center gap-2">+ <span+ className="flex shrink-0 items-center text-[var(--oh-muted)] transition-colors group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:size-4 [&_svg]:text-current"+ aria-hidden+ >+ <Icon />+ </span>+ <span className="min-w-0 flex-1 truncate">{label}</span>+ {isSelected ? <Check className="size-4 shrink-0" aria-hidden /> : null}+ </span>+ );+}++export function AutomationViewToggle({+ view,+ onChange,+}: AutomationViewToggleProps) {+ const { t } = useTranslation("openhands");+ const [open, setOpen] = useState(false);+ const [portalStyle, setPortalStyle] = useState<React.CSSProperties>();+ const triggerRef = useRef<HTMLButtonElement>(null);+ const menuRef = useRef<HTMLUListElement>(null);++ const activeOption =+ VIEW_OPTIONS.find((option) => option.value === view) ?? VIEW_OPTIONS[0]!;+ const ActiveIcon = activeOption.icon;++ useLayoutEffect(() => {+ if (!open || !triggerRef.current) return undefined;++ const updatePosition = () => {+ const rect = triggerRef.current?.getBoundingClientRect();+ if (!rect) return;++ const gap = 4;+ setPortalStyle({+ position: "fixed",+ zIndex: 9999,+ top: rect.bottom + gap,+ right: window.innerWidth - rect.right,+ });+ };++ updatePosition();+ window.addEventListener("resize", updatePosition);+ window.addEventListener("scroll", updatePosition, true);+ return () => {+ window.removeEventListener("resize", updatePosition);+ window.removeEventListener("scroll", updatePosition, true);+ };+ }, [open]);++ useEffect(() => {+ if (!open) return undefined;++ const handleClickOutside = (event: MouseEvent) => {+ const target = event.target as Node;+ if (+ triggerRef.current?.contains(target) ||+ menuRef.current?.contains(target)+ ) {+ return;+ }+ setOpen(false);+ };++ const handleEscape = (event: KeyboardEvent) => {+ if (event.key === "Escape") {+ setOpen(false);+ }+ };++ document.addEventListener("mousedown", handleClickOutside);+ document.addEventListener("keydown", handleEscape);+ return () => {+ document.removeEventListener("mousedown", handleClickOutside);+ document.removeEventListener("keydown", handleEscape);+ };+ }, [open]);++ const menu =+ open && portalStyle ? (+ <ContextMenu ref={menuRef} theme="popover" className="min-w-[10rem]">+ {VIEW_OPTIONS.map((option) => (+ <li key={option.value}>+ <ContextMenuListItem+ testId={option.testId}+ onClick={() => {+ onChange(option.value);+ setOpen(false);+ }}+ className="group"+ >+ <ViewMenuItemContent+ icon={option.icon}+ label={t(option.labelKey)}+ isSelected={view === option.value}+ />+ </ContextMenuListItem>+ </li>+ ))}+ </ContextMenu>+ ) : null;++ return (+ <>+ <button+ ref={triggerRef}+ type="button"+ data-testid="automations-view-toggle"+ aria-label={t(I18nKey.AUTOMATIONS$VIEW_MODE)}+ aria-haspopup="menu"+ aria-expanded={open}+ onClick={() => setOpen((current) => !current)}+ className={cn(+ "inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-[var(--oh-border)] bg-base-secondary text-white transition-colors hover:bg-[var(--oh-interactive-hover)] focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20",+ )}+ >+ <ActiveIcon className="size-4" aria-hidden />+ </button>++ {open && portalStyle && typeof document !== "undefined"+ ? ReactDOM.createPortal(+ <div style={portalStyle}>{menu}</div>,+ document.body,+ )+ : null}+ </>+ );+}diff --git a/src/components/features/automations/build-automation-menu-items.tsx b/src/components/features/automations/build-automation-menu-items.tsxnew file mode 100644index 0000000000..a9ffe0e3e4--- /dev/null+++ b/src/components/features/automations/build-automation-menu-items.tsx@@ -0,0 +1,75 @@+import { FileText } from "lucide-react";+import PlayIcon from "#/icons/play.svg?react";+import PowerIcon from "#/icons/power.svg?react";+import TrashIcon from "#/icons/trash.svg?react";+import EditIcon from "#/icons/u-edit.svg?react";+import { I18nKey } from "#/i18n/declaration";+import type { Automation } from "#/types/automation";+import type { KebabMenuItem } from "./kebab-menu";++interface BuildAutomationMenuItemsOptions {+ automation: Automation;+ t: (key: I18nKey) => string;+ canManage: boolean;+ onRunNow: (id: string) => void;+ isRunPending: boolean;+ onView: () => void;+ onEdit?: (id: string) => void;+ onToggle: (id: string, enabled: boolean) => void;+ onDelete: (id: string) => void;+}++export function buildAutomationMenuItems({+ automation,+ t,+ canManage,+ onRunNow,+ isRunPending,+ onView,+ onEdit,+ onToggle,+ onDelete,+}: BuildAutomationMenuItemsOptions): KebabMenuItem[] {+ return [+ ...(canManage+ ? [+ {+ label: t(I18nKey.AUTOMATIONS$RUN_NOW),+ icon: <PlayIcon className="size-4" />,+ onClick: () => onRunNow(automation.id),+ disabled: isRunPending,+ },+ ]+ : []),+ {+ label: t(I18nKey.COMMON$VIEW),+ icon: <FileText className="size-4" aria-hidden />,+ onClick: onView,+ },+ ...(canManage && onEdit+ ? [+ {+ label: t(I18nKey.AUTOMATIONS$EDIT),+ icon: <EditIcon className="size-4" />,+ onClick: () => onEdit(automation.id),+ },+ ]+ : []),+ ...(canManage+ ? [+ {+ label: automation.enabled+ ? t(I18nKey.AUTOMATIONS$TURN_OFF)+ : t(I18nKey.AUTOMATIONS$TURN_ON),+ icon: <PowerIcon className="size-4" />,+ onClick: () => onToggle(automation.id, automation.enabled),+ },+ {+ label: t(I18nKey.AUTOMATIONS$DELETE),+ icon: <TrashIcon className="size-4" />,+ onClick: () => onDelete(automation.id),+ },+ ]+ : []),+ ];+}diff --git a/src/components/features/automations/build-automation-pills.tsx b/src/components/features/automations/build-automation-pills.tsxnew file mode 100644index 0000000000..b0c7bf1d41--- /dev/null+++ b/src/components/features/automations/build-automation-pills.tsx@@ -0,0 +1,50 @@+import FolderIcon from "#/icons/folder.svg?react";+import ClockIcon from "#/icons/clock.svg?react";+import SparkleIcon from "#/icons/sparkle.svg?react";+import type { SkillCardPill } from "#/components/features/skills/skill-card-pill-row";+import type { Automation } from "#/types/automation";+import { cn } from "#/utils/utils";+import { extensionModuleCardPillClassName } from "#/utils/extension-module-card-classes";++export function buildAutomationMetadataPills(+ automation: Automation,+ scheduleLabel: string,+): SkillCardPill[] {+ const pills: SkillCardPill[] = [];++ if (automation.repository) {+ pills.push({+ id: "repository",+ node: (+ <span className={cn(extensionModuleCardPillClassName, "gap-1")}>+ <FolderIcon className="size-3 shrink-0" />+ {automation.repository}+ </span>+ ),+ });+ }++ pills.push({+ id: "schedule",+ node: (+ <span className={cn(extensionModuleCardPillClassName, "gap-1")}>+ <ClockIcon className="size-3 shrink-0" />+ {scheduleLabel}+ </span>+ ),+ });++ if (automation.model) {+ pills.push({+ id: "model",+ node: (+ <span className={cn(extensionModuleCardPillClassName, "gap-1")}>+ <SparkleIcon className="size-3 shrink-0" />+ {automation.model}+ </span>+ ),+ });+ }++ return pills;+}diff --git a/src/components/features/automations/create-instructions.tsx b/src/components/features/automations/create-instructions.tsxindex e939188c20..415457cedb 100644--- a/src/components/features/automations/create-instructions.tsx+++ b/src/components/features/automations/create-instructions.tsx@@ -1,91 +1,103 @@-import { useState } from "react";-import { useTranslation } from "react-i18next";+import { useState, type ReactNode } from "react";+import { Trans, useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";-import TerminalIcon from "#/icons/terminal.svg?react";-import SparkleIcon from "#/icons/sparkle.svg?react";import ChevronDownIcon from "#/icons/chevron-down.svg?react";+import MessageSquareShareIcon from "#/icons/message-square-share.svg?react";import { cn } from "#/utils/utils";-import { NavigationLink } from "#/components/shared/navigation-link";+import { BrandButton } from "#/components/features/settings/brand-button";+import { useLaunchSkillInChat } from "#/hooks/use-launch-skill-in-chat";const DOCS_URL ="https://docs.openhands.dev/openhands/usage/automations/overview";-const NEW_CONVERSATION_URL = "/";-const PLUGIN_COMMAND = "/openhands-automation create";-const PLUGIN_INSTALL_URL =- "https://github.com/OpenHands/extensions#quick-start";++function InlineExampleWrap({ children }: { children?: ReactNode }) {+ return <span className="whitespace-nowrap">{children}</span>;+}++function InlineCodeChip({ children }: { children?: ReactNode }) {+ return (+ <code+ data-testid="automations-create-instructions-example"+ className={cn(+ "mx-0.5 inline-block rounded-sm border border-[var(--oh-border-subtle)]",+ "bg-[var(--oh-surface-raised)] px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white",+ )}+ >+ {children}+ </code>+ );+}++function InlinePunctuation({ children }: { children?: ReactNode }) {+ return <>{children}</>;+}++const CREATE_INSTRUCTIONS_INLINE_COMPONENTS = {+ example: <InlineExampleWrap />,+ cmd: <InlineCodeChip />,+ punct: <InlinePunctuation />,+};interface CreateInstructionsProps {/** If true, the instructions are collapsible and start collapsed */collapsible?: boolean;}-export function CreateInstructions({- collapsible = false,-}: CreateInstructionsProps) {+interface CreateInstructionsContentProps {+ onLaunch?: () => void;+}++export function CreateInstructionsContent({+ onLaunch,+}: CreateInstructionsContentProps = {}) {const { t } = useTranslation("openhands");- const [isExpanded, setIsExpanded] = useState(!collapsible);+ const launchInChat = useLaunchSkillInChat();- const content = (- <>- <div className="mt-4 grid gap-4 sm:grid-cols-2">- {/* Option 1: Claude Code / Codex */}- <div className="rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)] p-4">- <div className="flex items-center gap-2">- <TerminalIcon className="size-5 text-muted" />- <span className="text-sm font-medium text-content">- {t(I18nKey.AUTOMATIONS$EMPTY_OPTION_PLUGIN_TITLE)}- </span>- </div>- <p className="mt-2 text-sm text-muted">- <a- href={PLUGIN_INSTALL_URL}- target="_blank"- rel="noopener noreferrer"- className="underline hover:text-foreground transition-colors"- >- {t(I18nKey.AUTOMATIONS$EMPTY_INSTALL_PLUGIN)}- </a>{" "}- {t(I18nKey.AUTOMATIONS$EMPTY_OPTION_PLUGIN_DESC)}- </p>- <code className="mt-2 block rounded bg-surface-raised px-3 py-2 font-mono text-xs text-content">- {PLUGIN_COMMAND}- </code>- </div>+ const handleCreateAutomation = () => {+ launchInChat(t(I18nKey.AUTOMATIONS$CREATE_AUTOMATION_PROMPT), onLaunch);+ };- {/* Option 2: OpenHands Cloud conversation */}- <div className="rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)] p-4">- <div className="flex items-center gap-2">- <SparkleIcon className="size-5 text-muted" />- <span className="text-sm font-medium text-content">- {t(I18nKey.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_TITLE)}- </span>- </div>- <p className="mt-2 text-sm text-muted">- {t(I18nKey.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC)}- </p>- <NavigationLink- to={NEW_CONVERSATION_URL}- className="mt-2 inline-flex items-center gap-1 rounded-md bg-surface-raised px-3 py-2 text-xs font-normal text-content hover:bg-surface-raised transition-colors"- >- {t(I18nKey.AUTOMATIONS$EMPTY_START_CONVERSATION)}- <span aria-hidden="true">→</span>- </NavigationLink>- </div>- </div>+ return (+ <div className="flex flex-col gap-5">+ <p className="text-sm leading-relaxed text-tertiary-light">+ <Trans+ ns="openhands"+ i18nKey={I18nKey.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC}+ components={CREATE_INSTRUCTIONS_INLINE_COMPONENTS}+ />{" "}+ {t(I18nKey.AUTOMATIONS$CREATE_INSTRUCTIONS_GUIDANCE)}+ </p>- {/* Documentation link */}- <p className="mt-4 text-center text-sm text-muted">+ <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between"><ahref={DOCS_URL}target="_blank"rel="noopener noreferrer"- className="underline hover:text-foreground transition-colors"+ className="text-sm text-muted underline transition-colors hover:text-foreground">{t(I18nKey.AUTOMATIONS$EMPTY_LEARN_MORE)}</a>- </p>- </>+ <BrandButton+ type="button"+ variant="primary"+ testId="automations-create-automation"+ onClick={handleCreateAutomation}+ startContent={+ <MessageSquareShareIcon className="size-4" aria-hidden />+ }+ >+ {t(I18nKey.AUTOMATIONS$CREATE_AUTOMATION_BUTTON)}+ </BrandButton>+ </div>+ </div>);+}++export function CreateInstructions({+ collapsible = false,+}: CreateInstructionsProps) {+ const { t } = useTranslation("openhands");+ const [isExpanded, setIsExpanded] = useState(!collapsible);if (collapsible) {return (@@ -94,7 +106,7 @@ export function CreateInstructions({type="button"onClick={() => setIsExpanded(!isExpanded)}aria-expanded={isExpanded}- className="flex w-full items-center justify-between p-4 text-left hover:bg-surface-raised transition-colors rounded-lg"+ className="flex w-full items-center justify-between rounded-lg p-4 text-left transition-colors hover:bg-surface-raised"><span className="text-sm font-normal text-content">{t(I18nKey.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}@@ -106,7 +118,11 @@ export function CreateInstructions({)}/></button>- {isExpanded && <div className="px-4 pb-4">{content}</div>}+ {isExpanded ? (+ <div className="px-4 pb-4">+ <CreateInstructionsContent />+ </div>+ ) : null}</div>);}@@ -116,7 +132,9 @@ export function CreateInstructions({<h3 className="text-center text-sm font-medium text-content">{t(I18nKey.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}</h3>- {content}+ <div className="mt-4">+ <CreateInstructionsContent />+ </div></div>);}diff --git a/src/components/features/automations/detail/activity-log-section.tsx b/src/components/features/automations/detail/activity-log-section.tsxindex f76ea1a01f..d6c552506e 100644--- a/src/components/features/automations/detail/activity-log-section.tsx+++ b/src/components/features/automations/detail/activity-log-section.tsx@@ -24,7 +24,7 @@ export function ActivityLogSection({ automationId }: ActivityLogSectionProps) {return (<div className="rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]">- <div className="flex items-center gap-2 border-b border-[var(--oh-border)] px-5 pb-3 pt-4">+ <div className="flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3"><span className="size-4 text-muted"><ActivityIcon className="size-4" /></span>diff --git a/src/components/features/automations/detail/detail-header.tsx b/src/components/features/automations/detail/detail-header.tsxindex f478bc3646..cf26228f1d 100644--- a/src/components/features/automations/detail/detail-header.tsx+++ b/src/components/features/automations/detail/detail-header.tsx@@ -63,7 +63,6 @@ export function DetailHeader({label: t(I18nKey.AUTOMATIONS$DELETE),icon: <TrashIcon className="size-4" />,onClick: onDelete,- variant: "danger" as const,},];diff --git a/src/components/features/automations/detail/section-card.tsx b/src/components/features/automations/detail/section-card.tsxindex 49428bb1b8..258baa3c18 100644--- a/src/components/features/automations/detail/section-card.tsx+++ b/src/components/features/automations/detail/section-card.tsx@@ -7,7 +7,7 @@ interface SectionCardProps {export function SectionCard({ icon, title, children }: SectionCardProps) {return (<div className="rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]">- <div className="flex items-center gap-2 border-b border-[var(--oh-border)] px-5 pb-3 pt-4">+ <div className="flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3"><span className="size-4 text-muted">{icon}</span><h3 className="text-sm font-medium text-content">{title}</h3></div>diff --git a/src/components/features/automations/empty-state.tsx b/src/components/features/automations/empty-state.tsxindex 0a4eb0bddd..64b8b35379 100644--- a/src/components/features/automations/empty-state.tsx+++ b/src/components/features/automations/empty-state.tsx@@ -1,17 +1,21 @@import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";-import DatabaseIcon from "#/icons/database.svg?react";+import { extensionModuleEmptyStateClassName } from "#/utils/extension-module-card-classes";import { CreateInstructions } from "./create-instructions";export function EmptyState() {const { t } = useTranslation("openhands");return (- <div className="flex flex-col items-center justify-center py-12">- <DatabaseIcon className="size-12 text-muted" />- <p className="mt-4 text-sm text-muted">{t(I18nKey.AUTOMATIONS$EMPTY)}</p>+ <div+ data-testid="automations-empty"+ className={extensionModuleEmptyStateClassName}+ >+ <p className="text-sm text-white">{t(I18nKey.AUTOMATIONS$EMPTY)}</p>+ <p className="mt-1 text-xs text-tertiary-light">+ {t(I18nKey.AUTOMATIONS$EMPTY_HINT)}+ </p>- {/* How to create section */}<div className="mt-8 flex justify-center"><CreateInstructions /></div>diff --git a/src/components/features/automations/kebab-menu.tsx b/src/components/features/automations/kebab-menu.tsxindex e3db688895..01f5903183 100644--- a/src/components/features/automations/kebab-menu.tsx+++ b/src/components/features/automations/kebab-menu.tsx@@ -1,12 +1,36 @@-import { useState, useEffect, useRef } from "react";+import { useState, useEffect, useLayoutEffect, useRef } from "react";+import ReactDOM from "react-dom";+import { useTranslation } from "react-i18next";import KebabVerticalIcon from "#/icons/kebab-vertical.svg?react";-import { cn } from "#/utils/utils";+import { ContextMenuListItem } from "#/components/features/context-menu/context-menu-list-item";+import { I18nKey } from "#/i18n/declaration";+import { ContextMenu } from "#/ui/context-menu";+import { automationIconActionButtonClassName } from "./automation-action-button-classes";export interface KebabMenuItem {label: string;icon: React.ReactNode;onClick: () => void;- variant?: "default" | "danger";+ disabled?: boolean;+}++interface KebabMenuItemContentProps {+ icon: React.ReactNode;+ label: string;+}++function KebabMenuItemContent({ icon, label }: KebabMenuItemContentProps) {+ return (+ <span className="flex min-w-0 w-full items-center gap-2">+ <span+ className="flex shrink-0 items-center text-[var(--oh-muted)] transition-colors group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:size-4 [&_svg]:text-current"+ aria-hidden+ >+ {icon}+ </span>+ <span className="min-w-0 flex-1 truncate">{label}</span>+ </span>+ );}interface KebabMenuProps {@@ -14,58 +38,109 @@ interface KebabMenuProps {}export function KebabMenu({ items }: KebabMenuProps) {+ const { t } = useTranslation("openhands");const [open, setOpen] = useState(false);- const menuRef = useRef<HTMLDivElement>(null);+ const [portalStyle, setPortalStyle] = useState<React.CSSProperties>();+ const triggerRef = useRef<HTMLButtonElement>(null);+ const menuRef = useRef<HTMLUListElement>(null);++ useLayoutEffect(() => {+ if (!open || !triggerRef.current) return undefined;++ const updatePosition = () => {+ const rect = triggerRef.current?.getBoundingClientRect();+ if (!rect) return;++ const gap = 4;+ setPortalStyle({+ position: "fixed",+ zIndex: 9999,+ top: rect.bottom + gap,+ right: window.innerWidth - rect.right,+ });+ };++ updatePosition();+ window.addEventListener("resize", updatePosition);+ window.addEventListener("scroll", updatePosition, true);+ return () => {+ window.removeEventListener("resize", updatePosition);+ window.removeEventListener("scroll", updatePosition, true);+ };+ }, [open]);useEffect(() => {if (!open) return undefined;- const handleClickOutside = (e: MouseEvent) => {- if (menuRef.current && !menuRef.current.contains(e.target as Node)) {+ const handleClickOutside = (event: MouseEvent) => {+ const target = event.target as Node;+ if (+ triggerRef.current?.contains(target) ||+ menuRef.current?.contains(target)+ ) {+ return;+ }+ setOpen(false);+ };++ const handleEscape = (event: KeyboardEvent) => {+ if (event.key === "Escape") {setOpen(false);}};document.addEventListener("mousedown", handleClickOutside);- return () => document.removeEventListener("mousedown", handleClickOutside);+ document.addEventListener("keydown", handleEscape);+ return () => {+ document.removeEventListener("mousedown", handleClickOutside);+ document.removeEventListener("keydown", handleEscape);+ };}, [open]);+ const menu =+ open && portalStyle ? (+ <ContextMenu ref={menuRef} theme="popover" className="min-w-[10rem]">+ {items.map((item) => (+ <li key={item.label}>+ <ContextMenuListItem+ onClick={(event) => {+ event.stopPropagation();+ item.onClick();+ setOpen(false);+ }}+ isDisabled={item.disabled}+ className="group"+ >+ <KebabMenuItemContent icon={item.icon} label={item.label} />+ </ContextMenuListItem>+ </li>+ ))}+ </ContextMenu>+ ) : null;+return (- <div ref={menuRef} className="relative">+ <><button+ ref={triggerRef}type="button"onClick={(e) => {e.stopPropagation();- setOpen(!open);+ setOpen((current) => !current);}}- className="flex size-8 cursor-pointer items-center justify-center rounded border border-[var(--oh-border)] bg-surface hover:bg-surface-raised"- aria-label="Automation actions"+ className={automationIconActionButtonClassName}+ aria-label={t(I18nKey.AUTOMATIONS$ACTIONS_MENU)}+ aria-expanded={open}+ aria-haspopup="menu">- <KebabVerticalIcon className="size-4 text-muted" />+ <KebabVerticalIcon className="size-4" /></button>- {open && (- <div className="absolute right-0 top-full z-10 mt-1 w-36 rounded-lg border border-[var(--oh-border)] bg-surface-raised py-1 shadow-lg">- {items.map((item) => (- <button- key={item.label}- type="button"- onClick={(e) => {- e.stopPropagation();- item.onClick();- setOpen(false);- }}- className={cn(- "flex w-full cursor-pointer items-center gap-2 px-4 py-2 text-sm hover:bg-[var(--oh-interactive-hover)]",- item.variant === "danger" ? "text-danger" : "text-white",- )}- >- {item.icon}- {item.label}- </button>- ))}- </div>- )}- </div>+ {open && portalStyle && typeof document !== "undefined"+ ? ReactDOM.createPortal(+ <div style={portalStyle}>{menu}</div>,+ document.body,+ )+ : null}+ </>);}diff --git a/src/components/features/automations/metadata-chip.tsx b/src/components/features/automations/metadata-chip.tsxindex 595667d1f2..5b5e46f054 100644--- a/src/components/features/automations/metadata-chip.tsx+++ b/src/components/features/automations/metadata-chip.tsx@@ -1,3 +1,6 @@+import { cn } from "#/utils/utils";+import { extensionModuleCardPillClassName } from "#/utils/extension-module-card-classes";+interface MetadataChipProps {icon: React.ReactNode;label: string;@@ -5,7 +8,7 @@ interface MetadataChipProps {export function MetadataChip({ icon, label }: MetadataChipProps) {return (- <span className="inline-flex items-center gap-1.5 rounded-full border border-[var(--oh-border)] px-3 py-1 text-xs text-muted">+ <span className={cn(extensionModuleCardPillClassName, "gap-1")}>{icon}{label}</span>diff --git a/src/components/features/automations/recommended-automations-section.tsx b/src/components/features/automations/recommended-automations-section.tsxindex 94baaaf13e..142eb820b2 100644--- a/src/components/features/automations/recommended-automations-section.tsx+++ b/src/components/features/automations/recommended-automations-section.tsx@@ -1,4 +1,5 @@import { useTranslation } from "react-i18next";+import type { TFunction } from "i18next";import { I18nKey } from "#/i18n/declaration";import {AUTOMATION_CATALOG,@@ -8,13 +9,27 @@ import {MCP_CATALOG as MCP_MARKETPLACE,type McpCatalogEntry as MarketplaceEntry,} from "@openhands/extensions/mcps";+import { McpLogoStackBadge } from "#/components/features/mcp-page/mcp-logo-stack-badge";import { McpLogoBadge } from "#/components/features/mcp-logo-badge";+import {+ SkillCardPillRow,+ type SkillCardPill,+} from "#/components/features/skills/skill-card-pill-row";+import { CirclePlusBadge } from "#/components/shared/buttons/circle-plus-check-toggle";import { MCPServerConfig } from "#/types/mcp-server";import {findInstalledMatch,getMarketplaceEntryById,isMarketplaceEntryAvailable,} from "#/utils/mcp-marketplace-utils";+import { cn } from "#/utils/utils";+import {+ extensionModuleCardInteractiveClassName,+ extensionModuleCardGridClassName,+ extensionModuleCardGridContainerClassName,+ extensionModuleCardPillClassName,+ extensionModuleCardSurfaceClassName,+} from "#/utils/extension-module-card-classes";import ClockIcon from "#/icons/clock.svg?react";import { StatusBadge } from "./status-badge";@@ -75,6 +90,60 @@ function isAutomationAvailable();}+function buildRecommendedAutomationPills(+ automation: RecommendedAutomation,+ requiredEntries: MarketplaceEntry[],+ installedServers: MCPServerConfig[],+ missingCount: number,+ translate: TFunction,+): SkillCardPill[] {+ const pills: SkillCardPill[] = requiredEntries.map((entry) => {+ const installed = !!findInstalledMatch(entry.template, installedServers);++ return {+ id: `mcp-${entry.id}`,+ node: (+ <span className={cn(extensionModuleCardPillClassName, "gap-1")}>+ <McpLogoBadge entry={entry} size="xs" />+ {entry.name}+ {installed ? (+ <span className="text-white">+ {translate(I18nKey.RECOMMENDED_AUTOMATIONS$CONNECTED)}+ </span>+ ) : null}+ </span>+ ),+ };+ });++ pills.push({+ id: "setup-minutes",+ node: (+ <span className={cn(extensionModuleCardPillClassName, "gap-1")}>+ <ClockIcon className="size-3 shrink-0" />+ {translate(I18nKey.RECOMMENDED_AUTOMATIONS$MINUTES, {+ count: automation.estimatedSetupMinutes,+ })}+ </span>+ ),+ });++ if (missingCount > 0) {+ pills.push({+ id: "missing-connect",+ node: (+ <span className={extensionModuleCardPillClassName}>+ {translate(I18nKey.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT, {+ count: missingCount,+ })}+ </span>+ ),+ });+ }++ return pills;+}+export function RecommendedAutomationsSection({backendKind,installedServers,@@ -96,7 +165,7 @@ export function RecommendedAutomationsSection({return (<section data-testid="recommended-automations-section"><div className="flex items-center">- <h2 className="text-sm font-medium text-white">+ <h2 className="text-base font-semibold text-foreground">{t(I18nKey.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}</h2><StatusBadge count={visibleAutomations.length} />@@ -105,84 +174,65 @@ export function RecommendedAutomationsSection({{t(I18nKey.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}</p>- <div className="mt-3 flex flex-col gap-3">- {visibleAutomations.map((automation) => {- const requiredEntries = getRequiredEntries(automation);- const missingCount = requiredEntries.filter(- (entry) => !findInstalledMatch(entry.template, installedServers),- ).length;-- return (- <button- key={automation.id}- type="button"- data-testid={`recommended-automation-card-${automation.id}`}- onClick={() => onSelect(automation)}- className="cursor-pointer rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-5 text-left transition-colors hover:border-[var(--oh-border)] focus:outline-none focus:ring-2 focus:ring-primary/50"- >- <div className="flex items-start justify-between gap-4">- <div className="min-w-0 flex-1">- <div className="text-xs font-normal text-muted">- {automation.category}- </div>- <h3 className="mt-1 truncate text-base font-normal text-white">- {automation.name}- </h3>- <p className="mt-1 line-clamp-2 text-sm text-muted">- {automation.description}- </p>- </div>- <div className="flex shrink-0 -space-x-1" aria-hidden="true">- {requiredEntries.map((entry) => (- <McpLogoBadge- key={entry.id}- entry={entry}- size="sm"- className="ring-2 ring-[var(--oh-surface)]"+ <div className={cn("mt-3", extensionModuleCardGridContainerClassName)}>+ <div className={extensionModuleCardGridClassName}>+ {visibleAutomations.map((automation) => {+ const requiredEntries = getRequiredEntries(automation);+ const missingCount = requiredEntries.filter(+ (entry) => !findInstalledMatch(entry.template, installedServers),+ ).length;++ return (+ <button+ key={automation.id}+ type="button"+ data-testid={`recommended-automation-card-${automation.id}`}+ onClick={() => onSelect(automation)}+ className={cn(+ "flex min-w-0 overflow-hidden p-4 text-left",+ extensionModuleCardSurfaceClassName,+ extensionModuleCardInteractiveClassName,+ )}+ >+ <div className="flex min-w-0 flex-1 items-start gap-3">+ <McpLogoStackBadge+ entries={requiredEntries}+ testId={`recommended-automation-icon-${automation.id}`}+ />+ <div className="flex min-w-0 flex-1 flex-col gap-3">+ <header className="flex items-start justify-between gap-3">+ <div className="min-w-0 flex-1">+ <h3 className="truncate text-sm font-semibold text-white">+ {automation.name}+ </h3>+ <p className="mt-0.5 truncate text-xs text-tertiary-alt">+ {automation.category}+ </p>+ </div>+ <CirclePlusBadge+ testId={`recommended-automation-plus-${automation.id}`}+ />+ </header>+ <p className="line-clamp-2 text-xs leading-relaxed text-tertiary-light">+ {automation.description}+ </p>++ <SkillCardPillRow+ pills={buildRecommendedAutomationPills(+ automation,+ requiredEntries,+ installedServers,+ missingCount,+ t,+ )}+ testId={`recommended-automation-pills-${automation.id}`}/>- ))}+ </div></div>- </div>-- <div className="mt-3 flex flex-wrap gap-2">- {requiredEntries.map((entry) => {- const installed = !!findInstalledMatch(- entry.template,- installedServers,- );- return (- <span- key={entry.id}- className="inline-flex items-center gap-1.5 rounded-full border border-[var(--oh-border)] px-3 py-1 text-xs text-muted"- >- <McpLogoBadge entry={entry} size="sm" />- {entry.name}- {installed && (- <span className="text-primary">- {t(I18nKey.RECOMMENDED_AUTOMATIONS$CONNECTED)}- </span>- )}- </span>- );- })}- <span className="inline-flex items-center gap-1.5 rounded-full border border-[var(--oh-border)] px-3 py-1 text-xs text-muted">- <ClockIcon className="size-3.5" />- {t(I18nKey.RECOMMENDED_AUTOMATIONS$MINUTES, {- count: automation.estimatedSetupMinutes,- })}- </span>- </div>-- {missingCount > 0 && (- <p className="mt-3 text-xs text-muted">- {t(I18nKey.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT, {- count: missingCount,- })}- </p>- )}- </button>- );- })}+ </button>+ );+ })}+ </div></div></section>);diff --git a/src/components/features/automations/search-input.tsx b/src/components/features/automations/search-input.tsxindex cb19dcbcab..c93728e538 100644--- a/src/components/features/automations/search-input.tsx+++ b/src/components/features/automations/search-input.tsx@@ -1,11 +1,7 @@import { useTranslation } from "react-i18next";-import { Search } from "lucide-react";import { I18nKey } from "#/i18n/declaration";import { cn } from "#/utils/utils";-import {- formControlInlineInputClassName,- formControlShellClassName,-} from "#/utils/form-control-classes";+import SearchIcon from "#/icons/search.svg?react";interface SearchInputProps {value: string;@@ -17,15 +13,26 @@ export function SearchInput({ value, onChange, className }: SearchInputProps) {const { t } = useTranslation("openhands");return (- <div className={cn(formControlShellClassName, "w-full", className)}>- <Search className="ml-3 h-4 w-4 shrink-0 text-tertiary-alt" aria-hidden />+ <div+ className={cn(+ "relative flex min-w-0 flex-1 items-center",+ "h-9 rounded-lg border border-[var(--oh-border)] bg-base-secondary",+ "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",+ "transition-colors",+ className,+ )}+ >+ <SearchIcon+ className="ml-3 size-4 shrink-0 text-tertiary-alt"+ aria-hidden+ /><inputtype="text"value={value}onChange={(e) => onChange(e.target.value)}placeholder={t(I18nKey.AUTOMATIONS$SEARCH_PLACEHOLDER)}aria-label={t(I18nKey.AUTOMATIONS$SEARCH_PLACEHOLDER)}- className={formControlInlineInputClassName}+ className="min-w-0 flex-1 border-0 bg-transparent px-3 text-sm text-white outline-none placeholder:text-tertiary-alt"/></div>);diff --git a/src/components/features/chat/components/chat-input-field.tsx b/src/components/features/chat/components/chat-input-field.tsxindex 3494a63284..9668fca6e7 100644--- a/src/components/features/chat/components/chat-input-field.tsx+++ b/src/components/features/chat/components/chat-input-field.tsx@@ -2,6 +2,7 @@ import React from "react";import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import { useConversationStore } from "#/stores/conversation-store";+import { focusContentEditableAtEnd } from "#/components/features/chat/utils/chat-input.utils";import { cn } from "#/utils/utils";interface ChatInputFieldProps {@@ -33,7 +34,7 @@ export function ChatInputField({React.useEffect(() => {if (!disabled) {- chatInputRef.current?.focus();+ focusContentEditableAtEnd(chatInputRef.current);}// Focus on mount only — re-focusing on later `disabled` transitions// would steal focus from a user who has clicked elsewhere.diff --git a/src/components/features/chat/utils/chat-input.utils.ts b/src/components/features/chat/utils/chat-input.utils.tsindex 46b33a6514..b081072595 100644--- a/src/components/features/chat/utils/chat-input.utils.ts+++ b/src/components/features/chat/utils/chat-input.utils.ts@@ -50,7 +50,7 @@ export const clearFileInput = (element: HTMLInputElement | null): void => {/*** Ensure cursor stays visible when content is scrollable*/-export const ensureCursorVisible = (element: HTMLDivElement | null): void => {+export const ensureCursorVisible = (element: HTMLElement | null): void => {if (!element) {return;}@@ -73,3 +73,28 @@ export const ensureCursorVisible = (element: HTMLDivElement | null): void => {element.scrollTop = element.scrollHeight - element.clientHeight;}};++/**+ * Focus a contentEditable input and place the caret at the end of its text.+ */+export const focusContentEditableAtEnd = (+ element: HTMLElement | null,+): void => {+ if (!element) {+ return;+ }++ element.focus();++ const selection = window.getSelection();+ if (!selection) {+ return;+ }++ const range = document.createRange();+ range.selectNodeContents(element);+ range.collapse(false);+ selection.removeAllRanges();+ selection.addRange(range);+ ensureCursorVisible(element);+};diff --git a/src/components/features/mcp-logo-badge.tsx b/src/components/features/mcp-logo-badge.tsxindex af4968da98..42a559c619 100644--- a/src/components/features/mcp-logo-badge.tsx+++ b/src/components/features/mcp-logo-badge.tsx@@ -8,14 +8,18 @@ type McpLogoEntry = Pick<"id" | "name" | "iconBg" | "iconColor">;+export type { McpLogoEntry };+interface McpLogoBadgeProps {entry?: McpLogoEntry | null;- size?: "sm" | "md";+ size?: "xs" | "sm" | "md";className?: string;fallback?: ReactNode;+ testId?: string;}const sizeClassNames = {+ xs: "h-4 w-4 rounded [&>svg]:h-2.5 [&>svg]:w-2.5",sm: "h-5 w-5 rounded-md [&>svg]:h-3 [&>svg]:w-3",md: "h-10 w-10 rounded-lg [&>svg]:h-5 [&>svg]:w-5",};@@ -25,11 +29,13 @@ export function McpLogoBadge({size = "md",className,fallback,+ testId,}: McpLogoBadgeProps) {return (<spanaria-hidden="true"title={entry?.name}+ data-testid={testId}className={cn("inline-flex shrink-0 items-center justify-center overflow-hidden","border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]",diff --git a/src/components/features/mcp-page/custom-server-editor.tsx b/src/components/features/mcp-page/custom-server-editor.tsxindex ae93e0df61..8ddfba9e5e 100644--- a/src/components/features/mcp-page/custom-server-editor.tsx+++ b/src/components/features/mcp-page/custom-server-editor.tsx@@ -1,24 +1,20 @@import React from "react";import { AxiosError } from "axios";import { useTranslation } from "react-i18next";-import { X } from "lucide-react";import { I18nKey } from "#/i18n/declaration";-import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";-import {- MODAL_MAX_WIDTH_VIEWPORT,- modalWidthClassName,-} from "#/components/shared/modals/modal-body";+import { ModalCloseButton } from "#/components/shared/modals/modal-close-button";+import { ConfirmationModal } from "#/components/shared/modals/confirmation-modal";import { MCPServerForm } from "#/components/features/settings/mcp-settings/mcp-server-form";import { useAddMcpServer } from "#/hooks/mutation/use-add-mcp-server";import { useUpdateMcpServer } from "#/hooks/mutation/use-update-mcp-server";+import { useDeleteMcpServer } from "#/hooks/mutation/use-delete-mcp-server";import { MCPServerConfig } from "#/types/mcp-server";-import { displayErrorToast } from "#/utils/custom-toast-handlers";+import {+ displayErrorToast,+ displaySuccessToast,+} from "#/utils/custom-toast-handlers";import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";-import { cn } from "#/utils/utils";--const ICON_BUTTON_CLASS =- "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";interface CustomServerEditorProps {server: MCPServerConfig;@@ -40,9 +36,13 @@ export function CustomServerEditor({const { mutate: addMcpServer, isPending: isAdding } = useAddMcpServer();const { mutate: updateMcpServer, isPending: isUpdating } =useUpdateMcpServer();+ const { mutate: deleteMcpServer, isPending: isDeleting } =+ useDeleteMcpServer();+ const [showDeleteConfirm, setShowDeleteConfirm] = React.useState(false);const isEditing = !!server.id;- const isPending = isAdding || isUpdating;+ const isPending = isAdding || isUpdating || isDeleting;+ const isDismissBlocked = isPending || showDeleteConfirm;// Shared error handler so both add and update surface backend errors// as a toast instead of failing silently — previously these calls@@ -64,55 +64,68 @@ export function CustomServerEditor({}};+ const handleConfirmDelete = () => {+ deleteMcpServer(server, {+ onSuccess: () => {+ displaySuccessToast(t(I18nKey.MCP$REMOVE_SUCCESS));+ setShowDeleteConfirm(false);+ onClose();+ },+ onError: (err) => {+ handleError(err);+ setShowDeleteConfirm(false);+ },+ });+ };+return (- <ModalBackdrop- // Block backdrop-click / Escape from dismissing the modal while- // a mutation is in flight — closing mid-request would orphan- // the request and leave the user with no error feedback.- onClose={isPending ? undefined : onClose}- closeOnEscape={!isPending}- aria-label={- isEditing- ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE)- : t(I18nKey.MCP$ADD_CUSTOM_TITLE)- }- >- <div- data-testid="mcp-custom-editor"- className={cn(- "bg-base-secondary p-6 rounded-xl border border-[var(--oh-border)] max-h-[90vh] overflow-y-auto custom-scrollbar",- modalWidthClassName("md"),- MODAL_MAX_WIDTH_VIEWPORT,- )}+ <>+ <ModalBackdrop+ // Block backdrop-click / Escape from dismissing the modal while+ // a mutation is in flight — closing mid-request would orphan+ // the request and leave the user with no error feedback.+ onClose={isDismissBlocked ? undefined : onClose}+ closeOnEscape={!isDismissBlocked}+ aria-label={+ isEditing+ ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE)+ : t(I18nKey.MCP$ADD_CUSTOM_TITLE)+ }>- <div className="mb-4 flex items-start justify-between gap-4">- <BaseModalTitle- className="text-lg font-medium"- title={- isEditing- ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE)- : t(I18nKey.MCP$ADD_CUSTOM_TITLE)- }+ <div+ data-testid="mcp-custom-editor"+ className="relative bg-base-secondary p-6 rounded-xl border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[90vh] overflow-y-auto custom-scrollbar"+ >+ <ModalCloseButton+ onClose={onClose}+ testId="mcp-custom-editor-close"+ disabled={isDismissBlocked}+ />+ <h2 className="mb-4 pr-6 text-lg font-semibold">+ {isEditing+ ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE)+ : t(I18nKey.MCP$ADD_CUSTOM_TITLE)}+ </h2>+ <MCPServerForm+ mode={isEditing ? "edit" : "add"}+ server={isEditing ? server : undefined}+ existingServers={existingServers}+ onSubmit={handleSubmit}+ onCancel={onClose}+ onDelete={isEditing ? () => setShowDeleteConfirm(true) : undefined}+ isActionDisabled={isPending}/>- <button- type="button"- onClick={onClose}- disabled={isPending}- className={ICON_BUTTON_CLASS}- aria-label={t(I18nKey.BUTTON$CLOSE)}- data-testid="close-mcp-custom-editor"- >- <X size={20} aria-hidden />- </button></div>- <MCPServerForm- mode={isEditing ? "edit" : "add"}- server={isEditing ? server : undefined}- existingServers={existingServers}- onSubmit={handleSubmit}- onCancel={onClose}+ </ModalBackdrop>++ {showDeleteConfirm ? (+ <ConfirmationModal+ text={t(I18nKey.SETTINGS$MCP_CONFIRM_DELETE)}+ onCancel={() => setShowDeleteConfirm(false)}+ onConfirm={handleConfirmDelete}+ isConfirming={isDeleting}/>- </div>- </ModalBackdrop>+ ) : null}+ </>);}diff --git a/src/components/features/mcp-page/index.ts b/src/components/features/mcp-page/index.tsindex 3ed10d2a6a..c64f0a148c 100644--- a/src/components/features/mcp-page/index.ts+++ b/src/components/features/mcp-page/index.ts@@ -4,4 +4,5 @@ export { MarketplaceSection } from "./marketplace-section";export { MarketplaceCard } from "./marketplace-card";export { InstallServerModal } from "./install-server-modal";export { CustomServerEditor } from "./custom-server-editor";-export { MarketplaceSearch } from "./marketplace-search";+export { McpToolbar } from "./mcp-toolbar";+export type { McpSectionFilter } from "./mcp-section-filter";diff --git a/src/components/features/mcp-page/install-server-modal.tsx b/src/components/features/mcp-page/install-server-modal.tsxindex ef7efb3e65..0bafe174e7 100644--- a/src/components/features/mcp-page/install-server-modal.tsx+++ b/src/components/features/mcp-page/install-server-modal.tsx@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";import { AxiosError } from "axios";import { X } from "lucide-react";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";+import { ModalCloseButton } from "#/components/shared/modals/modal-close-button";import { BrandButton } from "#/components/features/settings/brand-button";import { SettingsInput } from "#/components/features/settings/settings-input";import { I18nKey } from "#/i18n/declaration";@@ -12,11 +13,6 @@ import { MCPServerConfig } from "#/types/mcp-server";import { useAddMcpServer } from "#/hooks/mutation/use-add-mcp-server";import { displaySuccessToast } from "#/utils/custom-toast-handlers";import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";-import {- MODAL_MAX_WIDTH_VIEWPORT,- modalWidthClassName,-} from "#/components/shared/modals/modal-body";-import { cn } from "#/utils/utils";const ICON_BUTTON_CLASS ="rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";@@ -277,19 +273,18 @@ export function InstallServerModal({data-testid="mcp-install-modal"data-marketplace-id={entry.id}onSubmit={handleSubmit}- className={cn(- "bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] max-h-[85vh] overflow-y-auto custom-scrollbar",- modalWidthClassName("md"),- MODAL_MAX_WIDTH_VIEWPORT,- )}+ className="relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[85vh] overflow-y-auto custom-scrollbar">- <div className="flex items-start justify-between gap-4">- <div className="flex min-w-0 flex-1 items-start gap-3">- <McpLogoBadge entry={entry} />- <div className="flex min-w-0 flex-1 flex-col">- <h2 className="text-lg font-medium">{entry.name}</h2>- <p className="text-xs text-tertiary-alt">{entry.description}</p>- </div>+ <ModalCloseButton+ onClose={onClose}+ testId="mcp-install-modal-close"+ disabled={isPending}+ />+ <div className="flex items-start gap-3 pr-6">+ <McpLogoBadge entry={entry} />+ <div className="flex flex-col flex-1">+ <h2 className="text-lg font-semibold">{entry.name}</h2>+ <p className="text-xs text-tertiary-light">{entry.description}</p></div><buttontype="button"@@ -304,7 +299,7 @@ export function InstallServerModal({</div>{entry.installHint && (- <p className="text-xs text-content-2">{entry.installHint}</p>+ <p className="text-xs text-tertiary-light">{entry.installHint}</p>)}{entry.docsUrl && (diff --git a/src/components/features/mcp-page/installed-server-card.tsx b/src/components/features/mcp-page/installed-server-card.tsxindex fc267a9490..deac8d6505 100644--- a/src/components/features/mcp-page/installed-server-card.tsx+++ b/src/components/features/mcp-page/installed-server-card.tsx@@ -1,11 +1,17 @@-import { Puzzle, Pencil, Trash2 } from "lucide-react";+import React from "react";+import { Puzzle } from "lucide-react";import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import { McpLogoBadge } from "#/components/features/mcp-logo-badge";+import { CirclePlusCheckToggle } from "#/components/shared/buttons/circle-plus-check-toggle";import { MCPServerConfig } from "#/types/mcp-server";import { MCP_CATALOG as MCP_MARKETPLACE } from "@openhands/extensions/mcps";import { findCatalogEntryForServer } from "#/utils/mcp-marketplace-utils";import { cn } from "#/utils/utils";+import {+ extensionModuleCardInteractiveClassName,+ extensionModuleCardSurfaceClassName,+} from "#/utils/extension-module-card-classes";interface InstalledServerCardProps {server: MCPServerConfig;@@ -20,7 +26,7 @@ function getServerTransportLabel(type: MCPServerConfig["type"]) {case "shttp":return "HTTP";case "stdio":- return "stdio";+ return "STDIO";default:return type;}@@ -31,7 +37,7 @@ function getServerTitle(server: MCPServerConfig): string {return server.url ?? "";}-function getServerSubtitle(server: MCPServerConfig): string {+function getServerDetailLine(server: MCPServerConfig): string {if (server.type === "stdio") {const args =server.args && server.args.length > 0 ? ` ${server.args.join(" ")}` : "";@@ -46,62 +52,80 @@ export function InstalledServerCard({onDelete,}: InstalledServerCardProps) {const { t } = useTranslation("openhands");- // Match-by-content is delegated to the shared utility so this card- // and `findInstalledMatch` agree on URL canonicalization (trailing- // slashes, query strings, default ports) and stay in sync when one- // is updated.const catalog = findCatalogEntryForServer(server, MCP_MARKETPLACE);const title = catalog?.name ?? getServerTitle(server);- const subtitle = getServerSubtitle(server);+ const detailLine = getServerDetailLine(server);const transport = getServerTransportLabel(server.type);+ const handleKeyDown = (event: React.KeyboardEvent) => {+ if (event.key === "Enter" || event.key === " ") {+ event.preventDefault();+ onEdit();+ }+ };+return (<divdata-testid="mcp-server-item"data-server-id={server.id}+ role="button"+ tabIndex={0}+ onClick={onEdit}+ onKeyDown={handleKeyDown}+ aria-label={t(I18nKey.MCP$EDIT_SERVER_ARIA, { name: title })}className={cn(- "flex items-start gap-3 rounded-xl",- "border border-[var(--oh-border)] bg-base-secondary p-4",+ "flex min-h-[132px] flex-col overflow-hidden p-4 text-left",+ extensionModuleCardSurfaceClassName,+ extensionModuleCardInteractiveClassName,)}>- <McpLogoBadge entry={catalog} fallback={<Puzzle strokeWidth={2.25} />} />+ <div className="flex items-start gap-3">+ <McpLogoBadge+ entry={catalog}+ fallback={<Puzzle strokeWidth={2.25} />}+ />- <div className="flex flex-col min-w-0 flex-1 gap-0.5">- <div className="flex items-center gap-2">- <h3 className="text-sm font-semibold truncate" title={title}>- {title}- </h3>- <span className="shrink-0 rounded-full bg-tertiary text-tertiary-alt text-[10px] font-medium px-2 py-0.5 uppercase">- {transport}- </span>- </div>- {subtitle && (- <p className="text-xs text-content-2 truncate" title={subtitle}>- {subtitle}- </p>- )}- </div>+ <div className="flex min-w-0 flex-1 flex-col gap-3">+ <header className="flex items-start justify-between gap-3">+ <div className="min-w-0 flex-1">+ <h3 className="truncate text-sm font-semibold" title={title}>+ {title}+ </h3>+ <p className="mt-0.5 text-xs text-tertiary-alt">{transport}</p>+ </div>+ <CirclePlusCheckToggle+ testId={`mcp-installed-toggle-${server.id}`}+ isSelected+ onToggle={(selected) => {+ if (!selected) {+ onDelete();+ }+ }}+ enableLabelKey={I18nKey.MCP$TOGGLE_ADD_SERVER}+ disableLabelKey={I18nKey.MCP$TOGGLE_REMOVE_SERVER}+ />+ </header>- <div className="flex shrink-0 items-center gap-0.5">- <button- data-testid="edit-mcp-server-button"- type="button"- onClick={onEdit}- aria-label={t(I18nKey.MCP$EDIT_SERVER_ARIA, { name: title })}- className="inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted transition-colors hover:bg-interactive-hover hover:text-white"- >- <Pencil aria-hidden className="size-3.5" strokeWidth={2} />- </button>- <button- data-testid="delete-mcp-server-button"- type="button"- onClick={onDelete}- aria-label={t(I18nKey.MCP$DELETE_SERVER_ARIA, { name: title })}- className="inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted transition-colors hover:bg-interactive-hover hover:text-white"- >- <Trash2 aria-hidden className="size-3.5" strokeWidth={2} />- </button>+ {catalog?.description ? (+ <p+ data-testid={`mcp-server-description-${server.id}`}+ className="line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light"+ >+ {catalog.description}+ </p>+ ) : null}++ {detailLine ? (+ <p+ data-testid={`mcp-server-detail-${server.id}`}+ className="truncate text-xs text-tertiary-alt"+ title={detailLine}+ >+ {detailLine}+ </p>+ ) : null}+ </div></div></div>);diff --git a/src/components/features/mcp-page/installed-servers-section.tsx b/src/components/features/mcp-page/installed-servers-section.tsxindex 04e7dba28b..4e949ed2dd 100644--- a/src/components/features/mcp-page/installed-servers-section.tsx+++ b/src/components/features/mcp-page/installed-servers-section.tsx@@ -2,6 +2,11 @@ import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import { MCPServerConfig } from "#/types/mcp-server";import { InstalledServerCard } from "./installed-server-card";+import {+ extensionModuleCardGridClassName,+ extensionModuleCardGridContainerClassName,+ extensionModuleEmptyStateClassName,+} from "#/utils/extension-module-card-classes";interface InstalledServersSectionProps {/** Already-filtered list — search filtering happens upstream. */@@ -37,9 +42,9 @@ export function InstalledServersSection({return (<divdata-testid="mcp-installed-empty-search"- className="rounded-xl border border-dashed border-[var(--oh-border)] p-6 text-center"+ className="rounded-xl border border-[var(--oh-border)] p-6 text-center">- <p className="text-xs text-tertiary-alt">+ <p className="text-xs text-tertiary-light">{t(I18nKey.MCP$SEARCH_EMPTY)}</p></div>@@ -48,12 +53,12 @@ export function InstalledServersSection({return (<divdata-testid="mcp-installed-empty"- className="rounded-xl border border-dashed border-[var(--oh-border)] p-8 text-center"+ className={extensionModuleEmptyStateClassName}>- <p className="text-sm text-content-2">+ <p className="text-sm text-white">{t(I18nKey.MCP$INSTALLED_EMPTY_TITLE)}</p>- <p className="text-xs text-tertiary-alt mt-1">+ <p className="text-xs text-tertiary-light mt-1">{t(I18nKey.MCP$INSTALLED_EMPTY_HINT)}</p></div>@@ -61,18 +66,20 @@ export function InstalledServersSection({}return (- <div- data-testid="mcp-installed-list"- className="grid gap-3 grid-cols-1 md:grid-cols-2"- >- {servers.map((server) => (- <InstalledServerCard- key={server.id}- server={server}- onEdit={() => onEdit(server)}- onDelete={() => onDelete(server.id)}- />- ))}+ <div className={extensionModuleCardGridContainerClassName}>+ <div+ data-testid="mcp-installed-list"+ className={extensionModuleCardGridClassName}+ >+ {servers.map((server) => (+ <InstalledServerCard+ key={server.id}+ server={server}+ onEdit={() => onEdit(server)}+ onDelete={() => onDelete(server.id)}+ />+ ))}+ </div></div>);}diff --git a/src/components/features/mcp-page/marketplace-card.tsx b/src/components/features/mcp-page/marketplace-card.tsxindex 0f01b0ba3a..4057c1babc 100644--- a/src/components/features/mcp-page/marketplace-card.tsx+++ b/src/components/features/mcp-page/marketplace-card.tsx@@ -1,26 +1,28 @@-import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import type { McpCatalogEntry as MarketplaceEntry } from "@openhands/extensions/mcps";import { McpLogoBadge } from "#/components/features/mcp-logo-badge";+import { CirclePlusCheckToggle } from "#/components/shared/buttons/circle-plus-check-toggle";import { cn } from "#/utils/utils";+import {+ extensionModuleCardInteractiveClassName,+ extensionModuleCardSurfaceClassName,+} from "#/utils/extension-module-card-classes";interface MarketplaceCardProps {entry: MarketplaceEntry;- installed: boolean;onClick: () => void;+ onAdd: () => void;}export function MarketplaceCard({entry,- installed,onClick,+ onAdd,}: MarketplaceCardProps) {- const { t } = useTranslation("openhands");-const transportLabel = (() => {switch (entry.template.kind) {case "stdio":- return "stdio";+ return "STDIO";case "shttp":return "HTTP";case "sse":@@ -36,38 +38,38 @@ export function MarketplaceCard({onClick={onClick}data-testid={`mcp-marketplace-card-${entry.id}`}className={cn(- "group relative flex min-h-[132px] flex-col overflow-hidden text-left",- "rounded-xl border border-[var(--oh-border)] bg-base-secondary",- "p-4 gap-3 cursor-pointer",- "transition-all duration-200 hover:-translate-y-0.5",- "hover:border-primary/35 hover:bg-base-tertiary/30",- "focus:outline-none focus:ring-2 focus:ring-primary/50",+ "flex min-h-[132px] flex-col overflow-hidden p-4 text-left",+ extensionModuleCardSurfaceClassName,+ extensionModuleCardInteractiveClassName,)}>- <div- aria-hidden="true"- className="pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/15 to-transparent opacity-0 transition-opacity group-hover:opacity-100"- /><div className="flex items-start gap-3"><McpLogoBadge entry={entry} />- <div className="flex flex-col min-w-0 flex-1">- <div className="flex items-center gap-2">- <h3 className="text-sm font-semibold truncate">{entry.name}</h3>- {installed && (- <span- data-testid={`mcp-marketplace-installed-${entry.id}`}- className="shrink-0 rounded-full bg-primary/15 text-primary text-[10px] font-medium px-2 py-0.5 uppercase tracking-wide"- >- {t(I18nKey.MCP$INSTALLED_BADGE)}- </span>- )}- </div>- <p className="text-xs text-tertiary-alt mt-0.5">{transportLabel}</p>+ <div className="flex min-w-0 flex-1 flex-col gap-3">+ <header className="flex items-start justify-between gap-3">+ <div className="min-w-0 flex-1">+ <h3 className="truncate text-sm font-semibold">{entry.name}</h3>+ <p className="mt-0.5 text-xs text-tertiary-alt">+ {transportLabel}+ </p>+ </div>+ <CirclePlusCheckToggle+ testId={`mcp-marketplace-toggle-${entry.id}`}+ isSelected={false}+ onToggle={(selected) => {+ if (selected) {+ onAdd();+ }+ }}+ enableLabelKey={I18nKey.MCP$TOGGLE_ADD_SERVER}+ disableLabelKey={I18nKey.MCP$TOGGLE_ADD_SERVER}+ />+ </header>+ <p className="line-clamp-3 text-xs leading-relaxed text-tertiary-light">+ {entry.description}+ </p></div></div>- <p className="text-xs text-content-2 leading-relaxed line-clamp-3">- {entry.description}- </p></button>);}diff --git a/src/components/features/mcp-page/marketplace-search.tsx b/src/components/features/mcp-page/marketplace-search.tsxdeleted file mode 100644index 4b2310c4c7..0000000000--- a/src/components/features/mcp-page/marketplace-search.tsx+++ /dev/null@@ -1,58 +0,0 @@-import { Search, X } from "lucide-react";-import { useTranslation } from "react-i18next";-import { I18nKey } from "#/i18n/declaration";-import { cn } from "#/utils/utils";--interface MarketplaceSearchProps {- value: string;- onChange: (next: string) => void;-}--/**- * Single search input that filters both the Installed and Marketplace- * sections on the MCP page.- */-export function MarketplaceSearch({ value, onChange }: MarketplaceSearchProps) {- const { t } = useTranslation("openhands");-- return (- <div- data-testid="mcp-search"- className={cn(- "relative flex items-center w-1/2",- "rounded-lg border border-[var(--oh-border)] bg-base-secondary",- "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",- "transition-colors",- )}- >- <Search- className="ml-3 h-4 w-4 text-tertiary-alt shrink-0"- aria-hidden="true"- />- <input- type="search"- value={value}- onChange={(e) => onChange(e.target.value)}- placeholder={t(I18nKey.MCP$SEARCH_PLACEHOLDER)}- aria-label={t(I18nKey.MCP$SEARCH_PLACEHOLDER)}- data-testid="mcp-search-input"- className={cn(- "flex-1 min-w-0 bg-transparent border-0 outline-none",- "px-3 py-2 text-sm placeholder:text-tertiary-alt",- "[&::-webkit-search-cancel-button]:hidden",- )}- />- {value && (- <button- type="button"- onClick={() => onChange("")}- 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"- >- <X className="h-4 w-4" aria-hidden="true" />- </button>- )}- </div>- );-}diff --git a/src/components/features/mcp-page/marketplace-section.tsx b/src/components/features/mcp-page/marketplace-section.tsxindex e456507732..edcf85f90a 100644--- a/src/components/features/mcp-page/marketplace-section.tsx+++ b/src/components/features/mcp-page/marketplace-section.tsx@@ -10,19 +10,23 @@ import {marketplaceEntryMatchesQuery,} from "#/utils/mcp-marketplace-utils";import { MarketplaceCard } from "./marketplace-card";+import {+ extensionModuleCardGridClassName,+ extensionModuleCardGridContainerClassName,+} from "#/utils/extension-module-card-classes";interface MarketplaceSectionProps {- isInstalled: (entry: MarketplaceEntry) => boolean;backendKind: "local" | "cloud";onSelect: (entry: MarketplaceEntry) => void;+ onAdd: (entry: MarketplaceEntry) => void;/** Empty string = no filter. */query?: string;}export function MarketplaceSection({- isInstalled,backendKind,onSelect,+ onAdd,query = "",}: MarketplaceSectionProps) {const { t } = useTranslation("openhands");@@ -49,23 +53,25 @@ export function MarketplaceSection({data-testid="mcp-marketplace-empty"className="rounded-xl border border-dashed border-[var(--oh-border)] p-6 text-center">- <p className="text-xs text-tertiary-alt">+ <p className="text-xs text-tertiary-light">{t(I18nKey.MCP$SEARCH_EMPTY)}</p></div>) : (- <div- data-testid="mcp-marketplace-grid"- className="grid gap-3 grid-cols-1 md:grid-cols-2"- >- {visibleEntries.map((entry) => (- <MarketplaceCard- key={entry.id}- entry={entry}- installed={isInstalled(entry)}- onClick={() => onSelect(entry)}- />- ))}+ <div className={extensionModuleCardGridContainerClassName}>+ <div+ data-testid="mcp-marketplace-grid"+ className={extensionModuleCardGridClassName}+ >+ {visibleEntries.map((entry) => (+ <MarketplaceCard+ key={entry.id}+ entry={entry}+ onClick={() => onSelect(entry)}+ onAdd={() => onAdd(entry)}+ />+ ))}+ </div></div>)}</section>diff --git a/src/components/features/mcp-page/mcp-logo-stack-badge.tsx b/src/components/features/mcp-page/mcp-logo-stack-badge.tsxnew file mode 100644index 0000000000..6fda4e3e39--- /dev/null+++ b/src/components/features/mcp-page/mcp-logo-stack-badge.tsx@@ -0,0 +1,107 @@+import type { McpCatalogEntry } from "@openhands/extensions/mcps";+import {+ McpLogoBadge,+ type McpLogoEntry,+} from "#/components/features/mcp-logo-badge";+import { cn } from "#/utils/utils";++const STACK_CONTAINER_CLASS_NAME =+ "inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-white/10 bg-surface-raised shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]";++interface McpLogoStackBadgeProps {+ entries: Array<Pick<McpCatalogEntry, "id" | "name" | "iconBg" | "iconColor">>;+ className?: string;+ testId?: string;+}++function toLogoEntries(+ entries: McpLogoStackBadgeProps["entries"],+): McpLogoEntry[] {+ return entries.slice(0, 4);+}++export function McpLogoStackBadge({+ entries,+ className,+ testId,+}: McpLogoStackBadgeProps) {+ const visibleEntries = toLogoEntries(entries);++ if (visibleEntries.length === 0) {+ return (+ <McpLogoBadge+ entry={null}+ size="md"+ className={className}+ testId={testId}+ />+ );+ }++ if (visibleEntries.length === 1) {+ return (+ <McpLogoBadge+ entry={visibleEntries[0]}+ size="md"+ className={className}+ testId={testId}+ />+ );+ }++ if (visibleEntries.length === 2) {+ return (+ <span+ aria-hidden="true"+ data-testid={testId}+ data-layout="overlap"+ className={cn(+ STACK_CONTAINER_CLASS_NAME,+ "items-center justify-center",+ className,+ )}+ >+ <span className="flex items-center justify-center -space-x-2">+ {visibleEntries.map((entry) => (+ <McpLogoBadge+ key={entry.id}+ entry={entry}+ size="sm"+ className="ring-2 ring-surface-raised"+ />+ ))}+ </span>+ </span>+ );+ }++ const quadrantSlots: Array<McpLogoEntry | null> = [+ visibleEntries[0] ?? null,+ visibleEntries[1] ?? null,+ visibleEntries[2] ?? null,+ visibleEntries[3] ?? null,+ ];++ return (+ <span+ aria-hidden="true"+ data-testid={testId}+ data-layout="quadrants"+ className={cn(+ STACK_CONTAINER_CLASS_NAME,+ "grid grid-cols-2 grid-rows-2 gap-0.5 p-1",+ className,+ )}+ >+ {quadrantSlots.map((entry, index) =>+ entry ? (+ <span key={entry.id} className="flex items-center justify-center">+ <McpLogoBadge entry={entry} size="xs" />+ </span>+ ) : (+ <span key={`empty-${index}`} aria-hidden="true" />+ ),+ )}+ </span>+ );+}diff --git a/src/components/features/mcp-page/mcp-section-filter-dropdown.tsx b/src/components/features/mcp-page/mcp-section-filter-dropdown.tsxnew file mode 100644index 0000000000..fd25d5d3ca--- /dev/null+++ b/src/components/features/mcp-page/mcp-section-filter-dropdown.tsx@@ -0,0 +1,32 @@+import { I18nKey } from "#/i18n/declaration";+import { EnumFilterDropdown } from "#/components/shared/filters/enum-filter-dropdown";+import {+ MCP_SECTION_FILTER_OPTIONS,+ type McpSectionFilter,+} from "./mcp-section-filter";++const FILTER_LABEL_KEY: Record<McpSectionFilter, I18nKey> = {+ all: I18nKey.MCP$SECTION_FILTER_ALL,+ installed: I18nKey.MCP$INSTALLED_TITLE,+ library: I18nKey.MCP$LIBRARY_TITLE,+};++interface McpSectionFilterDropdownProps {+ value: McpSectionFilter;+ onChange: (filter: McpSectionFilter) => void;+}++export function McpSectionFilterDropdown({+ value,+ onChange,+}: McpSectionFilterDropdownProps) {+ return (+ <EnumFilterDropdown+ testId="mcp-section-filter"+ value={value}+ onChange={onChange}+ options={MCP_SECTION_FILTER_OPTIONS}+ labelKeyByValue={FILTER_LABEL_KEY}+ />+ );+}diff --git a/src/components/features/mcp-page/mcp-section-filter.ts b/src/components/features/mcp-page/mcp-section-filter.tsnew file mode 100644index 0000000000..a887959c75--- /dev/null+++ b/src/components/features/mcp-page/mcp-section-filter.ts@@ -0,0 +1,7 @@+export type McpSectionFilter = "all" | "installed" | "library";++export const MCP_SECTION_FILTER_OPTIONS: McpSectionFilter[] = [+ "all",+ "installed",+ "library",+];diff --git a/src/components/features/mcp-page/mcp-toolbar.tsx b/src/components/features/mcp-page/mcp-toolbar.tsxnew file mode 100644index 0000000000..6e38cfab78--- /dev/null+++ b/src/components/features/mcp-page/mcp-toolbar.tsx@@ -0,0 +1,74 @@+import { Search, X } from "lucide-react";+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import { cn } from "#/utils/utils";+import type { McpSectionFilter } from "./mcp-section-filter";+import { McpSectionFilterDropdown } from "./mcp-section-filter-dropdown";++interface McpToolbarProps {+ search: string;+ onSearchChange: (value: string) => void;+ sectionFilter: McpSectionFilter;+ onSectionFilterChange: (filter: McpSectionFilter) => void;+}++/**+ * Full-width search plus section filter for the MCP page. Filters both the+ * Installed and Library sections (or limits which section is visible).+ */+export function McpToolbar({+ search,+ onSearchChange,+ sectionFilter,+ onSectionFilterChange,+}: McpToolbarProps) {+ const { t } = useTranslation("openhands");++ return (+ <div data-testid="mcp-toolbar" className="flex items-stretch gap-2">+ <div+ data-testid="mcp-search"+ className={cn(+ "relative flex flex-1 min-w-0 items-center",+ "rounded-lg border border-[var(--oh-border)] bg-base-secondary",+ "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",+ "transition-colors",+ )}+ >+ <Search+ className="ml-3 h-4 w-4 text-tertiary-alt shrink-0"+ aria-hidden+ />+ <input+ type="search"+ value={search}+ onChange={(e) => onSearchChange(e.target.value)}+ placeholder={t(I18nKey.MCP$SEARCH_PLACEHOLDER)}+ aria-label={t(I18nKey.MCP$SEARCH_PLACEHOLDER)}+ data-testid="mcp-search-input"+ className={cn(+ "flex-1 min-w-0 bg-transparent border-0 outline-none",+ "px-3 py-2 text-sm placeholder:text-tertiary-alt",+ "[&::-webkit-search-cancel-button]:hidden",+ )}+ />+ {search ? (+ <button+ type="button"+ 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"+ >+ <X className="h-4 w-4" aria-hidden />+ </button>+ ) : null}+ </div>++ <McpSectionFilterDropdown+ value={sectionFilter}+ onChange={onSectionFilterChange}+ />+ </div>+ );+}diff --git a/src/components/features/settings/mcp-settings/mcp-server-form.tsx b/src/components/features/settings/mcp-settings/mcp-server-form.tsxindex a2937da136..935a546b33 100644--- a/src/components/features/settings/mcp-settings/mcp-server-form.tsx+++ b/src/components/features/settings/mcp-settings/mcp-server-form.tsx@@ -1,5 +1,6 @@import React from "react";import { useTranslation } from "react-i18next";+import { Trash2 } from "lucide-react";import { I18nKey } from "#/i18n/declaration";import { SettingsInput } from "../settings-input";import { SettingsDropdownInput } from "../settings-dropdown-input";@@ -28,6 +29,8 @@ interface MCPServerFormProps {existingServers?: MCPServerConfig[];onSubmit: (server: MCPServerConfig) => void;onCancel: () => void;+ onDelete?: () => void;+ isActionDisabled?: boolean;}export function MCPServerForm({@@ -36,6 +39,8 @@ export function MCPServerForm({existingServers,onSubmit,onCancel,+ onDelete,+ isActionDisabled = false,}: MCPServerFormProps) {const { t } = useTranslation("openhands");const [serverType, setServerType] = React.useState<MCPServerType>(@@ -410,19 +415,46 @@ export function MCPServerForm({</>)}- <div className="flex items-center justify-end gap-2 w-full">- <BrandButton- testId="cancel-button"- type="button"- variant="secondary"- onClick={onCancel}- >- {t(I18nKey.BUTTON$CANCEL)}- </BrandButton>- <BrandButton testId="submit-button" type="submit" variant="primary">- {mode === "add" && t(I18nKey.SETTINGS$MCP_ADD_SERVER)}- {mode === "edit" && t(I18nKey.SETTINGS$MCP_SAVE_SERVER)}- </BrandButton>+ <div+ className={cn(+ "flex w-full items-center gap-2",+ onDelete ? "justify-between" : "justify-end",+ )}+ >+ {onDelete ? (+ <BrandButton+ testId="mcp-custom-editor-delete"+ type="button"+ variant="secondary"+ onClick={onDelete}+ isDisabled={isActionDisabled}+ startContent={+ <Trash2 aria-hidden className="size-4" strokeWidth={2} />+ }+ >+ {t(I18nKey.BUTTON$DELETE)}+ </BrandButton>+ ) : null}+ <div className="flex items-center gap-2">+ <BrandButton+ testId="cancel-button"+ type="button"+ variant="secondary"+ onClick={onCancel}+ isDisabled={isActionDisabled}+ >+ {t(I18nKey.BUTTON$CANCEL)}+ </BrandButton>+ <BrandButton+ testId="submit-button"+ type="submit"+ variant="primary"+ isDisabled={isActionDisabled}+ >+ {mode === "add" && t(I18nKey.SETTINGS$MCP_ADD_SERVER)}+ {mode === "edit" && t(I18nKey.SETTINGS$MCP_SAVE_SERVER)}+ </BrandButton>+ </div></div></form>);diff --git a/src/components/features/skills/add-skill-modal.tsx b/src/components/features/skills/add-skill-modal.tsxnew file mode 100644index 0000000000..585dc5c88e--- /dev/null+++ b/src/components/features/skills/add-skill-modal.tsx@@ -0,0 +1,210 @@+import React from "react";+import { Trans, useTranslation } from "react-i18next";+import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";+import { ModalCloseButton } from "#/components/shared/modals/modal-close-button";+import { BrandButton } from "#/components/features/settings/brand-button";+import {+ ADD_SKILL_DOCS_URL,+ ADD_SKILL_EXAMPLE_COMMAND,+} from "#/constants/skills-docs";+import { I18nKey } from "#/i18n/declaration";+import { cn } from "#/utils/utils";+import CheckmarkIcon from "#/icons/checkmark.svg?react";+import CopyIcon from "#/icons/copy.svg?react";++interface AddSkillModalProps {+ onClose: () => void;+}++const ADD_SKILL_STEP_KEYS = [+ I18nKey.SETTINGS$SKILLS_ADD_MODAL_STEP_1,+ I18nKey.SETTINGS$SKILLS_ADD_MODAL_STEP_2,+ I18nKey.SETTINGS$SKILLS_ADD_MODAL_STEP_3,+ I18nKey.SETTINGS$SKILLS_ADD_MODAL_STEP_4,+ I18nKey.SETTINGS$SKILLS_ADD_MODAL_STEP_5,+] as const;++const ADD_SKILL_INLINE_CODE_COMPONENTS = {+ cmd: <InlineCodeChip />,+ path: <InlineCodeChip />,+ env: <InlineCodeChip />,+};++function InlineCodeChip({ children }: { children?: React.ReactNode }) {+ return (+ <code+ className={cn(+ "mx-0.5 inline-block rounded-sm border border-[var(--oh-border-subtle)]",+ "bg-[var(--oh-surface-raised)] px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white",+ )}+ >+ {children}+ </code>+ );+}++function AddSkillExampleBlock() {+ const { t } = useTranslation("openhands");+ const [copied, setCopied] = React.useState(false);++ const handleCopy = async () => {+ await navigator.clipboard.writeText(ADD_SKILL_EXAMPLE_COMMAND);+ setCopied(true);+ };++ React.useEffect(() => {+ if (!copied) return undefined;+ const timeout = setTimeout(() => setCopied(false), 2000);+ return () => clearTimeout(timeout);+ }, [copied]);++ return (+ <div className="relative">+ <pre+ data-testid="add-skill-modal-example"+ className={cn(+ "overflow-x-auto rounded-sm border border-[var(--oh-border-subtle)]",+ "bg-[var(--oh-surface-raised)] p-2 pr-10 text-xs text-white",+ )}+ >+ {ADD_SKILL_EXAMPLE_COMMAND}+ </pre>+ <button+ type="button"+ data-testid="add-skill-modal-example-copy"+ aria-label={t(copied ? I18nKey.BUTTON$COPIED : I18nKey.BUTTON$COPY)}+ disabled={copied}+ onClick={handleCopy}+ className={cn(+ "absolute right-2 top-2 cursor-pointer rounded-sm border border-[var(--oh-border-subtle)]",+ "bg-base-secondary p-1 text-tertiary-alt transition-colors",+ "hover:bg-[var(--oh-surface)] hover:text-white disabled:cursor-default [&_path]:fill-current",+ )}+ >+ {copied ? (+ <CheckmarkIcon width={14} height={14} />+ ) : (+ <CopyIcon width={14} height={14} />+ )}+ </button>+ </div>+ );+}++function AddSkillTransParagraph({+ i18nKey,+}: {+ i18nKey:+ | typeof I18nKey.SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY+ | typeof I18nKey.SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY+ | typeof I18nKey.SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS;+}) {+ return (+ <p className="text-xs leading-relaxed text-tertiary-light">+ <Trans+ ns="openhands"+ i18nKey={i18nKey}+ components={ADD_SKILL_INLINE_CODE_COMPONENTS}+ />+ </p>+ );+}++export function AddSkillModal({ onClose }: AddSkillModalProps) {+ const { t } = useTranslation("openhands");++ return (+ <ModalBackdrop+ onClose={onClose}+ aria-label={t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_TITLE)}+ >+ <div+ data-testid="add-skill-modal"+ className="relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary"+ >+ <ModalCloseButton onClose={onClose} testId="add-skill-modal-close" />+ <header className="flex-shrink-0 px-6 pb-4 pt-6">+ <h2 className="pr-6 text-lg font-semibold">+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_TITLE)}+ </h2>+ <p className="mt-4 text-sm text-tertiary-light">+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_INTRO)}+ </p>+ </header>++ <div className="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar">+ <section className="flex flex-col gap-2">+ <h3 className="text-sm font-semibold text-foreground">+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_CHAT_TITLE)}+ </h3>+ <AddSkillTransParagraph+ i18nKey={I18nKey.SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY}+ />+ <p className="text-xs text-tertiary-light">+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_EXAMPLE_LABEL)}+ </p>+ <AddSkillExampleBlock />+ <ol className="list-decimal space-y-1 pl-4 text-xs leading-relaxed text-tertiary-light">+ {ADD_SKILL_STEP_KEYS.map((key) => (+ <li key={key}>+ {key === I18nKey.SETTINGS$SKILLS_ADD_MODAL_STEP_3 ? (+ <Trans+ ns="openhands"+ i18nKey={key}+ components={ADD_SKILL_INLINE_CODE_COMPONENTS}+ />+ ) : (+ t(key)+ )}+ </li>+ ))}+ </ol>+ </section>++ <section className="flex flex-col gap-1">+ <h3 className="text-sm font-semibold text-foreground">+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS_TITLE)}+ </h3>+ <p className="text-xs leading-relaxed text-tertiary-light">+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS)}+ </p>+ </section>++ <section className="flex flex-col gap-1">+ <h3 className="text-sm font-semibold text-foreground">+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_STORAGE_TITLE)}+ </h3>+ <AddSkillTransParagraph+ i18nKey={I18nKey.SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY}+ />+ </section>++ <AddSkillTransParagraph+ i18nKey={I18nKey.SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS}+ />++ <a+ href={ADD_SKILL_DOCS_URL}+ target="_blank"+ rel="noreferrer"+ data-testid="add-skill-modal-docs-link"+ className="self-start text-xs text-[var(--oh-muted)] transition-colors hover:text-white hover:underline"+ >+ {t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS)}+ </a>+ </div>++ <footer className="flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4">+ <BrandButton+ type="button"+ variant="secondary"+ onClick={onClose}+ testId="add-skill-modal-dismiss"+ >+ {t(I18nKey.BUTTON$CLOSE)}+ </BrandButton>+ </footer>+ </div>+ </ModalBackdrop>+ );+}diff --git a/src/components/features/skills/build-skill-pills.tsx b/src/components/features/skills/build-skill-pills.tsxnew file mode 100644index 0000000000..23a36d6c91--- /dev/null+++ b/src/components/features/skills/build-skill-pills.tsx@@ -0,0 +1,166 @@+import React from "react";+import type { TFunction } from "i18next";+import { I18nKey } from "#/i18n/declaration";+import type { SkillInfo } from "#/types/settings";+import { cn } from "#/utils/utils";+import { SkillTypeBadge } from "./skill-type-badge";+import {+ SKILL_CARD_PILL_CLASS,+ type SkillCardPill,+} from "./skill-card-pill-row";++type SkillPillVariant = "card" | "detail";++interface BuildSkillPillsOptions {+ variant?: SkillPillVariant;+ testIdPrefix?: string;+}++function pillTestId(+ prefix: string | undefined,+ skillName: string,+ suffix: string,+) {+ if (prefix) {+ return `${prefix}-${skillName}-${suffix}`;+ }+ return undefined;+}++export function buildSkillPills(+ skill: SkillInfo,+ translate: TFunction,+ options: BuildSkillPillsOptions = {},+): SkillCardPill[] {+ const { variant = "card", testIdPrefix } = options;+ const pills: SkillCardPill[] = [+ {+ id: `type-${skill.type}`,+ node: <SkillTypeBadge type={skill.type} />,+ },+ ];++ if (skill.version) {+ pills.push({+ id: `version-${skill.version}`,+ node: (+ <span+ data-testid={+ pillTestId(testIdPrefix, skill.name, "version") ??+ `skill-version-${skill.name}`+ }+ className={SKILL_CARD_PILL_CLASS}+ >+ {translate(I18nKey.SETTINGS$SKILLS_VERSION, {+ version: skill.version,+ })}+ </span>+ ),+ });+ }++ if (variant === "detail" && skill.license) {+ pills.push({+ id: `license-${skill.license}`,+ node: (+ <span+ data-testid={pillTestId(testIdPrefix, skill.name, "license")}+ className={SKILL_CARD_PILL_CLASS}+ >+ {skill.license}+ </span>+ ),+ });+ }++ if (variant === "detail" && skill.compatibility) {+ pills.push({+ id: `compatibility-${skill.compatibility}`,+ node: (+ <span+ data-testid={pillTestId(testIdPrefix, skill.name, "compatibility")}+ className={SKILL_CARD_PILL_CLASS}+ >+ {skill.compatibility}+ </span>+ ),+ });+ }++ if (skill.disable_model_invocation) {+ pills.push({+ id: "disable-model-invocation",+ node: (+ <span+ data-testid={+ pillTestId(testIdPrefix, skill.name, "disable-model-invocation") ??+ `skill-disable-model-invocation-${skill.name}`+ }+ className="inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full border border-[rgba(248,113,113,0.35)] bg-[rgba(248,113,113,0.12)] px-2 py-0.5 text-[11px] font-medium leading-4 text-[#fca5a5]"+ >+ <span className="size-1.5 rounded-full bg-[#fca5a5]" />+ {translate(I18nKey.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)}+ </span>+ ),+ });+ }++ if (variant === "detail" && skill.allowed_tools) {+ for (const tool of skill.allowed_tools) {+ pills.push({+ id: `allowed-tool-${tool}`,+ node: (+ <span+ data-testid={pillTestId(testIdPrefix, skill.name, `tool-${tool}`)}+ className={cn(SKILL_CARD_PILL_CLASS, "font-mono")}+ >+ {tool}+ </span>+ ),+ });+ }+ }++ if (variant === "detail" && skill.metadata) {+ for (const [key, value] of Object.entries(skill.metadata)) {+ pills.push({+ id: `metadata-${key}`,+ node: (+ <span+ data-testid={pillTestId(+ testIdPrefix,+ skill.name,+ `metadata-${key}`,+ )}+ className={SKILL_CARD_PILL_CLASS}+ >+ <span className="font-mono text-[10px] text-tertiary-light">+ {key}:+ </span>{" "}+ {value}+ </span>+ ),+ });+ }+ }++ for (const trigger of skill.triggers ?? []) {+ pills.push({+ id: `trigger-${trigger}`,+ node: (+ <span+ data-testid={pillTestId(+ testIdPrefix,+ skill.name,+ `trigger-${trigger}`,+ )}+ className={SKILL_CARD_PILL_CLASS}+ >+ {trigger}+ </span>+ ),+ });+ }++ return pills;+}diff --git a/src/components/features/skills/get-skill-card-description.ts b/src/components/features/skills/get-skill-card-description.tsnew file mode 100644index 0000000000..e495cdcfeb--- /dev/null+++ b/src/components/features/skills/get-skill-card-description.ts@@ -0,0 +1,64 @@+import type { SkillInfo } from "#/types/settings";++const FRONTMATTER_PATTERN = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;++function parseDescriptionFromFrontmatter(frontmatter: string): string | null {+ const blockMatch = frontmatter.match(+ /^description:\s*\|\s*\r?\n((?:[ \t].*(?:\r?\n|$))+)/m,+ );+ if (blockMatch) {+ return blockMatch[1]!.replace(/^[ \t]+/gm, "").trim();+ }++ const quotedMatch = frontmatter.match(/^description:\s*['"](.+?)['"]\s*$/m);+ if (quotedMatch) {+ return quotedMatch[1]!.trim();+ }++ const inlineMatch = frontmatter.match(/^description:\s*(.+)\s*$/m);+ if (inlineMatch) {+ return inlineMatch[1]!.trim();+ }++ return null;+}++function stripFrontmatter(content: string): string {+ const match = content.match(FRONTMATTER_PATTERN);+ if (!match) return content.trim();+ return content.slice(match[0].length).trim();+}++function extractBodyPreview(body: string): string {+ const withoutTitle = body.replace(/^#+\s+[^\n]+\n+/, "").trim();+ const paragraph =+ withoutTitle+ .split(/\n\s*\n/)+ .map((part) => part.replace(/\s+/g, " ").trim())+ .find((part) => part.length > 0) ??+ withoutTitle.replace(/\s+/g, " ").trim();++ return paragraph;+}++/**+ * Subtitle text for skill cards: prefer API `description`, then YAML+ * frontmatter inside `content`, then the first body paragraph.+ */+export function getSkillCardDescription(skill: SkillInfo): string {+ const description = skill.description?.trim();+ if (description) return description;++ const content = skill.content?.trim();+ if (!content) return "";++ const frontmatterMatch = content.match(FRONTMATTER_PATTERN);+ if (frontmatterMatch) {+ const fromFrontmatter = parseDescriptionFromFrontmatter(+ frontmatterMatch[1]!,+ );+ if (fromFrontmatter) return fromFrontmatter;+ }++ return extractBodyPreview(stripFrontmatter(content));+}diff --git a/src/components/features/skills/get-skill-chat-launch-message.ts b/src/components/features/skills/get-skill-chat-launch-message.tsnew file mode 100644index 0000000000..b54bcfc06e--- /dev/null+++ b/src/components/features/skills/get-skill-chat-launch-message.ts@@ -0,0 +1,15 @@+import {+ ADD_SKILL_EXAMPLE_COMMAND,+ ADD_SKILL_SKILL_NAME,+} from "#/constants/skills-docs";+import type { SkillInfo } from "#/types/settings";++export function getSkillChatLaunchMessage(+ skill: Pick<SkillInfo, "name">,+): string {+ if (skill.name === ADD_SKILL_SKILL_NAME) {+ return ADD_SKILL_EXAMPLE_COMMAND;+ }++ return `/${skill.name} `;+}diff --git a/src/components/features/skills/is-copyable-skill-source.ts b/src/components/features/skills/is-copyable-skill-source.tsnew file mode 100644index 0000000000..3218999b36--- /dev/null+++ b/src/components/features/skills/is-copyable-skill-source.ts@@ -0,0 +1,21 @@+/** True when `source` is a filesystem path or URL worth copying (not a scope label like "global"). */+export function isCopyableSkillSource(+ source: string | null | undefined,+): boolean {+ const trimmed = source?.trim();+ if (!trimmed) return false;++ if (/^https?:\/\//i.test(trimmed)) return true;+ if (+ trimmed.startsWith("/") ||+ trimmed.startsWith("./") ||+ trimmed.startsWith("../") ||+ trimmed.startsWith("~")+ ) {+ return true;+ }+ if (/^[A-Za-z]:[\\/]/.test(trimmed)) return true;+ if (trimmed.includes("/") || trimmed.includes("\\")) return true;++ return false;+}diff --git a/src/components/features/skills/skill-card-pill-row.tsx b/src/components/features/skills/skill-card-pill-row.tsxnew file mode 100644index 0000000000..a1bb3a83b8--- /dev/null+++ b/src/components/features/skills/skill-card-pill-row.tsx@@ -0,0 +1,118 @@+import React from "react";+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import { cn } from "#/utils/utils";+import { extensionModuleCardPillClassName } from "#/utils/extension-module-card-classes";++/** @deprecated Use {@link extensionModuleCardPillClassName} from `#/utils/extension-module-card-classes`. */+export const SKILL_CARD_PILL_CLASS = extensionModuleCardPillClassName;++const PILL_GAP_PX = 6;+const OVERFLOW_PILL_WIDTH_PX = 40;++export interface SkillCardPill {+ id: string;+ node: React.ReactNode;+}++function computeVisiblePillCount(+ widths: number[],+ containerWidth: number,+): number {+ if (widths.length === 0 || containerWidth <= 0) return 0;++ let used = 0;+ for (let i = 0; i < widths.length; i += 1) {+ const width = widths[i]!;+ const gap = i > 0 ? PILL_GAP_PX : 0;+ const remaining = widths.length - i - 1;+ const reserve = remaining > 0 ? OVERFLOW_PILL_WIDTH_PX + PILL_GAP_PX : 0;+ if (used + gap + width + reserve > containerWidth) {+ return Math.max(1, i);+ }+ used += gap + width;+ }+ return widths.length;+}++interface SkillCardPillRowProps {+ pills: SkillCardPill[];+ testId: string;+}++export function SkillCardPillRow({ pills, testId }: SkillCardPillRowProps) {+ const { t } = useTranslation("openhands");+ const containerRef = React.useRef<HTMLDivElement>(null);+ const measureRef = React.useRef<HTMLDivElement>(null);+ const [visibleCount, setVisibleCount] = React.useState(pills.length);++ const recomputeVisibleCount = React.useCallback(() => {+ const container = containerRef.current;+ const measure = measureRef.current;+ if (!container || !measure) return;++ const widths = Array.from(measure.children).map(+ (child) => (child as HTMLElement).offsetWidth,+ );+ setVisibleCount(computeVisiblePillCount(widths, container.clientWidth));+ }, []);++ React.useLayoutEffect(() => {+ recomputeVisibleCount();+ }, [pills, recomputeVisibleCount]);++ React.useEffect(() => {+ const container = containerRef.current;+ if (!container || typeof ResizeObserver === "undefined") return undefined;++ const observer = new ResizeObserver(() => recomputeVisibleCount());+ observer.observe(container);+ return () => observer.disconnect();+ }, [recomputeVisibleCount]);++ if (pills.length === 0) return null;++ const hiddenCount = Math.max(0, pills.length - visibleCount);++ return (+ <div className="min-w-0 overflow-hidden">+ <div+ ref={measureRef}+ aria-hidden+ className="pointer-events-none fixed top-0 -left-[10000px] z-[-1] flex flex-nowrap items-center gap-1.5 opacity-0"+ >+ {pills.map((pill) => (+ <span key={pill.id} className="inline-flex shrink-0">+ {pill.node}+ </span>+ ))}+ </div>+ <div+ ref={containerRef}+ data-testid={testId}+ className="flex w-full min-w-0 max-w-full flex-nowrap items-center gap-1.5 overflow-hidden"+ >+ {pills.slice(0, visibleCount).map((pill) => (+ <span key={pill.id} className="inline-flex shrink-0">+ {pill.node}+ </span>+ ))}+ {hiddenCount > 0 ? (+ <span+ data-testid={`${testId}-overflow`}+ className={cn(+ extensionModuleCardPillClassName,+ "font-medium text-tertiary-alt",+ )}+ title={pills+ .slice(visibleCount)+ .map((pill) => pill.id)+ .join(", ")}+ >+ {t(I18nKey.SETTINGS$SKILLS_PILLS_MORE, { count: hiddenCount })}+ </span>+ ) : null}+ </div>+ </div>+ );+}diff --git a/src/components/features/skills/skill-card.tsx b/src/components/features/skills/skill-card.tsxindex 16648e3281..45282ae3cb 100644--- a/src/components/features/skills/skill-card.tsx+++ b/src/components/features/skills/skill-card.tsx@@ -1,245 +1,150 @@import React from "react";import { useTranslation } from "react-i18next";-import { SettingsSwitch } from "#/components/features/settings/settings-switch";import { I18nKey } from "#/i18n/declaration";import type { SkillInfo } from "#/types/settings";import { cn } from "#/utils/utils";-import {- displayErrorToast,- displaySuccessToast,-} from "#/utils/custom-toast-handlers";-import ChevronDownIcon from "#/icons/chevron-down.svg?react";import CopyIcon from "#/icons/copy.svg?react";-import { SkillTypeBadge } from "./skill-type-badge";+import CheckmarkIcon from "#/icons/checkmark.svg?react";+import { CirclePlusCheckToggle } from "#/components/shared/buttons/circle-plus-check-toggle";+import { SkillIconBadge } from "./skill-icon-badge";+import { SkillCardPillRow } from "./skill-card-pill-row";+import { getSkillCardDescription } from "./get-skill-card-description";+import { buildSkillPills } from "./build-skill-pills";+import { isCopyableSkillSource } from "./is-copyable-skill-source";+import {+ extensionModuleCardInteractiveClassName,+ extensionModuleCardSurfaceClassName,+} from "#/utils/extension-module-card-classes";interface SkillCardProps {skill: SkillInfo;enabled: boolean;+ onOpen: () => void;onToggle: (enabled: boolean) => void;}-const DESCRIPTION_CLAMP_THRESHOLD = 220;+export function SkillCard({+ skill,+ enabled,+ onOpen,+ onToggle,+}: SkillCardProps) {+ const { t } = useTranslation("openhands");+ const [sourceCopied, setSourceCopied] = React.useState(false);-function hasExpandableMetadata(skill: SkillInfo): boolean {- return Boolean(- skill.source ||- skill.license ||- skill.compatibility ||- (skill.allowed_tools && skill.allowed_tools.length > 0) ||- (skill.metadata && Object.keys(skill.metadata).length > 0),- );-}+ const description = getSkillCardDescription(skill);+ const pills = React.useMemo(() => buildSkillPills(skill, t), [skill, t]);+ const showCopySource = isCopyableSkillSource(skill.source);-export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {- const { t } = useTranslation("openhands");- const [showFullDescription, setShowFullDescription] = React.useState(false);- const [detailsOpen, setDetailsOpen] = React.useState(false);+ const handleCopySource = async (event: React.MouseEvent) => {+ event.stopPropagation();+ if (!skill.source) {+ return;+ }- const description = skill.description?.trim() || "";- const isDescriptionClamped = description.length > DESCRIPTION_CLAMP_THRESHOLD;- const showShowMoreButton = isDescriptionClamped;+ await navigator.clipboard.writeText(skill.source);+ setSourceCopied(true);+ };- const handleCopySource = async () => {- if (!skill.source) return;- try {- await navigator.clipboard.writeText(skill.source);- displaySuccessToast(t(I18nKey.SETTINGS$SKILLS_COPIED));- } catch {- displayErrorToast(t(I18nKey.ERROR$GENERIC));+ const handleKeyDown = (event: React.KeyboardEvent) => {+ if (event.key === "Enter" || event.key === " ") {+ event.preventDefault();+ onOpen();}};- const detailsAvailable = hasExpandableMetadata(skill);+ React.useEffect(() => {+ if (!sourceCopied) {+ return undefined;+ }++ const timeout = setTimeout(() => setSourceCopied(false), 2000);+ return () => clearTimeout(timeout);+ }, [sourceCopied]);return (- <article+ <divdata-testid={`skill-card-${skill.name}`}+ role="button"+ tabIndex={0}+ onClick={onOpen}+ onKeyDown={handleKeyDown}className={cn(- "flex flex-col gap-3 rounded-xl border border-[var(--oh-border)] bg-base-secondary p-4 transition-colors hover:border-[var(--cool-grey-500)] hover:bg-base-tertiary/30",- !enabled && "opacity-70",+ "flex min-w-0 flex-col gap-3 overflow-hidden p-4",+ extensionModuleCardSurfaceClassName,+ extensionModuleCardInteractiveClassName,)}>- <header className="flex items-center justify-between gap-3">- <div className="flex min-w-0 flex-1 items-center gap-2">- <span- data-testid={`skill-name-${skill.name}`}- className="text-sm font-semibold text-white truncate"- >- {skill.name}- </span>- </div>- <div className="flex shrink-0 flex-wrap items-center justify-end gap-1.5">- <SkillTypeBadge type={skill.type} />- {skill.version && (- <span- data-testid={`skill-version-${skill.name}`}- className="inline-flex items-center rounded-full border border-[var(--oh-border)] px-2 py-0.5 text-[11px] font-medium text-tertiary-light"- >- {t(I18nKey.SETTINGS$SKILLS_VERSION, { version: skill.version })}- </span>- )}- {skill.disable_model_invocation && (- <span- data-testid={`skill-disable-model-invocation-${skill.name}`}- className="inline-flex items-center gap-1 rounded-full border border-[rgba(248,113,113,0.35)] bg-[rgba(248,113,113,0.12)] px-2 py-0.5 text-[11px] font-medium text-[#fca5a5]"- >- <span className="size-1.5 rounded-full bg-[#fca5a5]" />- {t(I18nKey.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)}- </span>- )}- <SettingsSwitch- testId={`skill-toggle-${skill.name}`}- isToggled={enabled}- onToggle={onToggle}- />- </div>- </header>-- <div data-testid={`skill-description-${skill.name}`} className="text-sm">- {description ? (- <p- className={cn(- "whitespace-pre-wrap text-tertiary-light leading-5",- !showFullDescription && isDescriptionClamped && "line-clamp-3",- )}- >- {description}- </p>- ) : null}- {showShowMoreButton && (- <button- type="button"- onClick={() => setShowFullDescription((prev) => !prev)}- data-testid={`skill-show-more-${skill.name}`}- className="mt-1 text-xs font-normal text-[var(--oh-muted)] hover:text-white hover:underline transition-colors"- >- {showFullDescription- ? t(I18nKey.SETTINGS$SKILLS_SHOW_LESS)- : t(I18nKey.SETTINGS$SKILLS_SHOW_MORE)}- </button>- )}- </div>-- {skill.triggers && skill.triggers.length > 0 && (- <div- data-testid={`skill-triggers-${skill.name}`}- className="flex flex-wrap items-center gap-1.5"- >- {skill.triggers.map((trigger) => (- <span- key={trigger}- className="inline-flex items-center rounded-md border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-1.5 py-0.5 text-[11px] text-tertiary-light"- >- {trigger}- </span>- ))}- </div>- )}-- {detailsAvailable && (- <div className="pt-2">- <button- type="button"- data-testid={`skill-details-toggle-${skill.name}`}- aria-expanded={detailsOpen}- onClick={() => setDetailsOpen((prev) => !prev)}- className="flex w-full items-center justify-between text-xs font-normal text-tertiary-light hover:text-white"- >- <span>{t(I18nKey.SETTINGS$SKILLS_DETAILS)}</span>- <ChevronDownIcon- className={cn(- "size-3.5 transition-transform",- detailsOpen && "rotate-180",- )}- aria-hidden- />- </button>-- {detailsOpen && (- <dl- data-testid={`skill-details-${skill.name}`}- className="mt-2 grid grid-cols-1 gap-2 text-xs sm:grid-cols-[max-content_1fr]"- >- {skill.source && (- <>- <dt className="text-tertiary-light">- {t(I18nKey.SETTINGS$SKILLS_SOURCE)}- </dt>- <dd className="flex items-center gap-2 min-w-0">- <code- data-testid={`skill-source-${skill.name}`}- className="block break-all rounded bg-[rgba(255,255,255,0.04)] px-1.5 py-0.5 font-mono text-[11px] text-white"- >- {skill.source}- </code>+ <div className="flex items-start gap-3">+ <SkillIconBadge skillName={skill.name} />+ <div className="flex min-w-0 flex-1 flex-col gap-3">+ <header className="flex items-start justify-between gap-3">+ <div className="min-w-0 flex-1">+ <h3+ data-testid={`skill-name-${skill.name}`}+ className="truncate text-sm font-semibold text-white"+ >+ {skill.name}+ </h3>+ {skill.source ? (+ <div className="mt-0.5 flex min-w-0 items-center gap-1">+ <p+ data-testid={`skill-source-${skill.name}`}+ className="min-w-0 flex-1 truncate text-xs text-tertiary-alt"+ title={skill.source}+ >+ {skill.source}+ </p>+ {showCopySource ? (<buttontype="button"- onClick={handleCopySource}- aria-label={t(I18nKey.SETTINGS$SKILLS_COPY_PATH)}data-testid={`skill-copy-source-${skill.name}`}- className="shrink-0 rounded p-1 text-tertiary-light hover:bg-[rgba(255,255,255,0.06)] hover:text-white"+ aria-label={t(+ sourceCopied+ ? I18nKey.BUTTON$COPIED+ : I18nKey.SETTINGS$SKILLS_COPY_PATH,+ )}+ disabled={sourceCopied}+ onClick={handleCopySource}+ className="shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current">- <CopyIcon className="size-3.5" />+ {sourceCopied ? (+ <CheckmarkIcon width={12} height={12} />+ ) : (+ <CopyIcon width={12} height={12} />+ )}</button>- </dd>- </>- )}- {skill.license && (- <>- <dt className="text-tertiary-light">- {t(I18nKey.SETTINGS$SKILLS_LICENSE)}- </dt>- <dd className="text-white">{skill.license}</dd>- </>- )}- {skill.compatibility && (- <>- <dt className="text-tertiary-light">- {t(I18nKey.SETTINGS$SKILLS_COMPATIBILITY)}- </dt>- <dd className="text-white">{skill.compatibility}</dd>- </>- )}- {skill.allowed_tools && skill.allowed_tools.length > 0 && (- <>- <dt className="text-tertiary-light">- {t(I18nKey.SETTINGS$SKILLS_ALLOWED_TOOLS)}- </dt>- <dd className="flex flex-wrap gap-1">- {skill.allowed_tools.map((tool) => (- <span- key={tool}- className="inline-flex items-center rounded-md border border-[var(--oh-border)] px-1.5 py-0.5 font-mono text-[11px] text-tertiary-light"- >- {tool}- </span>- ))}- </dd>- </>- )}- {skill.metadata && Object.keys(skill.metadata).length > 0 && (- <>- <dt className="text-tertiary-light">- {t(I18nKey.SETTINGS$SKILLS_METADATA)}- </dt>- <dd>- <ul className="flex flex-col gap-0.5">- {Object.entries(skill.metadata).map(([key, value]) => (- <li key={key} className="flex gap-2">- <span className="font-mono text-[11px] text-tertiary-light">- {key}:- </span>- <span className="text-white">{value}</span>- </li>- ))}- </ul>- </dd>- </>- )}- </dl>- )}+ ) : null}+ </div>+ ) : null}+ </div>+ <CirclePlusCheckToggle+ testId={`skill-toggle-${skill.name}`}+ isSelected={enabled}+ onToggle={onToggle}+ disableTooltipKey={I18nKey.COMMON$DISABLE}+ />+ </header>++ {description ? (+ <div+ data-testid={`skill-description-${skill.name}`}+ className="min-w-0"+ >+ <p className="line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light">+ {description}+ </p>+ </div>+ ) : null}++ {pills.length > 0 ? (+ <SkillCardPillRow+ pills={pills}+ testId={`skill-triggers-${skill.name}`}+ />+ ) : null}</div>- )}- </article>+ </div>+ </div>);}diff --git a/src/components/features/skills/skill-detail-modal.tsx b/src/components/features/skills/skill-detail-modal.tsxnew file mode 100644index 0000000000..f81ce71c0f--- /dev/null+++ b/src/components/features/skills/skill-detail-modal.tsx@@ -0,0 +1,215 @@+import React from "react";+import { useTranslation } from "react-i18next";+import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";+import { ModalCloseButton } from "#/components/shared/modals/modal-close-button";+import { BrandButton } from "#/components/features/settings/brand-button";+import { SettingsSwitch } from "#/components/features/settings/settings-switch";+import { I18nKey } from "#/i18n/declaration";+import type { SkillInfo } from "#/types/settings";+import { cn } from "#/utils/utils";+import CopyIcon from "#/icons/copy.svg?react";+import CheckmarkIcon from "#/icons/checkmark.svg?react";+import MessageSquareShareIcon from "#/icons/message-square-share.svg?react";+import { SkillIconBadge } from "./skill-icon-badge";+import { getSkillCardDescription } from "./get-skill-card-description";+import { buildSkillPills } from "./build-skill-pills";+import { isCopyableSkillSource } from "./is-copyable-skill-source";+import { SkillCardPillRow } from "./skill-card-pill-row";+import { getSkillChatLaunchMessage } from "./get-skill-chat-launch-message";+import { useLaunchSkillInChat } from "#/hooks/use-launch-skill-in-chat";++interface SkillDetailModalProps {+ skill: SkillInfo;+ enabled: boolean;+ onToggle: (enabled: boolean) => void;+ onClose: () => void;+}++function ReadonlyTextArea({+ testId,+ label,+ value,+}: {+ testId: string;+ label: string;+ value: string;+}) {+ return (+ <label className="flex min-w-0 w-full flex-col gap-2.5">+ <span className="text-sm">{label}</span>+ <textarea+ data-testid={testId}+ readOnly+ value={value}+ rows={Math.min(12, Math.max(4, value.split("\n").length))}+ className={cn(+ "bg-[var(--oh-surface-raised)] border border-[var(--oh-border-subtle)] w-full min-w-0 rounded-sm p-2 text-sm",+ "cursor-not-allowed resize-none custom-scrollbar",+ )}+ />+ </label>+ );+}++export function SkillDetailModal({+ skill,+ enabled,+ onToggle,+ onClose,+}: SkillDetailModalProps) {+ const { t } = useTranslation("openhands");+ const launchSkillInChat = useLaunchSkillInChat();+ const [sourceCopied, setSourceCopied] = React.useState(false);+ const chatLaunchMessage = React.useMemo(+ () => getSkillChatLaunchMessage(skill),+ [skill],+ );++ const description = getSkillCardDescription(skill);+ const pills = React.useMemo(+ () =>+ buildSkillPills(skill, t, {+ variant: "detail",+ testIdPrefix: "skill-modal-pill",+ }),+ [skill, t],+ );+ const showCopySource = isCopyableSkillSource(skill.source);++ const handleCopySource = async () => {+ if (!skill.source) {+ return;+ }++ await navigator.clipboard.writeText(skill.source);+ setSourceCopied(true);+ };++ React.useEffect(() => {+ if (!sourceCopied) {+ return undefined;+ }++ const timeout = setTimeout(() => setSourceCopied(false), 2000);+ return () => clearTimeout(timeout);+ }, [sourceCopied]);++ return (+ <ModalBackdrop onClose={onClose} aria-label={skill.name}>+ <div+ data-testid="skill-detail-modal"+ data-skill-name={skill.name}+ className="relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[85vh] overflow-y-auto custom-scrollbar"+ >+ <ModalCloseButton onClose={onClose} testId="skill-detail-modal-close" />+ <div className="flex items-start gap-3 pr-6">+ <SkillIconBadge skillName={skill.name} />+ <div className="min-w-0 flex-1">+ <h2+ data-testid={`skill-modal-name-${skill.name}`}+ className="text-lg font-semibold"+ >+ {skill.name}+ </h2>+ {skill.source ? (+ <div className="mt-0.5 flex min-w-0 items-center gap-1">+ <p+ data-testid={`skill-modal-source-${skill.name}`}+ className="min-w-0 flex-1 truncate text-xs text-tertiary-alt"+ title={skill.source}+ >+ {skill.source}+ </p>+ {showCopySource ? (+ <button+ type="button"+ data-testid={`skill-modal-copy-source-${skill.name}`}+ aria-label={t(+ sourceCopied+ ? I18nKey.BUTTON$COPIED+ : I18nKey.SETTINGS$SKILLS_COPY_PATH,+ )}+ disabled={sourceCopied}+ onClick={handleCopySource}+ className="shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current"+ >+ {sourceCopied ? (+ <CheckmarkIcon width={12} height={12} />+ ) : (+ <CopyIcon width={12} height={12} />+ )}+ </button>+ ) : null}+ </div>+ ) : null}+ </div>+ </div>++ <div+ data-testid={`skill-modal-enable-row-${skill.name}`}+ className="flex w-full items-center rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5"+ >+ <SettingsSwitch+ testId={`skill-modal-toggle-${skill.name}`}+ isToggled={enabled}+ onToggle={onToggle}+ togglePosition="right"+ >+ {t(+ enabled+ ? I18nKey.SETTINGS$SKILLS_ENABLED+ : I18nKey.SETTINGS$SKILLS_DISABLED,+ )}+ </SettingsSwitch>+ </div>++ {description ? (+ <p+ data-testid={`skill-modal-description-${skill.name}`}+ className="text-xs text-tertiary-light"+ >+ {description}+ </p>+ ) : null}++ {pills.length > 0 ? (+ <SkillCardPillRow+ pills={pills}+ testId={`skill-modal-pills-${skill.name}`}+ />+ ) : null}++ {skill.content ? (+ <ReadonlyTextArea+ testId={`skill-modal-field-content-${skill.name}`}+ label={t(I18nKey.SETTINGS$SKILLS_CONTENT)}+ value={skill.content}+ />+ ) : null}++ <div className="mt-2 flex justify-end gap-2">+ <BrandButton+ type="button"+ variant="secondary"+ onClick={onClose}+ testId="skill-detail-close"+ >+ {t(I18nKey.BUTTON$CLOSE)}+ </BrandButton>+ <BrandButton+ type="button"+ variant="primary"+ isDisabled={!enabled}+ onClick={() => launchSkillInChat(chatLaunchMessage, onClose)}+ testId={`skill-detail-use-skill-${skill.name}`}+ startContent={+ <MessageSquareShareIcon className="size-4" aria-hidden />+ }+ >+ {t(I18nKey.SETTINGS$SKILLS_USE_SKILL_BUTTON)}+ </BrandButton>+ </div>+ </div>+ </ModalBackdrop>+ );+}diff --git a/src/components/features/skills/skill-icon-badge.tsx b/src/components/features/skills/skill-icon-badge.tsxnew file mode 100644index 0000000000..0291bd7f46--- /dev/null+++ b/src/components/features/skills/skill-icon-badge.tsx@@ -0,0 +1,26 @@+import SkillsIcon from "#/icons/skills.svg?react";+import { cn } from "#/utils/utils";++interface SkillIconBadgeProps {+ skillName: string;+ className?: string;+}++export function SkillIconBadge({ skillName, className }: SkillIconBadgeProps) {+ return (+ <span+ aria-hidden="true"+ title={skillName}+ data-testid={`skill-icon-${skillName}`}+ className={cn(+ "inline-flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden",+ "rounded-lg border border-white/10 bg-surface-raised text-white",+ "shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]",+ "[&>svg]:h-5 [&>svg]:w-5",+ className,+ )}+ >+ <SkillsIcon />+ </span>+ );+}diff --git a/src/components/features/skills/skill-type-badge.tsx b/src/components/features/skills/skill-type-badge.tsxindex 349a3498a5..21812ebf9d 100644--- a/src/components/features/skills/skill-type-badge.tsx+++ b/src/components/features/skills/skill-type-badge.tsx@@ -1,46 +1,38 @@import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import type { SkillType } from "#/types/settings";-import { cn } from "#/utils/utils";interface SkillTypeBadgeProps {type: SkillType;}-const TYPE_CONFIG: Record<- SkillType,- {- labelKey: I18nKey;- className: string;- }-> = {+/** Theme-aware pill chrome for skill type badges only (not shared metadata pills). */+const SKILL_TYPE_BADGE_CLASS_NAME =+ "inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-text-secondary/35 bg-text-secondary/12 px-2 py-0.5 text-[11px] font-medium leading-4 text-tertiary-light";++const TYPE_CONFIG: Record<SkillType, { labelKey: I18nKey }> = {agentskills: {labelKey: I18nKey.SETTINGS$SKILLS_TYPE_AGENTSKILLS,- className:- "bg-[rgba(247,206,109,0.12)] text-primary border border-[rgba(247,206,109,0.35)]",},knowledge: {labelKey: I18nKey.SETTINGS$SKILLS_TYPE_KNOWLEDGE,- className:- "bg-[rgba(96,165,250,0.12)] text-[#93c5fd] border border-[rgba(96,165,250,0.35)]",},repo: {labelKey: I18nKey.SETTINGS$SKILLS_TYPE_REPO,- className:- "bg-[rgba(52,211,153,0.12)] text-[#6ee7b7] border border-[rgba(52,211,153,0.35)]",},};+export function getSkillTypeLabelKey(type: SkillType): I18nKey {+ return TYPE_CONFIG[type].labelKey;+}+export function SkillTypeBadge({ type }: SkillTypeBadgeProps) {const { t } = useTranslation("openhands");const config = TYPE_CONFIG[type];return (<spandata-testid={`skill-type-badge-${type}`}- className={cn(- "inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium leading-4",- config.className,- )}+ className={SKILL_TYPE_BADGE_CLASS_NAME}>{t(config.labelKey)}</span>diff --git a/src/components/features/skills/skills-toolbar.tsx b/src/components/features/skills/skills-toolbar.tsxindex 25715ae15f..91d4a36637 100644--- a/src/components/features/skills/skills-toolbar.tsx+++ b/src/components/features/skills/skills-toolbar.tsx@@ -2,46 +2,33 @@ import { Search, X } from "lucide-react";import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import { cn } from "#/utils/utils";-import {- formControlInlineInputClassName,- formControlShellClassName,-} from "#/utils/form-control-classes";-import {- SKILL_TYPE_FILTER_OPTIONS,- type SkillTypeFilter,-} from "./skill-type-filter";+import type { SkillTypeFilter } from "./skill-type-filter";+import { SkillsTypeFilterDropdown } from "./skills-type-filter-dropdown";interface SkillsToolbarProps {search: string;onSearchChange: (value: string) => void;typeFilter: SkillTypeFilter;onTypeFilterChange: (filter: SkillTypeFilter) => void;- shown: number;- total: number;}-const FILTER_LABEL_KEY: Record<SkillTypeFilter, I18nKey> = {- all: I18nKey.SETTINGS$SKILLS_TYPE_ALL,- agentskills: I18nKey.SETTINGS$SKILLS_TYPE_AGENTSKILLS,- knowledge: I18nKey.SETTINGS$SKILLS_TYPE_KNOWLEDGE,- repo: I18nKey.SETTINGS$SKILLS_TYPE_REPO,-};-export function SkillsToolbar({search,onSearchChange,typeFilter,onTypeFilterChange,- shown,- total,}: SkillsToolbarProps) {const { t } = useTranslation("openhands");return (- <div data-testid="skills-toolbar" className="flex flex-col gap-6">+ <div data-testid="skills-toolbar" className="flex items-stretch gap-2"><div- data-testid="skills-toolbar-search"- className={cn(formControlShellClassName, "w-full lg:w-1/2")}+ className={cn(+ "relative flex flex-1 min-w-0 items-center",+ "rounded-lg border border-[var(--oh-border)] bg-base-secondary",+ "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",+ "transition-colors",+ )}><SearchclassName="ml-3 h-4 w-4 shrink-0 text-tertiary-alt"@@ -54,9 +41,8 @@ export function SkillsToolbar({onChange={(e) => onSearchChange(e.target.value)}placeholder={t(I18nKey.SETTINGS$SKILLS_SEARCH_PLACEHOLDER)}aria-label={t(I18nKey.SETTINGS$SKILLS_SEARCH_PLACEHOLDER)}- className={formControlInlineInputClassName}/>- {search && (+ {search ? (<buttontype="button"onClick={() => onSearchChange("")}@@ -65,43 +51,13 @@ export function SkillsToolbar({><X className="h-4 w-4" aria-hidden /></button>- )}+ ) : null}</div>- <div className="flex flex-wrap items-center gap-2">- <div- data-testid="skills-type-filter"- className="flex flex-wrap items-center gap-1.5"- >- {SKILL_TYPE_FILTER_OPTIONS.map((option) => {- const active = option === typeFilter;- return (- <button- key={option}- type="button"- data-testid={`skills-type-filter-${option}`}- aria-pressed={active}- onClick={() => onTypeFilterChange(option)}- className={cn(- "rounded-full border px-3 py-1 text-xs font-normal transition-colors cursor-pointer",- active- ? "border-white/60 bg-white/10 text-white"- : "border-[var(--oh-border)] bg-transparent text-tertiary-light hover:border-[var(--cool-grey-500)] hover:text-white",- )}- >- {t(FILTER_LABEL_KEY[option])}- </button>- );- })}- </div>-- <span- data-testid="skills-count"- className="text-xs text-tertiary-light whitespace-nowrap pr-2"- >- {t(I18nKey.SETTINGS$SKILLS_COUNT, { shown, total })}- </span>- </div>+ <SkillsTypeFilterDropdown+ value={typeFilter}+ onChange={onTypeFilterChange}+ /></div>);}diff --git a/src/components/features/skills/skills-type-filter-dropdown.tsx b/src/components/features/skills/skills-type-filter-dropdown.tsxnew file mode 100644index 0000000000..e37568cc9c--- /dev/null+++ b/src/components/features/skills/skills-type-filter-dropdown.tsx@@ -0,0 +1,33 @@+import { I18nKey } from "#/i18n/declaration";+import { EnumFilterDropdown } from "#/components/shared/filters/enum-filter-dropdown";+import {+ SKILL_TYPE_FILTER_OPTIONS,+ type SkillTypeFilter,+} from "./skill-type-filter";++const FILTER_LABEL_KEY: Record<SkillTypeFilter, I18nKey> = {+ all: I18nKey.SETTINGS$SKILLS_TYPE_ALL,+ agentskills: I18nKey.SETTINGS$SKILLS_TYPE_AGENTSKILLS,+ knowledge: I18nKey.SETTINGS$SKILLS_TYPE_KNOWLEDGE,+ repo: I18nKey.SETTINGS$SKILLS_TYPE_REPO,+};++interface SkillsTypeFilterDropdownProps {+ value: SkillTypeFilter;+ onChange: (filter: SkillTypeFilter) => void;+}++export function SkillsTypeFilterDropdown({+ value,+ onChange,+}: SkillsTypeFilterDropdownProps) {+ return (+ <EnumFilterDropdown+ testId="skills-type-filter"+ value={value}+ onChange={onChange}+ options={SKILL_TYPE_FILTER_OPTIONS}+ labelKeyByValue={FILTER_LABEL_KEY}+ />+ );+}diff --git a/src/components/shared/buttons/circle-plus-check-toggle.tsx b/src/components/shared/buttons/circle-plus-check-toggle.tsxnew file mode 100644index 0000000000..992eeb7781--- /dev/null+++ b/src/components/shared/buttons/circle-plus-check-toggle.tsx@@ -0,0 +1,121 @@+import React from "react";+import { useTranslation } from "react-i18next";+import PlusIcon from "#/icons/u-plus.svg?react";+import CheckmarkIcon from "#/icons/checkmark.svg?react";+import RemoveIcon from "#/icons/x-mark.svg?react";+import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";+import { I18nKey } from "#/i18n/declaration";+import { cn } from "#/utils/utils";++interface CirclePlusCheckToggleProps {+ testId?: string;+ isSelected: boolean;+ onToggle: (selected: boolean) => void;+ isDisabled?: boolean;+ className?: string;+ enableLabelKey?: I18nKey;+ disableLabelKey?: I18nKey;+ enableTooltipKey?: I18nKey;+ disableTooltipKey?: I18nKey;+ removeTooltipKey?: I18nKey;+}++export function CirclePlusBadge({+ className,+ testId,+ tooltipKey = I18nKey.AUTOMATIONS$ADD_AUTOMATION,+}: {+ className?: string;+ testId?: string;+ tooltipKey?: I18nKey;+}) {+ const { t } = useTranslation("openhands");++ return (+ <StyledTooltip content={t(tooltipKey)} placement="top">+ <span+ aria-hidden="true"+ data-testid={testId}+ className={cn(+ "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-surface-raised text-white transition-colors hover:bg-[var(--oh-interactive-hover)]",+ className,+ )}+ >+ <PlusIcon className="size-3" />+ </span>+ </StyledTooltip>+ );+}++export function CirclePlusCheckToggle({+ testId,+ isSelected,+ onToggle,+ isDisabled = false,+ className,+ enableLabelKey = I18nKey.SETTINGS$SKILLS_ENABLE_SKILL,+ disableLabelKey = I18nKey.SETTINGS$SKILLS_DISABLE_SKILL,+ enableTooltipKey = I18nKey.COMMON$ENABLE,+ disableTooltipKey,+ removeTooltipKey = I18nKey.COMMON$REMOVE,+}: CirclePlusCheckToggleProps) {+ const { t } = useTranslation("openhands");+ const [isPointerOver, setIsPointerOver] = React.useState(false);++ const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {+ event.stopPropagation();+ if (isDisabled) {+ return;+ }+ onToggle(!isSelected);+ event.currentTarget.blur();+ };++ const showRemoveIcon = isSelected && isPointerOver;+ const selectedTooltipKey = disableTooltipKey ?? removeTooltipKey;+ const tooltipLabel = t(isSelected ? selectedTooltipKey : enableTooltipKey);+ const ariaLabel = t(isSelected ? disableLabelKey : enableLabelKey);++ return (+ <StyledTooltip content={tooltipLabel} placement="top">+ <button+ type="button"+ role="switch"+ aria-checked={isSelected}+ data-testid={testId}+ data-showing-remove={showRemoveIcon ? "true" : "false"}+ disabled={isDisabled}+ aria-label={ariaLabel}+ onClick={handleClick}+ onPointerEnter={() => setIsPointerOver(true)}+ onPointerLeave={() => setIsPointerOver(false)}+ className={cn(+ "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full p-0 transition-colors",+ isSelected &&+ (showRemoveIcon+ ? "border-0 bg-[rgba(248,113,113,0.14)] text-[#ef4444] hover:bg-[rgba(248,113,113,0.24)]"+ : "border border-white bg-transparent text-white [&_path]:fill-current"),+ !isSelected &&+ "border-0 bg-surface-raised text-white hover:bg-[var(--oh-interactive-hover)]",+ isDisabled && "cursor-not-allowed opacity-50",+ className,+ )}+ >+ {isSelected ? (+ showRemoveIcon ? (+ <RemoveIcon+ aria-hidden+ width={14}+ height={14}+ className="stroke-[2.5]"+ />+ ) : (+ <CheckmarkIcon aria-hidden width={14} height={14} />+ )+ ) : (+ <PlusIcon aria-hidden className="size-3" />+ )}+ </button>+ </StyledTooltip>+ );+}diff --git a/src/components/shared/filters/enum-filter-dropdown.tsx b/src/components/shared/filters/enum-filter-dropdown.tsxnew file mode 100644index 0000000000..e1a812183f--- /dev/null+++ b/src/components/shared/filters/enum-filter-dropdown.tsx@@ -0,0 +1,106 @@+import React from "react";+import { Check, ChevronDown } from "lucide-react";+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import { useClickOutsideElement } from "#/hooks/use-click-outside-element";+import { cn } from "#/utils/utils";++interface EnumFilterDropdownProps<T extends string> {+ testId: string;+ value: T;+ onChange: (value: T) => void;+ options: readonly T[];+ labelKeyByValue: Record<T, I18nKey>;+}++export function EnumFilterDropdown<T extends string>({+ testId,+ value,+ onChange,+ options,+ labelKeyByValue,+}: EnumFilterDropdownProps<T>) {+ const { t } = useTranslation("openhands");+ const [open, setOpen] = React.useState(false);+ const containerRef = useClickOutsideElement<HTMLDivElement>(() =>+ setOpen(false),+ );++ const defaultOption = options[0];+ const selectedLabel = t(labelKeyByValue[value]);++ return (+ <div+ ref={containerRef}+ className="relative shrink-0 w-auto"+ data-testid={testId}+ >+ <button+ type="button"+ data-testid="dropdown-trigger"+ aria-haspopup="menu"+ aria-expanded={open}+ aria-label={t(I18nKey.CONVERSATION_PANEL$FILTER_LABEL)}+ onClick={() => setOpen((prev) => !prev)}+ className={cn(+ "inline-flex items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium transition-colors cursor-pointer",+ "border-[var(--oh-border)] bg-base-secondary text-white",+ "focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20",+ defaultOption &&+ value !== defaultOption &&+ "border-white/60 bg-white/10",+ )}+ >+ <span className="whitespace-nowrap">{selectedLabel}</span>+ <ChevronDown+ className={cn(+ "h-4 w-4 shrink-0 text-tertiary-alt transition-transform",+ open && "rotate-180",+ )}+ aria-hidden+ />+ </button>++ {open ? (+ <div+ role="menu"+ data-testid={`${testId}-menu`}+ aria-label={t(I18nKey.CONVERSATION_PANEL$FILTER_LABEL)}+ className={cn(+ "absolute right-0 top-full z-50 mt-1 min-w-full w-max",+ "max-h-60 overflow-auto rounded-[6px] bg-tertiary p-1 context-menu-box-shadow",+ )}+ >+ {options.map((option) => {+ const selected = option === value;+ return (+ <button+ key={option}+ type="button"+ role="menuitemradio"+ aria-checked={selected}+ data-testid={`${testId}-${option}`}+ onClick={() => {+ onChange(option);+ setOpen(false);+ }}+ className={cn(+ "flex w-full items-center gap-2 rounded px-2 py-2 text-left text-sm text-white",+ "hover:bg-[var(--oh-interactive-hover)] cursor-pointer",+ selected && "bg-[var(--oh-interactive-selected)]",+ )}+ >+ <span className="min-w-0 flex-1 truncate">+ {t(labelKeyByValue[option])}+ </span>+ {selected ? (+ <Check className="h-4 w-4 shrink-0" aria-hidden />+ ) : null}+ </button>+ );+ })}+ </div>+ ) : null}+ </div>+ );+}diff --git a/src/components/shared/modals/modal-close-button.tsx b/src/components/shared/modals/modal-close-button.tsxnew file mode 100644index 0000000000..0f48b0ad30--- /dev/null+++ b/src/components/shared/modals/modal-close-button.tsx@@ -0,0 +1,36 @@+import { useTranslation } from "react-i18next";+import ModalCloseIcon from "#/icons/modal-close.svg?react";+import { I18nKey } from "#/i18n/declaration";+import { cn } from "#/utils/utils";++interface ModalCloseButtonProps {+ onClose: () => void;+ testId?: string;+ className?: string;+ disabled?: boolean;+}++export function ModalCloseButton({+ onClose,+ testId,+ className,+ disabled = false,+}: ModalCloseButtonProps) {+ const { t } = useTranslation("openhands");++ return (+ <button+ type="button"+ data-testid={testId}+ onClick={onClose}+ disabled={disabled}+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ className={cn(+ "absolute right-4 top-4 z-10 flex cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-1 text-tertiary-alt transition-colors hover:bg-surface-raised hover:text-white disabled:cursor-not-allowed disabled:opacity-50",+ className,+ )}+ >+ <ModalCloseIcon aria-hidden className="size-4" />+ </button>+ );+}diff --git a/src/constants/skills-docs.ts b/src/constants/skills-docs.tsnew file mode 100644index 0000000000..9a9e99d80a--- /dev/null+++ b/src/constants/skills-docs.ts@@ -0,0 +1,7 @@+export const ADD_SKILL_DOCS_URL =+ "https://docs.openhands.dev/overview/skills/adding#adding-new-skills";++export const ADD_SKILL_SKILL_NAME = "add-skill";++export const ADD_SKILL_EXAMPLE_COMMAND =+ "/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview";diff --git a/src/hooks/chat/use-draft-persistence.ts b/src/hooks/chat/use-draft-persistence.tsindex a39fa70051..d0d40f999e 100644--- a/src/hooks/chat/use-draft-persistence.ts+++ b/src/hooks/chat/use-draft-persistence.ts@@ -4,7 +4,10 @@ import {getConversationState,setConversationState,} from "#/utils/conversation-local-storage";-import { getTextContent } from "#/components/features/chat/utils/chat-input.utils";+import {+ focusContentEditableAtEnd,+ getTextContent,+} from "#/components/features/chat/utils/chat-input.utils";/*** Check if a conversation ID is a temporary task ID.@@ -125,13 +128,7 @@ export const useDraftPersistence = (// Only restore if there's a saved draft and the input is emptyif (draftMessage && getTextContent(element).trim() === "") {element.textContent = draftMessage;- // Move cursor to end- const selection = window.getSelection();- const range = document.createRange();- range.selectNodeContents(element);- range.collapse(false);- selection?.removeAllRanges();- selection?.addRange(range);+ focusContentEditableAtEnd(element);}hasRestoredRef.current = true;diff --git a/src/hooks/query/use-automations.ts b/src/hooks/query/use-automations.tsindex 25fcbb58f6..712323a71d 100644--- a/src/hooks/query/use-automations.ts+++ b/src/hooks/query/use-automations.ts@@ -43,36 +43,38 @@ export function useToggleAutomation() {});}-export function useDispatchAutomation() {+export function useUpdateAutomation() {const queryClient = useQueryClient();return useMutation({- mutationFn: (id: string) => AutomationService.dispatchAutomation(id),+ mutationFn: ({ id, body }: { id: string; body: Partial<Automation> }) =>+ AutomationService.updateAutomation(id, body),onSuccess: () => {queryClient.invalidateQueries({ queryKey: AUTOMATIONS_QUERY_KEY });queryClient.invalidateQueries({ queryKey: AUTOMATION_DETAIL_QUERY_KEY });- queryClient.invalidateQueries({ queryKey: AUTOMATION_RUNS_QUERY_KEY });},});}-export function useUpdateAutomation() {+export function useDeleteAutomation() {const queryClient = useQueryClient();return useMutation({- mutationFn: ({ id, body }: { id: string; body: Partial<Automation> }) =>- AutomationService.updateAutomation(id, body),+ mutationFn: (id: string) => AutomationService.deleteAutomation(id),onSuccess: () => {queryClient.invalidateQueries({ queryKey: AUTOMATIONS_QUERY_KEY });- queryClient.invalidateQueries({ queryKey: AUTOMATION_DETAIL_QUERY_KEY });},});}-export function useDeleteAutomation() {+export function useDispatchAutomation() {const queryClient = useQueryClient();return useMutation({- mutationFn: (id: string) => AutomationService.deleteAutomation(id),- onSuccess: () => {+ mutationFn: (id: string) => AutomationService.dispatchAutomation(id),+ onSuccess: (_run, id) => {queryClient.invalidateQueries({ queryKey: AUTOMATIONS_QUERY_KEY });+ queryClient.invalidateQueries({ queryKey: AUTOMATION_DETAIL_QUERY_KEY });+ queryClient.invalidateQueries({+ queryKey: [...AUTOMATION_RUNS_QUERY_KEY, id],+ });},});}diff --git a/src/hooks/use-auto-resize.ts b/src/hooks/use-auto-resize.tsindex 52546d78ec..ad51ca8801 100644--- a/src/hooks/use-auto-resize.ts+++ b/src/hooks/use-auto-resize.ts@@ -2,6 +2,7 @@ import { useCallback, useEffect, RefObject, useRef } from "react";import { IMessageToSend } from "#/stores/conversation-store";import { EPS } from "#/utils/constants";import { getStyleHeightPx, setStyleHeightPx } from "#/utils/utils";+import { focusContentEditableAtEnd } from "#/components/features/chat/utils/chat-input.utils";import { useDragResize } from "./use-drag-resize";// Constants@@ -328,11 +329,35 @@ export const useAutoResize = (// Update content and resize when value prop changesuseEffect(() => {- const element = elementRef.current;- if (element && value !== undefined) {+ if (value === undefined) {+ return undefined;+ }++ let rafId = 0;++ const applyValue = () => {+ const element = elementRef.current;+ if (!element) {+ return false;+ }+element.textContent = value.text;smartResize();+ focusContentEditableAtEnd(element);+ return true;+ };++ if (!applyValue()) {+ rafId = requestAnimationFrame(() => {+ applyValue();+ });}++ return () => {+ if (rafId) {+ cancelAnimationFrame(rafId);+ }+ };}, [value, smartResize]);// Initialize auto-resize on mountdiff --git a/src/hooks/use-launch-skill-in-chat.ts b/src/hooks/use-launch-skill-in-chat.tsnew file mode 100644index 0000000000..73deb2b579--- /dev/null+++ b/src/hooks/use-launch-skill-in-chat.ts@@ -0,0 +1,21 @@+import { useCallback } from "react";+import { useNavigation } from "#/context/navigation-context";+import { useConversationStore } from "#/stores/conversation-store";++export function useLaunchSkillInChat() {+ const { navigate } = useNavigation();+ const setMessageToSend = useConversationStore(+ (state) => state.setMessageToSend,+ );++ return useCallback(+ (message: string, onClose?: () => void) => {+ onClose?.();+ navigate("/conversations");+ window.setTimeout(() => {+ setMessageToSend(message);+ }, 0);+ },+ [navigate, setMessageToSend],+ );+}diff --git a/src/i18n/translation.json b/src/i18n/translation.jsonindex 0ca4a0e16a..3cd3122bc2 100644--- a/src/i18n/translation.json+++ b/src/i18n/translation.json@@ -11474,6 +11474,23 @@"uk": "Переглядайте активні та неактивні автоматизації, шукайте за метаданими та переглядайте деталі лише для читання.","ca": "Visualitzeu les automatitzacions actives i inactives, cerqueu per metadades i inspeccioneu els detalls de només lectura."},+ "AUTOMATIONS$ADD_AUTOMATION": {+ "en": "Add Automation",+ "ja": "オートメーションを追加",+ "zh-CN": "添加自动化",+ "zh-TW": "新增自動化",+ "ko-KR": "자동화 추가",+ "no": "Legg til automatisering",+ "it": "Aggiungi automazione",+ "pt": "Adicionar automação",+ "es": "Agregar automatización",+ "ar": "إضافة أتمتة",+ "fr": "Ajouter une automatisation",+ "tr": "Otomasyon ekle",+ "de": "Automatisierung hinzufügen",+ "uk": "Додати автоматизацію",+ "ca": "Afegeix automatització"+ },"AUTOMATIONS$EMPTY": {"en": "No automations configured","ja": "オートメーションが設定されていません",@@ -11491,6 +11508,23 @@"uk": "Автоматизації не налаштовано","ca": "No hi ha automatitzacions configurades"},+ "AUTOMATIONS$EMPTY_HINT": {+ "en": "Pick one from the recommendations below to get started.",+ "ja": "下のおすすめから1つ選んで始めましょう。",+ "zh-CN": "从下方的推荐中选择一个开始使用。",+ "zh-TW": "從下方的推薦中選擇一個開始使用。",+ "ko-KR": "시작하려면 아래 추천 항목에서 하나를 선택하세요.",+ "no": "Velg en fra anbefalingene nedenfor for å komme i gang.",+ "it": "Scegline uno dai consigli qui sotto per iniziare.",+ "pt": "Escolha um das recomendações abaixo para começar.",+ "es": "Elige una de las recomendaciones de abajo para empezar.",+ "ar": "اختر واحدًا من التوصيات أدناه للبدء.",+ "fr": "Choisissez-en un parmi les recommandations ci-dessous pour commencer.",+ "tr": "Başlamak için aşağıdaki önerilerden birini seçin.",+ "de": "Wählen Sie unten eine Empfehlung aus, um loszulegen.",+ "uk": "Виберіть одну з рекомендацій нижче, щоб почати.",+ "ca": "Tria'n una de les recomanacions de sota per començar."+ },"AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE": {"en": "How to create an automation","ja": "オートメーションの作成方法",@@ -11577,21 +11611,38 @@"ca": "Ús d'OpenHands Cloud"},"AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC": {- "en": "Start a new conversation and ask OpenHands to create an automation for you.",- "ja": "新しい会話を開始し、OpenHandsにオートメーションの作成を依頼してください。",- "zh-CN": "开始新对话,请 OpenHands 为您创建自动化。",- "zh-TW": "開始新對話,並請 OpenHands 為您建立自動化。",- "ko-KR": "새 대화를 시작하고 OpenHands에 자동화 생성을 요청하세요.",- "no": "Start en ny samtale og be OpenHands om å opprette en automatisering for deg.",- "it": "Avvia una nuova conversazione e chiedi a OpenHands di creare un'automazione per te.",- "pt": "Inicie uma nova conversa e peça ao OpenHands para criar uma automação para você.",- "es": "Inicie una nueva conversación y pídale a OpenHands que cree una automatización para usted.",- "ar": "ابدأ محادثة جديدة واطلب من OpenHands إنشاء أتمتة لك.",- "fr": "Démarrez une nouvelle conversation et demandez à OpenHands de créer une automatisation pour vous.",- "tr": "Yeni bir konuşma başlatın ve OpenHands'ten sizin için bir otomasyon oluşturmasını isteyin.",- "de": "Starten Sie eine neue Konversation und bitten Sie OpenHands, eine Automatisierung für Sie zu erstellen.",- "uk": "Розпочніть нову розмову та попросіть OpenHands створити для вас автоматизацію.",- "ca": "Inicieu una nova conversa i demaneu a OpenHands que creï una automatització per a vós."+ "en": "Start a new conversation and tell OpenHands to <example><cmd>Create an automation</cmd><punct>.</punct></example>",+ "ja": "新しい会話を開始し、OpenHands に <example><cmd>オートメーションを作成してください</cmd></example> と伝えてください。",+ "zh-CN": "开始新对话,告诉 OpenHands <example><cmd>创建一个自动化</cmd><punct>。</punct></example>",+ "zh-TW": "開始新對話,告訴 OpenHands <example><cmd>建立一個自動化</cmd><punct>。</punct></example>",+ "ko-KR": "새 대화를 시작하고 OpenHands에게 <example><cmd>자동화를 만들어 주세요</cmd></example>라고 말하세요.",+ "no": "Start en ny samtale og be OpenHands om <example><cmd>Opprett en automatisering</cmd><punct>.</punct></example>",+ "it": "Avvia una nuova conversazione e chiedi a OpenHands di <example><cmd>Crea un'automazione</cmd><punct>.</punct></example>",+ "pt": "Inicie uma nova conversa e diga ao OpenHands para <example><cmd>Crie uma automação</cmd><punct>.</punct></example>",+ "es": "Inicie una nueva conversación y dígale a OpenHands <example><cmd>Crea una automatización</cmd><punct>.</punct></example>",+ "ar": "ابدأ محادثة جديدة واطلب من OpenHands <example><cmd>أنشئ أتمتة</cmd><punct>.</punct></example>",+ "fr": "Démarrez une nouvelle conversation et demandez à OpenHands de <example><cmd>Créez une automatisation</cmd><punct>.</punct></example>",+ "tr": "Yeni bir konuşma başlatın ve OpenHands'e <example><cmd>Bir otomasyon oluştur</cmd></example> deyin.",+ "de": "Starten Sie eine neue Konversation und bitten Sie OpenHands, <example><cmd>Erstelle eine Automatisierung</cmd><punct>.</punct></example>",+ "uk": "Розпочніть нову розмову та попросіть OpenHands <example><cmd>Створіть автоматизацію</cmd><punct>.</punct></example>",+ "ca": "Inicieu una nova conversa i digueu a OpenHands <example><cmd>Crea una automatització</cmd><punct>.</punct></example>"+ },+ "AUTOMATIONS$CREATE_INSTRUCTIONS_GUIDANCE": {+ "en": "Include what the automation should do, when it should run, and where to send the results. Be as specific as you would when giving instructions to a capable assistant—the agent handles the schedule and setup.",+ "ja": "オートメーションが実行すべき内容、実行タイミング、結果の送信先を含めてください。有能なアシスタントへの指示のように具体的に書けば、エージェントがスケジュールと設定を処理します。",+ "zh-CN": "说明自动化应执行的任务、运行时间以及结果发送位置。请像给能干的助手下指令一样具体——代理会处理日程和配置。",+ "zh-TW": "說明自動化應執行的任務、執行時間以及結果傳送位置。請像給能幹的助手下指令一樣具體——代理會處理排程和設定。",+ "ko-KR": "자동화가 수행할 작업, 실행 시점, 결과를 보낼 위치를 포함하세요. 유능한 어시스턴트에게 지시하듯 구체적으로 작성하면 에이전트가 일정과 설정을 처리합니다.",+ "no": "Inkluder hva automatiseringen skal gjøre, når den skal kjøre, og hvor resultatene skal sendes. Vær like spesifikk som når du gir instrukser til en dyktig assistent—agenten håndterer planlegging og oppsett.",+ "it": "Indica cosa deve fare l'automazione, quando deve essere eseguita e dove inviare i risultati. Sii specifico come quando dai istruzioni a un assistente capace: l'agente gestisce pianificazione e configurazione.",+ "pt": "Inclua o que a automação deve fazer, quando deve ser executada e onde enviar os resultados. Seja tão específico quanto ao dar instruções a um assistente capaz — o agente cuida da agenda e da configuração.",+ "es": "Indique qué debe hacer la automatización, cuándo debe ejecutarse y dónde enviar los resultados. Sea tan específico como al dar instrucciones a un asistente capaz: el agente se encarga del horario y la configuración.",+ "ar": "اذكر ما يجب أن تفعله الأتمتة، ومتى يجب أن تعمل، وأين تُرسل النتائج. كن محددًا كما لو كنت تعطي تعليمات لمساعد ماهر — الوكيل يتولى الجدولة والإعداد.",+ "fr": "Indiquez ce que l'automatisation doit faire, quand elle doit s'exécuter et où envoyer les résultats. Soyez aussi précis que si vous briefiez un assistant compétent — l'agent gère le planning et la configuration.",+ "tr": "Otomasyonun ne yapması gerektiğini, ne zaman çalışması gerektiğini ve sonuçların nereye gönderileceğini belirtin. Yetenekli bir asistana talimat verir gibi net olun — aracı zamanlama ve kurulumu halleder.",+ "de": "Geben Sie an, was die Automatisierung tun soll, wann sie laufen soll und wohin Ergebnisse gesendet werden. Seien Sie so konkret wie bei Anweisungen an einen fähigen Assistenten — der Agent übernimmt Zeitplan und Einrichtung.",+ "uk": "Вкажіть, що має робити автоматизація, коли вона має запускатися та куди надсилати результати. Будьте такими ж конкретними, як давши інструкції здібному асистенту — агент сам налаштує розклад і конфігурацію.",+ "ca": "Indiqueu què ha de fer l'automatització, quan s'ha d'executar i on enviar els resultats. Sigueu tan específics com quan doneu instruccions a un assistent competent: l'agent s'encarrega de la planificació i la configuració."},"AUTOMATIONS$EMPTY_START_CONVERSATION": {"en": "Start a conversation",@@ -11610,6 +11661,40 @@"uk": "Розпочати розмову","ca": "Inicia una conversa"},+ "AUTOMATIONS$CREATE_AUTOMATION_BUTTON": {+ "en": "Create Automation",+ "ja": "オートメーションを作成",+ "zh-CN": "创建自动化",+ "zh-TW": "建立自動化",+ "ko-KR": "자동화 만들기",+ "no": "Opprett automatisering",+ "it": "Crea automazione",+ "pt": "Criar automação",+ "es": "Crear automatización",+ "ar": "إنشاء أتمتة",+ "fr": "Créer une automatisation",+ "tr": "Otomasyon oluştur",+ "de": "Automatisierung erstellen",+ "uk": "Створити автоматизацію",+ "ca": "Crea una automatització"+ },+ "AUTOMATIONS$CREATE_AUTOMATION_PROMPT": {+ "en": "Create an automation",+ "ja": "オートメーションを作成してください",+ "zh-CN": "创建一个自动化",+ "zh-TW": "建立一個自動化",+ "ko-KR": "자동화를 만들어 주세요",+ "no": "Opprett en automatisering",+ "it": "Crea un'automazione",+ "pt": "Crie uma automação",+ "es": "Crea una automatización",+ "ar": "أنشئ أتمتة",+ "fr": "Créez une automatisation",+ "tr": "Bir otomasyon oluştur",+ "de": "Erstelle eine Automatisierung",+ "uk": "Створіть автоматизацію",+ "ca": "Crea una automatització"+ },"AUTOMATIONS$EMPTY_LEARN_MORE": {"en": "Learn more in the documentation","ja": "ドキュメントで詳細を確認",@@ -11644,6 +11729,57 @@"uk": "Пошук автоматизацій...","ca": "Cerca automatitzacions..."},+ "AUTOMATIONS$VIEW_MODE": {+ "en": "View mode",+ "ja": "表示モード",+ "zh-CN": "视图模式",+ "zh-TW": "檢視模式",+ "ko-KR": "보기 모드",+ "no": "Visningsmodus",+ "it": "Modalità di visualizzazione",+ "pt": "Modo de visualização",+ "es": "Modo de vista",+ "ar": "وضع العرض",+ "fr": "Mode d'affichage",+ "tr": "Görünüm modu",+ "de": "Ansichtsmodus",+ "uk": "Режим перегляду",+ "ca": "Mode de visualització"+ },+ "AUTOMATIONS$VIEW_GRID": {+ "en": "Grid view",+ "ja": "グリッド表示",+ "zh-CN": "网格视图",+ "zh-TW": "網格檢視",+ "ko-KR": "그리드 보기",+ "no": "Rutenettvisning",+ "it": "Vista griglia",+ "pt": "Visualização em grade",+ "es": "Vista de cuadrícula",+ "ar": "عرض شبكي",+ "fr": "Vue grille",+ "tr": "Izgara görünümü",+ "de": "Rasteransicht",+ "uk": "Подання сіткою",+ "ca": "Vista de graella"+ },+ "AUTOMATIONS$VIEW_LIST": {+ "en": "List view",+ "ja": "リスト表示",+ "zh-CN": "列表视图",+ "zh-TW": "列表檢視",+ "ko-KR": "목록 보기",+ "no": "Listevisning",+ "it": "Vista elenco",+ "pt": "Visualização em lista",+ "es": "Vista de lista",+ "ar": "عرض قائمة",+ "fr": "Vue liste",+ "tr": "Liste görünümü",+ "de": "Listenansicht",+ "uk": "Подання списком",+ "ca": "Vista de llista"+ },"AUTOMATIONS$ACTIVE": {"en": "Active","ja": "アクティブ",@@ -11678,6 +11814,40 @@"uk": "Неактивний","ca": "Inactiu"},+ "AUTOMATIONS$RUN_NOW": {+ "en": "Run now",+ "ja": "今すぐ実行",+ "zh-CN": "立即运行",+ "zh-TW": "立即執行",+ "ko-KR": "지금 실행",+ "no": "Kjør nå",+ "it": "Esegui ora",+ "pt": "Executar agora",+ "es": "Ejecutar ahora",+ "ar": "تشغيل الآن",+ "fr": "Exécuter maintenant",+ "tr": "Şimdi çalıştır",+ "de": "Jetzt ausführen",+ "uk": "Запустити зараз",+ "ca": "Executa ara"+ },+ "AUTOMATIONS$ACTIONS_MENU": {+ "en": "Automation actions",+ "ja": "オートメーション操作",+ "zh-CN": "自动化操作",+ "zh-TW": "自動化操作",+ "ko-KR": "자동화 작업",+ "no": "Automatiseringshandlinger",+ "it": "Azioni automazione",+ "pt": "Ações da automação",+ "es": "Acciones de automatización",+ "ar": "إجراءات الأتمتة",+ "fr": "Actions d'automatisation",+ "tr": "Otomasyon eylemleri",+ "de": "Automatisierungsaktionen",+ "uk": "Дії автоматизації",+ "ca": "Accions d'automatització"+ },"AUTOMATIONS$TURN_ON": {"en": "Turn on","ja": "オンにする",@@ -13293,6 +13463,23 @@"uk": "Очистити пошук","ca": "Esborra la cerca"},+ "MCP$SECTION_FILTER_ALL": {+ "en": "All",+ "ja": "すべて",+ "zh-CN": "全部",+ "zh-TW": "全部",+ "ko-KR": "전체",+ "no": "Alle",+ "ar": "الكل",+ "de": "Alle",+ "fr": "Tout",+ "it": "Tutti",+ "pt": "Todos",+ "es": "Todos",+ "tr": "Tümü",+ "uk": "Усі",+ "ca": "Tot"+ },"MCP$SEARCH_EMPTY": {"en": "No matches for your search.","ja": "検索に一致する結果はありません。",@@ -13327,6 +13514,40 @@"uk": "Встановлено","ca": "Instal·lat"},+ "MCP$TOGGLE_ADD_SERVER": {+ "en": "Install server",+ "ja": "サーバーをインストール",+ "zh-CN": "安装服务器",+ "zh-TW": "安裝伺服器",+ "ko-KR": "서버 설치",+ "no": "Installer server",+ "it": "Installa server",+ "pt": "Instalar servidor",+ "es": "Instalar servidor",+ "ar": "تثبيت الخادم",+ "fr": "Installer le serveur",+ "tr": "Sunucuyu yükle",+ "de": "Server installieren",+ "uk": "Встановити сервер",+ "ca": "Instal·la el servidor"+ },+ "MCP$TOGGLE_REMOVE_SERVER": {+ "en": "Remove server",+ "ja": "サーバーを削除",+ "zh-CN": "移除服务器",+ "zh-TW": "移除伺服器",+ "ko-KR": "서버 제거",+ "no": "Fjern server",+ "it": "Rimuovi server",+ "pt": "Remover servidor",+ "es": "Eliminar servidor",+ "ar": "إزالة الخادم",+ "fr": "Supprimer le serveur",+ "tr": "Sunucuyu kaldır",+ "de": "Server entfernen",+ "uk": "Видалити сервер",+ "ca": "Elimina el servidor"+ },"MCP$INSTALL_BUTTON": {"en": "Install","ja": "インストール",@@ -19651,6 +19872,57 @@"uk": "Додати мікроагента","ca": "Afegeix un Microagent"},+ "COMMON$ENABLE": {+ "en": "Enable",+ "ja": "有効化",+ "zh-CN": "启用",+ "zh-TW": "啟用",+ "ko-KR": "사용",+ "no": "Aktiver",+ "it": "Abilita",+ "pt": "Ativar",+ "es": "Activar",+ "ar": "تفعيل",+ "fr": "Activer",+ "tr": "Etkinleştir",+ "de": "Aktivieren",+ "uk": "Увімкнути",+ "ca": "Activa"+ },+ "COMMON$DISABLE": {+ "en": "Disable",+ "ja": "無効化",+ "zh-CN": "禁用",+ "zh-TW": "停用",+ "ko-KR": "사용 안 함",+ "no": "Deaktiver",+ "it": "Disabilita",+ "pt": "Desativar",+ "es": "Desactivar",+ "ar": "تعطيل",+ "fr": "Désactiver",+ "tr": "Devre dışı bırak",+ "de": "Deaktivieren",+ "uk": "Вимкнути",+ "ca": "Desactiva"+ },+ "COMMON$REMOVE": {+ "en": "Remove",+ "ja": "削除",+ "zh-CN": "移除",+ "zh-TW": "移除",+ "ko-KR": "제거",+ "no": "Fjern",+ "it": "Rimuovi",+ "pt": "Remover",+ "es": "Eliminar",+ "ar": "إزالة",+ "fr": "Supprimer",+ "tr": "Kaldır",+ "de": "Entfernen",+ "uk": "Видалити",+ "ca": "Elimina"+ },"COMMON$CREATED_ON": {"en": "Created on","ja": "作成日",@@ -23918,6 +24190,23 @@"uk": "Показати більше","ca": "Mostra més"},+ "SETTINGS$SKILLS_PILLS_MORE": {+ "en": "+{{count}}",+ "ja": "+{{count}}",+ "zh-CN": "+{{count}}",+ "zh-TW": "+{{count}}",+ "ko-KR": "+{{count}}",+ "no": "+{{count}}",+ "ar": "+{{count}}",+ "de": "+{{count}}",+ "fr": "+{{count}}",+ "it": "+{{count}}",+ "pt": "+{{count}}",+ "es": "+{{count}}",+ "tr": "+{{count}}",+ "uk": "+{{count}}",+ "ca": "+{{count}}"+ },"SETTINGS$SKILLS_SHOW_LESS": {"en": "Show less","ja": "折りたたむ",@@ -24054,6 +24343,125 @@"uk": "Шлях скопійовано","ca": "Camí copiat"},+ "SETTINGS$SKILLS_ENABLED": {+ "en": "Enabled",+ "ja": "有効",+ "zh-CN": "已启用",+ "zh-TW": "已啟用",+ "ko-KR": "사용",+ "no": "Aktivert",+ "ar": "ممكّن",+ "de": "Aktiviert",+ "fr": "Activé",+ "it": "Abilitato",+ "pt": "Ativado",+ "es": "Activado",+ "tr": "Etkin",+ "uk": "Увімкнено",+ "ca": "Activat"+ },+ "SETTINGS$SKILLS_DISABLED": {+ "en": "Disabled",+ "ja": "無効",+ "zh-CN": "已禁用",+ "zh-TW": "已停用",+ "ko-KR": "사용 안 함",+ "no": "Deaktivert",+ "ar": "معطّل",+ "de": "Deaktiviert",+ "fr": "Désactivé",+ "it": "Disabilitato",+ "pt": "Desativado",+ "es": "Desactivado",+ "tr": "Devre dışı",+ "uk": "Вимкнено",+ "ca": "Desactivat"+ },+ "SETTINGS$SKILLS_ENABLE_SKILL": {+ "en": "Enable skill",+ "ja": "スキルを有効化",+ "zh-CN": "启用技能",+ "zh-TW": "啟用技能",+ "ko-KR": "스킬 사용",+ "no": "Aktiver ferdighet",+ "ar": "تفعيل المهارة",+ "de": "Skill aktivieren",+ "fr": "Activer la compétence",+ "it": "Abilita skill",+ "pt": "Ativar habilidade",+ "es": "Activar habilidad",+ "tr": "Yeteneği etkinleştir",+ "uk": "Увімкнути навичку",+ "ca": "Activa l'habilitat"+ },+ "SETTINGS$SKILLS_DISABLE_SKILL": {+ "en": "Disable skill",+ "ja": "スキルを無効化",+ "zh-CN": "禁用技能",+ "zh-TW": "停用技能",+ "ko-KR": "스킬 사용 안 함",+ "no": "Deaktiver ferdighet",+ "ar": "تعطيل المهارة",+ "de": "Skill deaktivieren",+ "fr": "Désactiver la compétence",+ "it": "Disabilita skill",+ "pt": "Desativar habilidade",+ "es": "Desactivar habilidad",+ "tr": "Yeteneği devre dışı bırak",+ "uk": "Вимкнути навичку",+ "ca": "Desactiva l'habilitat"+ },+ "SETTINGS$SKILLS_TYPE_LABEL": {+ "en": "Type",+ "ja": "タイプ",+ "zh-CN": "类型",+ "zh-TW": "類型",+ "ko-KR": "유형",+ "no": "Type",+ "ar": "النوع",+ "de": "Typ",+ "fr": "Type",+ "it": "Tipo",+ "pt": "Tipo",+ "es": "Tipo",+ "tr": "Tür",+ "uk": "Тип",+ "ca": "Tipus"+ },+ "SETTINGS$SKILLS_VERSION_LABEL": {+ "en": "Version",+ "ja": "バージョン",+ "zh-CN": "版本",+ "zh-TW": "版本",+ "ko-KR": "버전",+ "no": "Versjon",+ "ar": "الإصدار",+ "de": "Version",+ "fr": "Version",+ "it": "Versione",+ "pt": "Versão",+ "es": "Versión",+ "tr": "Sürüm",+ "uk": "Версія",+ "ca": "Versió"+ },+ "SETTINGS$SKILLS_CONTENT": {+ "en": "Content",+ "ja": "コンテンツ",+ "zh-CN": "内容",+ "zh-TW": "內容",+ "ko-KR": "내용",+ "no": "Innhold",+ "ar": "المحتوى",+ "de": "Inhalt",+ "fr": "Contenu",+ "it": "Contenuto",+ "pt": "Conteúdo",+ "es": "Contenido",+ "tr": "İçerik",+ "uk": "Вміст",+ "ca": "Contingut"+ },"HOOKS_MODAL$TITLE": {"en": "Available Hooks","ja": "利用可能なフック",@@ -27726,6 +28134,312 @@"uk": "Відкривайте навички для додавання до вашого робочого простору. Відкрийте картку для запитів, curl та процесів встановлення. Шукайте на бічній панелі, щоб фільтрувати список. Увімкніть або вимкніть навички за замовчуванням. Вимкнені навички не завантажуватимуться в контекст агента.","ca": "Descobreix habilitats per afegir al teu espai de treball. Obre una targeta per veure indicacions, curl i fluxos d'instal·lació. Cerca des de la barra lateral per filtrar la llista. Activeu o desactiveu les habilitats predeterminades. Les habilitats desactivades no es carregaran al context de l'agent."},+ "SETTINGS$SKILLS_ADD_BUTTON": {+ "en": "Add skill",+ "ja": "スキルを追加",+ "zh-CN": "添加技能",+ "zh-TW": "新增技能",+ "ko-KR": "스킬 추가",+ "no": "Legg til ferdighet",+ "ar": "إضافة مهارة",+ "de": "Skill hinzufügen",+ "fr": "Ajouter une compétence",+ "it": "Aggiungi competenza",+ "pt": "Adicionar habilidade",+ "es": "Agregar habilidad",+ "tr": "Yetenek ekle",+ "uk": "Додати навичку",+ "ca": "Afegir habilitat"+ },+ "SETTINGS$SKILLS_USE_SKILL_BUTTON": {+ "en": "Use skill",+ "ja": "スキルを使う",+ "zh-CN": "使用技能",+ "zh-TW": "使用技能",+ "ko-KR": "스킬 사용",+ "no": "Bruk ferdighet",+ "ar": "استخدام المهارة",+ "de": "Skill verwenden",+ "fr": "Utiliser la compétence",+ "it": "Usa competenza",+ "pt": "Usar habilidade",+ "es": "Usar habilidad",+ "tr": "Yeteneği kullan",+ "uk": "Використати навичку",+ "ca": "Utilitzar habilitat"+ },+ "SETTINGS$SKILLS_ADD_MODAL_TITLE": {+ "en": "Add a skill",+ "ja": "スキルを追加",+ "zh-CN": "添加技能",+ "zh-TW": "新增技能",+ "ko-KR": "스킬 추가",+ "no": "Legg til en ferdighet",+ "ar": "إضافة مهارة",+ "de": "Skill hinzufügen",+ "fr": "Ajouter une compétence",+ "it": "Aggiungi una competenza",+ "pt": "Adicionar uma habilidade",+ "es": "Agregar una habilidad",+ "tr": "Yetenek ekle",+ "uk": "Додати навичку",+ "ca": "Afegir una habilitat"+ },+ "SETTINGS$SKILLS_ADD_MODAL_INTRO": {+ "en": "Extend what your agent can do by installing skills from the OpenHands registry, community repositories, or your own GitHub repos.",+ "ja": "OpenHands レジストリ、コミュニティリポジトリ、または独自の GitHub リポジトリからスキルをインストールして、エージェントの機能を拡張します。",+ "zh-CN": "从 OpenHands 注册表、社区仓库或您自己的 GitHub 仓库安装技能,扩展代理的能力。",+ "zh-TW": "從 OpenHands 註冊表、社群儲存庫或您自己的 GitHub 儲存庫安裝技能,擴展代理的能力。",+ "ko-KR": "OpenHands 레지스트리, 커뮤니티 저장소 또는 자체 GitHub 저장소에서 스킬을 설치하여 에이전트 기능을 확장하세요.",+ "no": "Utvid hva agenten din kan gjøre ved å installere ferdigheter fra OpenHands-registeret, fellesskapsrepoer eller dine egne GitHub-repoer.",+ "ar": "وسّع ما يستطيع وكيلك فعله بتثبيت مهارات من سجل OpenHands أو مستودعات المجتمع أو مستودعات GitHub الخاصة بك.",+ "de": "Erweitern Sie die Fähigkeiten Ihres Agenten, indem Sie Skills aus der OpenHands-Registry, Community-Repositories oder Ihren eigenen GitHub-Repos installieren.",+ "fr": "Étendez les capacités de votre agent en installant des compétences depuis le registre OpenHands, des dépôts communautaires ou vos propres dépôts GitHub.",+ "it": "Estendi le capacità del tuo agente installando competenze dal registro OpenHands, repository della community o i tuoi repository GitHub.",+ "pt": "Expanda o que seu agente pode fazer instalando habilidades do registro OpenHands, repositórios da comunidade ou seus próprios repositórios GitHub.",+ "es": "Amplíe lo que su agente puede hacer instalando habilidades del registro OpenHands, repositorios comunitarios o sus propios repositorios de GitHub.",+ "tr": "OpenHands kayıt defterinden, topluluk depolarından veya kendi GitHub depolarınızdan yetenekler yükleyerek ajanınızın yapabileceklerini genişletin.",+ "uk": "Розширте можливості агента, встановлюючи навички з реєстру OpenHands, спільнотних репозиторіїв або власних GitHub-репозиторіїв.",+ "ca": "Amplieu el que pot fer el vostre agent instal·lant habilitats del registre OpenHands, repositoris comunitaris o els vostres propis repositoris de GitHub."+ },+ "SETTINGS$SKILLS_ADD_MODAL_CHAT_TITLE": {+ "en": "Add from a conversation",+ "ja": "会話から追加",+ "zh-CN": "在对话中添加",+ "zh-TW": "在對話中新增",+ "ko-KR": "대화에서 추가",+ "no": "Legg til fra en samtale",+ "ar": "الإضافة من محادثة",+ "de": "Aus einer Unterhaltung hinzufügen",+ "fr": "Ajouter depuis une conversation",+ "it": "Aggiungi da una conversazione",+ "pt": "Adicionar a partir de uma conversa",+ "es": "Agregar desde una conversación",+ "tr": "Bir sohbetten ekle",+ "uk": "Додати з розмови",+ "ca": "Afegir des d'una conversa"+ },+ "SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY": {+ "en": "In any chat, send the <cmd>/add-skill</cmd> command with a GitHub URL that points to the skill. OpenHands downloads the files into your workspace and makes the skill available immediately.",+ "ja": "任意のチャットで、スキルを指す GitHub URL を付けて <cmd>/add-skill</cmd> コマンドを送信します。OpenHands がファイルをワークスペースにダウンロードし、すぐに利用できるようにします。",+ "zh-CN": "在任何对话中,发送带有指向技能的 GitHub URL 的 <cmd>/add-skill</cmd> 命令。OpenHands 会将文件下载到您的工作区并立即可用。",+ "zh-TW": "在任何對話中,傳送带有指向技能的 GitHub URL 的 <cmd>/add-skill</cmd> 指令。OpenHands 會將檔案下載到您的工作區並立即可用。",+ "ko-KR": "채팅에서 스킬을 가리키는 GitHub URL과 함께 <cmd>/add-skill</cmd> 명령을 보내세요. OpenHands가 파일을 워크스페이스에 다운로드하고 즉시 사용할 수 있게 합니다.",+ "no": "I en hvilken som helst chat, send <cmd>/add-skill</cmd>-kommandoen med en GitHub-URL som peker til ferdigheten. OpenHands laster ned filene til arbeidsområdet ditt og gjør ferdigheten tilgjengelig med en gang.",+ "ar": "في أي محادثة، أرسل أمر <cmd>/add-skill</cmd> مع عنوان URL على GitHub يشير إلى المهارة. يقوم OpenHands بتنزيل الملفات إلى مساحة عملك ويجعل المهارة متاحة فورًا.",+ "de": "Senden Sie in jedem Chat den Befehl <cmd>/add-skill</cmd> mit einer GitHub-URL, die auf den Skill verweist. OpenHands lädt die Dateien in Ihren Workspace herunter und stellt den Skill sofort bereit.",+ "fr": "Dans n'importe quelle conversation, envoyez la commande <cmd>/add-skill</cmd> avec une URL GitHub pointant vers la compétence. OpenHands télécharge les fichiers dans votre espace de travail et rend la compétence disponible immédiatement.",+ "it": "In qualsiasi chat, invia il comando <cmd>/add-skill</cmd> con un URL GitHub che punta alla competenza. OpenHands scarica i file nel tuo workspace e rende la competenza disponibile subito.",+ "pt": "Em qualquer conversa, envie o comando <cmd>/add-skill</cmd> com uma URL do GitHub que aponte para a habilidade. O OpenHands baixa os arquivos para seu workspace e disponibiliza a habilidade imediatamente.",+ "es": "En cualquier chat, envíe el comando <cmd>/add-skill</cmd> con una URL de GitHub que apunte a la habilidad. OpenHands descarga los archivos en su espacio de trabajo y la habilidad queda disponible de inmediato.",+ "tr": "Herhangi bir sohbette, beceriyi işaret eden bir GitHub URL'si ile <cmd>/add-skill</cmd> komutunu gönderin. OpenHands dosyaları çalışma alanınıza indirir ve beceriyi hemen kullanılabilir hale getirir.",+ "uk": "У будь-якій розмові надішліть команду <cmd>/add-skill</cmd> з URL GitHub, що вказує на навичку. OpenHands завантажить файли у ваш робочий простір і одразу зробить навичку доступною.",+ "ca": "En qualsevol conversa, envieu l'ordre <cmd>/add-skill</cmd> amb un URL de GitHub que apunti a l'habilitat. OpenHands baixa els fitxers al vostre espai de treball i la habilitat queda disponible immediatament."+ },+ "SETTINGS$SKILLS_ADD_MODAL_EXAMPLE_LABEL": {+ "en": "Example",+ "ja": "例",+ "zh-CN": "示例",+ "zh-TW": "範例",+ "ko-KR": "예시",+ "no": "Eksempel",+ "ar": "مثال",+ "de": "Beispiel",+ "fr": "Exemple",+ "it": "Esempio",+ "pt": "Exemplo",+ "es": "Ejemplo",+ "tr": "Örnek",+ "uk": "Приклад",+ "ca": "Exemple"+ },+ "SETTINGS$SKILLS_ADD_MODAL_STEP_1": {+ "en": "Parse the URL to find the repository and skill path",+ "ja": "URL を解析してリポジトリとスキルパスを特定する",+ "zh-CN": "解析 URL 以找到仓库和技能路径",+ "zh-TW": "解析 URL 以找到儲存庫和技能路徑",+ "ko-KR": "URL을 파싱하여 저장소와 스킬 경로 찾기",+ "no": "Analyser URL-en for å finne repoet og ferdighetsstien",+ "ar": "تحليل عنوان URL للعثور على المستودع ومسار المهارة",+ "de": "URL analysieren, um Repository und Skill-Pfad zu finden",+ "fr": "Analyser l'URL pour trouver le dépôt et le chemin de la compétence",+ "it": "Analizza l'URL per trovare il repository e il percorso della competenza",+ "pt": "Analisar a URL para encontrar o repositório e o caminho da habilidade",+ "es": "Analizar la URL para encontrar el repositorio y la ruta de la habilidad",+ "tr": "Depoyu ve beceri yolunu bulmak için URL'yi ayrıştırır",+ "uk": "Розбирає URL, щоб знайти репозиторій і шлях до навички",+ "ca": "Analitza l'URL per trobar el repositori i el camí de l'habilitat"+ },+ "SETTINGS$SKILLS_ADD_MODAL_STEP_2": {+ "en": "Fetch the skill files from GitHub",+ "ja": "GitHub からスキルファイルを取得する",+ "zh-CN": "从 GitHub 获取技能文件",+ "zh-TW": "從 GitHub 取得技能檔案",+ "ko-KR": "GitHub에서 스킬 파일 가져오기",+ "no": "Hent ferdighetsfilene fra GitHub",+ "ar": "جلب ملفات المهارة من GitHub",+ "de": "Skill-Dateien von GitHub abrufen",+ "fr": "Récupérer les fichiers de la compétence depuis GitHub",+ "it": "Recupera i file della competenza da GitHub",+ "pt": "Buscar os arquivos da habilidade no GitHub",+ "es": "Obtener los archivos de la habilidad desde GitHub",+ "tr": "Beceri dosyalarını GitHub'dan getirir",+ "uk": "Завантажує файли навички з GitHub",+ "ca": "Obté els fitxers de l'habilitat des de GitHub"+ },+ "SETTINGS$SKILLS_ADD_MODAL_STEP_3": {+ "en": "Install the skill in the <path>.agents/skills/</path> directory of your workspace",+ "ja": "ワークスペースの <path>.agents/skills/</path> ディレクトリにスキルをインストールする",+ "zh-CN": "将技能安装到工作区的 <path>.agents/skills/</path> 目录",+ "zh-TW": "將技能安裝到工作區的 <path>.agents/skills/</path> 目錄",+ "ko-KR": "워크스페이스의 <path>.agents/skills/</path> 디렉터리에 스킬 설치",+ "no": "Installer ferdigheten i <path>.agents/skills/</path>-mappen i arbeidsområdet ditt",+ "ar": "تثبيت المهارة في دليل <path>.agents/skills/</path> في مساحة عملك",+ "de": "Skill im Verzeichnis <path>.agents/skills/</path> Ihres Workspace installieren",+ "fr": "Installer la compétence dans le répertoire <path>.agents/skills/</path> de votre espace de travail",+ "it": "Installa la competenza nella directory <path>.agents/skills/</path> del tuo workspace",+ "pt": "Instalar a habilidade no diretório <path>.agents/skills/</path> do seu workspace",+ "es": "Instalar la habilidad en el directorio <path>.agents/skills/</path> de su espacio de trabajo",+ "tr": "Beceriyi çalışma alanınızın <path>.agents/skills/</path> dizinine kurar",+ "uk": "Встановлює навичку в каталозі <path>.agents/skills/</path> вашого робочого простору",+ "ca": "Instal·la l'habilitat al directori <path>.agents/skills/</path> del vostre espai de treball"+ },+ "SETTINGS$SKILLS_ADD_MODAL_STEP_4": {+ "en": "Verify the installation",+ "ja": "インストールを確認する",+ "zh-CN": "验证安装",+ "zh-TW": "驗證安裝",+ "ko-KR": "설치 확인",+ "no": "Bekreft installasjonen",+ "ar": "التحقق من التثبيت",+ "de": "Installation überprüfen",+ "fr": "Vérifier l'installation",+ "it": "Verifica l'installazione",+ "pt": "Verificar a instalação",+ "es": "Verificar la instalación",+ "tr": "Kurulumu doğrular",+ "uk": "Перевіряє встановлення",+ "ca": "Verifica la instal·lació"+ },+ "SETTINGS$SKILLS_ADD_MODAL_STEP_5": {+ "en": "Make the skill available for this project right away",+ "ja": "スキルをこのプロジェクトですぐに利用可能にする",+ "zh-CN": "立即使技能在此项目中可用",+ "zh-TW": "立即使技能在此專案中可用",+ "ko-KR": "이 프로젝트에서 바로 스킬 사용 가능",+ "no": "Gjør ferdigheten tilgjengelig for dette prosjektet med en gang",+ "ar": "جعل المهارة متاحة لهذا المشروع على الفور",+ "de": "Skill sofort für dieses Projekt verfügbar machen",+ "fr": "Rendre la compétence disponible immédiatement pour ce projet",+ "it": "Rende la competenza disponibile subito per questo progetto",+ "pt": "Disponibilizar a habilidade para este projeto imediatamente",+ "es": "Hacer que la habilidad esté disponible para este proyecto de inmediato",+ "tr": "Beceriyi bu proje için hemen kullanılabilir hale getirir",+ "uk": "Одразу робить навичку доступною для цього проєкту",+ "ca": "Fa que l'habilitat estigui disponible per a aquest projecte immediatament"+ },+ "SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS_TITLE": {+ "en": "Supported URL formats",+ "ja": "サポートされる URL 形式",+ "zh-CN": "支持的 URL 格式",+ "zh-TW": "支援的 URL 格式",+ "ko-KR": "지원되는 URL 형식",+ "no": "Støttede URL-formater",+ "ar": "تنسيقات URL المدعومة",+ "de": "Unterstützte URL-Formate",+ "fr": "Formats d'URL pris en charge",+ "it": "Formati URL supportati",+ "pt": "Formatos de URL suportados",+ "es": "Formatos de URL compatibles",+ "tr": "Desteklenen URL biçimleri",+ "uk": "Підтримувані формати URL",+ "ca": "Formats d'URL compatibles"+ },+ "SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS": {+ "en": "Full GitHub tree links, repository paths, and short forms such as OpenHands/extensions/skills/codereview all work.",+ "ja": "GitHub の tree リンク、リポジトリパス、OpenHands/extensions/skills/codereview のような短い形式などが使用できます。",+ "zh-CN": "完整的 GitHub tree 链接、仓库路径以及 OpenHands/extensions/skills/codereview 等简短形式均可使用。",+ "zh-TW": "完整的 GitHub tree 連結、儲存庫路徑以及 OpenHands/extensions/skills/codereview 等簡短形式均可使用。",+ "ko-KR": "전체 GitHub tree 링크, 저장소 경로, OpenHands/extensions/skills/codereview 같은 짧은 형식 모두 사용할 수 있습니다.",+ "no": "Fullstendige GitHub tree-lenker, repo-stier og korte former som OpenHands/extensions/skills/codereview fungerer alle.",+ "ar": "تعمل روابط GitHub tree الكاملة ومسارات المستودعات والأشكال المختصرة مثل OpenHands/extensions/skills/codereview جميعها.",+ "de": "Vollständige GitHub-Tree-Links, Repository-Pfade und Kurzformen wie OpenHands/extensions/skills/codereview funktionieren alle.",+ "fr": "Les liens tree GitHub complets, les chemins de dépôt et les formes courtes comme OpenHands/extensions/skills/codereview fonctionnent tous.",+ "it": "Funzionano link tree GitHub completi, percorsi repository e forme brevi come OpenHands/extensions/skills/codereview.",+ "pt": "Links tree completos do GitHub, caminhos de repositório e formas curtas como OpenHands/extensions/skills/codereview funcionam.",+ "es": "Funcionan enlaces tree completos de GitHub, rutas de repositorio y formas cortas como OpenHands/extensions/skills/codereview.",+ "tr": "Tam GitHub tree bağlantıları, depo yolları ve OpenHands/extensions/skills/codereview gibi kısa biçimlerin tümü çalışır.",+ "uk": "Працюють повні tree-посилання GitHub, шляхи репозиторію та короткі форми на кшталт OpenHands/extensions/skills/codereview.",+ "ca": "Funcionen enllaços tree complets de GitHub, camins de repositori i formes curtes com OpenHands/extensions/skills/codereview."+ },+ "SETTINGS$SKILLS_ADD_MODAL_STORAGE_TITLE": {+ "en": "Where skills are stored",+ "ja": "スキルの保存場所",+ "zh-CN": "技能存储位置",+ "zh-TW": "技能儲存位置",+ "ko-KR": "스킬 저장 위치",+ "no": "Hvor ferdigheter lagres",+ "ar": "مكان تخزين المهارات",+ "de": "Wo Skills gespeichert werden",+ "fr": "Où les compétences sont stockées",+ "it": "Dove vengono archiviate le competenze",+ "pt": "Onde as habilidades são armazenadas",+ "es": "Dónde se almacenan las habilidades",+ "tr": "Yeteneklerin saklandığı yer",+ "uk": "Де зберігаються навички",+ "ca": "On s'emmagatzemen les habilitats"+ },+ "SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY": {+ "en": "Skills added with <cmd>/add-skill</cmd> are saved in <path>.agents/skills/</path> for the current workspace. You can also copy skill folders there manually if you prefer.",+ "ja": "<cmd>/add-skill</cmd> で追加したスキルは現在のワークスペースの <path>.agents/skills/</path> に保存されます。必要に応じて、スキルフォルダを手動でコピーすることもできます。",+ "zh-CN": "通过 <cmd>/add-skill</cmd> 添加的技能会保存到当前工作区的 <path>.agents/skills/</path>。您也可以手动将技能文件夹复制到该位置。",+ "zh-TW": "透過 <cmd>/add-skill</cmd> 新增的技能會儲存到目前工作區的 <path>.agents/skills/</path>。您也可以手動將技能資料夾複製到該位置。",+ "ko-KR": "<cmd>/add-skill</cmd>로 추가한 스킬은 현재 워크스페이스의 <path>.agents/skills/</path>에 저장됩니다. 원하면 스킬 폴더를 수동으로 복사할 수도 있습니다.",+ "no": "Ferdigheter lagt til med <cmd>/add-skill</cmd> lagres i <path>.agents/skills/</path> for gjeldende arbeidsområde. Du kan også kopiere ferdighetsmapper dit manuelt.",+ "ar": "يتم حفظ المهارات المضافة بـ <cmd>/add-skill</cmd> في <path>.agents/skills/</path> لمساحة العمل الحالية. يمكنك أيضًا نسخ مجلدات المهارات يدويًا إذا أردت.",+ "de": "Mit <cmd>/add-skill</cmd> hinzugefügte Skills werden in <path>.agents/skills/</path> des aktuellen Workspace gespeichert. Sie können Skill-Ordner auch manuell dorthin kopieren.",+ "fr": "Les compétences ajoutées avec <cmd>/add-skill</cmd> sont enregistrées dans <path>.agents/skills/</path> pour l'espace de travail actuel. Vous pouvez aussi y copier des dossiers de compétences manuellement.",+ "it": "Le competenze aggiunte con <cmd>/add-skill</cmd> vengono salvate in <path>.agents/skills/</path> per il workspace corrente. Puoi anche copiare manualmente le cartelle delle competenze.",+ "pt": "Habilidades adicionadas com <cmd>/add-skill</cmd> são salvas em <path>.agents/skills/</path> do workspace atual. Você também pode copiar pastas de habilidades manualmente.",+ "es": "Las habilidades agregadas con <cmd>/add-skill</cmd> se guardan en <path>.agents/skills/</path> del espacio de trabajo actual. También puede copiar carpetas de habilidades manualmente.",+ "tr": "<cmd>/add-skill</cmd> ile eklenen yetenekler geçerli çalışma alanının <path>.agents/skills/</path> dizinine kaydedilir. İsterseniz yetenek klasörlerini manuel olarak da kopyalayabilirsiniz.",+ "uk": "Навички, додані через <cmd>/add-skill</cmd>, зберігаються в <path>.agents/skills/</path> поточного робочого простору. За бажанням можна скопіювати папки навичок туди вручну.",+ "ca": "Les habilitats afegides amb <cmd>/add-skill</cmd> es desen a <path>.agents/skills/</path> de l'espai de treball actual. També podeu copiar-hi carpetes d'habilitats manualment."+ },+ "SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS": {+ "en": "For private GitHub repositories, set <env>GITHUB_TOKEN</env> in your environment before using <cmd>/add-skill</cmd>.",+ "ja": "プライベート GitHub リポジトリの場合は、<cmd>/add-skill</cmd> を使う前に環境変数 <env>GITHUB_TOKEN</env> を設定してください。",+ "zh-CN": "对于私有 GitHub 仓库,请在使用 <cmd>/add-skill</cmd> 之前设置 <env>GITHUB_TOKEN</env> 环境变量。",+ "zh-TW": "對於私有 GitHub 儲存庫,請在使用 <cmd>/add-skill</cmd> 之前設定 <env>GITHUB_TOKEN</env> 環境變數。",+ "ko-KR": "비공개 GitHub 저장소의 경우 <cmd>/add-skill</cmd>을 사용하기 전에 <env>GITHUB_TOKEN</env> 환경 변수를 설정하세요.",+ "no": "For private GitHub-repoer, sett <env>GITHUB_TOKEN</env> i miljøet ditt før du bruker <cmd>/add-skill</cmd>.",+ "ar": "بالنسبة لمستودعات GitHub الخاصة، عيّن <env>GITHUB_TOKEN</env> في بيئتك قبل استخدام <cmd>/add-skill</cmd>.",+ "de": "Für private GitHub-Repositories setzen Sie <env>GITHUB_TOKEN</env> in Ihrer Umgebung, bevor Sie <cmd>/add-skill</cmd> verwenden.",+ "fr": "Pour les dépôts GitHub privés, définissez <env>GITHUB_TOKEN</env> dans votre environnement avant d'utiliser <cmd>/add-skill</cmd>.",+ "it": "Per repository GitHub privati, imposta <env>GITHUB_TOKEN</env> nell'ambiente prima di usare <cmd>/add-skill</cmd>.",+ "pt": "Para repositórios privados do GitHub, defina <env>GITHUB_TOKEN</env> no seu ambiente antes de usar <cmd>/add-skill</cmd>.",+ "es": "Para repositorios privados de GitHub, configure <env>GITHUB_TOKEN</env> en su entorno antes de usar <cmd>/add-skill</cmd>.",+ "tr": "Özel GitHub depoları için <cmd>/add-skill</cmd> kullanmadan önce ortamınızda <env>GITHUB_TOKEN</env> ayarlayın.",+ "uk": "Для приватних GitHub-репозиторіїв установіть <env>GITHUB_TOKEN</env> у середовищі перед використанням <cmd>/add-skill</cmd>.",+ "ca": "Per a repositoris privats de GitHub, configureu <env>GITHUB_TOKEN</env> al vostre entorn abans d'utilitzar <cmd>/add-skill</cmd>."+ },+ "SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS": {+ "en": "Read the full adding skills guide →",+ "ja": "スキル追加ガイド全文を読む →",+ "zh-CN": "阅读完整的添加技能指南 →",+ "zh-TW": "閱讀完整的新增技能指南 →",+ "ko-KR": "스킬 추가 가이드 전체 보기 →",+ "no": "Les hele guiden for å legge til ferdigheter →",+ "ar": "اقرأ دليل إضافة المهارات الكامل →",+ "de": "Vollständige Anleitung zum Hinzufügen von Skills lesen →",+ "fr": "Lire le guide complet d'ajout de compétences →",+ "it": "Leggi la guida completa per aggiungere competenze →",+ "pt": "Leia o guia completo para adicionar habilidades →",+ "es": "Lea la guía completa para agregar habilidades →",+ "tr": "Yetenek ekleme rehberinin tamamını okuyun →",+ "uk": "Прочитайте повний посібник з додавання навичок →",+ "ca": "Llegiu la guia completa per afegir habilitats →"+ },"RECOMMENDED_AUTOMATIONS$SECTION_LABEL": {"en": "Recommended automations","ja": "おすすめの自動化",diff --git a/src/icons/message-square-share.svg b/src/icons/message-square-share.svgnew file mode 100644index 0000000000..8ff454c224--- /dev/null+++ b/src/icons/message-square-share.svg@@ -0,0 +1,5 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M12 3H4a2 2 0 0 0-2 2v16.286a.71.71 0 0 0 1.212.502l2.202-2.202A2 2 0 0 1 6.828 19H20a2 2 0 0 0 2-2v-4"/>+ <path d="M16 3h6v6"/>+ <path d="m16 9 6-6"/>+</svg>diff --git a/src/mocks/automation-handlers.ts b/src/mocks/automation-handlers.tsindex cb17100efd..63120f272a 100644--- a/src/mocks/automation-handlers.ts+++ b/src/mocks/automation-handlers.ts@@ -2,8 +2,10 @@ import { http, HttpResponse, delay } from "msw";import type {Automation,AutomationsResponse,+ AutomationRun,AutomationRunsResponse,} from "#/types/automation";+import { AutomationRunStatus } from "#/types/automation";import { MOCK_AUTOMATIONS_RESPONSE } from "./automations.mock";import { MOCK_AUTOMATION_RUNS } from "./automation-runs.mock";@@ -113,6 +115,32 @@ export const AUTOMATION_HANDLERS = [return HttpResponse.json(updated);}),+ // POST /api/automation/v1/:id/dispatch — Manually trigger a run+ http.post("*/api/automation/v1/:id/dispatch", async ({ params }) => {+ await delay(200);++ const id = params.id as string;+ const automation = automations.get(id);+ if (!automation) {+ return HttpResponse.json(+ { detail: "Automation not found" },+ { status: 404 },+ );+ }++ const run: AutomationRun = {+ id: crypto.randomUUID(),+ status: AutomationRunStatus.PENDING,+ conversation_id: null,+ bash_command_id: null,+ error_detail: null,+ started_at: new Date().toISOString(),+ completed_at: null,+ };++ return HttpResponse.json(run, { status: 201 });+ }),+// DELETE /api/automation/v1/:id — Delete automationhttp.delete("*/api/automation/v1/:id", async ({ params }) => {await delay(200);diff --git a/src/routes/automations-list.tsx b/src/routes/automations-list.tsxindex b5693bf769..b284cd6f58 100644--- a/src/routes/automations-list.tsx+++ b/src/routes/automations-list.tsx@@ -1,23 +1,31 @@-import { useState, useMemo } from "react";+import { useState, useMemo, useCallback } from "react";import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import {useAutomations,useToggleAutomation,useDeleteAutomation,+ useDispatchAutomation,} from "#/hooks/query/use-automations";import { useAutomationHealth } from "#/hooks/query/use-automation-health";import { useActiveBackend } from "#/contexts/active-backend-context";import { SearchInput } from "#/components/features/automations/search-input";import { AutomationGroup } from "#/components/features/automations/automation-group";+import { AutomationViewToggle } from "#/components/features/automations/automation-view-toggle";+import {+ readStoredAutomationViewMode,+ writeStoredAutomationViewMode,+ type AutomationViewMode,+} from "#/components/features/automations/automation-view-mode";import { AutomationCardSkeleton } from "#/components/features/automations/automation-card-skeleton";import { EmptyState } from "#/components/features/automations/empty-state";import { ErrorState } from "#/components/features/automations/error-state";import { BackendNotConfigured } from "#/components/features/automations/backend-not-configured";import { DeleteConfirmationModal } from "#/components/features/automations/delete-confirmation-modal";import { EditAutomationModal } from "#/components/features/automations/detail/edit-automation-modal";-import { CreateInstructions } from "#/components/features/automations/create-instructions";+import { AddAutomationModal } from "#/components/features/automations/add-automation-modal";import { RecommendedAutomationsLauncher } from "#/components/features/automations/recommended-automations-launcher";+import { BrandButton } from "#/components/features/settings/brand-button";import type { Automation } from "#/types/automation";const PAGE_SIZE = 50;@@ -25,12 +33,16 @@ const PAGE_SIZE = 50;export default function AutomationsList() {const { t } = useTranslation("openhands");const [searchQuery, setSearchQuery] = useState("");+ const [viewMode, setViewMode] = useState<AutomationViewMode>(() =>+ readStoredAutomationViewMode(),+ );const [limit, setLimit] = useState(PAGE_SIZE);const [deleteTarget, setDeleteTarget] = useState<{id: string;name: string;} | null>(null);const [editTarget, setEditTarget] = useState<Automation | null>(null);+ const [isAddAutomationOpen, setIsAddAutomationOpen] = useState(false);const active = useActiveBackend();// Edit is a local-backend-only feature in MVP — cloud automations@@ -53,6 +65,7 @@ export default function AutomationsList() {});const toggleMutation = useToggleAutomation();const deleteMutation = useDeleteAutomation();+ const dispatchMutation = useDispatchAutomation();const filtered = useMemo(() => {if (!data?.automations) return [];@@ -80,6 +93,10 @@ export default function AutomationsList() {toggleMutation.mutate({ id, enabled: !currentEnabled });};+ const handleRunNow = (id: string) => {+ dispatchMutation.mutate(id);+ };+const handleDeleteRequest = (id: string) => {const automation = data?.automations.find((a) => a.id === id);if (automation) {@@ -101,6 +118,11 @@ export default function AutomationsList() {}};+ const handleViewModeChange = useCallback((view: AutomationViewMode) => {+ setViewMode(view);+ writeStoredAutomationViewMode(view);+ }, []);+const hasMore = data ? data.total > data.automations.length : false;// Show loading state while checking health@@ -145,16 +167,33 @@ export default function AutomationsList() {<div className="min-h-full"><div className="p-6 max-w-4xl mx-auto">{/* Header */}- <h1 className="text-xl font-medium text-content">- {t(I18nKey.AUTOMATIONS$TITLE)}- </h1>- <p className="mt-1 text-sm text-muted">- {t(I18nKey.AUTOMATIONS$SUBTITLE)}- </p>+ <div className="flex items-start justify-between gap-4">+ <div className="min-w-0">+ <h1 className="text-xl font-semibold text-content">+ {t(I18nKey.AUTOMATIONS$TITLE)}+ </h1>+ <p className="mt-1 text-sm text-muted">+ {t(I18nKey.AUTOMATIONS$SUBTITLE)}+ </p>+ </div>+ <BrandButton+ type="button"+ variant="secondary"+ testId="automations-add-automation"+ className="shrink-0 whitespace-nowrap"+ onClick={() => setIsAddAutomationOpen(true)}+ >+ {t(I18nKey.AUTOMATIONS$ADD_AUTOMATION)}+ </BrandButton>+ </div>{/* Search */}- <div className="mt-6">+ <div className="mt-6 flex items-stretch gap-2"><SearchInput value={searchQuery} onChange={setSearchQuery} />+ <AutomationViewToggle+ view={viewMode}+ onChange={handleViewModeChange}+ /></div>{/* Content */}@@ -175,14 +214,18 @@ export default function AutomationsList() {{!isLoading && !isError && data && data.automations.length > 0 && (<>- {/* Collapsible creation instructions at the top */}- <CreateInstructions collapsible />-<AutomationGrouptitle={t(I18nKey.AUTOMATIONS$ACTIVE)}count={activeAutomations.length}automations={activeAutomations}+ view={viewMode}onToggle={handleToggle}+ onRunNow={handleRunNow}+ runPendingId={+ dispatchMutation.isPending+ ? (dispatchMutation.variables ?? null)+ : null+ }onDelete={handleDeleteRequest}onEdit={canEdit ? handleEditRequest : undefined}/>@@ -190,7 +233,14 @@ export default function AutomationsList() {title={t(I18nKey.AUTOMATIONS$INACTIVE)}count={inactive.length}automations={inactive}+ view={viewMode}onToggle={handleToggle}+ onRunNow={handleRunNow}+ runPendingId={+ dispatchMutation.isPending+ ? (dispatchMutation.variables ?? null)+ : null+ }onDelete={handleDeleteRequest}onEdit={canEdit ? handleEditRequest : undefined}/>@@ -228,6 +278,11 @@ export default function AutomationsList() {onClose={() => setEditTarget(null)}/>)}++ <AddAutomationModal+ isOpen={isAddAutomationOpen}+ onClose={() => setIsAddAutomationOpen(false)}+ /></div></div>);diff --git a/src/routes/mcp.tsx b/src/routes/mcp.tsxindex 86aa467f19..55253f0f76 100644--- a/src/routes/mcp.tsx+++ b/src/routes/mcp.tsx@@ -18,7 +18,6 @@ import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message"import { settingsLikeMainScrollClassName } from "#/utils/settings-like-page-layout-classes";import {findCatalogEntryForServer,- findInstalledMatch,installedServerMatchesQuery,} from "#/utils/mcp-marketplace-utils";import {@@ -29,10 +28,11 @@ import { MCPServerConfig } from "#/types/mcp-server";import { flattenMcpConfig } from "#/utils/mcp-installed-servers";import {InstalledServersSection,- MarketplaceSearch,+ McpToolbar,MarketplaceSection,InstallServerModal,CustomServerEditor,+ type McpSectionFilter,} from "#/components/features/mcp-page";// ACP guard: the ACP sub-agent owns its own MCP server configuration —@@ -61,13 +61,12 @@ export default function MCPPage() {const [serverToDelete, setServerToDelete] =React.useState<MCPServerConfig | null>(null);const [searchQuery, setSearchQuery] = React.useState("");+ const [sectionFilter, setSectionFilter] =+ React.useState<McpSectionFilter>("all");const mcpConfig = parseMcpConfig(settings?.agent_settings?.mcp_config);const allServers = flattenMcpConfig(mcpConfig);- const isInstalled = (entry: MarketplaceEntry) =>- !!findInstalledMatch(entry.template, allServers);-// Filter installed servers by the search query. We pair each server// with its catalog entry (if any) so the search can match friendly// names like "Slack" against a stdio server whose own `.name` is@@ -80,7 +79,7 @@ export default function MCPPage() {),);- const handleMarketplaceClick = (entry: MarketplaceEntry) => {+ const handleMarketplaceInstall = (entry: MarketplaceEntry) => {setInstallEntry(entry);};@@ -156,27 +155,36 @@ export default function MCPPage() {</div></div>- <MarketplaceSearch value={searchQuery} onChange={setSearchQuery} />+ <McpToolbar+ search={searchQuery}+ onSearchChange={setSearchQuery}+ sectionFilter={sectionFilter}+ onSectionFilterChange={setSectionFilter}+ />- <section className="flex flex-col gap-3">- <h2 className="text-base font-medium text-foreground">- {t(I18nKey.MCP$INSTALLED_TITLE)}- </h2>- <InstalledServersSection- servers={filteredInstalledServers}- hasAnyInstalled={allServers.length > 0}+ {sectionFilter !== "library" ? (+ <section className="flex flex-col gap-3">+ <h2 className="text-base font-semibold text-foreground">+ {t(I18nKey.MCP$INSTALLED_TITLE)}+ </h2>+ <InstalledServersSection+ servers={filteredInstalledServers}+ hasAnyInstalled={allServers.length > 0}+ query={searchQuery}+ onEdit={handleEdit}+ onDelete={handleDeleteClick}+ />+ </section>+ ) : null}++ {sectionFilter !== "installed" ? (+ <MarketplaceSection+ backendKind={backendKind}+ onSelect={handleMarketplaceInstall}+ onAdd={handleMarketplaceInstall}query={searchQuery}- onEdit={handleEdit}- onDelete={handleDeleteClick}/>- </section>-- <MarketplaceSection- isInstalled={isInstalled}- backendKind={backendKind}- onSelect={handleMarketplaceClick}- query={searchQuery}- />+ ) : null}</div>{installEntry && (diff --git a/src/routes/skills-settings.tsx b/src/routes/skills-settings.tsxindex 2ff5d1f2e7..18d77f52da 100644--- a/src/routes/skills-settings.tsx+++ b/src/routes/skills-settings.tsx@@ -5,20 +5,30 @@ import { useSettings } from "#/hooks/query/use-settings";import { useSkills } from "#/hooks/query/use-skills";import { ExtensionsNavigation } from "#/components/features/skills/extensions-navigation";import { SkillCard } from "#/components/features/skills/skill-card";+import { SkillDetailModal } from "#/components/features/skills/skill-detail-modal";+import { AddSkillModal } from "#/components/features/skills/add-skill-modal";import { SkillsToolbar } from "#/components/features/skills/skills-toolbar";+import { BrandButton } from "#/components/features/settings/brand-button";import type { SkillTypeFilter } from "#/components/features/skills/skill-type-filter";import { I18nKey } from "#/i18n/declaration";import { displayErrorToast } from "#/utils/custom-toast-handlers";import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";import { cn } from "#/utils/utils";import { settingsLikeMainScrollClassName } from "#/utils/settings-like-page-layout-classes";+import {+ extensionModuleCardGridClassName,+ extensionModuleCardGridContainerClassName,+} from "#/utils/extension-module-card-classes";import type { SkillInfo } from "#/types/settings";+import { getSkillCardDescription } from "#/components/features/skills/get-skill-card-description";function matchesSearch(skill: SkillInfo, query: string): boolean {if (!query) return true;const haystacks = [skill.name,+ getSkillCardDescription(skill),skill.description ?? "",+ skill.content ?? "",skill.license ?? "",skill.compatibility ?? "",...(skill.triggers ?? []),@@ -40,6 +50,10 @@ function SkillsSettingsScreen() {React.useState(false);const [searchQuery, setSearchQuery] = React.useState("");const [typeFilter, setTypeFilter] = React.useState<SkillTypeFilter>("all");+ const [selectedSkill, setSelectedSkill] = React.useState<SkillInfo | null>(+ null,+ );+ const [showAddSkillModal, setShowAddSkillModal] = React.useState(false);// Sync local state with server settings when data first arrivesReact.useEffect(() => {@@ -94,16 +108,27 @@ function SkillsSettingsScreen() {<ExtensionsNavigation /><main className={cn(settingsLikeMainScrollClassName, "h-full")}><div className="mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6">- <div className="min-w-0 space-y-1">- <h2 className="text-xl font-medium leading-6 text-foreground">- {t(I18nKey.SETTINGS$SKILLS_TITLE)}- </h2>- <div- data-testid="skills-settings-description"- className="max-w-2xl text-sm text-tertiary-light"- >- {t(I18nKey.SETTINGS$SKILLS_PAGE_DESCRIPTION)}+ <div className="flex min-w-0 items-start justify-between gap-4">+ <div className="min-w-0 space-y-1">+ <h2 className="text-xl font-semibold leading-6 text-foreground">+ {t(I18nKey.SETTINGS$SKILLS_TITLE)}+ </h2>+ <div+ data-testid="skills-settings-description"+ className="max-w-2xl text-sm text-tertiary-light"+ >+ {t(I18nKey.SETTINGS$SKILLS_PAGE_DESCRIPTION)}+ </div></div>+ <BrandButton+ type="button"+ variant="secondary"+ testId="skills-add-skill-button"+ className="flex-shrink-0 whitespace-nowrap"+ onClick={() => setShowAddSkillModal(true)}+ >+ {t(I18nKey.SETTINGS$SKILLS_ADD_BUTTON)}+ </BrandButton></div>{isLoading && (@@ -130,8 +155,6 @@ function SkillsSettingsScreen() {onSearchChange={setSearchQuery}typeFilter={typeFilter}onTypeFilterChange={setTypeFilter}- shown={filteredSkills.length}- total={skills.length}/>{filteredSkills.length === 0 ? (<p@@ -141,13 +164,19 @@ function SkillsSettingsScreen() {{t(I18nKey.SETTINGS$SKILLS_NO_MATCH)}</p>) : (- <section className="flex flex-col gap-3">- <div className="grid grid-cols-1 gap-3 xl:grid-cols-2">+ <section+ className={cn(+ "flex min-w-0 flex-col gap-3",+ extensionModuleCardGridContainerClassName,+ )}+ >+ <div className={extensionModuleCardGridClassName}>{filteredSkills.map((skill) => (<SkillCardkey={skill.name}skill={skill}enabled={!disabledSet.has(skill.name)}+ onOpen={() => setSelectedSkill(skill)}onToggle={(enabled) =>handleToggle(skill.name, enabled)}@@ -158,6 +187,19 @@ function SkillsSettingsScreen() {)}</>)}++ {selectedSkill && (+ <SkillDetailModal+ skill={selectedSkill}+ enabled={!disabledSet.has(selectedSkill.name)}+ onToggle={(enabled) => handleToggle(selectedSkill.name, enabled)}+ onClose={() => setSelectedSkill(null)}+ />+ )}++ {showAddSkillModal && (+ <AddSkillModal onClose={() => setShowAddSkillModal(false)} />+ )}</div></main></div>diff --git a/src/tailwind.css b/src/tailwind.cssindex b9c9cc6121..62d2553580 100644--- a/src/tailwind.css+++ b/src/tailwind.css@@ -162,6 +162,38 @@}}+/* Skills / MCP / Automations tiles: no border at rest; hover/focus-visible only. */+.extension-module-card-interactive {+ cursor: pointer;+ border: 1px solid transparent;+ outline: none;+ box-shadow: none;+ transition: border-color 150ms;+ -webkit-tap-highlight-color: transparent;+}++button.extension-module-card-interactive {+ appearance: none;+}++.extension-module-card-interactive:hover {+ border-color: rgb(255 255 255 / 0.4);+}++.extension-module-card-interactive:focus {+ outline: none;+ box-shadow: none;+}++.extension-module-card-interactive:focus:not(:focus-visible) {+ border-color: transparent;+}++.extension-module-card-interactive:focus-visible {+ outline: none;+ border-color: rgb(255 255 255 / 0.4);+}+.button-base {@apply bg-tertiary border border-[var(--oh-border)] rounded-xs;}diff --git a/src/ui/dropdown/dropdown-input.tsx b/src/ui/dropdown/dropdown-input.tsxindex afa021a9d5..5c4ab3ba1c 100644--- a/src/ui/dropdown/dropdown-input.tsx+++ b/src/ui/dropdown/dropdown-input.tsx@@ -5,12 +5,17 @@ interface DropdownInputProps {placeholder?: string;isDisabled: boolean;getInputProps: (props?: object) => object;+ /** When false, placeholder hint keeps upright type (e.g. backend selector). */+ italicPlaceholder?: boolean;+ fitContent?: boolean;}export function DropdownInput({placeholder,isDisabled,getInputProps,+ italicPlaceholder = true,+ fitContent = false,}: DropdownInputProps) {return (<input@@ -18,6 +23,13 @@ export function DropdownInput({placeholder,disabled: isDisabled,className: cn(+ "outline-none bg-transparent text-white not-italic",+ fitContent+ ? "w-auto field-sizing-content whitespace-nowrap text-sm"+ : "flex-1 min-w-0",+ italicPlaceholder &&+ "placeholder:italic placeholder:text-tertiary-alt",+ !italicPlaceholder && "placeholder:text-tertiary-alt",formControlInlineInputClassName,"px-0 not-italic text-inherit",),diff --git a/src/ui/dropdown/dropdown-menu.tsx b/src/ui/dropdown/dropdown-menu.tsxindex f4d9f76d27..c92665bd42 100644--- a/src/ui/dropdown/dropdown-menu.tsx+++ b/src/ui/dropdown/dropdown-menu.tsx@@ -16,6 +16,7 @@ interface DropdownMenuProps {}) => object;footer?: React.ReactNode;openUpward?: boolean;+ fitContent?: boolean;}export function DropdownMenu({@@ -27,11 +28,13 @@ export function DropdownMenu({getItemProps,footer,openUpward = false,+ fitContent = false,}: DropdownMenuProps) {return (<divclassName={cn(- "absolute z-50 w-full overflow-hidden text-white",+ "absolute z-50 overflow-hidden text-white",+ fitContent ? "min-w-full w-max" : "w-full",openUpward ? "bottom-full mb-1" : "mt-1","bg-tertiary rounded-[6px] context-menu-box-shadow p-1","max-h-60 overflow-auto",diff --git a/src/ui/dropdown/dropdown.tsx b/src/ui/dropdown/dropdown.tsxindex 9c7c1b944e..7888f7bdf1 100644--- a/src/ui/dropdown/dropdown.tsx+++ b/src/ui/dropdown/dropdown.tsx@@ -40,6 +40,10 @@ interface DropdownProps {defaultOpen?: boolean;/** Open the dropdown menu on hover instead of requiring a click. */openOnHover?: boolean;+ /** When false, the combobox placeholder uses normal (non-italic) type. */+ italicPlaceholder?: boolean;+ /** Size the trigger to its label instead of stretching to the container width. */+ fitContent?: boolean;}export function Dropdown({@@ -58,6 +62,8 @@ export function Dropdown({hideTrigger = false,defaultOpen = false,openOnHover = false,+ italicPlaceholder = true,+ fitContent = false,}: DropdownProps) {const closeTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null,@@ -141,7 +147,7 @@ export function Dropdown({return (<div- className="relative w-full"+ className={cn("relative", fitContent ? "inline-block w-auto" : "w-full")}data-testid={testId}onMouseEnter={openOnHover@@ -165,6 +171,9 @@ export function Dropdown({{!hideTrigger ? (<divclassName={cn(+ "bg-tertiary border border-[var(--oh-border-input)] rounded p-2",+ "flex items-center gap-2",+ fitContent ? "w-auto" : "w-full",formControlShellClassName,"group w-full gap-2 px-3 text-[var(--oh-muted)] hover:text-white",isDisabled && "cursor-not-allowed opacity-60",@@ -180,6 +189,8 @@ export function Dropdown({placeholder={placeholder}isDisabled={isDisabled}getInputProps={getInputPropsWithCursorFix}+ italicPlaceholder={italicPlaceholder}+ fitContent={fitContent}/>{loading && <LoadingSpinner />}{clearable && selectedItem && (@@ -222,6 +233,7 @@ export function Dropdown({getItemProps={getItemProps}footer={footer}openUpward={openUpward}+ fitContent={fitContent}/></div>);diff --git a/src/utils/extension-module-card-classes.ts b/src/utils/extension-module-card-classes.tsnew file mode 100644index 0000000000..b4fc3dcf1e--- /dev/null+++ b/src/utils/extension-module-card-classes.ts@@ -0,0 +1,29 @@+/** Shared card chrome for Skills / MCP / Automations tiles (border on hover only). */+export const extensionModuleCardSurfaceClassName =+ "rounded-xl bg-base-secondary";++/** See `.extension-module-card-interactive` in `src/tailwind.css`. */+export const EXTENSION_MODULE_CARD_INTERACTIVE_CLASS =+ "extension-module-card-interactive";++export const extensionModuleCardInteractiveClassName =+ EXTENSION_MODULE_CARD_INTERACTIVE_CLASS;++/** Shared pill chrome for Skills, automation cards, and related modals. */+export const extensionModuleCardPillClassName =+ "inline-flex max-w-full shrink-0 items-center whitespace-nowrap rounded-full border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-2 py-0.5 text-[11px] leading-4 text-tertiary-light";++/** Two-column card grids switch back to one column at or below this width (px). */+export const EXTENSION_MODULE_CARD_GRID_SINGLE_COLUMN_MAX_PX = 599;++/** Establishes the inline-size container queried by {@link extensionModuleCardGridClassName}. */+export const extensionModuleCardGridContainerClassName =+ "@container min-w-0 w-full";++/** Single column in narrow content columns; two columns from 600px container width up. */+export const extensionModuleCardGridClassName =+ "grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2";++/** Bordered empty-state panel used on MCP Installed and Automations list pages. */+export const extensionModuleEmptyStateClassName =+ "rounded-xl border border-[var(--oh-border)] p-8 text-center";diff --git a/src/utils/settings-like-page-layout-classes.ts b/src/utils/settings-like-page-layout-classes.tsindex 0d4c35c90c..a313ec0367 100644--- a/src/utils/settings-like-page-layout-classes.ts+++ b/src/utils/settings-like-page-layout-classes.ts@@ -4,8 +4,8 @@* `gap-10` + right gutter pattern.*/export const settingsLikeMainScrollClassName =- "flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always px-4 pt-8 pb-12 md:px-0 md:pr-[14px]";+ "flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto custom-scrollbar-always px-4 pt-8 pb-12 md:px-0 md:pr-[14px]";/** Same scroll shell as {@link settingsLikeMainScrollClassName} but desktop top padding comes from the outer `md:pt-8` wrapper ({@link SettingsLayout}). */export const settingsLayoutMainScrollClassName =- "flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always px-4 pt-8 pb-12 md:px-0 md:pt-0 md:pr-[14px]";+ "flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto custom-scrollbar-always px-4 pt-8 pb-12 md:px-0 md:pt-0 md:pr-[14px]";diff --git a/src/utils/table-row-classes.ts b/src/utils/table-row-classes.tsnew file mode 100644index 0000000000..70a5aa968c--- /dev/null+++ b/src/utils/table-row-classes.ts@@ -0,0 +1,23 @@+/** Bordered table container on base-secondary surfaces. */+export const tableContainerClassName =+ "overflow-hidden rounded-md border border-[var(--oh-border)] bg-base-secondary";++/** Fixed 44px row height for compact data tables (secrets, automations, MCP). */+export const tableRowHeightClassName = "h-11";++export const tableRowClassName = [+ tableRowHeightClassName,+ "border-t border-[var(--oh-border)] transition-colors",+].join(" ");++/** Subtle row highlight on base-secondary tables. */+export const tableRowHoverClassName =+ "hover:bg-interactive-hover-low outline-none focus:outline-none focus-visible:outline-none focus-visible:bg-interactive-hover-low";++export const tableCellClassName = "px-3 align-middle";++export const tableRowInteractiveClassName = [+ tableRowClassName,+ tableRowHoverClassName,+ "cursor-pointer",+].join(" ");diff --git a/tests/e2e/snapshots/skills-page.snapshot.spec.ts b/tests/e2e/snapshots/skills-page.snapshot.spec.tsindex 79997d5571..ca55e91df4 100644--- a/tests/e2e/snapshots/skills-page.snapshot.spec.ts+++ b/tests/e2e/snapshots/skills-page.snapshot.spec.ts@@ -214,6 +214,8 @@ test.describe("Skills Page Visual Snapshots", () => {timeout: 5_000,});+ const filter = page.getByTestId("skills-type-filter");+ await filter.getByTestId("dropdown-trigger").click();await page.getByTestId("skills-type-filter-agentskills").click();await page.waitForTimeout(300);diff --git a/vite.config.ts b/vite.config.tsindex aedbfd8896..df27b3e6ae 100644--- a/vite.config.ts+++ b/vite.config.ts@@ -340,6 +340,14 @@ export default defineConfig(({ mode }) => {environment: "jsdom",setupFiles: ["vitest.setup.ts"],exclude: [...configDefaults.exclude, "tests"],+ // The full suite runs many DOM-heavy tests in parallel, which can+ // push individual `userEvent`-driven tests past Vitest's 5000ms+ // default on busy machines (the skills-settings and i18n+ // namespace tests are the typical victims). Bumping the global+ // timeout keeps these tests deterministic without changing any+ // production behavior.+ testTimeout: 30000,+ hookTimeout: 30000,server: {deps: {inline: ["@openhands/typescript-client"],