🙌 OpenHands: AI-Driven Development
feat(extensions): Extensions nav, unified card design, and UX polish across Skills & MCP (#386)
FraterCCCLXIII0205ad89c8d3
diff --git a/__tests__/routes/skills-settings.test.tsx b/__tests__/routes/skills-settings.test.tsxindex 3083ad02d2..15d2be318e 100644--- a/__tests__/routes/skills-settings.test.tsx+++ b/__tests__/routes/skills-settings.test.tsx@@ -1,5 +1,5 @@import { QueryClient, QueryClientProvider } from "@tanstack/react-query";-import { render, screen, within } from "@testing-library/react";+import { render, screen, within, fireEvent } from "@testing-library/react";import userEvent from "@testing-library/user-event";import { beforeEach, describe, expect, it, vi } from "vitest";import SkillsSettingsScreen from "#/routes/skills-settings";@@ -66,10 +66,20 @@ describe("SkillsSettingsScreen", () => {renderSkillsSettingsScreen();- const badge = await screen.findByTestId(- "skills-settings-description-badge",+ const description = await screen.findByTestId(+ "skills-settings-description",+ );+ expect(description).toHaveTextContent("SETTINGS$SKILLS_PAGE_DESCRIPTION");+ expect(screen.getByText("NAV$EXTENSIONS")).toBeInTheDocument();+ expect(screen.getByTestId("sidebar-extensions-/skills")).toHaveTextContent(+ "Skills",+ );+ expect(screen.getByTestId("sidebar-extensions-/plugins")).toHaveTextContent(+ "Plugins",+ );+ expect(screen.getByTestId("sidebar-extensions-/mcp")).toHaveTextContent(+ "MCP Servers",);- expect(badge).toHaveTextContent("SETTINGS$SKILLS_DESCRIPTION");});it("surfaces the YAML description and a friendly type label instead of the raw source path", async () => {@@ -97,7 +107,6 @@ describe("SkillsSettingsScreen", () => {});it("filters skills by name, description, or trigger via the search input", async () => {- const user = userEvent.setup();vi.spyOn(SkillsService, "getSkills").mockResolvedValue([buildSkill({ name: "deno", description: "Deno runtime helper" }),buildSkill({@@ -111,7 +120,9 @@ describe("SkillsSettingsScreen", () => {renderSkillsSettingsScreen();await screen.findByTestId("skill-card-deno");- await user.type(screen.getByTestId("skills-search-input"), "preview");+ fireEvent.change(screen.getByTestId("skills-search-input"), {+ target: { value: "preview" },+ });expect(screen.queryByTestId("skill-card-deno")).not.toBeInTheDocument();expect(screen.getByTestId("skill-card-vercel")).toBeInTheDocument();@@ -166,16 +177,15 @@ describe("SkillsSettingsScreen", () => {});it("shows an empty-state message when no skills match the current filters", async () => {- const user = userEvent.setup();- vi.spyOn(SkillsService, "getSkills").mockResolvedValue([buildSkill()]);+ const skill = buildSkill();+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([skill]);renderSkillsSettingsScreen();- await screen.findByTestId("skill-card-deno");+ await screen.findByTestId(`skill-card-${skill.name}`);- await user.type(- screen.getByTestId("skills-search-input"),- "no-such-skill-xyz",- );+ fireEvent.change(screen.getByTestId("skills-search-input"), {+ target: { value: "no-such-skill-xyz" },+ });expect(screen.getByTestId("skills-no-match")).toBeInTheDocument();});diff --git a/src/components/features/mcp-page/marketplace-card.tsx b/src/components/features/mcp-page/marketplace-card.tsxindex 392f1c27af..01b873b040 100644--- a/src/components/features/mcp-page/marketplace-card.tsx+++ b/src/components/features/mcp-page/marketplace-card.tsx@@ -38,7 +38,7 @@ export function MarketplaceCard({"group flex flex-col text-left","rounded-xl border border-tertiary bg-base-secondary","p-4 gap-3 cursor-pointer",- "hover:border-primary/60 hover:bg-base-tertiary/30 transition-colors",+ "hover:border-white/40 hover:bg-base-tertiary/30 transition-colors","focus:outline-none focus:ring-2 focus:ring-primary/60",)}>diff --git a/src/components/features/mcp-page/marketplace-search.tsx b/src/components/features/mcp-page/marketplace-search.tsxindex 1142b46d3e..1afb42233a 100644--- a/src/components/features/mcp-page/marketplace-search.tsx+++ b/src/components/features/mcp-page/marketplace-search.tsx@@ -19,9 +19,9 @@ export function MarketplaceSearch({ value, onChange }: MarketplaceSearchProps) {<divdata-testid="mcp-search"className={cn(- "relative flex items-center w-full",+ "relative flex items-center w-1/2","rounded-lg border border-tertiary bg-base-secondary",- "focus-within:border-primary/60 focus-within:ring-1 focus-within:ring-primary/40",+ "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20","transition-colors",)}>diff --git a/src/components/features/mcp-page/marketplace-section.tsx b/src/components/features/mcp-page/marketplace-section.tsxindex dad254461a..31e32fda8c 100644--- a/src/components/features/mcp-page/marketplace-section.tsx+++ b/src/components/features/mcp-page/marketplace-section.tsx@@ -34,14 +34,9 @@ export function MarketplaceSection({data-testid="mcp-marketplace-section"className="flex flex-col gap-3">- <div className="flex flex-col gap-1">- <h2 className="text-base font-semibold">- {t(I18nKey.MCP$MARKETPLACE_TITLE)}- </h2>- <p className="text-xs text-tertiary-alt">- {t(I18nKey.MCP$MARKETPLACE_DESCRIPTION)}- </p>- </div>+ <h2 className="text-base font-semibold text-foreground">+ {t(I18nKey.MCP$LIBRARY_TITLE)}+ </h2>{visibleEntries.length === 0 ? (<div@@ -55,7 +50,7 @@ export function MarketplaceSection({) : (<divdata-testid="mcp-marketplace-grid"- className="grid gap-3 grid-cols-1 md:grid-cols-2 lg:grid-cols-3"+ className="grid gap-3 grid-cols-1 md:grid-cols-2">{visibleEntries.map((entry) => (<MarketplaceCarddiff --git a/src/components/features/settings/backend-synced-settings-badge.tsx b/src/components/features/settings/backend-synced-settings-badge.tsxindex 71f45843e2..5538b49128 100644--- a/src/components/features/settings/backend-synced-settings-badge.tsx+++ b/src/components/features/settings/backend-synced-settings-badge.tsx@@ -1,7 +1,6 @@import { useTranslation } from "react-i18next";import { Typography } from "#/ui/typography";import { I18nKey } from "#/i18n/declaration";-import InfoCircleIcon from "#/icons/info-circle.svg?react";import { useActiveBackend } from "#/contexts/active-backend-context";import { useAllCloudOrganizations } from "#/hooks/query/use-cloud-organizations";import { useCloudCurrentUserId } from "#/hooks/query/use-cloud-current-user-id";@@ -36,9 +35,8 @@ export function BackendSyncedSettingsBadge() {return (<divdata-testid="backend-synced-settings-badge"- className="flex items-center gap-2 bg-[rgba(31,31,31,0.4)] border border-[#242424] rounded-full px-2.5 py-1"+ className="flex items-center">- <InfoCircleIcon width={12} height={12} className="text-[#8c8c8c]" /><Typography.Text className="text-[11px] font-medium text-[#8c8c8c] leading-5">{t(I18nKey.SETTINGS$BACKEND_SYNCED_BADGE, {name,diff --git a/src/components/features/settings/settings-switch.tsx b/src/components/features/settings/settings-switch.tsxindex c967c163e5..7804a5f953 100644--- a/src/components/features/settings/settings-switch.tsx+++ b/src/components/features/settings/settings-switch.tsx@@ -12,6 +12,8 @@ interface SettingsSwitchProps {isToggled?: boolean;isBeta?: boolean;isDisabled?: boolean;+ /** Whether the toggle sits before or after the label. Defaults to "left". */+ togglePosition?: "left" | "right";}export function SettingsSwitch({@@ -23,6 +25,7 @@ export function SettingsSwitch({isToggled: controlledIsToggled,isBeta,isDisabled,+ togglePosition = "left",}: React.PropsWithChildren<SettingsSwitchProps>) {const { t } = useTranslation("openhands");const [isToggled, setIsToggled] = React.useState(defaultIsToggled ?? false);@@ -33,25 +36,24 @@ export function SettingsSwitch({onToggle?.(value);};- return (- <label- className={cn(- "flex items-center gap-2 w-fit",- isDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",- )}- >- <input- hidden- data-testid={testId}- name={name}- type="checkbox"- onChange={(e) => handleToggle(e.target.checked)}- checked={controlledIsToggled ?? isToggled}- disabled={isDisabled}- />+ const input = (+ <input+ hidden+ data-testid={testId}+ name={name}+ type="checkbox"+ onChange={(e) => handleToggle(e.target.checked)}+ checked={controlledIsToggled ?? isToggled}+ disabled={isDisabled}+ />+ );- <StyledSwitchComponent isToggled={controlledIsToggled ?? isToggled} />+ const toggle = (+ <StyledSwitchComponent isToggled={controlledIsToggled ?? isToggled} />+ );+ const label =+ children || isBeta ? (<div className="flex items-center gap-1"><span className="text-sm">{children}</span>{isBeta && (@@ -60,6 +62,28 @@ export function SettingsSwitch({</span>)}</div>+ ) : null;++ return (+ <label+ className={cn(+ "flex items-center gap-2",+ togglePosition === "right" ? "w-full justify-between" : "w-fit",+ isDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",+ )}+ >+ {input}+ {togglePosition === "right" ? (+ <>+ {label}+ {toggle}+ </>+ ) : (+ <>+ {toggle}+ {label}+ </>+ )}</label>);}diff --git a/src/components/features/sidebar/sidebar-nav-link.tsx b/src/components/features/sidebar/sidebar-nav-link.tsxindex 99be800530..2067b41ac2 100644--- a/src/components/features/sidebar/sidebar-nav-link.tsx+++ b/src/components/features/sidebar/sidebar-nav-link.tsx@@ -22,6 +22,12 @@ interface SidebarNavLinkProps {* while the sidebar is collapsed.*/hoverContent?: React.ReactNode;+ /**+ * When true, forces the active style regardless of the current path.+ * Useful for links that should appear active for multiple related routes+ * (e.g. the Extensions link being active on /mcp and /plugins too).+ */+ forceActive?: boolean;}function getLayoutClasses(collapsed: boolean, indent: boolean): string {@@ -40,6 +46,7 @@ export function SidebarNavLink({icon,collapsed = false,hoverContent,+ forceActive = false,}: SidebarNavLinkProps) {const link = (<NavigationLink@@ -58,7 +65,7 @@ export function SidebarNavLink({"flex items-center gap-2 rounded-md transition-colors","text-sm leading-5 truncate",getLayoutClasses(collapsed, indent),- isActive+ isActive || forceActive? "bg-[#1f1f1f99] text-white font-medium": "text-[#8C8C8C] hover:text-white hover:bg-[#1f1f1f99]",disabled && "pointer-events-none opacity-50",diff --git a/src/components/features/sidebar/sidebar.tsx b/src/components/features/sidebar/sidebar.tsxindex 2fbbfa8905..291026f08b 100644--- a/src/components/features/sidebar/sidebar.tsx+++ b/src/components/features/sidebar/sidebar.tsx@@ -24,7 +24,6 @@ import { useSidebarCollapsedState } from "#/hooks/use-sidebar-collapsed";import { useClickOutsideElement } from "#/hooks/use-click-outside-element";import { useBackendsHealth } from "#/hooks/query/use-backends-health";import AutomationsIcon from "#/icons/automations.svg?react";-import SparkleIcon from "#/icons/sparkle.svg?react";// The LLM settings modal is only mounted when the settings query 404s and// LLM settings aren't hidden — keep it out of the sidebar's eager graph.@@ -141,6 +140,11 @@ export function Sidebar() {);const showCollapsedExpandButton = collapsed && collapsedRailHovered;+ const isExtensionsActive =+ currentPath.startsWith("/skills") ||+ currentPath === "/plugins" ||+ currentPath === "/mcp";+return (<SidebarCollapseContext.Provider value={collapsed}>{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- the aside acts as a hit-area for the collapsed rail; nested controls handle their own keyboard interactions. */}@@ -258,11 +262,38 @@ export function Sidebar() {/><SidebarNavLinkto="/skills"- label={t(I18nKey.SIDEBAR$SKILLS)}+ label="Extensions"testId="sidebar-skills-link"disabled={linkDisabled}collapsed={collapsed}- icon={<SparkleIcon width={ICON_SIZE} height={ICON_SIZE} />}+ forceActive={isExtensionsActive}+ icon={+ <svg+ xmlns="http://www.w3.org/2000/svg"+ width={ICON_SIZE}+ height={ICON_SIZE}+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ aria-hidden="true"+ >+ <path d="M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z" />+ <path d="m7 16.5-4.74-2.85" />+ <path d="m7 16.5 5-3" />+ <path d="M7 16.5v5.17" />+ <path d="M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z" />+ <path d="m17 16.5-5-3" />+ <path d="m17 16.5 4.74-2.85" />+ <path d="M17 16.5v5.17" />+ <path d="M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z" />+ <path d="M12 8 7.26 5.15" />+ <path d="m12 8 4.74-2.85" />+ <path d="M12 13.5V8" />+ </svg>+ }/><SidebarNavLinkto="/automations"diff --git a/src/components/features/skills/extensions-navigation.tsx b/src/components/features/skills/extensions-navigation.tsxnew file mode 100644index 0000000000..32553b52fe--- /dev/null+++ b/src/components/features/skills/extensions-navigation.tsx@@ -0,0 +1,118 @@+import { useTranslation } from "react-i18next";+import { NavigationLink } from "#/components/shared/navigation-link";+import { cn } from "#/utils/utils";+import ServerProcessIcon from "#/icons/server-process.svg?react";+import { BackendSyncedSettingsBadge } from "#/components/features/settings/backend-synced-settings-badge";+import { I18nKey } from "#/i18n/declaration";++interface ExtensionNavItem {+ to: string;+ label: string;+ icon: React.ReactElement;+ end?: boolean;+ comingSoon?: boolean;+}++const EXTENSIONS_NAV_ITEMS: ExtensionNavItem[] = [+ {+ to: "/skills",+ label: "Skills",+ icon: (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 19.13 24.62"+ fill="none"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ width={16}+ height={16}+ aria-hidden="true"+ >+ <path d="M.86,7.26l5.74,3.3,11.68-6.6" />+ <path d="M6.6,17.15v-6.6" />+ <path d="M1.32,14.34l4.62,2.64c.41.24.91.24,1.32,0l10.56-5.94" />+ <path d="M.66,20c0,.47.25.91.66,1.14l4.62,2.64c.41.24.91.24,1.32,0l10.56-5.94c.41-.24.66-.67.66-1.14V4.62c0-.47-.25-.91-.66-1.14L13.2.84c-.41-.24-.91-.24-1.32,0L1.32,6.78c-.41.24-.66.67-.66,1.14v12.08Z" />+ <path d="M.86,14.06l5.74,3.3,11.68-6.6" />+ <path d="M6.6,23.96v-6.6" />+ </svg>+ ),+ end: true,+ },+ {+ to: "/mcp",+ label: "MCP Servers",+ icon: <ServerProcessIcon width={16} height={16} />,+ end: true,+ },+ {+ to: "/plugins",+ label: "Plugins",+ icon: (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ width={16}+ height={16}+ aria-hidden="true"+ >+ <path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z" />+ <path d="m3.3 7 8.7 5 8.7-5" />+ <path d="M12 22V12" />+ </svg>+ ),+ end: true,+ comingSoon: true,+ },+];++export function ExtensionsNavigation() {+ const { t } = useTranslation("openhands");++ return (+ <aside+ data-testid="extensions-navbar-desktop"+ className="hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2 md:sticky md:top-8 md:self-start md:pl-[14px]"+ >+ <span className="px-3 text-xs font-semibold uppercase tracking-wider text-[#A3A3A3]">+ {t(I18nKey.NAV$EXTENSIONS)}+ </span>+ <div className="flex flex-col gap-0.5 pt-0.5">+ {EXTENSIONS_NAV_ITEMS.map((item) => (+ <NavigationLink+ key={item.to}+ to={item.to}+ end={item.end}+ data-testid={`sidebar-extensions-${item.to}`}+ className={({ isActive }) =>+ cn(+ "flex items-center gap-2 rounded-md transition-colors text-sm leading-5 truncate px-2 py-2 w-full",+ isActive+ ? "bg-[#1f1f1f99] text-white font-medium"+ : "text-[#8C8C8C] hover:text-white hover:bg-[#1f1f1f99]",+ )+ }+ >+ <span className="shrink-0 flex items-center justify-center">+ {item.icon}+ </span>+ <span className="truncate">{item.label}</span>+ {item.comingSoon && (+ <span className="ml-auto shrink-0 rounded-full border border-white/20 bg-white/5 px-1.5 py-0.5 text-[10px] font-medium text-[#8C8C8C]">+ {t(I18nKey.NAV$COMING_SOON)}+ </span>+ )}+ </NavigationLink>+ ))}+ </div>+ <div className="px-2 pt-3">+ <BackendSyncedSettingsBadge />+ </div>+ </aside>+ );+}diff --git a/src/components/features/skills/skill-card.tsx b/src/components/features/skills/skill-card.tsxindex 980b27e85e..023a071f19 100644--- a/src/components/features/skills/skill-card.tsx+++ b/src/components/features/skills/skill-card.tsx@@ -55,31 +55,25 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {<articledata-testid={`skill-card-${skill.name}`}className={cn(- "flex flex-col gap-3 rounded-2xl border border-border bg-surface-card p-4 transition-colors hover:border-border-hover",+ "flex flex-col gap-3 rounded-xl border border-tertiary bg-base-secondary p-4 transition-colors hover:border-white/40 hover:bg-base-tertiary/30",!enabled && "opacity-70",)}>- <header className="flex items-start justify-between gap-3">- <div className="flex min-w-0 flex-1 items-start gap-3">- <SettingsSwitch- testId={`skill-toggle-${skill.name}`}- isToggled={enabled}- onToggle={onToggle}+ <header className="flex items-center justify-between gap-3">+ <div className="flex min-w-0 flex-1 items-center gap-2">+ <span+ data-testid={`skill-name-${skill.name}`}+ className="text-sm font-semibold text-white truncate">- <span- data-testid={`skill-name-${skill.name}`}- className="text-sm font-semibold text-white"- >- {skill.name}- </span>- </SettingsSwitch>+ {skill.name}+ </span></div><div className="flex shrink-0 flex-wrap items-center justify-end gap-1.5"><SkillTypeBadge type={skill.type} />{skill.version && (<spandata-testid={`skill-version-${skill.name}`}- className="inline-flex items-center rounded-full border border-border px-2 py-0.5 text-[11px] font-medium text-content-muted"+ className="inline-flex items-center rounded-full border border-tertiary px-2 py-0.5 text-[11px] font-medium text-tertiary-light">{t(I18nKey.SETTINGS$SKILLS_VERSION, { version: skill.version })}</span>@@ -93,6 +87,11 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {{t(I18nKey.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)}</span>)}+ <SettingsSwitch+ testId={`skill-toggle-${skill.name}`}+ isToggled={enabled}+ onToggle={onToggle}+ /></div></header>@@ -100,17 +99,13 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {{description ? (<pclassName={cn(- "whitespace-pre-wrap text-content-muted leading-5",+ "whitespace-pre-wrap text-tertiary-light leading-5",!showFullDescription && isDescriptionClamped && "line-clamp-3",)}>{description}</p>- ) : (- <p className="italic text-content-muted">- {t(I18nKey.SETTINGS$SKILLS_NO_DESCRIPTION)}- </p>- )}+ ) : null}{showShowMoreButton && (<buttontype="button"@@ -133,7 +128,7 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {{skill.triggers.map((trigger) => (<spankey={trigger}- className="inline-flex items-center rounded-md border border-border bg-[rgba(255,255,255,0.04)] px-1.5 py-0.5 font-mono text-[11px] text-content-muted"+ className="inline-flex items-center rounded-md border border-tertiary bg-[rgba(255,255,255,0.04)] px-1.5 py-0.5 text-[11px] text-tertiary-light">{trigger}</span>@@ -142,13 +137,13 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {)}{detailsAvailable && (- <div className="border-t border-border pt-2">+ <div className="pt-2"><buttontype="button"data-testid={`skill-details-toggle-${skill.name}`}aria-expanded={detailsOpen}onClick={() => setDetailsOpen((prev) => !prev)}- className="flex w-full items-center justify-between text-xs font-medium text-content-muted hover:text-white"+ className="flex w-full items-center justify-between text-xs font-medium text-tertiary-light hover:text-white"><span>{t(I18nKey.SETTINGS$SKILLS_DETAILS)}</span><ChevronDownIcon@@ -167,7 +162,7 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {>{skill.source && (<>- <dt className="text-content-muted">+ <dt className="text-tertiary-light">{t(I18nKey.SETTINGS$SKILLS_SOURCE)}</dt><dd className="flex items-center gap-2 min-w-0">@@ -182,7 +177,7 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {onClick={handleCopySource}aria-label={t(I18nKey.SETTINGS$SKILLS_COPY_PATH)}data-testid={`skill-copy-source-${skill.name}`}- className="shrink-0 rounded p-1 text-content-muted hover:bg-[rgba(255,255,255,0.06)] hover:text-white"+ className="shrink-0 rounded p-1 text-tertiary-light hover:bg-[rgba(255,255,255,0.06)] hover:text-white"><CopyIcon className="size-3.5" /></button>@@ -191,7 +186,7 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {)}{skill.license && (<>- <dt className="text-content-muted">+ <dt className="text-tertiary-light">{t(I18nKey.SETTINGS$SKILLS_LICENSE)}</dt><dd className="text-white">{skill.license}</dd>@@ -199,7 +194,7 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {)}{skill.compatibility && (<>- <dt className="text-content-muted">+ <dt className="text-tertiary-light">{t(I18nKey.SETTINGS$SKILLS_COMPATIBILITY)}</dt><dd className="text-white">{skill.compatibility}</dd>@@ -207,14 +202,14 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {)}{skill.allowed_tools && skill.allowed_tools.length > 0 && (<>- <dt className="text-content-muted">+ <dt className="text-tertiary-light">{t(I18nKey.SETTINGS$SKILLS_ALLOWED_TOOLS)}</dt><dd className="flex flex-wrap gap-1">{skill.allowed_tools.map((tool) => (<spankey={tool}- className="inline-flex items-center rounded-md border border-border px-1.5 py-0.5 font-mono text-[11px] text-content-muted"+ className="inline-flex items-center rounded-md border border-tertiary px-1.5 py-0.5 font-mono text-[11px] text-tertiary-light">{tool}</span>@@ -224,14 +219,14 @@ export function SkillCard({ skill, enabled, onToggle }: SkillCardProps) {)}{skill.metadata && Object.keys(skill.metadata).length > 0 && (<>- <dt className="text-content-muted">+ <dt className="text-tertiary-light">{t(I18nKey.SETTINGS$SKILLS_METADATA)}</dt><dd><ul className="flex flex-col gap-0.5">{Object.entries(skill.metadata).map(([key, value]) => (<li key={key} className="flex gap-2">- <span className="font-mono text-[11px] text-content-muted">+ <span className="font-mono text-[11px] text-tertiary-light">{key}:</span><span className="text-white">{value}</span>diff --git a/src/components/features/skills/skill-type-badge.tsx b/src/components/features/skills/skill-type-badge.tsxindex ccf5951a9b..349a3498a5 100644--- a/src/components/features/skills/skill-type-badge.tsx+++ b/src/components/features/skills/skill-type-badge.tsx@@ -2,9 +2,6 @@ import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import type { SkillType } from "#/types/settings";import { cn } from "#/utils/utils";-import SparkleIcon from "#/icons/sparkle.svg?react";-import KeyIcon from "#/icons/key.svg?react";-import CheckCircleIcon from "#/icons/u-check-circle.svg?react";interface SkillTypeBadgeProps {type: SkillType;@@ -14,25 +11,21 @@ const TYPE_CONFIG: Record<SkillType,{labelKey: I18nKey;- Icon: React.ComponentType<React.SVGProps<SVGSVGElement>>;className: string;}> = {agentskills: {labelKey: I18nKey.SETTINGS$SKILLS_TYPE_AGENTSKILLS,- Icon: SparkleIcon,className:"bg-[rgba(247,206,109,0.12)] text-primary border border-[rgba(247,206,109,0.35)]",},knowledge: {labelKey: I18nKey.SETTINGS$SKILLS_TYPE_KNOWLEDGE,- Icon: KeyIcon,className:"bg-[rgba(96,165,250,0.12)] text-[#93c5fd] border border-[rgba(96,165,250,0.35)]",},repo: {labelKey: I18nKey.SETTINGS$SKILLS_TYPE_REPO,- Icon: CheckCircleIcon,className:"bg-[rgba(52,211,153,0.12)] text-[#6ee7b7] border border-[rgba(52,211,153,0.35)]",},@@ -41,16 +34,14 @@ const TYPE_CONFIG: Record<export function SkillTypeBadge({ type }: SkillTypeBadgeProps) {const { t } = useTranslation("openhands");const config = TYPE_CONFIG[type];- const { Icon } = config;return (<spandata-testid={`skill-type-badge-${type}`}className={cn(- "inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium leading-4",+ "inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium leading-4",config.className,)}>- <Icon className="size-3" />{t(config.labelKey)}</span>);diff --git a/src/components/features/skills/skills-toolbar.tsx b/src/components/features/skills/skills-toolbar.tsxindex 5103ea6f5a..e5c3fd8778 100644--- a/src/components/features/skills/skills-toolbar.tsx+++ b/src/components/features/skills/skills-toolbar.tsx@@ -1,7 +1,7 @@+import { Search, X } from "lucide-react";import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";import { cn } from "#/utils/utils";-import SearchIcon from "#/icons/search.svg?react";import {SKILL_TYPE_FILTER_OPTIONS,type SkillTypeFilter,@@ -34,24 +34,42 @@ export function SkillsToolbar({const { t } = useTranslation("openhands");return (- <div- data-testid="skills-toolbar"- className="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between mb-4"- >- <div className="relative flex-1 lg:max-w-md">- <SearchIcon- className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-content-muted"+ <div data-testid="skills-toolbar" className="flex flex-col gap-6">+ <div+ className={cn(+ "relative flex items-center w-1/2",+ "rounded-lg border border-tertiary bg-base-secondary",+ "focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20",+ "transition-colors",+ )}+ >+ <Search+ className="ml-3 h-4 w-4 text-tertiary-alt shrink-0"aria-hidden/><inputdata-testid="skills-search-input"type="search"value={search}- onChange={(event) => onSearchChange(event.target.value)}+ onChange={(e) => onSearchChange(e.target.value)}placeholder={t(I18nKey.SETTINGS$SKILLS_SEARCH_PLACEHOLDER)}aria-label={t(I18nKey.SETTINGS$SKILLS_SEARCH_PLACEHOLDER)}- className="w-full rounded-full border border-border bg-[rgba(31,31,31,0.6)] py-1.5 pl-9 pr-3 text-sm text-white placeholder:text-content-muted focus:border-primary focus:outline-none"+ className={cn(+ "flex-1 min-w-0 bg-transparent border-0 outline-none",+ "px-3 py-2 text-sm placeholder:text-tertiary-alt",+ "[&::-webkit-search-cancel-button]:hidden",+ )}/>+ {search && (+ <button+ type="button"+ onClick={() => onSearchChange("")}+ aria-label="Clear search"+ className="mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer"+ >+ <X className="h-4 w-4" aria-hidden />+ </button>+ )}</div><div className="flex flex-wrap items-center gap-2">@@ -71,8 +89,8 @@ export function SkillsToolbar({className={cn("rounded-full border px-3 py-1 text-xs font-medium transition-colors cursor-pointer",active- ? "border-primary bg-primary/15 text-primary"- : "border-border bg-transparent text-content-muted hover:border-border-hover hover:text-white",+ ? "border-white/60 bg-white/10 text-white"+ : "border-tertiary bg-transparent text-tertiary-light hover:border-white/40 hover:text-white",)}>{t(FILTER_LABEL_KEY[option])}@@ -83,7 +101,7 @@ export function SkillsToolbar({<spandata-testid="skills-count"- className="text-xs text-content-muted whitespace-nowrap pr-2"+ className="text-xs text-tertiary-light whitespace-nowrap pr-2">{t(I18nKey.SETTINGS$SKILLS_COUNT, { shown, total })}</span>diff --git a/src/i18n/translation.json b/src/i18n/translation.jsonindex 6ad2dcdb70..fc6e6d12d6 100644--- a/src/i18n/translation.json+++ b/src/i18n/translation.json@@ -25464,5 +25464,107 @@"tr": "Düşünmeyi daralt","uk": "Згорнути мислення","ca": "Plegar pensament"+ },+ "MCP$LIBRARY_TITLE": {+ "en": "Library",+ "ja": "ライブラリ",+ "zh-CN": "库",+ "zh-TW": "資料庫",+ "ko-KR": "라이브러리",+ "no": "Bibliotek",+ "ar": "المكتبة",+ "de": "Bibliothek",+ "fr": "Bibliothèque",+ "it": "Libreria",+ "pt": "Biblioteca",+ "es": "Biblioteca",+ "tr": "Kütüphane",+ "uk": "Бібліотека",+ "ca": "Biblioteca"+ },+ "NAV$EXTENSIONS": {+ "en": "Extensions",+ "ja": "拡張機能",+ "zh-CN": "扩展",+ "zh-TW": "擴充功能",+ "ko-KR": "확장 프로그램",+ "no": "Utvidelser",+ "ar": "الإضافات",+ "de": "Erweiterungen",+ "fr": "Extensions",+ "it": "Estensioni",+ "pt": "Extensões",+ "es": "Extensiones",+ "tr": "Uzantılar",+ "uk": "Розширення",+ "ca": "Extensions"+ },+ "NAV$COMING_SOON": {+ "en": "Coming Soon",+ "ja": "近日公開",+ "zh-CN": "即将推出",+ "zh-TW": "即將推出",+ "ko-KR": "곧 출시",+ "no": "Kommer snart",+ "ar": "قريبًا",+ "de": "Demnächst",+ "fr": "Bientôt disponible",+ "it": "Prossimamente",+ "pt": "Em breve",+ "es": "Próximamente",+ "tr": "Yakında",+ "uk": "Незабаром",+ "ca": "Pròximament"+ },+ "SETTINGS$PLUGINS_TITLE": {+ "en": "Plugins",+ "ja": "プラグイン",+ "zh-CN": "插件",+ "zh-TW": "外掛程式",+ "ko-KR": "플러그인",+ "no": "Plugins",+ "ar": "الإضافات",+ "de": "Plugins",+ "fr": "Plugins",+ "it": "Plugin",+ "pt": "Plugins",+ "es": "Complementos",+ "tr": "Eklentiler",+ "uk": "Плагіни",+ "ca": "Connectors"+ },+ "SETTINGS$PLUGINS_DESCRIPTION": {+ "en": "Plugin configuration options will appear here.",+ "ja": "プラグインの設定オプションがここに表示されます。",+ "zh-CN": "插件配置选项将显示在此处。",+ "zh-TW": "外掛程式設定選項將顯示於此。",+ "ko-KR": "플러그인 구성 옵션이 여기에 표시됩니다.",+ "no": "Plugin-konfigurasjonsalternativer vil vises her.",+ "ar": "ستظهر خيارات تكوين الإضافات هنا.",+ "de": "Plugin-Konfigurationsoptionen werden hier angezeigt.",+ "fr": "Les options de configuration des plugins apparaîtront ici.",+ "it": "Le opzioni di configurazione del plugin appariranno qui.",+ "pt": "As opções de configuração de plugins aparecerão aqui.",+ "es": "Las opciones de configuración de complementos aparecerán aquí.",+ "tr": "Eklenti yapılandırma seçenekleri burada görünecek.",+ "uk": "Параметри конфігурації плагінів з'являться тут.",+ "ca": "Les opcions de configuració dels connectors apareixeran aquí."+ },+ "SETTINGS$SKILLS_PAGE_DESCRIPTION": {+ "en": "Discover skills to add to your workspace. Open a card for prompts, curl, and install flows. Search from the sidebar to filter the list. Enable or disable default skills. Disabled skills will not be loaded into agent context.",+ "ja": "ワークスペースに追加するスキルを見つけましょう。カードを開いて、プロンプト、curl、インストール手順を確認できます。サイドバーから検索してリストを絞り込めます。デフォルトスキルの有効化・無効化が可能です。無効化されたスキルはエージェントコンテキストに読み込まれません。",+ "zh-CN": "发现要添加到工作区的技能。打开卡片以查看提示、curl 和安装流程。从侧边栏搜索以过滤列表。启用或禁用默认技能。禁用的技能不会加载到代理上下文中。",+ "zh-TW": "探索要加入工作區的技能。開啟卡片以查看提示、curl 和安裝流程。從側邊欄搜尋以篩選清單。啟用或停用預設技能。停用的技能不會載入到代理上下文中。",+ "ko-KR": "워크스페이스에 추가할 스킬을 찾아보세요. 카드를 열어 프롬프트, curl, 설치 흐름을 확인하세요. 사이드바에서 검색하여 목록을 필터링하세요. 기본 스킬을 활성화하거나 비활성화하세요. 비활성화된 스킬은 에이전트 컨텍스트에 로드되지 않습니다.",+ "no": "Oppdag ferdigheter du kan legge til i arbeidsområdet ditt. Åpne et kort for ledetekster, curl og installasjonsflyt. Søk fra sidefeltet for å filtrere listen. Aktiver eller deaktiver standardferdigheter. Deaktiverte ferdigheter lastes ikke inn i agentkonteksten.",+ "ar": "اكتشف المهارات لإضافتها إلى مساحة عملك. افتح بطاقة لعرض التعليمات وأوامر curl وعمليات التثبيت. ابحث من الشريط الجانبي لتصفية القائمة. قم بتمكين أو تعطيل المهارات الافتراضية. لن يتم تحميل المهارات المعطلة في سياق الوكيل.",+ "de": "Entdecken Sie Fähigkeiten, die Sie Ihrem Arbeitsbereich hinzufügen können. Öffnen Sie eine Karte für Eingabeaufforderungen, curl und Installationsabläufe. Suchen Sie in der Seitenleiste, um die Liste zu filtern. Aktivieren oder deaktivieren Sie Standardfähigkeiten. Deaktivierte Fähigkeiten werden nicht in den Agentenkontext geladen.",+ "fr": "Découvrez des compétences à ajouter à votre espace de travail. Ouvrez une fiche pour les invites, curl et les flux d'installation. Recherchez dans la barre latérale pour filtrer la liste. Activez ou désactivez les compétences par défaut. Les compétences désactivées ne seront pas chargées dans le contexte de l'agent.",+ "it": "Scopri le competenze da aggiungere al tuo spazio di lavoro. Apri una scheda per i prompt, curl e i flussi di installazione. Cerca dalla barra laterale per filtrare l'elenco. Abilita o disabilita le competenze predefinite. Le competenze disabilitate non verranno caricate nel contesto dell'agente.",+ "pt": "Descubra habilidades para adicionar ao seu espaço de trabalho. Abra um cartão para prompts, curl e fluxos de instalação. Pesquise na barra lateral para filtrar a lista. Ative ou desative as habilidades padrão. Habilidades desativadas não serão carregadas no contexto do agente.",+ "es": "Descubre habilidades para agregar a tu espacio de trabajo. Abre una tarjeta para ver indicaciones, curl y flujos de instalación. Busca desde la barra lateral para filtrar la lista. Habilita o deshabilita las habilidades predeterminadas. Las habilidades deshabilitadas no se cargarán en el contexto del agente.",+ "tr": "Çalışma alanınıza eklenecek yetenekleri keşfedin. İstemler, curl ve yükleme akışları için bir kart açın. Listeyi filtrelemek için kenar çubuğundan arama yapın. Varsayılan yetenekleri etkinleştirin veya devre dışı bırakın. Devre dışı bırakılan yetenekler ajan bağlamına yüklenmez.",+ "uk": "Відкривайте навички для додавання до вашого робочого простору. Відкрийте картку для запитів, curl та процесів встановлення. Шукайте на бічній панелі, щоб фільтрувати список. Увімкніть або вимкніть навички за замовчуванням. Вимкнені навички не завантажуватимуться в контекст агента.",+ "ca": "Descobreix habilitats per afegir al teu espai de treball. Obre una targeta per veure indicacions, curl i fluxos d'instal·lació. Cerca des de la barra lateral per filtrar la llista. Activeu o desactiveu les habilitats predeterminades. Les habilitats desactivades no es carregaran al context de l'agent."}}diff --git a/src/routes.ts b/src/routes.tsindex 4edd5de8a5..74c572a50f 100644--- a/src/routes.ts+++ b/src/routes.ts@@ -12,6 +12,7 @@ export default [route("conversations/:conversationId", "routes/conversation.tsx"),route("launch", "routes/launch.tsx"),route("skills", "routes/skills-settings.tsx"),+ route("plugins", "routes/skills-plugins.tsx"),route("mcp", "routes/mcp.tsx"),route("settings", "routes/settings.tsx", [index("routes/llm-settings.tsx"),diff --git a/src/routes/mcp.tsx b/src/routes/mcp.tsxindex b77974390d..10ab763c30 100644--- a/src/routes/mcp.tsx+++ b/src/routes/mcp.tsx@@ -1,10 +1,9 @@import React from "react";import { AxiosError } from "axios";+import { ExtensionsNavigation } from "#/components/features/skills/extensions-navigation";import { useTranslation } from "react-i18next";import { I18nKey } from "#/i18n/declaration";-import { Typography } from "#/ui/typography";import { BrandButton } from "#/components/features/settings/brand-button";-import { BackendSyncedSettingsBadge } from "#/components/features/settings/backend-synced-settings-badge";import { ConfirmationModal } from "#/components/shared/modals/confirmation-modal";import { useSettings } from "#/hooks/query/use-settings";import { useDeleteMcpServer } from "#/hooks/mutation/use-delete-mcp-server";@@ -118,96 +117,98 @@ export default function MCPPage() {onError: (err) => {const message = retrieveAxiosErrorMessage(err as AxiosError);displayErrorToast(message || t(I18nKey.ERROR$GENERIC));+ setServerToDelete(null);},});};if (isLoading || !settings) {return (- <main- data-testid="mcp-page"- className="h-full flex items-center justify-center"- >- <div className="h-8 w-8 rounded-full border-2 border-tertiary border-t-primary animate-spin" />- </main>+ <div data-testid="mcp-page" className="flex h-full gap-10">+ <ExtensionsNavigation />+ <div className="flex h-full flex-1 items-center justify-center">+ <div className="h-8 w-8 rounded-full border-2 border-tertiary border-t-primary animate-spin" />+ </div>+ </div>);}return (- <main- data-testid="mcp-page"- className="h-full overflow-auto custom-scrollbar-always px-6 md:px-10 pt-8 pb-12"- >- <div className="max-w-5xl mx-auto flex flex-col gap-8">- <header className="flex flex-col gap-2">- <div className="flex items-end justify-between gap-4">- <div className="flex flex-col gap-2">- <Typography.H2>{t(I18nKey.SETTINGS$MCP_TITLE)}</Typography.H2>- <BackendSyncedSettingsBadge />+ <div data-testid="mcp-page" className="flex h-full gap-10">+ <ExtensionsNavigation />+ <main className="flex-1 min-w-0 overflow-auto custom-scrollbar-always pr-[14px] pt-8 pb-12">+ <div className="max-w-5xl flex flex-col gap-6">+ <div className="min-w-0">+ <div className="flex items-start justify-between gap-4">+ <div className="space-y-1">+ <h2 className="text-xl font-semibold leading-6 text-foreground">+ {t(I18nKey.SETTINGS$MCP_TITLE)}+ </h2>+ <div className="max-w-2xl text-sm text-tertiary-light">+ {t(I18nKey.MCP$PAGE_DESCRIPTION)}+ </div>+ </div>+ <BrandButton+ type="button"+ variant="secondary"+ testId="mcp-add-custom-server"+ onClick={() => setEditingServer({ id: "", type: "sse" })}+ >+ {t(I18nKey.MCP$ADD_CUSTOM)}+ </BrandButton></div>- <BrandButton- type="button"- variant="secondary"- testId="mcp-add-custom-server"- onClick={() => setEditingServer({ id: "", type: "sse" })}- >- {t(I18nKey.MCP$ADD_CUSTOM)}- </BrandButton></div>- <Typography.Paragraph className="text-sm text-tertiary-alt">- {t(I18nKey.MCP$PAGE_DESCRIPTION)}- </Typography.Paragraph>- </header>-- <MarketplaceSearch value={searchQuery} onChange={setSearchQuery} />-- <section className="flex flex-col gap-3">- <h2 className="text-base font-semibold">- {t(I18nKey.MCP$INSTALLED_TITLE)}- </h2>- <InstalledServersSection- servers={filteredInstalledServers}- hasAnyInstalled={allServers.length > 0}++ <MarketplaceSearch value={searchQuery} onChange={setSearchQuery} />++ <section className="flex flex-col gap-3">+ <h2 className="text-base font-semibold text-foreground">+ {t(I18nKey.MCP$INSTALLED_TITLE)}+ </h2>+ <InstalledServersSection+ servers={filteredInstalledServers}+ hasAnyInstalled={allServers.length > 0}+ query={searchQuery}+ onEdit={handleEdit}+ onDelete={handleDeleteClick}+ />+ </section>++ <MarketplaceSection+ isInstalled={isInstalled}+ backendKind={backendKind}+ onSelect={handleMarketplaceClick}query={searchQuery}- onEdit={handleEdit}- onDelete={handleDeleteClick}/>- </section>-- <MarketplaceSection- isInstalled={isInstalled}- backendKind={backendKind}- onSelect={handleMarketplaceClick}- query={searchQuery}- />- </div>+ </div>- {installEntry && (- <InstallServerModal- entry={installEntry}- onClose={() => setInstallEntry(null)}- />- )}-- {/* Custom (or non-marketplace) server editor — falls back to the- legacy MCPServerForm for full control. The empty-id sentinel- (`{ id: "", type: "sse" }`) means "add new". */}- {editingServer && (- <CustomServerEditor- server={editingServer}- existingServers={allServers}- onClose={() => setEditingServer(null)}- />- )}-- {serverToDelete && (- <ConfirmationModal- text={t(I18nKey.SETTINGS$MCP_CONFIRM_DELETE)}- onCancel={() => setServerToDelete(null)}- onConfirm={handleConfirmDelete}- isConfirming={isDeleting}- />- )}- </main>+ {installEntry && (+ <InstallServerModal+ entry={installEntry}+ onClose={() => setInstallEntry(null)}+ />+ )}++ {/* Custom (or non-marketplace) server editor — falls back to the+ legacy MCPServerForm for full control. The empty-id sentinel+ (`{ id: "", type: "sse" }`) means "add new". */}+ {editingServer && (+ <CustomServerEditor+ server={editingServer}+ existingServers={allServers}+ onClose={() => setEditingServer(null)}+ />+ )}++ {serverToDelete && (+ <ConfirmationModal+ text={t(I18nKey.SETTINGS$MCP_CONFIRM_DELETE)}+ onCancel={() => setServerToDelete(null)}+ onConfirm={handleConfirmDelete}+ isConfirming={isDeleting}+ />+ )}+ </main>+ </div>);}diff --git a/src/routes/skills-plugins.tsx b/src/routes/skills-plugins.tsxnew file mode 100644index 0000000000..f71efcdb34--- /dev/null+++ b/src/routes/skills-plugins.tsx@@ -0,0 +1,23 @@+import { useTranslation } from "react-i18next";+import { ExtensionsNavigation } from "#/components/features/skills/extensions-navigation";+import { I18nKey } from "#/i18n/declaration";++export default function SkillsPluginsScreen() {+ const { t } = useTranslation("openhands");++ return (+ <div data-testid="skills-plugins-screen" className="flex h-full gap-10">+ <ExtensionsNavigation />+ <section className="flex-1 min-w-0 overflow-auto custom-scrollbar-always pr-[14px] pt-8">+ <div className="min-w-0 space-y-1 mb-4">+ <h2 className="text-xl font-semibold leading-6 text-foreground">+ {t(I18nKey.SETTINGS$PLUGINS_TITLE)}+ </h2>+ <div className="max-w-2xl text-sm text-tertiary-light">+ {t(I18nKey.SETTINGS$PLUGINS_DESCRIPTION)}+ </div>+ </div>+ </section>+ </div>+ );+}diff --git a/src/routes/skills-settings.tsx b/src/routes/skills-settings.tsxindex b96bc44274..507c59af0d 100644--- a/src/routes/skills-settings.tsx+++ b/src/routes/skills-settings.tsx@@ -3,17 +3,12 @@ import { useTranslation } from "react-i18next";import { useSaveSettings } from "#/hooks/mutation/use-save-settings";import { useSettings } from "#/hooks/query/use-settings";import { useSkills } from "#/hooks/query/use-skills";-import { BrandButton } from "#/components/features/settings/brand-button";+import { ExtensionsNavigation } from "#/components/features/skills/extensions-navigation";import { SkillCard } from "#/components/features/skills/skill-card";import { SkillsToolbar } from "#/components/features/skills/skills-toolbar";import type { SkillTypeFilter } from "#/components/features/skills/skill-type-filter";import { I18nKey } from "#/i18n/declaration";-import { Typography } from "#/ui/typography";-import InfoCircleIcon from "#/icons/info-circle.svg?react";-import {- displayErrorToast,- displaySuccessToast,-} from "#/utils/custom-toast-handlers";+import { displayErrorToast } from "#/utils/custom-toast-handlers";import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";import type { SkillInfo } from "#/types/settings";@@ -34,18 +29,21 @@ function matchesSearch(skill: SkillInfo, query: string): boolean {function SkillsSettingsScreen() {const { t } = useTranslation("openhands");- const { mutate: saveSettings, isPending } = useSaveSettings();+ const { mutate: saveSettings } = useSaveSettings();const { data: settings, isLoading: settingsLoading } = useSettings();const { data: skills, isLoading: skillsLoading } = useSkills();const [disabledSet, setDisabledSet] = React.useState<Set<string>>(new Set());- const [hasChanges, setHasChanges] = React.useState(false);+ const [hasHydratedInitialSettings, setHasHydratedInitialSettings] =+ React.useState(false);const [searchQuery, setSearchQuery] = React.useState("");const [typeFilter, setTypeFilter] = React.useState<SkillTypeFilter>("all");+ // Sync local state with server settings when data first arrivesReact.useEffect(() => {if (settings?.disabled_skills) {setDisabledSet(new Set(settings.disabled_skills));+ setHasHydratedInitialSettings(true);}}, [settings?.disabled_skills]);@@ -59,119 +57,103 @@ function SkillsSettingsScreen() {}return next;});- setHasChanges(true);};- const handleSave = () => {+ // Auto-save skill toggles once initial settings are loaded.+ React.useEffect(() => {+ if (!hasHydratedInitialSettings) return;saveSettings({ disabled_skills: Array.from(disabledSet) },{- onSuccess: () => {- displaySuccessToast(t(I18nKey.SETTINGS$SAVED));- setHasChanges(false);- },onError: (error) => {const errorMessage = retrieveAxiosErrorMessage(error);displayErrorToast(errorMessage || t(I18nKey.ERROR$GENERIC));},},);- };+ }, [disabledSet, hasHydratedInitialSettings, saveSettings, t]);const isLoading = settingsLoading || skillsLoading || !settings;- const sortedSkills = React.useMemo(() => {+ const filteredSkills = React.useMemo(() => {if (!skills) return [];- return [...skills].sort((a, b) => a.name.localeCompare(b.name));- }, [skills]);-- const filteredSkills = React.useMemo(- () =>- sortedSkills.filter((skill) => {- const typeMatch = typeFilter === "all" || skill.type === typeFilter;- return typeMatch && matchesSearch(skill, searchQuery.trim());- }),- [sortedSkills, searchQuery, typeFilter],- );-- const totalSkills = sortedSkills.length;- const shownSkills = filteredSkills.length;+ return skills.filter(+ (skill) =>+ (typeFilter === "all" || skill.type === typeFilter) &&+ matchesSearch(skill, searchQuery),+ );+ }, [skills, typeFilter, searchQuery]);return (- <div data-testid="skills-settings-screen" className="flex flex-col h-full">- <div- data-testid="skills-settings-description-badge"- className="flex items-center gap-2 bg-[rgba(31,31,31,0.4)] border border-[#242424] rounded-full px-2.5 py-1 mt-4 mb-4 self-start"- >- <InfoCircleIcon width={12} height={12} className="text-[#8c8c8c]" />- <Typography.Text className="text-[11px] font-medium text-[#8c8c8c] leading-5">- {t(I18nKey.SETTINGS$SKILLS_DESCRIPTION)}- </Typography.Text>- </div>-- <div className="flex-1 overflow-auto custom-scrollbar-always">- {isLoading && (- <div className="grid grid-cols-1 gap-3 lg:grid-cols-2">- {[1, 2, 3, 4].map((i) => (- <div- key={i}- className="h-32 rounded-2xl border border-border bg-surface-card animate-pulse"- />- ))}+ <div data-testid="skills-settings-screen" className="flex h-full gap-10">+ <ExtensionsNavigation />+ <div className="flex-1 min-w-0 flex flex-col h-full overflow-auto custom-scrollbar-always pr-[14px] pt-8 pb-12">+ <div className="max-w-5xl flex flex-col gap-6">+ <div className="min-w-0 space-y-1">+ <h2 className="text-xl font-semibold leading-6 text-foreground">+ {t(I18nKey.SETTINGS$SKILLS_TITLE)}+ </h2>+ <div+ data-testid="skills-settings-description"+ className="max-w-2xl text-sm text-tertiary-light"+ >+ {t(I18nKey.SETTINGS$SKILLS_PAGE_DESCRIPTION)}+ </div></div>- )}-- {!isLoading && totalSkills === 0 && (- <p className="text-sm text-content-muted">- {t(I18nKey.SETTINGS$SKILLS_NO_SKILLS)}- </p>- )}-- {!isLoading && totalSkills > 0 && (- <>- <SkillsToolbar- search={searchQuery}- onSearchChange={setSearchQuery}- typeFilter={typeFilter}- onTypeFilterChange={setTypeFilter}- shown={shownSkills}- total={totalSkills}- />- {shownSkills === 0 ? (- <p- data-testid="skills-no-match"- className="text-sm text-content-muted"- >- {t(I18nKey.SETTINGS$SKILLS_NO_MATCH)}- </p>- ) : (- <div className="grid grid-cols-1 gap-3 lg:grid-cols-2">- {filteredSkills.map((skill) => (- <SkillCard- key={skill.name}- skill={skill}- enabled={!disabledSet.has(skill.name)}- onToggle={(enabled) => handleToggle(skill.name, enabled)}- />- ))}- </div>- )}- </>- )}- </div>-- <div className="flex gap-6 p-6 justify-end">- <BrandButton- testId="skills-save-button"- variant="primary"- type="button"- isDisabled={isPending || !hasChanges}- onClick={handleSave}- >- {!isPending && t(I18nKey.SETTINGS$SAVE_CHANGES)}- {isPending && t(I18nKey.SETTINGS$SAVING)}- </BrandButton>+ {isLoading && (+ <div className="flex flex-col gap-4">+ {[1, 2, 3].map((i) => (+ <div+ key={i}+ className="h-24 rounded-2xl bg-tertiary animate-pulse"+ />+ ))}+ </div>+ )}++ {!isLoading && (!skills || skills.length === 0) && (+ <p className="text-sm text-tertiary">+ {t(I18nKey.SETTINGS$SKILLS_NO_SKILLS)}+ </p>+ )}++ {!isLoading && skills && skills.length > 0 && (+ <>+ <SkillsToolbar+ search={searchQuery}+ onSearchChange={setSearchQuery}+ typeFilter={typeFilter}+ onTypeFilterChange={setTypeFilter}+ shown={filteredSkills.length}+ total={skills.length}+ />+ {filteredSkills.length === 0 ? (+ <p+ data-testid="skills-no-match"+ className="text-sm text-tertiary"+ >+ {t(I18nKey.SETTINGS$SKILLS_NO_MATCH)}+ </p>+ ) : (+ <section className="flex flex-col gap-3">+ <div className="grid grid-cols-2 gap-3">+ {filteredSkills.map((skill) => (+ <SkillCard+ key={skill.name}+ skill={skill}+ enabled={!disabledSet.has(skill.name)}+ onToggle={(enabled) =>+ handleToggle(skill.name, enabled)+ }+ />+ ))}+ </div>+ </section>+ )}+ </>+ )}+ </div></div></div>);