🙌 OpenHands: AI-Driven Development
feat(ui): modal polish — skills, hooks, tools, metrics, and conversation menu (#721)
FraterCCCLXIII57f01fb512a5
diff --git a/__tests__/components/backends/add-backend-modal.test.tsx b/__tests__/components/backends/add-backend-modal.test.tsxindex d318c829a9..786f94b98a 100644--- a/__tests__/components/backends/add-backend-modal.test.tsx+++ b/__tests__/components/backends/add-backend-modal.test.tsx@@ -153,10 +153,32 @@ describe("AddBackendModal – two-column layout", () => {expect(active).toEqual({ backendId: added.id, orgId: null });});- it("shows the close button", () => {+ it("closes when the header close button is clicked", async () => {+ const user = userEvent.setup();const onClose = vi.fn();renderWithProviders(<AddBackendModal onClose={onClose} />);- expect(screen.getByTestId("add-backend-close")).toBeInTheDocument();+ await user.click(screen.getByTestId("add-backend-close"));++ expect(onClose).toHaveBeenCalledTimes(1);+ });++ it("keeps advanced host settings in the layout when collapsed", async () => {+ const user = userEvent.setup();+ renderWithProviders(<AddBackendModal onClose={vi.fn()} />);++ expect(screen.getByTestId("add-backend-cloud-host")).toBeInTheDocument();++ await user.click(screen.getByTestId("add-backend-advanced-toggle"));++ expect(screen.getByTestId("add-backend-cloud-host")).toBeInTheDocument();+ });++ it("renders the cloud login button without a key icon prefix", () => {+ renderWithProviders(<AddBackendModal onClose={vi.fn()} />);++ const loginButton = screen.getByTestId("add-backend-login-button");+ expect(loginButton.textContent?.trim()).not.toMatch(/^🔑/);+ expect(loginButton.textContent).not.toContain("🔑");});});diff --git a/__tests__/components/backends/manage-backends-modal.test.tsx b/__tests__/components/backends/manage-backends-modal.test.tsxindex de80d31776..62d8f69ce1 100644--- a/__tests__/components/backends/manage-backends-modal.test.tsx+++ b/__tests__/components/backends/manage-backends-modal.test.tsx@@ -84,6 +84,18 @@ describe("ManageBackendsModal", () => {expect(dots.length).toBeGreaterThanOrEqual(1);});+ it("closes when the header close button is clicked", async () => {+ const user = userEvent.setup();+ const onClose = vi.fn();+ renderWithProviders(<ManageBackendsModal onClose={onClose} />);++ await user.click(+ await screen.findByTestId("close-manage-backends-modal"),+ );++ expect(onClose).toHaveBeenCalledTimes(1);+ });+it("opens the add-backend form when '+ Add backend' is clicked", async () => {const user = userEvent.setup();renderWithProviders(<ManageBackendsModal onClose={vi.fn()} />);@@ -165,4 +177,37 @@ describe("ManageBackendsModal", () => {expect(row.textContent).toContain("http://localhost:9999");expect(backendId).not.toBe("");});++ it("closes the edit form when the header close button is clicked", async () => {+ const user = userEvent.setup();++ renderWithProviders(+ <TestSeed+ onMount={(ctx) => {+ ctx.addBackend({+ name: "Acme Local",+ host: "http://localhost:9000",+ apiKey: "old-key",+ kind: "local",+ });+ }}+ >+ <ManageBackendsModal onClose={vi.fn()} />+ </TestSeed>,+ );++ await user.click(+ await screen.findByTestId("manage-backends-edit-Acme Local"),+ );+ await screen.findByTestId("edit-backend-modal");++ await user.click(screen.getByTestId("edit-backend-close"));++ await waitFor(() => {+ expect(+ screen.queryByTestId("edit-backend-modal"),+ ).not.toBeInTheDocument();+ });+ expect(screen.getByTestId("manage-backends-modal")).toBeInTheDocument();+ });});diff --git a/__tests__/components/features/chat/open-repository-modal.test.tsx b/__tests__/components/features/chat/open-repository-modal.test.tsxindex 58b51a7f21..3c08472c2b 100644--- a/__tests__/components/features/chat/open-repository-modal.test.tsx+++ b/__tests__/components/features/chat/open-repository-modal.test.tsx@@ -102,10 +102,6 @@ vi.mock();// Mock RepoForkedIcon-vi.mock("#/icons/repo-forked.svg?react", () => ({- default: () => <div data-testid="repo-forked-icon" />,-}));-describe("OpenRepositoryModal", () => {const mockOnClose = vi.fn();const mockOnLaunch = vi.fn();@@ -141,10 +137,27 @@ describe("OpenRepositoryModal", () => {expect(screen.getByText("CONVERSATION$OPEN_REPOSITORY"),).toBeInTheDocument();+ expect(+ screen.getByTestId("close-open-repository-modal"),+ ).toBeInTheDocument();expect(screen.getByText("CONVERSATION$SELECT_OR_INSERT_LINK"),).toBeInTheDocument();- expect(screen.getByTestId("repo-forked-icon")).toBeInTheDocument();+ });++ it("calls onClose when the header close button is clicked", async () => {+ const user = userEvent.setup();+ render(+ <OpenRepositoryModal+ isOpen={true}+ onClose={mockOnClose}+ onLaunch={mockOnLaunch}+ />,+ );++ await user.click(screen.getByTestId("close-open-repository-modal"));++ expect(mockOnClose).toHaveBeenCalledTimes(1);});it("should render Launch and Cancel buttons", () => {diff --git a/__tests__/components/features/conversation-panel/hooks-modal.test.tsx b/__tests__/components/features/conversation-panel/hooks-modal.test.tsxindex 4edd7ef44f..8624b8ef7a 100644--- a/__tests__/components/features/conversation-panel/hooks-modal.test.tsx+++ b/__tests__/components/features/conversation-panel/hooks-modal.test.tsx@@ -1,5 +1,5 @@import { describe, it, expect, vi, beforeEach } from "vitest";-import { render, screen, within } from "@testing-library/react";+import { render, screen } from "@testing-library/react";import userEvent from "@testing-library/user-event";import React from "react";import { HookEventItem } from "#/components/features/conversation-panel/hook-event-item";@@ -15,9 +15,14 @@ vi.mock("react-i18next", async () => {...actual,useTranslation: () => ({t: (key: string, params?: Record<string, unknown>) => {+ if (key === "HOOKS_MODAL$HOOK_COUNT") {+ const count = Number(params?.count ?? 0);+ return count === 1 ? `${count} hook` : `${count} hooks`;+ }+const translations: Record<string, string> = {HOOKS_MODAL$TITLE: "Available Hooks",- HOOKS_MODAL$HOOK_COUNT: `${params?.count ?? 0} hooks`,+ HOOKS_MODAL$WARNING: "Hooks warning text",HOOKS_MODAL$EVENT_PRE_TOOL_USE: "Pre Tool Use",HOOKS_MODAL$EVENT_POST_TOOL_USE: "Post Tool Use",HOOKS_MODAL$EVENT_USER_PROMPT_SUBMIT: "User Prompt Submit",@@ -32,6 +37,7 @@ vi.mock("react-i18next", async () => {COMMON$FETCH_ERROR: "Failed to fetch data",CONVERSATION$NO_HOOKS: "No hooks configured",BUTTON$REFRESH: "Refresh",+ BUTTON$CLOSE: "Close",};return translations[key] || key;},@@ -64,29 +70,33 @@ describe("HooksEmptyState", () => {describe("HooksModalHeader", () => {const defaultProps = {- isAgentReady: true,isLoading: false,isRefetching: false,onRefresh: vi.fn(),+ onClose: vi.fn(),};beforeEach(() => {vi.clearAllMocks();});- it("should render title", () => {+ it("should render title and warning", () => {render(<HooksModalHeader {...defaultProps} />);expect(screen.getByText("Available Hooks")).toBeInTheDocument();+ expect(screen.getByText("Hooks warning text")).toBeInTheDocument();});- it("should render refresh button when agent is ready", () => {+ it("should render icon-only refresh button with accessible label", () => {render(<HooksModalHeader {...defaultProps} />);- expect(screen.getByTestId("refresh-hooks")).toBeInTheDocument();+ const refreshButton = screen.getByTestId("refresh-hooks");+ expect(refreshButton).toBeInTheDocument();+ expect(refreshButton).toHaveAttribute("aria-label", "Refresh");+ expect(refreshButton).not.toHaveTextContent("Refresh");});- it("should not render refresh button when agent is not ready", () => {- render(<HooksModalHeader {...defaultProps} isAgentReady={false} />);- expect(screen.queryByTestId("refresh-hooks")).not.toBeInTheDocument();+ it("should render close button", () => {+ render(<HooksModalHeader {...defaultProps} />);+ expect(screen.getByTestId("close-hooks-modal")).toBeInTheDocument();});it("should call onRefresh when refresh button is clicked", async () => {@@ -98,6 +108,15 @@ describe("HooksModalHeader", () => {expect(onRefresh).toHaveBeenCalledTimes(1);});+ it("should call onClose when close button is clicked", async () => {+ const user = userEvent.setup();+ const onClose = vi.fn();+ render(<HooksModalHeader {...defaultProps} onClose={onClose} />);++ await user.click(screen.getByTestId("close-hooks-modal"));+ expect(onClose).toHaveBeenCalledTimes(1);+ });+it("should disable refresh button when loading", () => {render(<HooksModalHeader {...defaultProps} isLoading={true} />);expect(screen.getByTestId("refresh-hooks")).toBeDisabled();@@ -144,7 +163,7 @@ describe("HookEventItem", () => {it("should render hook count", () => {render(<HookEventItem {...defaultProps} />);- expect(screen.getByText("1 hooks")).toBeInTheDocument();+ expect(screen.getByText("1 hook")).toBeInTheDocument();});it("should call onToggle when clicked", async () => {@@ -158,13 +177,11 @@ describe("HookEventItem", () => {it("should show collapsed state by default", () => {render(<HookEventItem {...defaultProps} isExpanded={false} />);- // Matcher content should not be visible when collapsedexpect(screen.queryByText("*")).not.toBeInTheDocument();});it("should show expanded state with matcher content", () => {render(<HookEventItem {...defaultProps} isExpanded={true} />);- // Matcher content should be visible when expandedexpect(screen.getByText("*")).toBeInTheDocument();});@@ -281,7 +298,6 @@ describe("HookEventItem", () => {),).not.toThrow();- // Should count only the valid hooks- expect(screen.getByText("1 hooks")).toBeInTheDocument();+ expect(screen.getByText("1 hook")).toBeInTheDocument();});});diff --git a/__tests__/components/features/conversation/conversation-name.test.tsx b/__tests__/components/features/conversation/conversation-name.test.tsxindex 7feb47a09b..70ec2da3c6 100644--- a/__tests__/components/features/conversation/conversation-name.test.tsx+++ b/__tests__/components/features/conversation/conversation-name.test.tsx@@ -662,7 +662,11 @@ describe("ConversationName public sharing", () => {renderConversationNameWithRouter();await user.click(screen.getByTestId("ellipsis-button"));- await user.click(screen.getByTestId("share-publicly-button"));+ const toggleLabel = screen+ .getByTestId("share-publicly-button")+ .closest("label");+ expect(toggleLabel).not.toBeNull();+ await user.click(toggleLabel!);expect(updatePublicFlagSpy).toHaveBeenCalledWith("test-conversation-id",diff --git a/__tests__/components/features/mcp-page/custom-server-editor.test.tsx b/__tests__/components/features/mcp-page/custom-server-editor.test.tsxindex 334e23f2ba..5da761572d 100644--- a/__tests__/components/features/mcp-page/custom-server-editor.test.tsx+++ b/__tests__/components/features/mcp-page/custom-server-editor.test.tsx@@ -86,4 +86,13 @@ describe("CustomServerEditor", () => {expect(onClose).not.toHaveBeenCalled();});});++ 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"));++ 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 968512384a..bfa6ac4787 100644--- a/__tests__/components/features/mcp-page/install-server-modal.test.tsx+++ b/__tests__/components/features/mcp-page/install-server-modal.test.tsx@@ -182,6 +182,16 @@ describe("InstallServerModal", () => {await waitFor(() => expect(saveSpy).toHaveBeenCalledTimes(1));});+ it("calls onClose when the header close button is clicked", async () => {+ const onClose = vi.fn();+ const slack = MCP_MARKETPLACE.find((e) => e.id === "slack")!;+ renderWith(<InstallServerModal entry={slack} onClose={onClose} />);++ fireEvent.click(await screen.findByTestId("close-mcp-install-modal"));++ expect(onClose).toHaveBeenCalledTimes(1);+ });+it("places Cancel before Install in the footer so the dominant action is the last focusable button", async () => {// Arrange: render with any marketplace entry so the footer is mounted.const slack = MCP_MARKETPLACE.find((e) => e.id === "slack")!;diff --git a/__tests__/hooks/mutation/use-update-conversation-public-flag.test.tsx b/__tests__/hooks/mutation/use-update-conversation-public-flag.test.tsxnew file mode 100644index 0000000000..d13b5c8312--- /dev/null+++ b/__tests__/hooks/mutation/use-update-conversation-public-flag.test.tsx@@ -0,0 +1,75 @@+import React from "react";+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";+import { beforeEach, describe, expect, it, vi } from "vitest";+import { renderHook, waitFor } from "@testing-library/react";+import AgentServerConversationService from "#/api/conversation-service/agent-server-conversation-service.api";+import type { AppConversation } from "#/api/conversation-service/agent-server-conversation-service.types";+import { useUpdateConversationPublicFlag } from "#/hooks/mutation/use-update-conversation-public-flag";++vi.mock("#/api/conversation-service/agent-server-conversation-service.api", () => ({+ default: {+ updateConversationPublicFlag: vi.fn(),+ },+}));++describe("useUpdateConversationPublicFlag", () => {+ let queryClient: QueryClient;++ beforeEach(() => {+ queryClient = new QueryClient({+ defaultOptions: {+ queries: { retry: false },+ mutations: { retry: false },+ },+ });+ vi.clearAllMocks();+ });++ it("optimistically updates all conversation cache entries before the request settles", async () => {+ const conversationId = "conv-1";+ const queryKey = [+ "user",+ "conversation",+ conversationId,+ "cloud-backend",+ "org-1",+ ] as const;++ queryClient.setQueryData(queryKey, {+ conversation_id: conversationId,+ public: false,+ });++ vi.mocked(+ AgentServerConversationService.updateConversationPublicFlag,+ ).mockImplementation(+ () =>+ new Promise((resolve) => {+ setTimeout(+ () =>+ resolve({+ conversation_id: conversationId,+ public: true,+ } as unknown as AppConversation),+ 50,+ );+ }),+ );++ const wrapper = ({ children }: { children: React.ReactNode }) => (+ <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>+ );++ const { result } = renderHook(() => useUpdateConversationPublicFlag(), {+ wrapper,+ });++ result.current.mutate({ conversationId, isPublic: true });++ await waitFor(() => {+ expect(queryClient.getQueryData(queryKey)).toMatchObject({+ public: true,+ });+ });+ });+});diff --git a/src/components/features/automations/delete-confirmation-modal.tsx b/src/components/features/automations/delete-confirmation-modal.tsxindex ce927a56f6..3c512a485e 100644--- a/src/components/features/automations/delete-confirmation-modal.tsx+++ b/src/components/features/automations/delete-confirmation-modal.tsx@@ -39,7 +39,7 @@ export function DeleteConfirmationModal({<XMarkIcon className="size-5" /></button>- <h2 className="text-lg font-semibold text-white">+ <h2 className="text-lg font-semibold text-content-2">{t(I18nKey.AUTOMATIONS$DELETE_CONFIRM_TITLE)}</h2><p className="mt-2 text-sm text-muted">diff --git a/src/components/features/automations/detail/edit-automation-modal.tsx b/src/components/features/automations/detail/edit-automation-modal.tsxindex eb364b3b4c..84e3b16cc6 100644--- a/src/components/features/automations/detail/edit-automation-modal.tsx+++ b/src/components/features/automations/detail/edit-automation-modal.tsx@@ -214,7 +214,7 @@ export function EditAutomationModal({<XMarkIcon className="size-5" /></button>- <h2 className="text-lg font-semibold text-white">+ <h2 className="text-lg font-semibold text-content-2">{t(I18nKey.AUTOMATIONS$EDIT_TITLE)}</h2>@@ -244,7 +244,7 @@ export function EditAutomationModal({setForm((f) => ({ ...f, prompt: e.target.value }))}rows={4}- className="bg-tertiary border border-[var(--oh-border-input)] w-full min-w-0 rounded-sm p-2 text-sm placeholder:italic placeholder:text-tertiary-alt"+ className="bg-tertiary border border-[var(--oh-border-input)] w-full min-w-0 rounded-sm p-2 text-sm placeholder:text-tertiary-alt"/><span className="text-xs text-muted">{t(I18nKey.AUTOMATIONS$EDIT_PROMPT_HINT)}diff --git a/src/components/features/automations/detail/run-logs-modal.tsx b/src/components/features/automations/detail/run-logs-modal.tsxindex 717d9174d7..4c6441dd96 100644--- a/src/components/features/automations/detail/run-logs-modal.tsx+++ b/src/components/features/automations/detail/run-logs-modal.tsx@@ -126,7 +126,7 @@ export function RunLogsModal({<XMarkIcon className="size-5" /></button>- <h2 className="pr-8 text-lg font-semibold text-white">+ <h2 className="pr-8 text-lg font-semibold text-content-2">{t(I18nKey.AUTOMATIONS$DETAIL$LOGS_TITLE)}</h2>diff --git a/src/components/features/backends/backend-form-modal.tsx b/src/components/features/backends/backend-form-modal.tsxindex ffea4945dc..88a5f3b277 100644--- a/src/components/features/backends/backend-form-modal.tsx+++ b/src/components/features/backends/backend-form-modal.tsx@@ -1,19 +1,30 @@import React from "react";import { useQuery } from "@tanstack/react-query";import { useTranslation } from "react-i18next";+import { X } from "lucide-react";import { ServerClient } from "@openhands/typescript-client/clients";import OpenHandsLogoWhite from "#/assets/branding/openhands-logo-white.svg?react";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";+import {+ MODAL_MAX_WIDTH_VIEWPORT,+ modalWidthClassName,+} from "#/components/shared/modals/modal-body";+import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";import { BrandButton } from "#/components/features/settings/brand-button";import { SettingsInput } from "#/components/features/settings/settings-input";import { useActiveBackendContext } from "#/contexts/active-backend-context";import { useBackendsHealth } from "#/hooks/query/use-backends-health";import { getAgentServerClientOptions } from "#/api/agent-server-client-options";+import ChevronDownSmallIcon from "#/icons/chevron-down-small.svg?react";import { I18nKey } from "#/i18n/declaration";import type { Backend, BackendKind } from "#/api/backend-registry/types";+import { cn } from "#/utils/utils";import { BackendStatusDot } from "./backend-status-dot";import { DeviceFlowAuth } from "./device-flow-auth";+const ICON_BUTTON_CLASS =+ "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer";+export type BackendFormMode = "add" | "edit";interface BackendFormModalProps {@@ -433,7 +444,7 @@ function ManualConnectionColumn({ onClose }: { onClose: () => void }) {placeholder="e.g. My Server"className="w-full"/>- <p className="text-xs text-gray-500">+ <p className="text-xs text-[var(--oh-muted)]">{t(I18nKey.BACKEND$NAME_HELPER)}</p></div>@@ -450,7 +461,7 @@ function ManualConnectionColumn({ onClose }: { onClose: () => void }) {className="w-full"/><p- className="text-xs text-gray-500"+ className="text-xs text-[var(--oh-muted)]"data-testid="add-backend-host-helper">{t(I18nKey.BACKEND$HOST_HELPER)}@@ -506,17 +517,19 @@ function CloudLoginColumn({ onClose }: { onClose: () => void }) {};return (- <div className="flex flex-col items-center justify-center gap-4 flex-1 min-w-0 px-4">- <OpenHandsLogoWhite width={56} height={56} aria-hidden />+ <div className="flex flex-1 min-w-0 flex-col items-center gap-3">+ <div className="flex flex-col items-center gap-1">+ <OpenHandsLogoWhite width={56} height={56} aria-hidden />- <h4- className="text-lg font-bold text-white"- data-testid="add-backend-cloud-title"- >- {t(I18nKey.BACKEND$CLOUD_TITLE)}- </h4>+ <h4+ className="text-lg font-bold text-content-2"+ data-testid="add-backend-cloud-title"+ >+ {t(I18nKey.BACKEND$CLOUD_TITLE)}+ </h4>+ </div>- <p className="text-sm text-gray-400 text-center leading-relaxed">+ <p className="text-center text-sm leading-relaxed text-[var(--oh-muted)]">{t(I18nKey.BACKEND$CLOUD_DESCRIPTION)}</p>@@ -526,18 +539,30 @@ function CloudLoginColumn({ onClose }: { onClose: () => void }) {testIdRoot="add-backend"/>- <details- className="w-full"- open={advancedOpen}- onToggle={(e) => setAdvancedOpen((e.target as HTMLDetailsElement).open)}- >- <summary- className="text-xs text-gray-400 cursor-pointer select-none text-center hover:text-gray-300"+ <div className="w-full">+ <button+ type="button"+ onClick={() => setAdvancedOpen((open) => !open)}+ aria-expanded={advancedOpen}data-testid="add-backend-advanced-toggle"+ className="flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2"+ >+ <span>{t(I18nKey.BACKEND$ADVANCED)}</span>+ <ChevronDownSmallIcon+ className={cn(+ "h-4 w-4 shrink-0 text-muted transition-transform",+ advancedOpen && "rotate-180",+ )}+ aria-hidden+ />+ </button>+ <div+ className={cn(+ "pt-2",+ !advancedOpen && "pointer-events-none invisible",+ )}+ aria-hidden={!advancedOpen}>- {t(I18nKey.BACKEND$ADVANCED)}- </summary>- <div className="mt-3"><SettingsInputtestId="add-backend-cloud-host"name="add-backend-cloud-host"@@ -548,11 +573,11 @@ function CloudLoginColumn({ onClose }: { onClose: () => void }) {placeholder={DEFAULT_OPENHANDS_CLOUD_HOST}className="w-full"/>- <p className="text-xs text-gray-500 mt-1">+ <p className="mt-1 text-xs text-[var(--oh-muted)]">{t(I18nKey.BACKEND$LOGIN_CLOUD_HINT)}</p></div>- </details>+ </div></div>);}@@ -580,42 +605,44 @@ export function BackendFormModal({><divdata-testid="add-backend-modal"- className="bg-base-secondary rounded-xl border border-tertiary w-[720px]"+ className={cn(+ "rounded-xl border border-[var(--oh-border)] bg-base-secondary",+ modalWidthClassName("xl"),+ MODAL_MAX_WIDTH_VIEWPORT,+ )}>{/* Header */}- <div className="flex items-center justify-between px-6 pt-6 pb-2">- <h3 className="text-xl font-bold">- {t(I18nKey.BACKEND$ADD_TITLE)}- </h3>+ <div className="flex items-start justify-between gap-4 px-6 pt-6 pb-2">+ <BaseModalTitle title={t(I18nKey.BACKEND$ADD_TITLE)} /><buttontype="button"onClick={onClose}- className="text-gray-400 hover:text-white text-xl leading-none cursor-pointer"+ className={cn(ICON_BUTTON_CLASS, "shrink-0")}data-testid="add-backend-close"- aria-label="Close"+ aria-label={t(I18nKey.BUTTON$CLOSE)}>- {"✕"}+ <X size={20} aria-hidden /></button></div>{/* Two-column body */}- <div className="flex px-6 pb-6 pt-2">+ <div className="flex gap-6 px-6 pb-6 pt-2">{/* Left: manual connection */}- <div className="flex-1 min-w-0 pr-6">+ <div className="flex-1 min-w-0"><ManualConnectionColumn onClose={onClose} /></div>{/* Vertical OR divider */}- <div className="flex flex-col items-center mx-2 shrink-0">- <div className="flex-1 w-px bg-gray-600" />- <span className="text-xs text-gray-500 uppercase py-3">+ <div className="flex shrink-0 flex-col items-center">+ <div className="flex-1 w-px bg-[var(--oh-border)]" />+ <span className="py-3 text-xs uppercase text-[var(--oh-muted)]">{t(I18nKey.BACKEND$LOGIN_OR)}</span>- <div className="flex-1 w-px bg-gray-600" />+ <div className="flex-1 w-px bg-[var(--oh-border)]" /></div>{/* Right: cloud login */}- <div className="flex-1 min-w-0 pl-6">+ <div className="flex-1 min-w-0"><CloudLoginColumn onClose={onClose} /></div></div>@@ -634,9 +661,23 @@ export function BackendFormModal({><divdata-testid={`${testIdRoot}-modal`}- className="bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[480px]"+ className={cn(+ "bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]",+ modalWidthClassName("md"),+ )}>- <h3 className="text-xl font-bold">{t(I18nKey.BACKEND$EDIT_TITLE)}</h3>+ <div className="flex items-start justify-between gap-4">+ <BaseModalTitle title={t(I18nKey.BACKEND$EDIT_TITLE)} />+ <button+ type="button"+ onClick={onClose}+ className={cn(ICON_BUTTON_CLASS, "shrink-0")}+ data-testid={`${testIdRoot}-close`}+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ >+ <X size={20} aria-hidden />+ </button>+ </div><BackendFormmode="edit"backend={backend}diff --git a/src/components/features/backends/backend-selector.tsx b/src/components/features/backends/backend-selector.tsxindex 6d97a0e413..092837d0f7 100644--- a/src/components/features/backends/backend-selector.tsx+++ b/src/components/features/backends/backend-selector.tsx@@ -325,7 +325,6 @@ export function BackendSelector({placeholder={active.backend.name}loading={someCloudLoading}options={options}- italicPlaceholder={false}className="h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)]"/></div>diff --git a/src/components/features/backends/device-flow-auth.tsx b/src/components/features/backends/device-flow-auth.tsxindex 555b6a96b4..46ff4b1009 100644--- a/src/components/features/backends/device-flow-auth.tsx+++ b/src/components/features/backends/device-flow-auth.tsx@@ -138,7 +138,7 @@ export function DeviceFlowAuth({className="w-full"isDisabled={isDisabled}>- 🔑 {t(I18nKey.BACKEND$LOGIN_WITH_OPENHANDS)}+ {t(I18nKey.BACKEND$LOGIN_WITH_OPENHANDS)}</BrandButton>)}diff --git a/src/components/features/backends/manage-backends-modal.tsx b/src/components/features/backends/manage-backends-modal.tsxindex dda7149f36..d2f05fb16a 100644--- a/src/components/features/backends/manage-backends-modal.tsx+++ b/src/components/features/backends/manage-backends-modal.tsx@@ -1,25 +1,35 @@import React from "react";import { useTranslation } from "react-i18next";import { useQuery } from "@tanstack/react-query";-import { Plus } from "lucide-react";+import { Pencil, Plus, Trash2, X } from "lucide-react";import { ServerClient } from "@openhands/typescript-client/clients";import { type Backend } from "#/api/backend-registry/types";import { getAgentServerClientOptions } from "#/api/agent-server-client-options";import { BrandButton } from "#/components/features/settings/brand-button";import { ConfirmationModal } from "#/components/shared/modals/confirmation-modal";+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 { useActiveBackendContext } from "#/contexts/active-backend-context";import {useBackendsHealth,type BackendHealth,} from "#/hooks/query/use-backends-health";-import CloseIcon from "#/icons/close.svg?react";import { I18nKey } from "#/i18n/declaration";import { cn } from "#/utils/utils";import { BackendFormModal } from "./backend-form-modal";import { BackendStatusDot } from "./backend-status-dot";+const ICON_BUTTON_CLASS =+ "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer";++const ROW_ACTION_BUTTON_CLASS =+ "inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted transition-colors hover:bg-interactive-hover hover:text-white";+function BackendVersion({ backend }: { backend: Backend }) {const { t } = useTranslation("openhands");const { data: version } = useQuery({@@ -43,7 +53,7 @@ function BackendVersion({ backend }: { backend: Backend }) {return (<span- className="text-xs text-[var(--oh-text-dim)] truncate"+ className="inline-flex shrink-0 items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface)] px-1.5 py-0.5 text-[10px] font-medium leading-none text-[var(--oh-text-dim)]"data-testid={`manage-backends-version-${backend.name}`}>{t(I18nKey.BACKEND$VERSION_LABEL, { version })}@@ -72,41 +82,44 @@ function BackendRow({ backend, health, onEdit, onRemove }: BackendRowProps) {return (<li- className="flex items-center gap-3 px-5 py-3 border-b border-[var(--oh-border)] last:border-b-0"+ className="flex items-center gap-3 px-3 py-3"data-testid={`manage-backends-row-${backend.name}`}><BackendStatusDot isConnected={health?.isConnected ?? null} />- <div className="flex flex-col min-w-0 flex-1">- <span className="text-sm text-white truncate">{backend.name}</span>- <span className="text-xs text-[var(--oh-muted)] truncate">+ <div className="flex min-w-0 flex-1 flex-col">+ <div className="flex min-w-0 items-center gap-2">+ <span className="truncate text-sm text-white">{backend.name}</span>+ <BackendVersion backend={backend} />+ </div>+ <span className="truncate text-xs text-[var(--oh-muted)]">{backend.host}</span>- <BackendVersion backend={backend} /></div><span className="px-2 py-1 rounded-full text-[11px] uppercase tracking-wide text-[var(--oh-text-tertiary)] bg-[var(--oh-surface)] border border-[var(--oh-border)]">{backend.kind === "cloud"? t(I18nKey.BACKEND$KIND_CLOUD): t(I18nKey.BACKEND$KIND_LOCAL)}</span>- <button- type="button"- onClick={onEdit}- aria-label={t(I18nKey.BACKEND$EDIT)}- data-testid={`manage-backends-edit-${backend.name}`}- className="px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer"- >- {t(I18nKey.BACKEND$EDIT)}- </button>- <button- type="button"- onClick={onRemove}- aria-label={t(I18nKey.BACKEND$REMOVE)}- data-testid={`manage-backends-remove-${backend.name}`}- className="flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer"- >- <CloseIcon width={12} height={12} />- <span>{t(I18nKey.BACKEND$REMOVE)}</span>- </button>+ <div className="flex shrink-0 items-center gap-0.5">+ <button+ type="button"+ onClick={onEdit}+ aria-label={t(I18nKey.BACKEND$EDIT)}+ data-testid={`manage-backends-edit-${backend.name}`}+ className={ROW_ACTION_BUTTON_CLASS}+ >+ <Pencil aria-hidden className="size-4" strokeWidth={2} />+ </button>+ <button+ type="button"+ onClick={onRemove}+ aria-label={t(I18nKey.BACKEND$REMOVE)}+ data-testid={`manage-backends-remove-${backend.name}`}+ className={ROW_ACTION_BUTTON_CLASS}+ >+ <Trash2 aria-hidden className="size-4" strokeWidth={2} />+ </button>+ </div></li>);}@@ -140,44 +153,55 @@ export function ManageBackendsModal({ onClose }: ManageBackendsModalProps) {data-testid="manage-backends-modal"className={cn("flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-xl",- "w-[640px] max-w-[90vw] max-h-[70vh]",+ modalWidthClassName("lg"),+ MODAL_MAX_WIDTH_VIEWPORT,+ "max-h-[70vh]",)}>- <div className="flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border)]">- <span className="text-sm font-semibold text-white">- {t(I18nKey.BACKEND$MANAGE_TITLE)}- </span>+ <div className="flex items-start justify-between gap-4 p-5">+ <BaseModalTitle title={t(I18nKey.BACKEND$MANAGE_TITLE)} />+ <button+ type="button"+ onClick={onClose}+ className={ICON_BUTTON_CLASS}+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ data-testid="close-manage-backends-modal"+ >+ <X size={20} aria-hidden />+ </button></div>- <div- className="flex-1 overflow-auto custom-scrollbar-always"- data-testid="manage-backends-list"- >- {backends.length === 0 ? (- <p className="px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center">- {t(I18nKey.BACKEND$MANAGE_EMPTY)}- </p>- ) : (- <ul>- {backends.map((backend) => (- <BackendRow- key={backend.id}- backend={backend}- health={healthByBackendId[backend.id]}- onEdit={() => setEditingBackend(backend)}- onRemove={() =>- setPendingRemoval({- id: backend.id,- name: backend.name,- })- }- />- ))}- </ul>- )}+ <div className="flex min-h-0 flex-1 flex-col px-5">+ <div+ className="flex-1 overflow-auto rounded-md border border-[var(--oh-border)] bg-surface-raised custom-scrollbar-always"+ data-testid="manage-backends-list"+ >+ {backends.length === 0 ? (+ <p className="px-3 py-6 text-center text-sm text-[var(--oh-text-secondary)]">+ {t(I18nKey.BACKEND$MANAGE_EMPTY)}+ </p>+ ) : (+ <ul className="divide-y divide-[var(--oh-border)]">+ {backends.map((backend) => (+ <BackendRow+ key={backend.id}+ backend={backend}+ health={healthByBackendId[backend.id]}+ onEdit={() => setEditingBackend(backend)}+ onRemove={() =>+ setPendingRemoval({+ id: backend.id,+ name: backend.name,+ })+ }+ />+ ))}+ </ul>+ )}+ </div></div>- <div className="flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border)]">+ <div className="flex justify-end gap-2 p-5"><BrandButtontype="button"variant="secondary"diff --git a/src/components/features/chat/open-repository-modal.tsx b/src/components/features/chat/open-repository-modal.tsxindex 5af298269b..dee6e445e5 100644--- a/src/components/features/chat/open-repository-modal.tsx+++ b/src/components/features/chat/open-repository-modal.tsx@@ -1,5 +1,6 @@import React, { useState, useCallback, useEffect } from "react";import { useTranslation } from "react-i18next";+import { X } from "lucide-react";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";import { ModalBody } from "#/components/shared/modals/modal-body";import { BrandButton } from "#/components/features/settings/brand-button";@@ -11,7 +12,10 @@ import { GitRepoDropdown } from "#/components/features/home/git-repo-dropdown/giimport { GitBranchDropdown } from "#/components/features/home/git-branch-dropdown/git-branch-dropdown";import { GitProviderDropdown } from "#/components/features/home/git-provider-dropdown/git-provider-dropdown";import { useUserProviders } from "#/hooks/use-user-providers";-import RepoForkedIcon from "#/icons/repo-forked.svg?react";+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 OpenRepositoryModalProps {isOpen: boolean;@@ -96,15 +100,23 @@ export function OpenRepositoryModal({return (<ModalBackdrop onClose={handleClose}><ModalBody- width="small"+ width="sm"className="items-start border border-[var(--oh-border)] !gap-4">- <div className="flex flex-col gap-4 w-full">- <div className="flex items-center gap-[10px]">- <RepoForkedIcon width={24} height={24} />- <BaseModalTitle title={t(I18nKey.CONVERSATION$OPEN_REPOSITORY)} />- </div>+ <div className="flex w-full items-start justify-between gap-4">+ <BaseModalTitle title={t(I18nKey.CONVERSATION$OPEN_REPOSITORY)} />+ <button+ type="button"+ onClick={handleClose}+ className={cn(ICON_BUTTON_CLASS, "shrink-0")}+ data-testid="close-open-repository-modal"+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ >+ <X size={20} aria-hidden />+ </button>+ </div>+ <div className="flex flex-col gap-4 w-full"><div className="flex items-center justify-between"><span className="text-sm text-white font-normal leading-[22px]">{t(I18nKey.CONVERSATION$SELECT_OR_INSERT_LINK)}@@ -118,28 +130,28 @@ export function OpenRepositoryModal({/>)}</div>- </div>- <div className="flex flex-col gap-[10px] w-full">- <GitRepoDropdown- provider={activeProvider}- value={selectedRepository?.id || null}- repositoryName={selectedRepository?.full_name || null}- onChange={handleRepositoryChange}- placeholder="Search repositories..."- className="w-full"- />-- <GitBranchDropdown- repository={selectedRepository?.full_name || null}- provider={activeProvider}- selectedBranch={selectedBranch}- onBranchSelect={handleBranchSelect}- defaultBranch={selectedRepository?.main_branch || null}- placeholder="Select branch..."- disabled={!selectedRepository}- className="w-full"- />+ <div className="flex flex-col gap-[10px] w-full">+ <GitRepoDropdown+ provider={activeProvider}+ value={selectedRepository?.id || null}+ repositoryName={selectedRepository?.full_name || null}+ onChange={handleRepositoryChange}+ placeholder="Search repositories..."+ className="w-full"+ />++ <GitBranchDropdown+ repository={selectedRepository?.full_name || null}+ provider={activeProvider}+ selectedBranch={selectedBranch}+ onBranchSelect={handleBranchSelect}+ defaultBranch={selectedRepository?.main_branch || null}+ placeholder="Select branch..."+ disabled={!selectedRepository}+ className="w-full"+ />+ </div></div><divdiff --git a/src/components/features/controls/tools-context-menu.tsx b/src/components/features/controls/tools-context-menu.tsxindex b27087001e..0df9fcef17 100644--- a/src/components/features/controls/tools-context-menu.tsx+++ b/src/components/features/controls/tools-context-menu.tsx@@ -10,7 +10,8 @@ import { Divider } from "#/ui/divider";import { I18nKey } from "#/i18n/declaration";import CodeBranchIcon from "#/icons/u-code-branch.svg?react";-import RobotIcon from "#/icons/u-robot.svg?react";+import SkillsIcon from "#/icons/skills.svg?react";+import FishingHookIcon from "#/icons/fishing-hook.svg?react";import ToolsIcon from "#/icons/u-tools.svg?react";import SettingsIcon from "#/icons/settings.svg?react";import CarretRightFillIcon from "#/icons/carret-right-fill.svg?react";@@ -122,7 +123,14 @@ export function ToolsContextMenu({<ContextMenuListItem testId="show-skills-button" onClick={onShowSkills}><ToolsContextMenuIconText- icon={<RobotIcon width={16} height={16} />}+ icon={+ <SkillsIcon+ width={16}+ height={16}+ className="stroke-[1.75]"+ aria-hidden+ />+ }text={t(I18nKey.CONVERSATION$SHOW_SKILLS)}/></ContextMenuListItem>@@ -131,7 +139,7 @@ export function ToolsContextMenu({{shouldShowHooks && (<ContextMenuListItem testId="show-hooks-button" onClick={onShowHooks}><ToolsContextMenuIconText- icon={<ToolsIcon width={16} height={16} />}+ icon={<FishingHookIcon width={16} height={16} aria-hidden />}text={t(I18nKey.CONVERSATION$SHOW_HOOKS)}/></ContextMenuListItem>diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card-context-menu.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card-context-menu.tsxindex 985ea08eb4..fd871ab890 100644--- a/src/components/features/conversation-panel/conversation-card/conversation-card-context-menu.tsx+++ b/src/components/features/conversation-panel/conversation-card/conversation-card-context-menu.tsx@@ -8,7 +8,7 @@ import { I18nKey } from "#/i18n/declaration";import { ConversationNameContextMenuIconText } from "../../conversation/conversation-name-context-menu-icon-text";import EditIcon from "#/icons/u-edit.svg?react";-import RobotIcon from "#/icons/u-robot.svg?react";+import SkillsIcon from "#/icons/skills.svg?react";import ToolsIcon from "#/icons/u-tools.svg?react";import DownloadIcon from "#/icons/u-download.svg?react";import CreditCardIcon from "#/icons/u-credit-card.svg?react";@@ -134,7 +134,14 @@ export function ConversationCardContextMenu({onClick={onShowSkills}><ConversationNameContextMenuIconText- icon={<RobotIcon width={16} height={16} />}+ icon={+ <SkillsIcon+ width={16}+ height={16}+ className="stroke-[1.75]"+ aria-hidden+ />+ }text={t(I18nKey.CONVERSATION$SHOW_SKILLS)}/></ContextMenuListItem>diff --git a/src/components/features/conversation-panel/hook-event-item.tsx b/src/components/features/conversation-panel/hook-event-item.tsxindex 1f4b5a8383..82a4c4228f 100644--- a/src/components/features/conversation-panel/hook-event-item.tsx+++ b/src/components/features/conversation-panel/hook-event-item.tsx@@ -20,6 +20,11 @@ const EVENT_TYPE_I18N_KEYS: Record<string, I18nKey> = {stop: I18nKey.HOOKS_MODAL$EVENT_STOP,};+const HOOK_PILL_CLASS =+ "inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium leading-4 border border-[var(--oh-border)] bg-[var(--oh-surface)] text-tertiary-light";++const HOOK_COUNT_I18N_KEY = "HOOKS_MODAL$HOOK_COUNT";+export function HookEventItem({hookEvent,isExpanded,@@ -35,21 +40,21 @@ export function HookEventItem({);return (- <div className="rounded-md overflow-hidden">+ <div><buttontype="button"onClick={() => onToggle(hookEvent.event_type)}- className="w-full py-3 px-2 text-left flex items-center justify-between hover:bg-tertiary transition-colors"+ className="w-full py-3 px-3 text-left flex items-center justify-between hover:bg-tertiary transition-colors"><div className="flex items-center"><Typography.Text className="font-bold text-content-2">{eventTypeLabel}</Typography.Text></div>- <div className="flex items-center">- <Typography.Text className="px-2 py-1 text-xs rounded-full bg-[var(--oh-surface)] mr-2">- {t(I18nKey.HOOKS_MODAL$HOOK_COUNT, { count: totalHooks })}- </Typography.Text>+ <div className="flex items-center gap-2">+ <span className={HOOK_PILL_CLASS}>+ {t(HOOK_COUNT_I18N_KEY, { count: totalHooks })}+ </span><Typography.Text className="text-[var(--oh-text-tertiary)]">{isExpanded ? (<ChevronDown size={18} />@@ -61,13 +66,15 @@ export function HookEventItem({</button>{isExpanded && (- <div className="px-2 pb-3 pt-1">- {hookEvent.matchers.map((matcher, index) => (- <HookMatcherContent- key={`${hookEvent.event_type}-${matcher.matcher}-${index}`}- matcher={matcher}- />- ))}+ <div className="border-t border-[var(--oh-border)] px-3 pt-3 pb-3">+ <div className="divide-y divide-[var(--oh-border)]">+ {hookEvent.matchers.map((matcher, index) => (+ <HookMatcherContent+ key={`${hookEvent.event_type}-${matcher.matcher}-${index}`}+ matcher={matcher}+ />+ ))}+ </div></div>)}</div>diff --git a/src/components/features/conversation-panel/hook-matcher-content.tsx b/src/components/features/conversation-panel/hook-matcher-content.tsxindex b425d018af..8a6b7f3063 100644--- a/src/components/features/conversation-panel/hook-matcher-content.tsx+++ b/src/components/features/conversation-panel/hook-matcher-content.tsx@@ -8,47 +8,48 @@ interface HookMatcherContentProps {matcher: HookMatcher;}+const HOOK_PILL_CLASS =+ "inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium leading-4 border border-[var(--oh-border)] bg-[var(--oh-surface)] text-tertiary-light";+export function HookMatcherContent({ matcher }: HookMatcherContentProps) {const { t } = useTranslation("openhands");return (- <div className="mb-4 p-3 bg-[var(--oh-surface)] rounded-md">+ <div className="py-3"><div className="mb-2"><Typography.Text className="text-sm font-semibold text-[var(--oh-text-tertiary)]">{t(I18nKey.HOOKS_MODAL$MATCHER)}</Typography.Text>- <Typography.Text className="ml-2 px-2 py-1 text-xs rounded-full bg-blue-900">- {matcher.matcher}- </Typography.Text>+ <span className={`ml-2 ${HOOK_PILL_CLASS}`}>{matcher.matcher}</span></div>- <div className="mt-3">+ <div className="mt-2"><Typography.Text className="text-sm font-semibold text-[var(--oh-text-tertiary)] mb-2">{t(I18nKey.HOOKS_MODAL$COMMANDS)}</Typography.Text>{(matcher.hooks ?? []).map((hook, index) => (<div key={`${hook.command}-${index}`} className="mt-2"><Pre- size="default"+ size="small"font="mono"lineHeight="relaxed"- background="dark"- textColor="light"padding="medium"borderRadius="medium"- shadow="inner"maxHeight="small"overflow="auto"+ className="border border-[var(--oh-border)] bg-base text-[var(--oh-text-tertiary)]">{hook.command}</Pre>- <div className="flex gap-4 mt-1 text-xs text-[var(--oh-muted)]">- <span>{t(I18nKey.HOOKS_MODAL$TYPE, { type: hook.type })}</span>- <span>+ <div className="mt-2 flex flex-wrap gap-2 text-xs text-[var(--oh-muted)]">+ <span className={HOOK_PILL_CLASS}>+ {t(I18nKey.HOOKS_MODAL$TYPE, { type: hook.type })}+ </span>+ <span className={HOOK_PILL_CLASS}>{t(I18nKey.HOOKS_MODAL$TIMEOUT, { timeout: hook.timeout })}</span>{hook.async ? (- <span className="rounded-full bg-emerald-900 px-2 py-0.5 text-emerald-300">+ <span className={HOOK_PILL_CLASS}>{t(I18nKey.HOOKS_MODAL$ASYNC)}</span>) : null}diff --git a/src/components/features/conversation-panel/hooks-modal-header.tsx b/src/components/features/conversation-panel/hooks-modal-header.tsxindex 76c648d683..fcda51d3d4 100644--- a/src/components/features/conversation-panel/hooks-modal-header.tsx+++ b/src/components/features/conversation-panel/hooks-modal-header.tsx@@ -1,45 +1,64 @@import { useTranslation } from "react-i18next";-import { RefreshCw } from "lucide-react";+import { RefreshCw, X } from "lucide-react";import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";+import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";import { I18nKey } from "#/i18n/declaration";-import { BrandButton } from "../settings/brand-button";+import { Typography } from "#/ui/typography";import { cn } from "#/utils/utils";interface HooksModalHeaderProps {- isAgentReady: boolean;isLoading: boolean;isRefetching: boolean;onRefresh: () => void;+ onClose: () => void;}+const ICON_BUTTON_CLASS =+ "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";+export function HooksModalHeader({- isAgentReady,isLoading,isRefetching,onRefresh,+ onClose,}: HooksModalHeaderProps) {const { t } = useTranslation("openhands");+ const refreshLabel = t(I18nKey.BUTTON$REFRESH);return (- <div className="flex flex-col gap-6 w-full">- <div className="flex items-center justify-between w-full">+ <div className="flex w-full items-start justify-between gap-4">+ <div className="flex min-w-0 flex-1 flex-col gap-2"><BaseModalTitle title={t(I18nKey.HOOKS_MODAL$TITLE)} />- {isAgentReady && (- <BrandButton- testId="refresh-hooks"+ <Typography.Text className="text-sm text-[var(--oh-muted)]">+ {t(I18nKey.HOOKS_MODAL$WARNING)}+ </Typography.Text>+ </div>+ <div className="flex shrink-0 items-center gap-2">+ <StyledTooltip content={refreshLabel} placement="bottom">+ <buttontype="button"- variant="primary"- className="flex items-center gap-2"+ data-testid="refresh-hooks"onClick={onRefresh}- isDisabled={isLoading || isRefetching}+ disabled={isLoading || isRefetching}+ aria-label={refreshLabel}+ className={ICON_BUTTON_CLASS}><RefreshCw- size={16}+ size={18}className={cn(isRefetching && "animate-spin")}+ aria-hidden/>- {t(I18nKey.BUTTON$REFRESH)}- </BrandButton>- )}+ </button>+ </StyledTooltip>+ <button+ type="button"+ onClick={onClose}+ className={ICON_BUTTON_CLASS}+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ data-testid="close-hooks-modal"+ >+ <X size={20} aria-hidden />+ </button></div></div>);diff --git a/src/components/features/conversation-panel/hooks-modal.tsx b/src/components/features/conversation-panel/hooks-modal.tsxindex 040d32a9bf..cc38e4e2ab 100644--- a/src/components/features/conversation-panel/hooks-modal.tsx+++ b/src/components/features/conversation-panel/hooks-modal.tsx@@ -1,15 +1,13 @@import { useState } from "react";-import { useTranslation } from "react-i18next";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";import { ModalBody } from "#/components/shared/modals/modal-body";-import { I18nKey } from "#/i18n/declaration";import { useConversationHooks } from "#/hooks/query/use-conversation-hooks";import { AgentState } from "#/types/agent-state";-import { Typography } from "#/ui/typography";import { HooksModalHeader } from "./hooks-modal-header";import { HooksLoadingState } from "./hooks-loading-state";import { HooksEmptyState } from "./hooks-empty-state";import { HookEventItem } from "./hook-event-item";+import { RuntimeWaitingState } from "./runtime-waiting-state";import { useAgentState } from "#/hooks/use-agent-state";interface HooksModalProps {@@ -17,7 +15,6 @@ interface HooksModalProps {}export function HooksModal({ onClose }: HooksModalProps) {- const { t } = useTranslation("openhands");const { curAgentState } = useAgentState();const [expandedEvents, setExpandedEvents] = useState<Record<string, boolean>>({},@@ -44,42 +41,26 @@ export function HooksModal({ onClose }: HooksModalProps) {return (<ModalBackdrop onClose={onClose}><ModalBody- width="medium"- className="max-h-[80vh] flex flex-col items-start"+ width="lg"+ className="max-h-[80vh] flex flex-col items-start border border-[var(--oh-border)]"testID="hooks-modal"><HooksModalHeader- isAgentReady={isAgentReady}isLoading={isLoading}isRefetching={isRefetching}onRefresh={refetch}+ onClose={onClose}/>- {isAgentReady && (- <Typography.Text className="text-sm text-[var(--oh-muted)]">- {t(I18nKey.HOOKS_MODAL$WARNING)}- </Typography.Text>- )}-- <div className="w-full h-[60vh] overflow-auto rounded-md custom-scrollbar-always">- {!isAgentReady && (- <div className="w-full h-full flex items-center text-center justify-center text-2xl text-tertiary-light">- <Typography.Text>- {t(I18nKey.DIFF_VIEWER$WAITING_FOR_RUNTIME)}- </Typography.Text>- </div>- )}-- {isLoading && <HooksLoadingState />}-- {!isLoading &&- isAgentReady &&- (isError || !hooks || hooks.length === 0) && (- <HooksEmptyState isError={isError} />- )}-- {!isLoading && isAgentReady && hooks && hooks.length > 0 && (- <div className="p-2 space-y-3">+ <div className="w-full h-[60vh] overflow-auto rounded-md border border-[var(--oh-border)] bg-surface-raised custom-scrollbar-always">+ {!isAgentReady ? (+ <RuntimeWaitingState testId="hooks-runtime-waiting" />+ ) : isLoading ? (+ <HooksLoadingState />+ ) : isError || !hooks || hooks.length === 0 ? (+ <HooksEmptyState isError={isError} />+ ) : (+ <div className="divide-y divide-[var(--oh-border)]">{hooks.map((hookEvent) => {const isExpanded =expandedEvents[hookEvent.event_type] || false;diff --git a/src/components/features/conversation-panel/runtime-waiting-state.tsx b/src/components/features/conversation-panel/runtime-waiting-state.tsxnew file mode 100644index 0000000000..9463d3b8b4--- /dev/null+++ b/src/components/features/conversation-panel/runtime-waiting-state.tsx@@ -0,0 +1,26 @@+import { useTranslation } from "react-i18next";+import { LoadingSpinner } from "#/components/shared/loading-spinner";+import { I18nKey } from "#/i18n/declaration";+import { Typography } from "#/ui/typography";++interface RuntimeWaitingStateProps {+ testId?: string;+}++export function RuntimeWaitingState({+ testId = "runtime-waiting",+}: RuntimeWaitingStateProps) {+ const { t } = useTranslation("openhands");++ return (+ <div+ data-testid={testId}+ className="flex h-full w-full flex-col items-center justify-center gap-3 py-8 text-center"+ >+ <LoadingSpinner size="small" />+ <Typography.Text className="text-sm text-[var(--oh-muted)]">+ {t(I18nKey.DIFF_VIEWER$WAITING_FOR_RUNTIME)}+ </Typography.Text>+ </div>+ );+}diff --git a/src/components/features/conversation-panel/skills-modal.tsx b/src/components/features/conversation-panel/skills-modal.tsxindex a11ea4403b..d10c96d706 100644--- a/src/components/features/conversation-panel/skills-modal.tsx+++ b/src/components/features/conversation-panel/skills-modal.tsx@@ -63,7 +63,7 @@ export function SkillsModal({ onClose }: SkillsModalProps) {return (<ModalBackdrop onClose={onClose}><ModalBody- width="medium"+ width="lg"className="max-h-[80vh] flex flex-col items-start border border-[var(--oh-border)]"testID="skills-modal">diff --git a/src/components/features/conversation-panel/system-message-modal.tsx b/src/components/features/conversation-panel/system-message-modal.tsxindex 6b27e6c532..b65000b8ab 100644--- a/src/components/features/conversation-panel/system-message-modal.tsx+++ b/src/components/features/conversation-panel/system-message-modal.tsx@@ -37,12 +37,14 @@ export function SystemMessageModal({isOpen && (<ModalBackdrop onClose={onClose}><ModalBody- width="medium"- className="max-h-[80vh] flex flex-col items-start"+ width="lg"+ className="max-h-[80vh] flex flex-col items-start border border-[var(--oh-border)]"+ testID="system-message-modal"><SystemMessageHeaderagentClass={systemMessage.agent_class}openhandsVersion={systemMessage.openhands_version}+ onClose={onClose}/><div className="w-full">@@ -54,7 +56,7 @@ export function SystemMessageModal({}/>- <div className="max-h-[51vh] overflow-auto rounded-md custom-scrollbar-always">+ <div className="h-[60vh] overflow-auto rounded-md border border-[var(--oh-border)] bg-surface-raised custom-scrollbar-always"><TabContentactiveTab={activeTab}systemMessage={systemMessage}diff --git a/src/components/features/conversation-panel/system-message-modal/system-message-content.tsx b/src/components/features/conversation-panel/system-message-modal/system-message-content.tsxindex e6be1724e6..f10330c2ff 100644--- a/src/components/features/conversation-panel/system-message-modal/system-message-content.tsx+++ b/src/components/features/conversation-panel/system-message-modal/system-message-content.tsx@@ -1,4 +1,4 @@-import { Typography } from "#/ui/typography";+import { Pre } from "#/ui/pre";interface SystemMessageContentProps {content: string;@@ -6,8 +6,14 @@ interface SystemMessageContentProps {export function SystemMessageContent({ content }: SystemMessageContentProps) {return (- <div className="p-4 shadow-inner">- <Typography.CodeBlock>{content}</Typography.CodeBlock>- </div>+ <Pre+ size="small"+ font="mono"+ lineHeight="relaxed"+ padding="medium"+ className="text-[var(--oh-text-tertiary)]"+ >+ {content}+ </Pre>);}diff --git a/src/components/features/conversation-panel/system-message-modal/system-message-header.tsx b/src/components/features/conversation-panel/system-message-modal/system-message-header.tsxindex 108373d1d6..57dacec64f 100644--- a/src/components/features/conversation-panel/system-message-modal/system-message-header.tsx+++ b/src/components/features/conversation-panel/system-message-modal/system-message-header.tsx@@ -1,49 +1,63 @@import { useTranslation } from "react-i18next";+import { X } from "lucide-react";import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";import { Typography } from "#/ui/typography";-import { cn } from "#/utils/utils";+import { I18nKey } from "#/i18n/declaration";interface SystemMessageHeaderProps {agentClass: string | null;openhandsVersion: string | null;+ onClose: () => void;}+const ICON_BUTTON_CLASS =+ "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer";+export function SystemMessageHeader({agentClass,openhandsVersion,+ onClose,}: SystemMessageHeaderProps) {const { t } = useTranslation("openhands");return (- <div- className={cn(- "flex flex-col gap-6 w-full",- !!agentClass && !!openhandsVersion ? "gap-6" : "gap-0",- )}- >- <BaseModalTitle title={t("SYSTEM_MESSAGE_MODAL$TITLE")} />- <div className="flex flex-col gap-2">- {agentClass && (- <div className="text-sm">- <Typography.Text className="font-semibold text-[var(--oh-text-tertiary)]">- {t("SYSTEM_MESSAGE_MODAL$AGENT_CLASS")}- </Typography.Text>{" "}- <Typography.Text className="font-medium text-content-2">- {agentClass}- </Typography.Text>- </div>- )}- {openhandsVersion && (- <div className="text-sm">- <Typography.Text className="font-semibold text-[var(--oh-text-tertiary)]">- {t("SYSTEM_MESSAGE_MODAL$OPENHANDS_VERSION")}- </Typography.Text>{" "}- <Typography.Text className="text-content-2">- {openhandsVersion}- </Typography.Text>+ <div className="flex w-full items-start justify-between gap-4">+ <div className="flex min-w-0 flex-1 flex-col gap-2">+ <BaseModalTitle title={t(I18nKey.SYSTEM_MESSAGE_MODAL$TITLE)} />+ {(agentClass || openhandsVersion) && (+ <div className="flex flex-col gap-2">+ {agentClass && (+ <div className="text-sm">+ <Typography.Text className="font-semibold text-[var(--oh-text-tertiary)]">+ {t(I18nKey.SYSTEM_MESSAGE_MODAL$AGENT_CLASS)}+ </Typography.Text>{" "}+ <Typography.Text className="font-medium text-content-2">+ {agentClass}+ </Typography.Text>+ </div>+ )}+ {openhandsVersion && (+ <div className="text-sm">+ <Typography.Text className="font-semibold text-[var(--oh-text-tertiary)]">+ {t(I18nKey.SYSTEM_MESSAGE_MODAL$OPENHANDS_VERSION)}+ </Typography.Text>{" "}+ <Typography.Text className="text-content-2">+ {openhandsVersion}+ </Typography.Text>+ </div>+ )}</div>)}</div>+ <button+ type="button"+ onClick={onClose}+ className={ICON_BUTTON_CLASS}+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ data-testid="close-system-message-modal"+ >+ <X size={20} aria-hidden />+ </button></div>);}diff --git a/src/components/features/conversation-panel/system-message-modal/tab-button.tsx b/src/components/features/conversation-panel/system-message-modal/tab-button.tsxindex 8223e62f9a..43c1740646 100644--- a/src/components/features/conversation-panel/system-message-modal/tab-button.tsx+++ b/src/components/features/conversation-panel/system-message-modal/tab-button.tsx@@ -22,8 +22,8 @@ export function TabButton({className={cn("px-4 py-2 font-medium border-b-2 transition-colors",isActive- ? "border-primary text-content-2"- : "border-transparent hover:text-[var(--oh-border-subtle)] dark:hover:text-[var(--oh-text-tertiary)]",+ ? "border-foreground text-foreground"+ : "border-transparent text-[var(--oh-muted)] hover:text-[var(--oh-foreground)]",disabled && "opacity-50 cursor-not-allowed",className,)}diff --git a/src/components/features/conversation-panel/system-message-modal/tab-navigation.tsx b/src/components/features/conversation-panel/system-message-modal/tab-navigation.tsxindex 85a5f0519f..c8522b1381 100644--- a/src/components/features/conversation-panel/system-message-modal/tab-navigation.tsx+++ b/src/components/features/conversation-panel/system-message-modal/tab-navigation.tsx@@ -15,7 +15,10 @@ export function TabNavigation({const { t } = useTranslation("openhands");return (- <div className="flex border-b mb-2" role="tablist">+ <div+ className="mb-2 flex border-b border-[var(--oh-border)]"+ role="tablist"+ ><TabButtonisActive={activeTab === "system"}onClick={() => onTabChange("system")}diff --git a/src/components/features/conversation-panel/system-message-modal/toggle-button.tsx b/src/components/features/conversation-panel/system-message-modal/toggle-button.tsxindex 8679090253..83e0fed901 100644--- a/src/components/features/conversation-panel/system-message-modal/toggle-button.tsx+++ b/src/components/features/conversation-panel/system-message-modal/toggle-button.tsx@@ -21,7 +21,7 @@ export function ToggleButton({data-testid="toggle-button"onClick={onClick}className={cn(- "w-full py-3 px-2 text-left flex items-center justify-between hover:bg-tertiary transition-colors",+ "w-full py-3 px-3 text-left flex items-center justify-between hover:bg-tertiary transition-colors",className,)}>diff --git a/src/components/features/conversation-panel/system-message-modal/tool-item.tsx b/src/components/features/conversation-panel/system-message-modal/tool-item.tsxindex edf673af7d..6749088229 100644--- a/src/components/features/conversation-panel/system-message-modal/tool-item.tsx+++ b/src/components/features/conversation-panel/system-message-modal/tool-item.tsx@@ -65,7 +65,7 @@ export function ToolItem({ tool, index, isExpanded, onToggle }: ToolItemProps) {null;return (- <div className="rounded-md overflow-hidden">+ <div><ToggleButtontitle={String(name)}isExpanded={isExpanded}@@ -73,12 +73,11 @@ export function ToolItem({ tool, index, isExpanded, onToggle }: ToolItemProps) {/>{isExpanded && (- <div className="px-2 pb-3 pt-1">+ <div className="px-3 pb-3 pt-1 border-t border-[var(--oh-border)]"><div className="mt-2 mb-3 text-sm text-[var(--oh-text-tertiary)] leading-relaxed"><MarkdownRenderer>{String(description)}</MarkdownRenderer></div>- {/* Parameters section */}{parameters && <ToolParameters parameters={parameters} />}</div>)}diff --git a/src/components/features/conversation-panel/system-message-modal/tool-parameters.tsx b/src/components/features/conversation-panel/system-message-modal/tool-parameters.tsxindex 72c7860c8b..a89996d7ec 100644--- a/src/components/features/conversation-panel/system-message-modal/tool-parameters.tsx+++ b/src/components/features/conversation-panel/system-message-modal/tool-parameters.tsx@@ -15,7 +15,7 @@ export function ToolParameters({ parameters }: ToolParametersProps) {<Typography.Text className="text-sm font-semibold text-[var(--oh-text-tertiary)]">{t("SYSTEM_MESSAGE_MODAL$PARAMETERS")}</Typography.Text>- <div className="text-sm mt-2 p-3 bg-base rounded-md overflow-auto text-[var(--oh-text-tertiary)] max-h-[400px] shadow-inner">+ <div className="text-sm mt-2 p-3 bg-base rounded-md overflow-auto text-[var(--oh-text-tertiary)] max-h-[400px] border border-[var(--oh-border)]"><ReactJsonView name={false} src={parameters} theme={JSON_VIEW_THEME} /></div></div>diff --git a/src/components/features/conversation-panel/system-message-modal/tools-list.tsx b/src/components/features/conversation-panel/system-message-modal/tools-list.tsxindex 586e770174..e94b686543 100644--- a/src/components/features/conversation-panel/system-message-modal/tools-list.tsx+++ b/src/components/features/conversation-panel/system-message-modal/tools-list.tsx@@ -13,7 +13,7 @@ export function ToolsList({onToggleTool,}: ToolsListProps) {return (- <div className="p-2 space-y-3">+ <div className="divide-y divide-[var(--oh-border)]">{tools.map((tool, index) => (<ToolItemkey={index}diff --git a/src/components/features/conversation/conversation-name-context-menu.tsx b/src/components/features/conversation/conversation-name-context-menu.tsxindex 769d716941..1406b0fd2b 100644--- a/src/components/features/conversation/conversation-name-context-menu.tsx+++ b/src/components/features/conversation/conversation-name-context-menu.tsx@@ -1,5 +1,6 @@import React from "react";import ReactDOM from "react-dom";+import { ExternalLink, Share2 } from "lucide-react";import { useTranslation } from "react-i18next";import { useActiveBackend } from "#/contexts/active-backend-context";import { useActiveConversation } from "#/hooks/query/use-active-conversation";@@ -12,13 +13,13 @@ import { Divider } from "#/ui/divider";import { I18nKey } from "#/i18n/declaration";import EditIcon from "#/icons/u-edit.svg?react";-import RobotIcon from "#/icons/u-robot.svg?react";+import SkillsIcon from "#/icons/skills.svg?react";+import FishingHookIcon from "#/icons/fishing-hook.svg?react";import ToolsIcon from "#/icons/u-tools.svg?react";import DownloadIcon from "#/icons/u-download.svg?react";import CreditCardIcon from "#/icons/u-credit-card.svg?react";import CloseIcon from "#/icons/u-close.svg?react";import DeleteIcon from "#/icons/u-delete.svg?react";-import LinkIcon from "#/icons/link-external.svg?react";import CopyIcon from "#/icons/copy.svg?react";import { ConversationNameContextMenuIconText } from "./conversation-name-context-menu-icon-text";@@ -31,7 +32,7 @@ interface ConversationNameContextMenuProps {onShowAgentTools?: (event: React.MouseEvent<HTMLButtonElement>) => void;onShowSkills?: (event: React.MouseEvent<HTMLButtonElement>) => void;onShowHooks?: (event: React.MouseEvent<HTMLButtonElement>) => void;- onTogglePublic?: (event: React.MouseEvent<HTMLButtonElement>) => void;+ onTogglePublic?: (nextIsPublic: boolean) => void;onCopyShareLink?: (event: React.MouseEvent<HTMLButtonElement>) => void;onDownloadConversation?: (event: React.MouseEvent<HTMLButtonElement>) => void;shareUrl?: string;@@ -45,6 +46,45 @@ interface ConversationNameContextMenuProps {anchorRef?: React.RefObject<HTMLElement | null>;}+function PublicShareToggle({+ isPublic,+ onToggle,+ ariaLabel,+}: {+ isPublic: boolean;+ onToggle: (nextIsPublic: boolean) => void;+ ariaLabel: string;+}) {+ return (+ <label className="relative inline-flex shrink-0 cursor-pointer items-center">+ <input+ hidden+ type="checkbox"+ data-testid="share-publicly-button"+ checked={isPublic}+ aria-label={ariaLabel}+ onChange={(event) => onToggle(event.target.checked)}+ />+ <span+ aria-hidden+ className={cn(+ "inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out",+ isPublic ? "bg-white" : "bg-base-secondary",+ )}+ >+ <span+ className={cn(+ "block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out",+ isPublic+ ? "translate-x-[calc(1rem-1px)] bg-base-secondary"+ : "translate-x-px bg-tertiary-light",+ )}+ />+ </span>+ </label>+ );+}+export function ConversationNameContextMenu({onClose,onRename,@@ -68,9 +108,6 @@ export function ConversationNameContextMenu({const { data: conversation } = useActiveConversation();const ref = useClickOutsideElement<HTMLUListElement>(onClose);- // When anchored, render via a portal with fixed positioning computed from- // the anchor's bounding rect. This avoids being clipped by ancestors with- // `overflow: hidden`.const anchorElement = anchorRef?.current ?? null;const [portalStyle, setPortalStyle] = React.useState<React.CSSProperties>();React.useLayoutEffect(() => {@@ -79,7 +116,6 @@ export function ConversationNameContextMenu({const updatePosition = () => {const rect = anchorElement.getBoundingClientRect();if (!rect) return;- // 8px gap roughly matching the previous `mt-2` spacing.const gap = 8;const style: React.CSSProperties = {position: "fixed",@@ -109,14 +145,11 @@ export function ConversationNameContextMenu({backend.kind === "cloud"? I18nKey.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME: I18nKey.COMMON$STOP_CONVERSATION;- // Public sharing is a cloud-only feature; hide it on local backends.const shouldShowPublicSharing =backend.kind === "cloud" && Boolean(onTogglePublic);+ const isPublic = conversation?.public || false;const isPortaled = Boolean(anchorElement);- // When portaled the menu is positioned via inline `style` (fixed coords from- // the anchor rect), so we must drop the variant-driven absolute positioning- // that would otherwise pin it to its now-irrelevant offset parent.const portalClassName = isPortaled? "!static !top-auto !bottom-auto !left-auto !right-auto !mt-0": "";@@ -146,7 +179,14 @@ export function ConversationNameContextMenu({{onShowSkills && (<ContextMenuListItem testId="show-skills-button" onClick={onShowSkills}><ConversationNameContextMenuIconText- icon={<RobotIcon width={16} height={16} />}+ icon={+ <SkillsIcon+ width={16}+ height={16}+ className="stroke-[1.75]"+ aria-hidden+ />+ }text={t(I18nKey.CONVERSATION$SHOW_SKILLS)}/></ContextMenuListItem>@@ -155,7 +195,7 @@ export function ConversationNameContextMenu({{onShowHooks && (<ContextMenuListItem testId="show-hooks-button" onClick={onShowHooks}><ConversationNameContextMenuIconText- icon={<ToolsIcon width={16} height={16} />}+ icon={<FishingHookIcon width={16} height={16} aria-hidden />}text={t(I18nKey.CONVERSATION$SHOW_HOOKS)}/></ContextMenuListItem>@@ -202,45 +242,47 @@ export function ConversationNameContextMenu({)}{shouldShowPublicSharing && onTogglePublic && (- <li className="flex w-full items-center justify-between gap-2 px-2 py-2 hover:bg-[var(--oh-interactive-hover)]">- <button- type="button"- data-testid="share-publicly-button"- onClick={onTogglePublic}- className="flex items-center gap-2 flex-1 text-sm text-start cursor-pointer"+ <li className="flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]">+ <span+ className="flex shrink-0 items-center text-[var(--oh-muted)]"+ aria-hidden>- <input- type="checkbox"- checked={conversation?.public || false}- readOnly- className="w-4 h-4 cursor-pointer"+ <Share2 size={16} />+ </span>+ <span className="min-w-0 flex-1 truncate text-sm">+ {t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}+ </span>+ <div className="flex shrink-0 items-center">+ {isPublic && shareUrl && onCopyShareLink && (+ <div className="mr-2 flex items-center gap-0.5">+ <button+ type="button"+ data-testid="copy-share-link-button"+ onClick={onCopyShareLink}+ className="rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current"+ title={t(I18nKey.BUTTON$COPY_TO_CLIPBOARD)}+ >+ <CopyIcon width={14} height={14} />+ </button>+ <a+ data-testid="open-share-link-button"+ href={shareUrl}+ target="_blank"+ rel="noopener noreferrer"+ onClick={(event) => event.stopPropagation()}+ className="rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current"+ title={t(I18nKey.BUTTON$OPEN_IN_NEW_TAB)}+ >+ <ExternalLink size={14} aria-hidden />+ </a>+ </div>+ )}+ <PublicShareToggle+ isPublic={isPublic}+ onToggle={onTogglePublic}+ ariaLabel={t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}/>- <span>{t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}</span>- </button>- {conversation?.public && shareUrl && onCopyShareLink && (- <div className="flex items-center gap-1">- <button- type="button"- data-testid="copy-share-link-button"- onClick={onCopyShareLink}- className="p-1 hover:bg-[var(--oh-interactive-selected)] rounded cursor-pointer"- title={t(I18nKey.BUTTON$COPY_TO_CLIPBOARD)}- >- <CopyIcon width={16} height={16} />- </button>- <a- data-testid="open-share-link-button"- href={shareUrl}- target="_blank"- rel="noopener noreferrer"- onClick={(e) => e.stopPropagation()}- className="p-1 hover:bg-[var(--oh-interactive-selected)] rounded cursor-pointer"- title={t(I18nKey.BUTTON$OPEN_IN_NEW_TAB)}- >- <LinkIcon width={16} height={16} />- </a>- </div>- )}+ </div></li>)}@@ -269,7 +311,6 @@ export function ConversationNameContextMenu({return null;}return ReactDOM.createPortal(- // portal position computed from DOM bounding rect at runtime<div style={portalStyle}>{menu}</div>,document.body,);diff --git a/src/components/features/conversation/metrics-modal/context-window-section.tsx b/src/components/features/conversation/metrics-modal/context-window-section.tsxindex 5a9d30631b..59b26ac59c 100644--- a/src/components/features/conversation/metrics-modal/context-window-section.tsx+++ b/src/components/features/conversation/metrics-modal/context-window-section.tsx@@ -25,7 +25,7 @@ export function ContextWindowSection({</div><div className="w-full h-1.5 bg-tertiary rounded-full overflow-hidden"><div- className="h-full bg-blue-500 transition-all duration-300"+ className="h-full bg-foreground transition-all duration-300"// runtime usage-percentage widthstyle={{ width: `${progressWidth}%` }}/>diff --git a/src/components/features/conversation/metrics-modal/empty-state.tsx b/src/components/features/conversation/metrics-modal/empty-state.tsxindex d2b5521758..a4c598e5e1 100644--- a/src/components/features/conversation/metrics-modal/empty-state.tsx+++ b/src/components/features/conversation/metrics-modal/empty-state.tsx@@ -5,7 +5,7 @@ export function EmptyState() {const { t } = useTranslation("openhands");return (- <div className="rounded-md p-4 text-center">+ <div className="text-center"><p className="text-[var(--oh-muted)]">{t(I18nKey.CONVERSATION$NO_METRICS)}</p>diff --git a/src/components/features/conversation/metrics-modal/metrics-modal-header.tsx b/src/components/features/conversation/metrics-modal/metrics-modal-header.tsxnew file mode 100644index 0000000000..81e7689d46--- /dev/null+++ b/src/components/features/conversation/metrics-modal/metrics-modal-header.tsx@@ -0,0 +1,30 @@+import { useTranslation } from "react-i18next";+import { X } from "lucide-react";+import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";+import { I18nKey } from "#/i18n/declaration";++interface MetricsModalHeaderProps {+ onClose: () => void;+}++const ICON_BUTTON_CLASS =+ "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer";++export function MetricsModalHeader({ onClose }: MetricsModalHeaderProps) {+ const { t } = useTranslation("openhands");++ return (+ <div className="flex w-full items-start justify-between gap-4">+ <BaseModalTitle title={t(I18nKey.CONVERSATION$METRICS_INFO)} />+ <button+ type="button"+ onClick={onClose}+ className={ICON_BUTTON_CLASS}+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ data-testid="close-metrics-modal"+ >+ <X size={20} aria-hidden />+ </button>+ </div>+ );+}diff --git a/src/components/features/conversation/metrics-modal/metrics-modal.tsx b/src/components/features/conversation/metrics-modal/metrics-modal.tsxindex b149ed1838..2732deeaae 100644--- a/src/components/features/conversation/metrics-modal/metrics-modal.tsx+++ b/src/components/features/conversation/metrics-modal/metrics-modal.tsx@@ -1,9 +1,7 @@import { useMemo } from "react";-import { useTranslation } from "react-i18next";-import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";+import { MetricsModalHeader } from "./metrics-modal-header";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";import { ModalBody } from "#/components/shared/modals/modal-body";-import { I18nKey } from "#/i18n/declaration";import { CostSection } from "./cost-section";import { UsageSection } from "./usage-section";import { ContextWindowSection } from "./context-window-section";@@ -18,7 +16,6 @@ interface MetricsModalProps {}export function MetricsModal({ isOpen, onOpenChange }: MetricsModalProps) {- const { t } = useTranslation("openhands");const storeMetrics = useMetricsStore();const { data: conversation } = useActiveConversation();@@ -67,11 +64,14 @@ export function MetricsModal({ isOpen, onOpenChange }: MetricsModalProps) {return (<ModalBackdrop onClose={() => onOpenChange(false)}>- <ModalBody className="items-start border border-[var(--oh-border)]">- <BaseModalTitle title={t(I18nKey.CONVERSATION$METRICS_INFO)} />- <div className="space-y-4 w-full">+ <ModalBody+ testID="metrics-modal"+ className="items-start border border-[var(--oh-border)]"+ >+ <MetricsModalHeader onClose={() => onOpenChange(false)} />+ <div className="w-full">{(metrics?.cost !== null || metrics?.usage !== null) && (- <div className="rounded-md p-3">+ <div className="rounded-md border border-[var(--oh-border)] bg-surface-raised p-3"><div className="grid gap-3"><CostSectioncost={metrics?.cost ?? null}@@ -91,7 +91,11 @@ export function MetricsModal({ isOpen, onOpenChange }: MetricsModalProps) {</div>)}- {!metrics?.cost && !metrics?.usage && <EmptyState />}+ {!metrics?.cost && !metrics?.usage && (+ <div className="rounded-md border border-[var(--oh-border)] bg-surface-raised p-3">+ <EmptyState />+ </div>+ )}</div></ModalBody></ModalBackdrop>diff --git a/src/components/features/home/open-repository-dialog.tsx b/src/components/features/home/open-repository-dialog.tsxindex dcb72d174b..1df8295a55 100644--- a/src/components/features/home/open-repository-dialog.tsx+++ b/src/components/features/home/open-repository-dialog.tsx@@ -1,10 +1,14 @@import { useTranslation } from "react-i18next";+import { X } from "lucide-react";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";import { ModalBody } from "#/components/shared/modals/modal-body";import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";import { I18nKey } from "#/i18n/declaration";-import RepoForkedIcon from "#/icons/repo-forked.svg?react";+import { cn } from "#/utils/utils";import { Branch, GitRepository } from "#/types/git";++const ICON_BUTTON_CLASS =+ "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";import { Provider } from "#/types/settings";import { useUserProviders } from "#/hooks/use-user-providers";import { RepositorySelectionForm } from "./repo-selection-form";@@ -32,12 +36,20 @@ export function OpenRepositoryDialog({return (<ModalBackdrop onClose={onClose}><ModalBody- width="small"+ width="sm"className="items-start border border-[var(--oh-border)] !gap-4">- <div className="flex items-center gap-[10px]">- <RepoForkedIcon width={24} height={24} />+ <div className="flex w-full items-start justify-between gap-4"><BaseModalTitle title={t(I18nKey.COMMON$OPEN_REPOSITORY)} />+ <button+ type="button"+ onClick={onClose}+ className={cn(ICON_BUTTON_CLASS, "shrink-0")}+ data-testid="close-open-repository-dialog"+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ >+ <X size={20} aria-hidden />+ </button></div><div className="w-full" data-testid="open-repository-dialog-body">diff --git a/src/components/features/home/open-workspace-dialog.tsx b/src/components/features/home/open-workspace-dialog.tsxindex 4025cd454b..dd46a6bc43 100644--- a/src/components/features/home/open-workspace-dialog.tsx+++ b/src/components/features/home/open-workspace-dialog.tsx@@ -1,13 +1,17 @@import { useTranslation } from "react-i18next";+import { X } from "lucide-react";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";import { ModalBody } from "#/components/shared/modals/modal-body";import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";import { I18nKey } from "#/i18n/declaration";-import FolderIcon from "#/icons/folder.svg?react";+import { cn } from "#/utils/utils";import { LocalWorkspace } from "#/types/workspace";import { useUserProviders } from "#/hooks/use-user-providers";import { WorkspaceSelectionForm } from "./workspace-selection-form";+const ICON_BUTTON_CLASS =+ "rounded-md p-1 text-white hover:bg-tertiary cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed";+interface OpenWorkspaceDialogProps {isOpen: boolean;onClose: () => void;@@ -27,12 +31,20 @@ export function OpenWorkspaceDialog({return (<ModalBackdrop onClose={onClose}><ModalBody- width="small"+ width="sm"className="items-start border border-[var(--oh-border)] !gap-4">- <div className="flex items-center gap-[10px]">- <FolderIcon width={24} height={24} />+ <div className="flex w-full items-start justify-between gap-4"><BaseModalTitle title={t(I18nKey.HOME$OPEN_WORKSPACE)} />+ <button+ type="button"+ onClick={onClose}+ className={cn(ICON_BUTTON_CLASS, "shrink-0")}+ data-testid="close-open-workspace-dialog"+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ >+ <X size={20} aria-hidden />+ </button></div><div className="w-full" data-testid="open-workspace-dialog-body">diff --git a/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx b/src/components/features/home/workspace-dropdown/folder-browser-modal.tsxindex f0b1c3e7bf..4b0e96c3a8 100644--- a/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx+++ b/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx@@ -1,7 +1,12 @@import React, { useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";+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 { BrandButton } from "#/components/features/settings/brand-button";import { I18nKey } from "#/i18n/declaration";import { LocalWorkspace, LocalWorkspaceParent } from "#/types/workspace";@@ -205,14 +210,17 @@ export function FolderBrowserModal({data-testid="folder-browser-modal"className={cn("flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl",- "w-[720px] max-w-[90vw] h-[480px]",+ modalWidthClassName("xl"),+ MODAL_MAX_WIDTH_VIEWPORT,+ "h-[480px]",)}>{/* Title bar */}<div className="flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]">- <span className="text-sm font-semibold text-white">- {t(I18nKey.HOME$ADD_WORKSPACES_TITLE)}- </span>+ <BaseModalTitle+ className="text-base"+ title={t(I18nKey.HOME$ADD_WORKSPACES_TITLE)}+ /></div>{/* Body: sidebar + main */}diff --git a/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx b/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsxindex fedf724622..14bfe4a813 100644--- a/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx+++ b/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx@@ -1,7 +1,12 @@import React from "react";import { useTranslation } from "react-i18next";+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 { ConfirmationModal } from "#/components/shared/modals/confirmation-modal";import { BrandButton } from "#/components/features/settings/brand-button";import { I18nKey } from "#/i18n/declaration";@@ -71,13 +76,16 @@ export function ManageWorkspacesModal({data-testid="manage-workspaces-modal"className={cn("flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl",- "w-[560px] max-w-[90vw] max-h-[70vh]",+ modalWidthClassName("lg"),+ MODAL_MAX_WIDTH_VIEWPORT,+ "max-h-[70vh]",)}><div className="flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]">- <span className="text-sm font-semibold text-white">- {t(I18nKey.HOME$MANAGE_WORKSPACES)}- </span>+ <BaseModalTitle+ className="text-base"+ title={t(I18nKey.HOME$MANAGE_WORKSPACES)}+ /></div><divdiff --git a/src/components/features/launch/plugin-launch-modal.tsx b/src/components/features/launch/plugin-launch-modal.tsxindex 48a2e174c9..96ff483164 100644--- a/src/components/features/launch/plugin-launch-modal.tsx+++ b/src/components/features/launch/plugin-launch-modal.tsx@@ -2,6 +2,10 @@ import React from "react";import { useTranslation } from "react-i18next";import { IoClose } from "react-icons/io5";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";+import {+ MODAL_MAX_WIDTH_VIEWPORT,+ modalWidthClassName,+} from "#/components/shared/modals/modal-body";import { BrandButton } from "#/components/features/settings/brand-button";import { I18nKey } from "#/i18n/declaration";import { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types";@@ -126,10 +130,14 @@ export function PluginLaunchModal({<ModalBackdrop onClose={onClose}><divdata-testid="plugin-launch-modal"- className="bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[500px] max-w-[90vw] max-h-[80vh]"+ className={cn(+ "bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] max-h-[80vh]",+ modalWidthClassName("md"),+ MODAL_MAX_WIDTH_VIEWPORT,+ )}><div className="flex w-full items-center justify-between">- <Typography.H2>+ <Typography.H2 className="text-content-2">{t(I18nKey.LAUNCH$MODAL_TITLE)} {modalTitle}</Typography.H2><buttondiff --git a/src/components/features/mcp-page/custom-server-editor.tsx b/src/components/features/mcp-page/custom-server-editor.tsxindex 8df395d3a4..69c67ef81d 100644--- a/src/components/features/mcp-page/custom-server-editor.tsx+++ b/src/components/features/mcp-page/custom-server-editor.tsx@@ -1,14 +1,24 @@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 { 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 { MCPServerConfig } from "#/types/mcp-server";import { displayErrorToast } 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;@@ -69,13 +79,32 @@ export function CustomServerEditor({><divdata-testid="mcp-custom-editor"- className="bg-base-secondary p-6 rounded-xl border border-[var(--oh-border)] w-[680px] max-w-[90vw] max-h-[90vh] overflow-y-auto custom-scrollbar"+ 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,+ )}>- <h2 className="text-lg font-semibold mb-4">- {isEditing- ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE)- : t(I18nKey.MCP$ADD_CUSTOM_TITLE)}- </h2>+ <div className="mb-4 flex items-start justify-between gap-4">+ <BaseModalTitle+ className="text-lg"+ title={+ isEditing+ ? t(I18nKey.MCP$EDIT_CUSTOM_TITLE)+ : t(I18nKey.MCP$ADD_CUSTOM_TITLE)+ }+ />+ <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><MCPServerFormmode={isEditing ? "edit" : "add"}server={isEditing ? server : undefined}diff --git a/src/components/features/mcp-page/install-server-modal.tsx b/src/components/features/mcp-page/install-server-modal.tsxindex 4ff7d2fcb6..02f7003d95 100644--- a/src/components/features/mcp-page/install-server-modal.tsx+++ b/src/components/features/mcp-page/install-server-modal.tsx@@ -1,6 +1,7 @@import React from "react";import { useTranslation } from "react-i18next";import { AxiosError } from "axios";+import { X } from "lucide-react";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";import { BrandButton } from "#/components/features/settings/brand-button";import { SettingsInput } from "#/components/features/settings/settings-input";@@ -11,6 +12,14 @@ 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";interface InstallServerModalProps {entry: MarketplaceEntry;@@ -268,14 +277,32 @@ export function InstallServerModal({data-testid="mcp-install-modal"data-marketplace-id={entry.id}onSubmit={handleSubmit}- className="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"+ 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,+ )}>- <div className="flex items-start gap-3">- <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-alt">{entry.description}</p>+ <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-semibold text-content-2">+ {entry.name}+ </h2>+ <p className="text-xs text-tertiary-alt">{entry.description}</p>+ </div></div>+ <button+ type="button"+ onClick={onClose}+ disabled={isPending}+ className={ICON_BUTTON_CLASS}+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ data-testid="close-mcp-install-modal"+ >+ <X size={20} aria-hidden />+ </button></div>{entry.installHint && (diff --git a/src/components/features/onboarding/onboarding-modal.tsx b/src/components/features/onboarding/onboarding-modal.tsxindex 5567f0bf34..7550933e33 100644--- a/src/components/features/onboarding/onboarding-modal.tsx+++ b/src/components/features/onboarding/onboarding-modal.tsx@@ -1,6 +1,10 @@import React from "react";import { useTranslation } from "react-i18next";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";+import {+ MODAL_MAX_WIDTH_VIEWPORT,+ modalWidthClassName,+} from "#/components/shared/modals/modal-body";import { I18nKey } from "#/i18n/declaration";import { cn } from "#/utils/utils";import { OnboardingProgressBar } from "./onboarding-progress-bar";@@ -128,7 +132,9 @@ export function OnboardingModal({ onClose }: OnboardingModalProps) {data-current-step={currentStep}className={cn("flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl",- "w-[560px] max-w-[92vw] max-h-[90vh]",+ modalWidthClassName("lg"),+ MODAL_MAX_WIDTH_VIEWPORT,+ "max-h-[90vh]",)}><header className="flex flex-col gap-3 px-7 pt-7 shrink-0">diff --git a/src/components/features/settings/api-key-modal-base.tsx b/src/components/features/settings/api-key-modal-base.tsxindex e084e24035..584d9e2e60 100644--- a/src/components/features/settings/api-key-modal-base.tsx+++ b/src/components/features/settings/api-key-modal-base.tsx@@ -1,10 +1,17 @@import React, { ReactNode, useEffect, useRef } from "react";+import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";+import {+ MODAL_MAX_WIDTH_VIEWPORT,+ type ModalWidth,+ modalWidthClassName,+} from "#/components/shared/modals/modal-body";+import { cn } from "#/utils/utils";interface ApiKeyModalBaseProps {isOpen: boolean;title: string;- width?: string;+ width?: ModalWidth;children: ReactNode;footer: ReactNode;/** Called when the modal should close (e.g., Escape key or backdrop click) */@@ -16,7 +23,7 @@ interface ApiKeyModalBaseProps {export function ApiKeyModalBase({isOpen,title,- width = "500px",+ width = "md",children,footer,onClose,@@ -79,13 +86,13 @@ export function ApiKeyModalBase({role="dialog"aria-modal="true"aria-labelledby="modal-title"- className="bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]"- // runtime prop-driven width; cannot move to className- style={{ width }}+ className={cn(+ "bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]",+ modalWidthClassName(width),+ MODAL_MAX_WIDTH_VIEWPORT,+ )}>- <h3 id="modal-title" className="text-xl font-bold">- {title}- </h3>+ <BaseModalTitle id="modal-title" title={title} />{children}<div className="w-full flex justify-end gap-2 mt-2">{footer}</div></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 986105a27c..4276d8737a 100644--- a/src/components/features/settings/mcp-settings/mcp-server-form.tsx+++ b/src/components/features/settings/mcp-settings/mcp-server-form.tsx@@ -376,7 +376,7 @@ export function MCPServerForm({defaultValue={server?.args?.join("\n") || ""}placeholder="arg1 arg2 arg3"className={cn(- "bg-tertiary border border-[var(--oh-border-input)] w-full rounded-sm p-2 placeholder:italic placeholder:text-tertiary-alt resize-none",+ "bg-tertiary border border-[var(--oh-border-input)] w-full rounded-sm p-2 placeholder:text-tertiary-alt resize-none","disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed",)}/>@@ -400,7 +400,7 @@ export function MCPServerForm({placeholder="KEY1=value1 KEY2=value2"className={cn("resize-none",- "bg-tertiary border border-[var(--oh-border-input)] rounded-sm p-2 placeholder:italic placeholder:text-tertiary-alt",+ "bg-tertiary border border-[var(--oh-border-input)] rounded-sm p-2 placeholder:text-tertiary-alt","disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed",)}/>diff --git a/src/components/features/settings/sdk-settings/schema-field.tsx b/src/components/features/settings/sdk-settings/schema-field.tsxindex 5bf1b5fe21..294e80a593 100644--- a/src/components/features/settings/sdk-settings/schema-field.tsx+++ b/src/components/features/settings/sdk-settings/schema-field.tsx@@ -168,7 +168,7 @@ export function SchemaField({onChange={(event) => onChange(event.target.value)}className={cn("bg-tertiary border border-[var(--oh-border-input)] min-h-32 w-full min-w-0 rounded-sm p-2 font-mono text-sm",- "placeholder:italic placeholder:text-tertiary-alt",+ "placeholder:text-tertiary-alt","disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed",)}/>diff --git a/src/components/features/settings/secrets-settings/secret-form.tsx b/src/components/features/settings/secrets-settings/secret-form.tsxindex b6aaaa8f56..1b63ea8db6 100644--- a/src/components/features/settings/secrets-settings/secret-form.tsx+++ b/src/components/features/settings/secrets-settings/secret-form.tsx@@ -138,7 +138,7 @@ export function SecretForm({requiredclassName={cn("resize-none",- "bg-tertiary border border-[var(--oh-border-input)] rounded-sm p-2 placeholder:italic placeholder:text-tertiary-alt",+ "bg-tertiary border border-[var(--oh-border-input)] rounded-sm p-2 placeholder:text-tertiary-alt","disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed",)}rows={8}@@ -157,7 +157,7 @@ export function SecretForm({defaultValue={secretDescription}className={cn("resize-none",- "bg-tertiary border border-[var(--oh-border-input)] rounded-sm p-2 placeholder:italic placeholder:text-tertiary-alt",+ "bg-tertiary border border-[var(--oh-border-input)] rounded-sm p-2 placeholder:text-tertiary-alt","disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed",)}/>diff --git a/src/components/features/settings/settings-dropdown-input.tsx b/src/components/features/settings/settings-dropdown-input.tsxindex 107c26fd90..ac3a2bebea 100644--- a/src/components/features/settings/settings-dropdown-input.tsx+++ b/src/components/features/settings/settings-dropdown-input.tsx@@ -86,7 +86,7 @@ export function SettingsDropdownInput({inputProps={{classNames: {inputWrapper: cn(- "bg-tertiary border border-[var(--oh-border-input)] h-10 w-full min-w-0 rounded-sm p-2 placeholder:italic",+ "bg-tertiary border border-[var(--oh-border-input)] h-10 w-full min-w-0 rounded-sm p-2 placeholder:text-tertiary-alt",inputWrapperClassName,),input: inputClassName,diff --git a/src/components/features/settings/settings-input.tsx b/src/components/features/settings/settings-input.tsxindex 58a467762b..0a4ee23706 100644--- a/src/components/features/settings/settings-input.tsx+++ b/src/components/features/settings/settings-input.tsx@@ -36,6 +36,8 @@ interface SettingsInputProps {/** Renders a red asterisk next to the label to mark the field as required. */showRequiredTag?: boolean;onBlur?: () => void;+ /** Extra classes merged onto the `<input>` element. */+ inputClassName?: string;}export const SettingsInput = forwardRef<HTMLInputElement, SettingsInputProps>(@@ -66,6 +68,7 @@ export const SettingsInput = forwardRef<HTMLInputElement, SettingsInputProps>(error,showRequiredTag,onBlur,+ inputClassName,},ref,) {@@ -103,9 +106,10 @@ export const SettingsInput = forwardRef<HTMLInputElement, SettingsInputProps>(aria-describedby={errorId ?? ariaDescribedBy}aria-invalid={!!error || ariaInvalid}className={cn(- "bg-tertiary border border-[var(--oh-border-input)] h-10 w-full min-w-0 rounded-sm p-2 placeholder:italic placeholder:text-tertiary-alt",+ "bg-tertiary border border-[var(--oh-border-input)] h-10 w-full min-w-0 rounded-sm p-2 placeholder:text-tertiary-alt","disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed",error && "border-red-500",+ inputClassName,)}/>{error && (diff --git a/src/components/shared/modals/confirmation-modals/base-modal.tsx b/src/components/shared/modals/confirmation-modals/base-modal.tsxindex c4c69eda87..9c1710363a 100644--- a/src/components/shared/modals/confirmation-modals/base-modal.tsx+++ b/src/components/shared/modals/confirmation-modals/base-modal.tsx@@ -1,6 +1,7 @@import React from "react";import { ModalBody } from "../modal-body";import { ModalButton } from "../../buttons/modal-button";+import { cn } from "#/utils/utils";interface ButtonConfig {text: string;@@ -10,11 +11,19 @@ interface ButtonConfig {interface BaseModalTitleProps {title: React.ReactNode;+ id?: string;+ className?: string;}-export function BaseModalTitle({ title }: BaseModalTitleProps) {+export function BaseModalTitle({ title, id, className }: BaseModalTitleProps) {return (- <span className="text-xl leading-6 -tracking-[0.01em] font-semibold text-content-2">+ <span+ id={id}+ className={cn(+ "text-xl leading-6 -tracking-[0.01em] font-semibold text-content-2",+ className,+ )}+ >{title}</span>);diff --git a/src/components/shared/modals/modal-body.tsx b/src/components/shared/modals/modal-body.tsxindex 3f503527af..052981ceb9 100644--- a/src/components/shared/modals/modal-body.tsx+++ b/src/components/shared/modals/modal-body.tsx@@ -1,7 +1,21 @@import React from "react";import { cn } from "#/utils/utils";-type ModalWidth = "small" | "medium";+/** Shared modal content widths (sm / md / lg / xl). */+export type ModalWidth = "sm" | "md" | "lg" | "xl";++export const MODAL_WIDTH_CLASS: Record<ModalWidth, string> = {+ sm: "w-[384px]",+ md: "w-[520px]",+ lg: "w-[640px]",+ xl: "w-[720px]",+};++export const MODAL_MAX_WIDTH_VIEWPORT = "max-w-[90vw]";++export function modalWidthClassName(width: ModalWidth): string {+ return MODAL_WIDTH_CLASS[width];+}interface ModalBodyProps {testID?: string;@@ -14,15 +28,14 @@ export function ModalBody({testID,children,className,- width = "small",+ width = "sm",}: ModalBodyProps) {return (<divdata-testid={testID}className={cn("bg-base-secondary flex flex-col gap-6 items-center p-6 rounded-xl",- width === "small" && "w-[384px]",- width === "medium" && "w-[700px]",+ modalWidthClassName(width),className,)}>diff --git a/src/components/shared/modals/settings/settings-modal.tsx b/src/components/shared/modals/settings/settings-modal.tsxindex 2b7f0593c7..ae8ef40c44 100644--- a/src/components/shared/modals/settings/settings-modal.tsx+++ b/src/components/shared/modals/settings/settings-modal.tsx@@ -1,6 +1,8 @@import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import { ModalBackdrop } from "../modal-backdrop";+import { MODAL_MAX_WIDTH_VIEWPORT, modalWidthClassName } from "../modal-body";+import { cn } from "#/utils/utils";import { SettingsForm } from "./settings-form";import { Settings } from "#/types/settings";import { DEFAULT_SETTINGS } from "#/services/settings";@@ -18,7 +20,11 @@ export function SettingsModal({ onClose, settings }: SettingsModalProps) {<ModalBackdrop><divdata-testid="ai-config-modal"- className="bg-[var(--oh-surface)] min-w-full max-w-[475px] m-4 p-6 rounded-xl flex flex-col gap-[17px] border border-[var(--oh-border)] api-configuration-modal"+ className={cn(+ "bg-[var(--oh-surface)] m-4 p-6 rounded-xl flex flex-col gap-[17px] border border-[var(--oh-border)] api-configuration-modal",+ modalWidthClassName("md"),+ MODAL_MAX_WIDTH_VIEWPORT,+ )}><span className="text-5 leading-6 font-semibold -tracking-[0.2px]">{t(I18nKey.AI_SETTINGS$TITLE)}diff --git a/src/hooks/mutation/use-update-conversation-public-flag.ts b/src/hooks/mutation/use-update-conversation-public-flag.tsindex 57c3106815..bdb41298e2 100644--- a/src/hooks/mutation/use-update-conversation-public-flag.ts+++ b/src/hooks/mutation/use-update-conversation-public-flag.ts@@ -2,10 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";import { useTranslation } from "react-i18next";import AgentServerConversationService from "#/api/conversation-service/agent-server-conversation-service.api";import { I18nKey } from "#/i18n/declaration";-import {- displaySuccessToast,- displayErrorToast,-} from "#/utils/custom-toast-handlers";+import { displayErrorToast } from "#/utils/custom-toast-handlers";export const useUpdateConversationPublicFlag = () => {const queryClient = useQueryClient();@@ -18,40 +15,36 @@ export const useUpdateConversationPublicFlag = () => {variables.isPublic,),onMutate: async (variables) => {- await queryClient.cancelQueries({- queryKey: ["user", "conversation", variables.conversationId],- });-- const previousConversation = queryClient.getQueryData([+ const conversationQueryKey = ["user","conversation",variables.conversationId,- ]);+ ] as const;++ await queryClient.cancelQueries({ queryKey: conversationQueryKey });- queryClient.setQueryData(- ["user", "conversation", variables.conversationId],+ const previousEntries = queryClient.getQueriesData({+ queryKey: conversationQueryKey,+ });++ queryClient.setQueriesData(+ { queryKey: conversationQueryKey },(old: unknown) =>old && typeof old === "object"? { ...old, public: variables.isPublic }: old,);- return { previousConversation };+ return { previousEntries };},onError: (_err, variables, context) => {- if (context?.previousConversation) {- queryClient.setQueryData(- ["user", "conversation", variables.conversationId],- context.previousConversation,- );- }+ context?.previousEntries?.forEach(([queryKey, data]) => {+ queryClient.setQueryData(queryKey, data);+ });displayErrorToast(t(I18nKey.CONVERSATION$FAILED_TO_UPDATE_PUBLIC_SHARING),);},- onSuccess: () => {- displaySuccessToast(t(I18nKey.CONVERSATION$PUBLIC_SHARING_UPDATED));- },onSettled: (_data, _error, variables) => {queryClient.invalidateQueries({queryKey: ["user", "conversation", variables.conversationId],diff --git a/src/hooks/query/use-conversation-hooks.ts b/src/hooks/query/use-conversation-hooks.tsindex a69486518c..5fe8de1010 100644--- a/src/hooks/query/use-conversation-hooks.ts+++ b/src/hooks/query/use-conversation-hooks.ts@@ -1,5 +1,5 @@import { useQuery } from "@tanstack/react-query";-import type { HookEvent } from "#/api/conversation-service/agent-server-conversation-service.types";+import AgentServerConversationService from "#/api/conversation-service/agent-server-conversation-service.api";import { useConversationId } from "../use-conversation-id";import { AgentState } from "#/types/agent-state";import { useAgentState } from "#/hooks/use-agent-state";@@ -14,7 +14,9 @@ export const useConversationHooks = () => {throw new Error("No conversation ID provided");}- return [] as HookEvent[];+ const { hooks } =+ await AgentServerConversationService.getHooks(conversationId);+ return hooks;},enabled:!!conversationId &&diff --git a/src/hooks/use-conversation-name-context-menu.ts b/src/hooks/use-conversation-name-context-menu.tsindex c77636cdb7..49be384f10 100644--- a/src/hooks/use-conversation-name-context-menu.ts+++ b/src/hooks/use-conversation-name-context-menu.ts@@ -134,14 +134,11 @@ export function useConversationNameContextMenu({onContextMenuToggle?.(false);};- const handleTogglePublic = (event: React.MouseEvent<HTMLButtonElement>) => {- event.preventDefault();- event.stopPropagation();-+ const handleTogglePublic = (nextIsPublic?: boolean) => {if (conversationId && conversation) {updatePublicFlag({conversationId,- isPublic: !conversation.public,+ isPublic: nextIsPublic ?? !conversation.public,});}// Intentionally don't close the menu — let the user see the toggle flip.diff --git a/src/i18n/translation.json b/src/i18n/translation.jsonindex e379382403..15b28c2e69 100644--- a/src/i18n/translation.json+++ b/src/i18n/translation.json@@ -16099,55 +16099,55 @@"ca": "Sense límit de pressupost"},"CONVERSATION$INPUT": {- "en": "- Input:",- "ja": "- 入力:",- "zh-CN": "- 输入:",- "zh-TW": "- 輸入:",- "ko-KR": "- 입력:",- "de": "- Eingabe:",- "no": "- Inndata:",- "it": "- Input:",- "pt": "- Entrada:",- "es": "- Entrada:",- "ar": "- المدخلات:",- "fr": "- Entrée :",- "tr": "- Giriş:",- "uk": "- Вхідні дані:",- "ca": "- Entrada:"+ "en": "Input",+ "ja": "入力",+ "zh-CN": "输入",+ "zh-TW": "輸入",+ "ko-KR": "입력",+ "de": "Eingabe",+ "no": "Inndata",+ "it": "Input",+ "pt": "Entrada",+ "es": "Entrada",+ "ar": "المدخلات",+ "fr": "Entrée",+ "tr": "Giriş",+ "uk": "Вхідні дані",+ "ca": "Entrada"},"CONVERSATION$OUTPUT": {- "en": "- Output:",- "ja": "- 出力:",- "zh-CN": "- 输出:",- "zh-TW": "- 輸出:",- "ko-KR": "- 출력:",- "de": "- Ausgabe:",- "no": "- Utdata:",- "it": "- Output:",- "pt": "- Saída:",- "es": "- Salida:",- "ar": "- المخرجات:",- "fr": "- Sortie :",- "tr": "- Çıkış:",- "uk": "- Результат:",- "ca": "- Sortida:"+ "en": "Output",+ "ja": "出力",+ "zh-CN": "输出",+ "zh-TW": "輸出",+ "ko-KR": "출력",+ "de": "Ausgabe",+ "no": "Utdata",+ "it": "Output",+ "pt": "Saída",+ "es": "Salida",+ "ar": "المخرجات",+ "fr": "Sortie",+ "tr": "Çıkış",+ "uk": "Результат",+ "ca": "Sortida"},"CONVERSATION$TOTAL": {- "en": "- Total:",- "ja": "- 合計:",- "zh-CN": "- 总计:",- "zh-TW": "- 總計:",- "ko-KR": "- 총계:",- "de": "- Gesamt:",- "no": "- Totalt:",- "it": "- Totale:",- "pt": "- Total:",- "es": "- Total:",- "ar": "- المجموع:",- "fr": "- Total :",- "tr": "- Toplam:",- "uk": "- Всього:",- "ca": "- Total:"+ "en": "Total",+ "ja": "合計",+ "zh-CN": "总计",+ "zh-TW": "總計",+ "ko-KR": "총계",+ "de": "Gesamt",+ "no": "Totalt",+ "it": "Totale",+ "pt": "Total",+ "es": "Total",+ "ar": "المجموع",+ "fr": "Total",+ "tr": "Toplam",+ "uk": "Всього",+ "ca": "Total"},"CONVERSATION$CONTEXT_WINDOW": {"en": "Context Window",@@ -24054,8 +24054,8 @@"uk": "Команди","ca": "Comandes"},- "HOOKS_MODAL$HOOK_COUNT": {- "en": "{{count}} hook(s)",+ "HOOKS_MODAL$HOOK_COUNT_one": {+ "en": "{{count}} hook","ja": "{{count}}個のフック","zh-CN": "{{count}}个钩子","zh-TW": "{{count}}個鉤子",@@ -24069,7 +24069,24 @@"es": "{{count}} hook","tr": "{{count}} kanca","uk": "{{count}} хук",- "ca": "{{count}} hook(s)"+ "ca": "{{count}} hook"+ },+ "HOOKS_MODAL$HOOK_COUNT_other": {+ "en": "{{count}} hooks",+ "ja": "{{count}}個のフック",+ "zh-CN": "{{count}}个钩子",+ "zh-TW": "{{count}}個鉤子",+ "ko-KR": "{{count}}개 훅",+ "no": "{{count}} kroker",+ "ar": "{{count}} خطاف",+ "de": "{{count}} Hooks",+ "fr": "{{count}} hooks",+ "it": "{{count}} hook",+ "pt": "{{count}} hooks",+ "es": "{{count}} hooks",+ "tr": "{{count}} kanca",+ "uk": "{{count}} хуків",+ "ca": "{{count}} hooks"},"HOOKS_MODAL$TYPE": {"en": "Type: {{type}}",diff --git a/src/icons/copy.svg b/src/icons/copy.svgindex 61f3d5f517..9c3d31d893 100644--- a/src/icons/copy.svg+++ b/src/icons/copy.svg@@ -1,5 +1,5 @@<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><pathd="M1.25 2.5C1.25 1.80964 1.80964 1.25 2.5 1.25H8.75C9.44036 1.25 10 1.80964 10 2.5V5H12.5C13.1904 5 13.75 5.55964 13.75 6.25V12.5C13.75 13.1904 13.1904 13.75 12.5 13.75H6.25C5.55964 13.75 5 13.1904 5 12.5V10H2.5C1.80964 10 1.25 9.44036 1.25 8.75V2.5ZM6.25 10V12.5H12.5V6.25H10V8.75C10 9.44036 9.44036 10 8.75 10H6.25ZM8.75 8.75V2.5L2.5 2.5V8.75H8.75Z"- fill="white" />+ fill="currentColor" /></svg>diff --git a/src/icons/fishing-hook.svg b/src/icons/fishing-hook.svgnew file mode 100644index 0000000000..f0cb29135c--- /dev/null+++ b/src/icons/fishing-hook.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="m17.586 11.414-5.93 5.93a1 1 0 0 1-8-8l3.137-3.137a.707.707 0 0 1 1.207.5V10"/>+ <path d="M20.414 8.586 22 7"/>+ <circle cx="19" cy="10" r="2"/>+</svg>diff --git a/src/routes/agent-settings.tsx b/src/routes/agent-settings.tsxindex c769e6019f..bf0f2a0593 100644--- a/src/routes/agent-settings.tsx+++ b/src/routes/agent-settings.tsx@@ -336,7 +336,7 @@ function AgentSettingsScreen() {</Typography.Text><textareadata-testid="agent-command-input"- className="bg-tertiary border border-[#717888] rounded-sm p-2 text-sm font-mono text-white placeholder:italic placeholder:text-[#717888] min-h-[60px] resize-y focus:outline-none focus:border-white"+ className="bg-tertiary border border-[#717888] rounded-sm p-2 text-sm font-mono text-white placeholder:text-[#717888] min-h-[60px] resize-y focus:outline-none focus:border-white"value={commandText}placeholder={commandPlaceholder}onChange={(e) => {diff --git a/src/ui/dropdown/dropdown-input.tsx b/src/ui/dropdown/dropdown-input.tsxindex 0054cbf0bb..90a9d7ccda 100644--- a/src/ui/dropdown/dropdown-input.tsx+++ b/src/ui/dropdown/dropdown-input.tsx@@ -4,15 +4,12 @@ interface DropdownInputProps {placeholder?: string;isDisabled: boolean;getInputProps: (props?: object) => object;- /** When false, placeholder hint keeps upright type (e.g. backend selector). */- italicPlaceholder?: boolean;}export function DropdownInput({placeholder,isDisabled,getInputProps,- italicPlaceholder = true,}: DropdownInputProps) {return (<input@@ -20,10 +17,7 @@ export function DropdownInput({placeholder,disabled: isDisabled,className: cn(- "flex-1 min-w-0 outline-none bg-transparent text-white not-italic",- italicPlaceholder &&- "placeholder:italic placeholder:text-tertiary-alt",- !italicPlaceholder && "placeholder:text-tertiary-alt",+ "flex-1 min-w-0 outline-none bg-transparent text-white not-italic placeholder:text-tertiary-alt",),})}/>diff --git a/src/ui/dropdown/dropdown.tsx b/src/ui/dropdown/dropdown.tsxindex 30c15081a6..7cec377937 100644--- a/src/ui/dropdown/dropdown.tsx+++ b/src/ui/dropdown/dropdown.tsx@@ -39,8 +39,6 @@ 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;}export function Dropdown({@@ -59,7 +57,6 @@ export function Dropdown({hideTrigger = false,defaultOpen = false,openOnHover = false,- italicPlaceholder = true,}: DropdownProps) {const closeTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null,@@ -182,7 +179,6 @@ export function Dropdown({placeholder={placeholder}isDisabled={isDisabled}getInputProps={getInputPropsWithCursorFix}- italicPlaceholder={italicPlaceholder}/>{loading && <LoadingSpinner />}{clearable && selectedItem && (