Skip to content

🙌 OpenHands: AI-Driven Development

Design updates: navigation polish, modal tokens, and git control bar fixes (#884)

FraterCCCLXIII936b950dc085
diff --git a/__tests__/components/automations/detail/prompt-section.test.tsx b/__tests__/components/automations/detail/prompt-section.test.tsx
new file mode 100644
index 0000000000..b881c97ba6
--- /dev/null
+++ b/__tests__/components/automations/detail/prompt-section.test.tsx
@@ -0,0 +1,55 @@
+import { describe, expect, it } from "vitest";
+import React from "react";
+import { render, screen, fireEvent } from "@testing-library/react";
+
+import { I18nKey } from "#/i18n/declaration";
+import { PromptSection } from "#/components/features/automations/detail/prompt-section";
+
+describe("PromptSection", () => {
+ it("does not show a toggle for short prompts", () => {
+ render(<PromptSection prompt="Short prompt." />);
+
+ expect(screen.getByTestId("automation-prompt-content")).toHaveTextContent(
+ "Short prompt.",
+ );
+ expect(
+ screen.queryByTestId("automation-prompt-toggle"),
+ ).not.toBeInTheDocument();
+ expect(
+ screen.queryByTestId("automation-prompt-fade"),
+ ).not.toBeInTheDocument();
+ });
+
+ it("collapses long prompts with a fade and expands on toggle", () => {
+ const longPrompt = Array.from({ length: 40 }, (_, index) => `Line ${index + 1}.`).join(
+ "\n",
+ );
+
+ Object.defineProperty(HTMLElement.prototype, "scrollHeight", {
+ configurable: true,
+ get() {
+ return this.textContent?.includes("Line 40.") ? 480 : 120;
+ },
+ });
+
+ render(<PromptSection prompt={longPrompt} />);
+
+ expect(screen.getByTestId("automation-prompt-fade")).toBeInTheDocument();
+ expect(screen.getByTestId("automation-prompt-content")).toHaveClass("max-h-60");
+ expect(screen.getByTestId("automation-prompt-toggle")).toHaveTextContent(
+ I18nKey.COMMON$VIEW_MORE,
+ );
+
+ fireEvent.click(screen.getByTestId("automation-prompt-toggle"));
+
+ expect(
+ screen.queryByTestId("automation-prompt-fade"),
+ ).not.toBeInTheDocument();
+ expect(screen.getByTestId("automation-prompt-content")).not.toHaveClass(
+ "max-h-60",
+ );
+ expect(screen.getByTestId("automation-prompt-toggle")).toHaveTextContent(
+ I18nKey.COMMON$VIEW_LESS,
+ );
+ });
+});
diff --git a/__tests__/components/features/chat/change-agent-context-menu.test.tsx b/__tests__/components/features/chat/change-agent-context-menu.test.tsx
new file mode 100644
index 0000000000..20339a22af
--- /dev/null
+++ b/__tests__/components/features/chat/change-agent-context-menu.test.tsx
@@ -0,0 +1,62 @@
+import { fireEvent, screen } from "@testing-library/react";
+import { describe, expect, it, vi } from "vitest";
+import { renderWithProviders } from "test-utils";
+import { ChangeAgentContextMenu } from "#/components/features/chat/change-agent-context-menu";
+
+describe("ChangeAgentContextMenu", () => {
+ it("marks the active mode with hover background and a checkmark", () => {
+ renderWithProviders(
+ <ChangeAgentContextMenu
+ activeMode="code"
+ onClose={vi.fn()}
+ onCodeClick={vi.fn()}
+ onPlanClick={vi.fn()}
+ />,
+ );
+
+ const codeOption = screen.getByTestId("code-option");
+ const planOption = screen.getByTestId("plan-option");
+
+ expect(codeOption).toHaveClass("bg-[var(--oh-interactive-hover)]");
+ expect(planOption).not.toHaveClass("bg-[var(--oh-interactive-hover)]");
+ expect(codeOption.querySelectorAll("svg")).toHaveLength(2);
+ expect(planOption.querySelectorAll("svg")).toHaveLength(1);
+ });
+
+ it("shows plan as active when conversation mode is plan", () => {
+ renderWithProviders(
+ <ChangeAgentContextMenu
+ activeMode="plan"
+ onClose={vi.fn()}
+ onCodeClick={vi.fn()}
+ onPlanClick={vi.fn()}
+ />,
+ );
+
+ const codeOption = screen.getByTestId("code-option");
+ const planOption = screen.getByTestId("plan-option");
+
+ expect(planOption).toHaveClass("bg-[var(--oh-interactive-hover)]");
+ expect(codeOption).not.toHaveClass("bg-[var(--oh-interactive-hover)]");
+ expect(planOption.querySelectorAll("svg")).toHaveLength(2);
+ });
+
+ it("calls onCodeClick and onClose when code is selected", () => {
+ const onClose = vi.fn();
+ const onCodeClick = vi.fn();
+
+ renderWithProviders(
+ <ChangeAgentContextMenu
+ activeMode="plan"
+ onClose={onClose}
+ onCodeClick={onCodeClick}
+ onPlanClick={vi.fn()}
+ />,
+ );
+
+ fireEvent.click(screen.getByTestId("code-option"));
+
+ expect(onCodeClick).toHaveBeenCalledTimes(1);
+ expect(onClose).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/__tests__/components/features/chat/git-control-bar-pull-button.test.tsx b/__tests__/components/features/chat/git-control-bar-pull-button.test.tsx
new file mode 100644
index 0000000000..83f86e2370
--- /dev/null
+++ b/__tests__/components/features/chat/git-control-bar-pull-button.test.tsx
@@ -0,0 +1,64 @@
+import { render, screen } from "@testing-library/react";
+import { describe, it, expect, vi } from "vitest";
+import { GitControlBarPullButton } from "#/components/features/chat/git-control-bar-pull-button";
+
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({
+ t: (key: string) => key,
+ }),
+}));
+
+vi.mock("#/hooks/use-tracking", () => ({
+ useTracking: () => ({
+ trackPullButtonClick: vi.fn(),
+ }),
+}));
+
+vi.mock("#/icons/u-arrow-down.svg?react", () => ({
+ default: ({ color }: { color?: string }) => (
+ <svg data-testid="pull-icon" data-color={color ?? ""} />
+ ),
+}));
+
+describe("GitControlBarPullButton", () => {
+ it("uses muted theme colors when inactive during conversation loading", () => {
+ render(
+ <GitControlBarPullButton
+ onSuggestionsClick={vi.fn()}
+ hasRepository
+ providerTokensReady
+ isConversationReady={false}
+ />,
+ );
+
+ const button = screen.getByRole("button");
+ expect(button).toBeDisabled();
+ expect(button.className).toContain("text-[var(--oh-muted)]");
+ expect(button.className).toContain("opacity-50");
+ expect(button.className).not.toContain("hover:bg-tertiary");
+ expect(screen.getByTestId("pull-icon")).toHaveAttribute(
+ "data-color",
+ "var(--oh-muted)",
+ );
+ });
+
+ it("uses active theme colors when conversation is ready", () => {
+ render(
+ <GitControlBarPullButton
+ onSuggestionsClick={vi.fn()}
+ hasRepository
+ providerTokensReady
+ isConversationReady
+ />,
+ );
+
+ const button = screen.getByRole("button");
+ expect(button).not.toBeDisabled();
+ expect(button.className).toContain("text-white");
+ expect(button.className).toContain("hover:bg-tertiary");
+ expect(screen.getByTestId("pull-icon")).toHaveAttribute(
+ "data-color",
+ "white",
+ );
+ });
+});
diff --git a/__tests__/components/features/chat/git-control-bar.test.tsx b/__tests__/components/features/chat/git-control-bar.test.tsx
index 8123a4630c..b1c067d0ac 100644
--- a/__tests__/components/features/chat/git-control-bar.test.tsx
+++ b/__tests__/components/features/chat/git-control-bar.test.tsx
@@ -7,6 +7,7 @@ import { useActiveConversation } from "#/hooks/query/use-active-conversation";
import { useTaskPolling } from "#/hooks/query/use-task-polling";
import { useLocalGitInfo } from "#/hooks/query/use-local-git-info";
import { useUnifiedWebSocketStatus } from "#/hooks/use-unified-websocket-status";
+import { useConversationWebSocket } from "#/contexts/conversation-websocket-context";
import { useSendMessage } from "#/hooks/use-send-message";
import { useUpdateConversationRepository } from "#/hooks/mutation/use-update-conversation-repository";
import { useHomeStore } from "#/stores/home-store";
@@ -33,6 +34,7 @@ vi.mock("#/hooks/query/use-active-conversation");
vi.mock("#/hooks/query/use-task-polling");
vi.mock("#/hooks/query/use-local-git-info");
vi.mock("#/hooks/use-unified-websocket-status");
+vi.mock("#/contexts/conversation-websocket-context");
vi.mock("#/hooks/use-send-message");
vi.mock("#/hooks/mutation/use-update-conversation-repository");
vi.mock("#/stores/home-store");
@@ -142,6 +144,9 @@ describe("GitControlBar repo button visibility", () => {
data: null,
} as unknown as ReturnType<typeof useLocalGitInfo>);
vi.mocked(useUnifiedWebSocketStatus).mockReturnValue("OPEN");
+ vi.mocked(useConversationWebSocket).mockReturnValue({
+ isLoadingHistory: false,
+ } as ReturnType<typeof useConversationWebSocket>);
vi.mocked(useSendMessage).mockReturnValue({
send: vi.fn(),
} as unknown as ReturnType<typeof useSendMessage>);
@@ -192,6 +197,18 @@ describe("GitControlBar repo button visibility", () => {
const button = screen.getByTestId("git-control-bar-repo-button");
expect(button).toHaveAttribute("data-disabled", "true");
});
+
+ it("renders the repo button as disabled while conversation history is loading", () => {
+ vi.mocked(useActiveBackend).mockReturnValue(makeBackend("cloud"));
+ vi.mocked(useConversationWebSocket).mockReturnValue({
+ isLoadingHistory: true,
+ } as ReturnType<typeof useConversationWebSocket>);
+
+ renderWithProviders(<GitControlBar onSuggestionsClick={vi.fn()} />);
+
+ const button = screen.getByTestId("git-control-bar-repo-button");
+ expect(button).toHaveAttribute("data-disabled", "true");
+ });
});
describe("GitControlBar - Auto-scroll on clone (issue #817)", () => {
diff --git a/__tests__/routes/automation-detail.test.tsx b/__tests__/routes/automation-detail.test.tsx
index a05128c50b..2a64ab2357 100644
--- a/__tests__/routes/automation-detail.test.tsx
+++ b/__tests__/routes/automation-detail.test.tsx
@@ -187,7 +187,9 @@ describe("AutomationDetail — backend-change guard", () => {
it("dispatches the automation when Run now is clicked", async () => {
renderDetail();
- const runNow = await screen.findByRole("button", { name: "Run now" });
+ const runNow = await screen.findByRole("button", {
+ name: I18nKey.AUTOMATIONS$RUN_NOW,
+ });
fireEvent.click(runNow);
await waitFor(() => {
@@ -206,7 +208,9 @@ describe("AutomationDetail — backend-change guard", () => {
});
const user = userEvent.setup();
renderDetail();
- const runNow = await screen.findByRole("button", { name: "Run now" });
+ const runNow = await screen.findByRole("button", {
+ name: I18nKey.AUTOMATIONS$RUN_NOW,
+ });
// Act — userEvent honors the disabled attribute and suppresses the click.
await user.click(runNow);
diff --git a/__tests__/routes/skills-settings.test.tsx b/__tests__/routes/skills-settings.test.tsx
index deacf69ebf..224e9beb12 100644
--- a/__tests__/routes/skills-settings.test.tsx
+++ b/__tests__/routes/skills-settings.test.tsx
@@ -87,7 +87,7 @@ describe("SkillsSettingsScreen", () => {
"skills-settings-description",
);
expect(description).toHaveTextContent("SETTINGS$SKILLS_PAGE_DESCRIPTION");
- expect(screen.getByText("NAV$EXTENSIONS")).toBeInTheDocument();
+ expect(screen.getByText("NAV$CUSTOMIZE")).toBeInTheDocument();
expect(screen.getByTestId("sidebar-extensions-/skills")).toHaveTextContent(
"Skills",
);
diff --git a/__tests__/utils/mobile-section-nav.test.ts b/__tests__/utils/mobile-section-nav.test.ts
index 0b601840a5..b0d57f930f 100644
--- a/__tests__/utils/mobile-section-nav.test.ts
+++ b/__tests__/utils/mobile-section-nav.test.ts
@@ -20,12 +20,12 @@ describe("getMobileTopBarState", () => {
expect(getMobileTopBarState("/skills")).toEqual({
mode: "back",
backTo: "/customize",
- backLabelKey: I18nKey.NAV$EXTENSIONS,
+ backLabelKey: I18nKey.NAV$CUSTOMIZE,
});
expect(getMobileTopBarState("/mcp")).toEqual({
mode: "back",
backTo: "/customize",
- backLabelKey: I18nKey.NAV$EXTENSIONS,
+ backLabelKey: I18nKey.NAV$CUSTOMIZE,
});
});
diff --git a/src/components/features/automations/add-automation-modal.tsx b/src/components/features/automations/add-automation-modal.tsx
index 0cbf0d9820..74c25d8e25 100644
--- a/src/components/features/automations/add-automation-modal.tsx
+++ b/src/components/features/automations/add-automation-modal.tsx
@@ -2,6 +2,8 @@ import { useTranslation } from "react-i18next";
import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";
import { ModalCloseButton } from "#/components/shared/modals/modal-close-button";
import { I18nKey } from "#/i18n/declaration";
+import { cn } from "#/utils/utils";
+import { modalTitleLgClassName } from "#/utils/modal-classes";
import { CreateInstructionsContent } from "./create-instructions";
interface AddAutomationModalProps {
@@ -33,7 +35,7 @@ export function AddAutomationModal({
<header className="flex-shrink-0 px-6 pb-4 pt-6">
<h2
id="add-automation-modal-title"
- className="pr-6 text-lg font-semibold"
+ className={cn("pr-6", modalTitleLgClassName)}
>
{t(I18nKey.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}
</h2>
diff --git a/src/components/features/automations/automation-action-button-classes.ts b/src/components/features/automations/automation-action-button-classes.ts
index 8d8274995a..532a8aef7e 100644
--- a/src/components/features/automations/automation-action-button-classes.ts
+++ b/src/components/features/automations/automation-action-button-classes.ts
@@ -1,6 +1,13 @@
-export const automationIconActionButtonClassName =
- "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted transition-colors hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted";
+import { cn } from "#/utils/utils";
+import { dropdownInstantColorClassName } from "#/utils/dropdown-classes";
+
+export const automationIconActionButtonClassName = cn(
+ "inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted",
+ dropdownInstantColorClassName,
+);
/** Text + icon Run now control on automation grid cards (matches kebab height). */
-export const automationRunNowTextButtonClassName =
- "inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 text-xs text-muted transition-colors hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted";
+export const automationRunNowTextButtonClassName = cn(
+ "inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 text-xs text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted",
+ dropdownInstantColorClassName,
+);
diff --git a/src/components/features/automations/automation-view-toggle.tsx b/src/components/features/automations/automation-view-toggle.tsx
index 1f37fbb265..fdcfbde370 100644
--- a/src/components/features/automations/automation-view-toggle.tsx
+++ b/src/components/features/automations/automation-view-toggle.tsx
@@ -6,6 +6,7 @@ import { ContextMenuListItem } from "#/components/features/context-menu/context-
import { I18nKey } from "#/i18n/declaration";
import { ContextMenu } from "#/ui/context-menu";
import { cn } from "#/utils/utils";
+import { dropdownMenuRowIconWrapperClassName } from "#/utils/dropdown-classes";
import type { AutomationViewMode } from "./automation-view-mode";
interface AutomationViewToggleProps {
@@ -45,10 +46,7 @@ function ViewMenuItemContent({
}) {
return (
<span className="flex min-w-0 w-full items-center gap-2">
- <span
- className="flex shrink-0 items-center text-[var(--oh-muted)] transition-colors group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:size-4 [&_svg]:text-current"
- aria-hidden
- >
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
<Icon />
</span>
<span className="min-w-0 flex-1 truncate">{label}</span>
diff --git a/src/components/features/automations/delete-confirmation-modal.tsx b/src/components/features/automations/delete-confirmation-modal.tsx
index db133e7722..6d2ea1d102 100644
--- a/src/components/features/automations/delete-confirmation-modal.tsx
+++ b/src/components/features/automations/delete-confirmation-modal.tsx
@@ -1,6 +1,7 @@
import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import XMarkIcon from "#/icons/x-mark.svg?react";
+import { modalTitleLgMediumClassName } from "#/utils/modal-classes";
interface DeleteConfirmationModalProps {
automationName: string;
@@ -39,7 +40,7 @@ export function DeleteConfirmationModal({
<XMarkIcon className="size-5" />
</button>
- <h2 className="text-lg font-medium text-white">
+ <h2 className={modalTitleLgMediumClassName}>
{t(I18nKey.AUTOMATIONS$DELETE_CONFIRM_TITLE)}
</h2>
<p className="mt-2 text-sm text-muted">
diff --git a/src/components/features/automations/detail/back-link.tsx b/src/components/features/automations/detail/back-link.tsx
index bf91d89ed1..43d24c2ed7 100644
--- a/src/components/features/automations/detail/back-link.tsx
+++ b/src/components/features/automations/detail/back-link.tsx
@@ -1,18 +1,13 @@
import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
-import { NavigationLink } from "#/components/shared/navigation-link";
-import ChevronLeftIcon from "#/icons/chevron-left.svg?react";
+import { BackNavButton } from "#/components/shared/buttons/back-nav-button";
export function BackLink() {
const { t } = useTranslation("openhands");
return (
- <NavigationLink
- to="/automations"
- className="inline-flex items-center gap-1.5 text-sm text-muted hover:text-foreground"
- >
- <ChevronLeftIcon className="size-4" />
+ <BackNavButton to="/automations">
{t(I18nKey.AUTOMATIONS$DETAIL$BACK_TO_LIST)}
- </NavigationLink>
+ </BackNavButton>
);
}
diff --git a/src/components/features/automations/detail/detail-header.tsx b/src/components/features/automations/detail/detail-header.tsx
index ae27bc7119..e2a13abe46 100644
--- a/src/components/features/automations/detail/detail-header.tsx
+++ b/src/components/features/automations/detail/detail-header.tsx
@@ -8,6 +8,7 @@ import PowerIcon from "#/icons/power.svg?react";
import DownloadIcon from "#/icons/download.svg?react";
import TrashIcon from "#/icons/trash.svg?react";
import EditIcon from "#/icons/u-edit.svg?react";
+import PlayIcon from "#/icons/play.svg?react";
import { useHasPermission } from "#/hooks/use-has-permission";
import { ActiveStatusBadge } from "./active-status-badge";
@@ -79,11 +80,12 @@ export function DetailHeader({
{canManage && onRunNow && (
<button
type="button"
- className="rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60"
+ className="inline-flex items-center gap-1.5 rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60"
disabled={isRunningNow || !automation.enabled}
onClick={onRunNow}
>
- {isRunningNow ? "Starting…" : "Run now"}
+ <PlayIcon className="size-3.5 shrink-0" aria-hidden />
+ {isRunningNow ? "Starting…" : t(I18nKey.AUTOMATIONS$RUN_NOW)}
</button>
)}
{canManage && (
diff --git a/src/components/features/automations/detail/edit-automation-modal.tsx b/src/components/features/automations/detail/edit-automation-modal.tsx
index f22d4ff8d0..a8b4995a8a 100644
--- a/src/components/features/automations/detail/edit-automation-modal.tsx
+++ b/src/components/features/automations/detail/edit-automation-modal.tsx
@@ -11,6 +11,7 @@ import {
displaySuccessToast,
displayErrorToast,
} from "#/utils/custom-toast-handlers";
+import { modalTitleLgMediumClassName } from "#/utils/modal-classes";
import {
parseCronSchedule,
buildCronSchedule,
@@ -219,7 +220,7 @@ export function EditAutomationModal({
<XMarkIcon className="size-5" />
</button>
- <h2 className="text-lg font-medium text-white">
+ <h2 className={modalTitleLgMediumClassName}>
{t(I18nKey.AUTOMATIONS$EDIT_TITLE)}
</h2>
diff --git a/src/components/features/automations/detail/prompt-section.tsx b/src/components/features/automations/detail/prompt-section.tsx
index 96767397bf..e43ba0ea55 100644
--- a/src/components/features/automations/detail/prompt-section.tsx
+++ b/src/components/features/automations/detail/prompt-section.tsx
@@ -1,23 +1,84 @@
+import React from "react";
import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import TerminalIcon from "#/icons/terminal.svg?react";
+import { cn } from "#/utils/utils";
import { SectionCard } from "./section-card";
+/** ~10 lines at `leading-6` (24px). */
+const PROMPT_COLLAPSED_MAX_HEIGHT_PX = 240;
+const PROMPT_COLLAPSED_MAX_HEIGHT_CLASS = "max-h-60";
+
interface PromptSectionProps {
prompt: string;
}
export function PromptSection({ prompt }: PromptSectionProps) {
const { t } = useTranslation("openhands");
+ const [isExpanded, setIsExpanded] = React.useState(false);
+ const [isOverflowing, setIsOverflowing] = React.useState(false);
+ const contentRef = React.useRef<HTMLParagraphElement>(null);
+
+ const isCollapsed = isOverflowing && !isExpanded;
+
+ React.useLayoutEffect(() => {
+ const content = contentRef.current;
+ if (!content) {
+ return undefined;
+ }
+
+ const updateOverflow = () => {
+ setIsOverflowing(content.scrollHeight > PROMPT_COLLAPSED_MAX_HEIGHT_PX);
+ };
+
+ updateOverflow();
+
+ const observer = new ResizeObserver(updateOverflow);
+ observer.observe(content);
+
+ return () => observer.disconnect();
+ }, [prompt]);
return (
<SectionCard
icon={<TerminalIcon className="size-4" />}
title={t(I18nKey.AUTOMATIONS$DETAIL$PROMPT)}
>
- <p className="whitespace-pre-wrap text-sm leading-6 text-content">
- {prompt}
- </p>
+ <div className="flex flex-col gap-2">
+ <div className="relative">
+ <p
+ ref={contentRef}
+ className={cn(
+ "whitespace-pre-wrap text-sm leading-6 text-content",
+ isCollapsed &&
+ cn(PROMPT_COLLAPSED_MAX_HEIGHT_CLASS, "overflow-hidden"),
+ )}
+ data-testid="automation-prompt-content"
+ >
+ {prompt}
+ </p>
+ {isCollapsed ? (
+ <div
+ className="pointer-events-none absolute inset-x-0 bottom-0 h-20 bg-gradient-to-t from-[var(--oh-surface)] to-transparent"
+ aria-hidden
+ data-testid="automation-prompt-fade"
+ />
+ ) : null}
+ </div>
+
+ {isOverflowing ? (
+ <button
+ type="button"
+ className="self-start cursor-pointer text-sm font-normal text-[var(--oh-muted)] hover:text-white"
+ onClick={() => setIsExpanded((expanded) => !expanded)}
+ data-testid="automation-prompt-toggle"
+ >
+ {isExpanded
+ ? t(I18nKey.COMMON$VIEW_LESS)
+ : t(I18nKey.COMMON$VIEW_MORE)}
+ </button>
+ ) : null}
+ </div>
</SectionCard>
);
}
diff --git a/src/components/features/automations/detail/run-logs-modal.tsx b/src/components/features/automations/detail/run-logs-modal.tsx
index 2ef4c94dff..88df46c947 100644
--- a/src/components/features/automations/detail/run-logs-modal.tsx
+++ b/src/components/features/automations/detail/run-logs-modal.tsx
@@ -7,6 +7,8 @@ import {
type SandboxIssue,
} from "#/hooks/query/use-bash-command-logs";
import type { BashOutput } from "@openhands/typescript-client";
+import { cn } from "#/utils/utils";
+import { modalTitleLgMediumClassName } from "#/utils/modal-classes";
/**
* Localized empty-state message key for each `SandboxIssue` reason.
@@ -126,7 +128,7 @@ export function RunLogsModal({
<XMarkIcon className="size-5" />
</button>
- <h2 className="pr-8 text-lg font-medium text-white">
+ <h2 className={cn("pr-8", modalTitleLgMediumClassName)}>
{t(I18nKey.AUTOMATIONS$DETAIL$LOGS_TITLE)}
</h2>
diff --git a/src/components/features/automations/kebab-menu.tsx b/src/components/features/automations/kebab-menu.tsx
index 01f5903183..ce0339da06 100644
--- a/src/components/features/automations/kebab-menu.tsx
+++ b/src/components/features/automations/kebab-menu.tsx
@@ -4,7 +4,9 @@ import { useTranslation } from "react-i18next";
import KebabVerticalIcon from "#/icons/kebab-vertical.svg?react";
import { ContextMenuListItem } from "#/components/features/context-menu/context-menu-list-item";
import { I18nKey } from "#/i18n/declaration";
+import { cn } from "#/utils/utils";
import { ContextMenu } from "#/ui/context-menu";
+import { dropdownMenuRowIconWrapperClassName } from "#/utils/dropdown-classes";
import { automationIconActionButtonClassName } from "./automation-action-button-classes";
export interface KebabMenuItem {
@@ -23,7 +25,7 @@ function KebabMenuItemContent({ icon, label }: KebabMenuItemContentProps) {
return (
<span className="flex min-w-0 w-full items-center gap-2">
<span
- className="flex shrink-0 items-center text-[var(--oh-muted)] transition-colors group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:size-4 [&_svg]:text-current"
+ className={cn("[&_svg]:size-4", dropdownMenuRowIconWrapperClassName)}
aria-hidden
>
{icon}
diff --git a/src/components/features/automations/recommended-automations-section.tsx b/src/components/features/automations/recommended-automations-section.tsx
index a64833b6e2..66a730782a 100644
--- a/src/components/features/automations/recommended-automations-section.tsx
+++ b/src/components/features/automations/recommended-automations-section.tsx
@@ -31,7 +31,6 @@ import {
extensionModuleCardPillClassName,
extensionModuleCardSurfaceClassName,
} from "#/utils/extension-module-card-classes";
-import ClockIcon from "#/icons/clock.svg?react";
import { StatusBadge } from "./status-badge";
interface RecommendedAutomationsSectionProps {
@@ -93,7 +92,6 @@ function isAutomationAvailable(
}
function buildRecommendedAutomationPills(
- automation: RecommendedAutomation,
requiredEntries: MarketplaceEntry[],
installedServers: MCPServerConfig[],
missingCount: number,
@@ -118,18 +116,6 @@ function buildRecommendedAutomationPills(
};
});
- pills.push({
- id: "setup-minutes",
- node: (
- <span className={cn(extensionModuleCardPillClassName, "gap-1")}>
- <ClockIcon className="size-3 shrink-0" />
- {translate(I18nKey.RECOMMENDED_AUTOMATIONS$MINUTES, {
- count: automation.estimatedSetupMinutes,
- })}
- </span>
- ),
- });
-
if (missingCount > 0) {
pills.push({
id: "missing-connect",
@@ -221,7 +207,6 @@ export function RecommendedAutomationsSection({
<SkillCardPillRow
pills={buildRecommendedAutomationPills(
- automation,
requiredEntries,
installedServers,
missingCount,
diff --git a/src/components/features/backends/backend-form-modal.tsx b/src/components/features/backends/backend-form-modal.tsx
index a4792e605d..7a9be9f37c 100644
--- a/src/components/features/backends/backend-form-modal.tsx
+++ b/src/components/features/backends/backend-form-modal.tsx
@@ -19,6 +19,10 @@ 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 {
+ modalTitleLgClassName,
+ modalTitleLgMediumClassName,
+} from "#/utils/modal-classes";
import { BackendStatusDot } from "./backend-status-dot";
import { DeviceFlowAuth } from "./device-flow-auth";
@@ -570,7 +574,7 @@ function CloudLoginColumn({ onClose }: { onClose: () => void }) {
<OpenHandsLogoWhite width={56} height={56} aria-hidden />
<h4
- className="text-lg font-medium text-white"
+ className={modalTitleLgMediumClassName}
data-testid="add-backend-cloud-title"
>
{t(I18nKey.BACKEND$CLOUD_TITLE)}
@@ -662,7 +666,7 @@ export function BackendFormModal({
<ModalCloseButton onClose={onClose} testId="add-backend-close" />
{/* Header */}
<div className="px-6 pt-6 pb-2 pr-12">
- <h2 className="text-lg font-semibold">
+ <h2 className={modalTitleLgClassName}>
{t(I18nKey.BACKEND$ADD_TITLE)}
</h2>
</div>
@@ -709,7 +713,7 @@ export function BackendFormModal({
)}
>
<ModalCloseButton onClose={onClose} testId={`${testIdRoot}-close`} />
- <h2 className="pr-6 text-lg font-semibold">
+ <h2 className={cn("pr-6", modalTitleLgClassName)}>
{t(I18nKey.BACKEND$EDIT_TITLE)}
</h2>
<BackendForm
diff --git a/src/components/features/backends/backend-selector.tsx b/src/components/features/backends/backend-selector.tsx
index 01504a29e0..0dfb5860ba 100644
--- a/src/components/features/backends/backend-selector.tsx
+++ b/src/components/features/backends/backend-selector.tsx
@@ -29,6 +29,11 @@ import { BackendStatusDot } from "./backend-status-dot";
import { ManageBackendsModal } from "./manage-backends-modal";
import { cn } from "#/utils/utils";
import { formControlTransitionClassName } from "#/utils/form-control-classes";
+import {
+ dropdownFooterActionClassName,
+ dropdownMenuListClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
const VALUE_SEPARATOR = "::";
@@ -243,15 +248,20 @@ export function BackendSelector({
);
const addBackendFooter = (
- <div className="flex flex-col">
+ <div className={dropdownMenuListClassName}>
<button
type="button"
data-testid="add-backend-menu-item"
onMouseDown={preventDropdownMenuClose}
onClick={openAddBackendModal}
- className="flex w-full items-center gap-2 px-2 py-2 rounded-md text-sm cursor-pointer text-white hover:bg-[var(--oh-interactive-hover)]"
+ className={cn(
+ dropdownFooterActionClassName,
+ "cursor-pointer rounded-md",
+ )}
>
- <Plus width={16} height={16} className="text-white shrink-0" />
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
+ <Plus width={16} height={16} />
+ </span>
{t(I18nKey.BACKEND$ADD)}
</button>
<button
@@ -259,9 +269,14 @@ export function BackendSelector({
data-testid="manage-backends-menu-item"
onMouseDown={preventDropdownMenuClose}
onClick={openManageBackendsModal}
- className="flex w-full items-center gap-2 px-2 py-2 rounded-md text-sm cursor-pointer text-white hover:bg-[var(--oh-interactive-hover)]"
+ className={cn(
+ dropdownFooterActionClassName,
+ "cursor-pointer rounded-md",
+ )}
>
- <Settings width={16} height={16} className="text-white shrink-0" />
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
+ <Settings width={16} height={16} />
+ </span>
{t(I18nKey.BACKEND$MANAGE)}
</button>
</div>
diff --git a/src/components/features/backends/manage-backends-modal.tsx b/src/components/features/backends/manage-backends-modal.tsx
index 29e5aafef5..fb3452966b 100644
--- a/src/components/features/backends/manage-backends-modal.tsx
+++ b/src/components/features/backends/manage-backends-modal.tsx
@@ -21,6 +21,7 @@ import {
} from "#/hooks/query/use-backends-health";
import { I18nKey } from "#/i18n/declaration";
import { cn } from "#/utils/utils";
+import { modalTitleLgClassName } from "#/utils/modal-classes";
import { BackendFormModal } from "./backend-form-modal";
import { BackendStatusDot } from "./backend-status-dot";
@@ -160,7 +161,7 @@ export function ManageBackendsModal({ onClose }: ManageBackendsModalProps) {
testId="close-manage-backends-modal"
/>
<div className="p-5 pr-12">
- <h2 className="text-lg font-semibold">
+ <h2 className={modalTitleLgClassName}>
{t(I18nKey.BACKEND$MANAGE_TITLE)}
</h2>
</div>
diff --git a/src/components/features/chat/change-agent-button.tsx b/src/components/features/chat/change-agent-button.tsx
index 1d062fdcec..fa9ee97e09 100644
--- a/src/components/features/chat/change-agent-button.tsx
+++ b/src/components/features/chat/change-agent-button.tsx
@@ -9,6 +9,10 @@ import { CodePillIcon } from "#/icons/code-pill";
import { useConversationStore } from "#/stores/conversation-store";
import { ChangeAgentContextMenu } from "./change-agent-context-menu";
import { cn } from "#/utils/utils";
+import {
+ formControlMutedHoverClassName,
+ formControlTransitionClassName,
+} from "#/utils/form-control-classes";
import { useAgentState } from "#/hooks/use-agent-state";
import { AgentState } from "#/types/agent-state";
import { useActiveConversation } from "#/hooks/query/use-active-conversation";
@@ -161,16 +165,17 @@ export function ChangeAgentButton() {
onClick={handleButtonClick}
disabled={isButtonDisabled}
className={cn(
- "flex items-center rounded-[100px] transition-[border-color,color,opacity]",
+ "flex items-center rounded-[100px]",
+ formControlTransitionClassName,
isExecutionAgent
? "border border-transparent text-[var(--oh-muted)]"
: "border border-[#597FF4] bg-[#4A67BD]",
!isButtonDisabled &&
isExecutionAgent &&
- "cursor-pointer hover:text-white hover:bg-white/10",
+ cn("cursor-pointer", formControlMutedHoverClassName),
!isButtonDisabled &&
!isExecutionAgent &&
- "cursor-pointer text-white hover:bg-white/10",
+ "cursor-pointer text-white hover:bg-[#597FF4]",
isButtonDisabled &&
cn(
"opacity-50 cursor-not-allowed",
@@ -188,6 +193,7 @@ export function ChangeAgentButton() {
</button>
{contextMenuOpen && (
<ChangeAgentContextMenu
+ activeMode={conversationMode}
onClose={() => setContextMenuOpen(false)}
onCodeClick={handleCodeClick}
onPlanClick={handlePlanClick}
diff --git a/src/components/features/chat/change-agent-context-menu.tsx b/src/components/features/chat/change-agent-context-menu.tsx
index a4c79276b2..dfc0da4648 100644
--- a/src/components/features/chat/change-agent-context-menu.tsx
+++ b/src/components/features/chat/change-agent-context-menu.tsx
@@ -7,14 +7,18 @@ import { ContextMenu } from "#/ui/context-menu";
import { ContextMenuListItem } from "../context-menu/context-menu-list-item";
import { ContextMenuIconTextWithDescription } from "../context-menu/context-menu-icon-text-with-description";
import { useClickOutsideElement } from "#/hooks/use-click-outside-element";
+import { cn } from "#/utils/utils";
+import type { ConversationMode } from "#/stores/conversation-store";
interface ChangeAgentContextMenuProps {
+ activeMode: ConversationMode;
onClose: () => void;
onCodeClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
onPlanClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
}
export function ChangeAgentContextMenu({
+ activeMode,
onClose,
onCodeClick,
onPlanClick,
@@ -42,20 +46,34 @@ export function ChangeAgentContextMenu({
testId="change-agent-context-menu"
position="top"
alignment="left"
- className="min-h-fit mb-2 min-w-[195px] max-w-[195px] gap-0"
+ className="min-h-fit mb-2 min-w-[195px] max-w-[195px]"
>
- <ContextMenuListItem testId="code-option" onClick={handleCodeClick}>
+ <ContextMenuListItem
+ testId="code-option"
+ onClick={handleCodeClick}
+ className={cn(
+ activeMode === "code" && "bg-[var(--oh-interactive-hover)]",
+ )}
+ >
<ContextMenuIconTextWithDescription
icon={CodeTagIcon}
title={t(I18nKey.COMMON$CODE)}
description={t(I18nKey.COMMON$CODE_AGENT_DESCRIPTION)}
+ isActive={activeMode === "code"}
/>
</ContextMenuListItem>
- <ContextMenuListItem testId="plan-option" onClick={handlePlanClick}>
+ <ContextMenuListItem
+ testId="plan-option"
+ onClick={handlePlanClick}
+ className={cn(
+ activeMode === "plan" && "bg-[var(--oh-interactive-hover)]",
+ )}
+ >
<ContextMenuIconTextWithDescription
icon={LessonPlanIcon}
title={t(I18nKey.COMMON$PLAN)}
description={t(I18nKey.COMMON$PLAN_AGENT_DESCRIPTION)}
+ isActive={activeMode === "plan"}
/>
</ContextMenuListItem>
</ContextMenu>
diff --git a/src/components/features/chat/chat-add-file-button.tsx b/src/components/features/chat/chat-add-file-button.tsx
index e1ad9a47ae..c43aaa90e5 100644
--- a/src/components/features/chat/chat-add-file-button.tsx
+++ b/src/components/features/chat/chat-add-file-button.tsx
@@ -3,6 +3,7 @@ import { Paperclip, Plus } from "lucide-react";
import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import { cn } from "#/utils/utils";
+import { chatInputIconButtonClassName } from "#/utils/form-control-classes";
import { useOptionalConversationId } from "#/hooks/use-conversation-id";
import { useActiveConversation } from "#/hooks/query/use-active-conversation";
import { useConversationNameContextMenu } from "#/hooks/use-conversation-name-context-menu";
@@ -57,10 +58,11 @@ export function ChatAddFileButton({
<button
type="button"
className={cn(
- "relative shrink-0 size-6 rounded-full transition-colors",
+ chatInputIconButtonClassName,
+ "relative shrink-0 size-6",
disabled
? "cursor-not-allowed text-[var(--oh-text-subtle)]"
- : "cursor-pointer text-[var(--oh-muted)] hover:text-white hover:bg-white/10",
+ : undefined,
menuOpen && !disabled && "text-white bg-white/10",
)}
aria-label={t(I18nKey.CHAT_INTERFACE$PLUS_MENU)}
diff --git a/src/components/features/chat/components/chat-input-actions.tsx b/src/components/features/chat/components/chat-input-actions.tsx
index ee40d66ba8..c1d9d0ec15 100644
--- a/src/components/features/chat/components/chat-input-actions.tsx
+++ b/src/components/features/chat/components/chat-input-actions.tsx
@@ -29,7 +29,10 @@ import { ContextMenuListItem } from "../../context-menu/context-menu-list-item";
import { ContextMenu } from "#/ui/context-menu";
import { useClickOutsideElement } from "#/hooks/use-click-outside-element";
import { cn } from "#/utils/utils";
-import { formControlTransitionClassName } from "#/utils/form-control-classes";
+import {
+ chatInputIconButtonClassName,
+ formControlTransitionClassName,
+} from "#/utils/form-control-classes";
interface ChatInputActionsProps {
disabled: boolean;
@@ -289,7 +292,7 @@ export function ChatInputActions({
>
<ContextMenu
testId="overflow-agent-submenu"
- className="overflow-visible min-w-[195px] gap-0"
+ className="overflow-visible min-w-[195px]"
>
<ContextMenuListItem
testId="overflow-agent-code"
@@ -413,11 +416,7 @@ export function ChatInputActions({
<button
ref={overflowTriggerRef}
type="button"
- className={cn(
- "flex size-6 items-center justify-center rounded-full text-[var(--oh-muted)]",
- formControlTransitionClassName,
- "hover:bg-white/10 hover:text-white cursor-pointer",
- )}
+ className={cn(chatInputIconButtonClassName, "size-6")}
aria-label="More input actions"
aria-expanded={isOverflowOpen}
aria-haspopup="menu"
diff --git a/src/components/features/chat/components/chat-input-model.tsx b/src/components/features/chat/components/chat-input-model.tsx
index 7774bcb3b7..975b5f6d01 100644
--- a/src/components/features/chat/components/chat-input-model.tsx
+++ b/src/components/features/chat/components/chat-input-model.tsx
@@ -15,6 +15,7 @@ import { Divider } from "#/ui/divider";
import { Typography } from "#/ui/typography";
import { I18nKey } from "#/i18n/declaration";
import { cn } from "#/utils/utils";
+import { chatInputPillButtonClassName } from "#/utils/form-control-classes";
import React from "react";
const MODEL_LABEL_MAX_CHARS = 10;
@@ -161,10 +162,7 @@ export function ChatInputModel() {
<button
ref={triggerRef}
type="button"
- className={cn(
- "inline-flex items-center gap-1 rounded-[100px] border border-transparent px-1.5 text-sm font-normal leading-5 text-[var(--oh-muted)] whitespace-nowrap min-w-0 transition-[border-color,background-color,box-shadow,opacity] duration-150 motion-reduce:transition-none",
- "hover:text-white hover:bg-white/10 cursor-pointer",
- )}
+ className={chatInputPillButtonClassName}
title={model.displayModel}
data-testid="chat-input-llm-model"
aria-expanded={isPopoverOpen}
diff --git a/src/components/features/chat/components/slash-command-menu.tsx b/src/components/features/chat/components/slash-command-menu.tsx
index 58278f5fa9..adbc053aff 100644
--- a/src/components/features/chat/components/slash-command-menu.tsx
+++ b/src/components/features/chat/components/slash-command-menu.tsx
@@ -1,6 +1,10 @@
import React, { useEffect, useMemo, useRef } from "react";
import { useTranslation } from "react-i18next";
import { cn } from "#/utils/utils";
+import {
+ dropdownInstantColorClassName,
+ dropdownMenuListClassName,
+} from "#/utils/dropdown-classes";
import { Text } from "#/ui/typography";
import { SlashCommandItem } from "#/hooks/chat/use-slash-command";
@@ -101,7 +105,8 @@ function SlashCommandMenuItem({
ref={ref}
type="button"
className={cn(
- "w-full px-3 py-2.5 text-left transition-colors",
+ "w-full px-3 py-2.5 text-left",
+ dropdownInstantColorClassName,
isSelected ? "bg-tertiary" : "hover:bg-[var(--oh-surface-raised)]",
)}
onMouseDown={(e) => {
@@ -159,17 +164,19 @@ export function SlashCommandMenu({
<div className="px-3 py-2 text-xs text-[var(--oh-muted)] border-b border-[var(--oh-border-subtle)]">
{t("CHAT_INTERFACE$COMMANDS")}
</div>
- {items.map((item, index) => (
- <SlashCommandMenuItem
- key={item.command}
- item={item}
- isSelected={index === selectedIndex}
- onSelect={onSelect}
- ref={(el) => {
- itemRefs.current[index] = el;
- }}
- />
- ))}
+ <div className={dropdownMenuListClassName}>
+ {items.map((item, index) => (
+ <SlashCommandMenuItem
+ key={item.command}
+ item={item}
+ isSelected={index === selectedIndex}
+ onSelect={onSelect}
+ ref={(el) => {
+ itemRefs.current[index] = el;
+ }}
+ />
+ ))}
+ </div>
</div>
);
}
diff --git a/src/components/features/chat/git-control-bar-pr-button.tsx b/src/components/features/chat/git-control-bar-pr-button.tsx
index d553aaa9d5..aaec63b174 100644
--- a/src/components/features/chat/git-control-bar-pr-button.tsx
+++ b/src/components/features/chat/git-control-bar-pr-button.tsx
@@ -1,6 +1,11 @@
import { useTranslation } from "react-i18next";
import PRIcon from "#/icons/u-pr.svg?react";
import { cn, getCreatePRPrompt } from "#/utils/utils";
+import {
+ gitControlBarActionButtonClassName,
+ gitControlBarActionIconColor,
+ gitControlBarActionLabelClassName,
+} from "#/utils/git-control-bar-classes";
import { I18nKey } from "#/i18n/declaration";
import { Provider } from "#/types/settings";
import { useTracking } from "#/hooks/use-tracking";
@@ -37,17 +42,19 @@ export function GitControlBarPrButton({
onClick={handlePrClick}
disabled={!isButtonEnabled}
className={cn(
- "flex flex-row gap-1 items-center justify-center px-2 py-1 rounded-[100px] w-[126px] min-w-[126px] h-7",
- isButtonEnabled
- ? "bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer"
- : "bg-[rgba(71,74,84,0.50)] cursor-not-allowed",
+ gitControlBarActionButtonClassName(isButtonEnabled),
+ "px-2 py-1 w-[126px] min-w-[126px] h-7",
)}
>
<div className="w-3 h-3 flex items-center justify-center">
- <PRIcon width={12} height={12} color="white" />
+ <PRIcon
+ width={12}
+ height={12}
+ color={gitControlBarActionIconColor(isButtonEnabled)}
+ />
</div>
<div
- className="font-normal text-white text-sm leading-5 max-w-[126px] truncate"
+ className={cn(gitControlBarActionLabelClassName, "max-w-[126px]")}
title={t(I18nKey.COMMON$PULL_REQUEST)}
>
{t(I18nKey.COMMON$PULL_REQUEST)}
diff --git a/src/components/features/chat/git-control-bar-pull-button.tsx b/src/components/features/chat/git-control-bar-pull-button.tsx
index c896c8c65d..7efb7ae188 100644
--- a/src/components/features/chat/git-control-bar-pull-button.tsx
+++ b/src/components/features/chat/git-control-bar-pull-button.tsx
@@ -1,6 +1,11 @@
import { useTranslation } from "react-i18next";
import ArrowDownIcon from "#/icons/u-arrow-down.svg?react";
import { cn, getGitPullPrompt } from "#/utils/utils";
+import {
+ gitControlBarActionButtonClassName,
+ gitControlBarActionIconColor,
+ gitControlBarActionLabelClassName,
+} from "#/utils/git-control-bar-classes";
import { I18nKey } from "#/i18n/declaration";
import { useTracking } from "#/hooks/use-tracking";
@@ -34,17 +39,19 @@ export function GitControlBarPullButton({
onClick={handlePullClick}
disabled={!isButtonEnabled}
className={cn(
- "flex flex-row gap-1 items-center justify-center px-0.5 py-1 rounded-[100px] w-[76px] min-w-[76px]",
- isButtonEnabled
- ? "bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer"
- : "bg-[rgba(71,74,84,0.50)] cursor-not-allowed",
+ gitControlBarActionButtonClassName(isButtonEnabled),
+ "px-0.5 py-1 w-[76px] min-w-[76px]",
)}
>
<div className="w-3 h-3 flex items-center justify-center">
- <ArrowDownIcon width={12} height={12} color="white" />
+ <ArrowDownIcon
+ width={12}
+ height={12}
+ color={gitControlBarActionIconColor(isButtonEnabled)}
+ />
</div>
<div
- className="font-normal text-white text-sm leading-5 max-w-[76px] truncate"
+ className={cn(gitControlBarActionLabelClassName, "max-w-[76px]")}
title={t(I18nKey.COMMON$PULL)}
>
{t(I18nKey.COMMON$PULL)}
diff --git a/src/components/features/chat/git-control-bar-push-button.tsx b/src/components/features/chat/git-control-bar-push-button.tsx
index 779c444ac5..2bb59592b9 100644
--- a/src/components/features/chat/git-control-bar-push-button.tsx
+++ b/src/components/features/chat/git-control-bar-push-button.tsx
@@ -1,6 +1,11 @@
import { useTranslation } from "react-i18next";
import ArrowUpIcon from "#/icons/u-arrow-up.svg?react";
import { cn, getGitPushPrompt } from "#/utils/utils";
+import {
+ gitControlBarActionButtonClassName,
+ gitControlBarActionIconColor,
+ gitControlBarActionLabelClassName,
+} from "#/utils/git-control-bar-classes";
import { I18nKey } from "#/i18n/declaration";
import { Provider } from "#/types/settings";
import { useTracking } from "#/hooks/use-tracking";
@@ -37,17 +42,19 @@ export function GitControlBarPushButton({
onClick={handlePushClick}
disabled={!isButtonEnabled}
className={cn(
- "flex flex-row gap-1 items-center justify-center px-2 py-1 rounded-[100px] w-[77px] min-w-[77px]",
- isButtonEnabled
- ? "bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer"
- : "bg-[rgba(71,74,84,0.50)] cursor-not-allowed",
+ gitControlBarActionButtonClassName(isButtonEnabled),
+ "px-2 py-1 w-[77px] min-w-[77px]",
)}
>
<div className="w-3 h-3 flex items-center justify-center">
- <ArrowUpIcon width={12} height={12} color="white" />
+ <ArrowUpIcon
+ width={12}
+ height={12}
+ color={gitControlBarActionIconColor(isButtonEnabled)}
+ />
</div>
<div
- className="font-normal text-white text-sm leading-5 max-w-[77px] truncate"
+ className={cn(gitControlBarActionLabelClassName, "max-w-[77px]")}
title={t(I18nKey.COMMON$PUSH)}
>
{t(I18nKey.COMMON$PUSH)}
diff --git a/src/components/features/chat/git-control-bar.tsx b/src/components/features/chat/git-control-bar.tsx
index c2a706bda1..94f846f6d1 100644
--- a/src/components/features/chat/git-control-bar.tsx
+++ b/src/components/features/chat/git-control-bar.tsx
@@ -9,6 +9,7 @@ import { useActiveConversation } from "#/hooks/query/use-active-conversation";
import { useLocalGitInfo } from "#/hooks/query/use-local-git-info";
import { useTaskPolling } from "#/hooks/query/use-task-polling";
import { useUnifiedWebSocketStatus } from "#/hooks/use-unified-websocket-status";
+import { useConversationWebSocket } from "#/contexts/conversation-websocket-context";
import { useSendMessage } from "#/hooks/use-send-message";
import { useUpdateConversationRepository } from "#/hooks/mutation/use-update-conversation-repository";
import { useCreateConversation } from "#/hooks/mutation/use-create-conversation";
@@ -52,6 +53,8 @@ export function GitControlBar({ onSuggestionsClick }: GitControlBarProps) {
const { repositoryInfo } = useTaskPolling();
const { data: localGitInfo } = useLocalGitInfo();
const webSocketStatus = useUnifiedWebSocketStatus();
+ const conversationWebSocket = useConversationWebSocket();
+ const isLoadingHistory = conversationWebSocket?.isLoadingHistory ?? false;
const webSocketStatusRef = useRef(webSocketStatus);
useEffect(() => {
webSocketStatusRef.current = webSocketStatus;
@@ -101,8 +104,10 @@ export function GitControlBar({ onSuggestionsClick }: GitControlBarProps) {
// local conversations where repo metadata is inferred from git remotes.
const hasRepository = !!selectedRepository && !!gitProvider;
- // Enable buttons only when conversation exists and WS is connected
- const isConversationReady = !!conversation && webSocketStatus === "OPEN";
+ // Enable buttons only when conversation exists, WS is connected, and the
+ // initial history preload has finished (matches chat-interface loading gate).
+ const isConversationReady =
+ !!conversation && webSocketStatus === "OPEN" && !isLoadingHistory;
useEffect(() => {
if (!isWorkspaceMenuOpen) return undefined;
diff --git a/src/components/features/chat/switch-profile-button.tsx b/src/components/features/chat/switch-profile-button.tsx
index 4d23c6823b..03340f2b9c 100644
--- a/src/components/features/chat/switch-profile-button.tsx
+++ b/src/components/features/chat/switch-profile-button.tsx
@@ -9,6 +9,7 @@ import { useSettings } from "#/hooks/query/use-settings";
import { useOptionalConversationId } from "#/hooks/use-conversation-id";
import { useModelStore } from "#/stores/model-store";
import { cn } from "#/utils/utils";
+import { chatInputPillButtonClassName } from "#/utils/form-control-classes";
import { SwitchProfileContextMenu } from "./switch-profile-context-menu";
export function SwitchProfileButton() {
@@ -87,8 +88,8 @@ export function SwitchProfileButton() {
aria-haspopup="menu"
aria-expanded={contextMenuOpen}
className={cn(
- "inline-flex items-center gap-1 rounded-[100px] border border-transparent px-1.5 text-sm font-normal leading-5 text-[var(--oh-muted)] whitespace-nowrap min-w-0 transition-[border-color,background-color,box-shadow,opacity] duration-150 motion-reduce:transition-none max-w-[200px]",
- "hover:text-white hover:bg-white/10 cursor-pointer",
+ chatInputPillButtonClassName,
+ "max-w-[200px]",
"disabled:opacity-50 disabled:cursor-not-allowed",
)}
>
diff --git a/src/components/features/chat/switch-profile-context-menu.tsx b/src/components/features/chat/switch-profile-context-menu.tsx
index 0b67c84555..46d6fd576d 100644
--- a/src/components/features/chat/switch-profile-context-menu.tsx
+++ b/src/components/features/chat/switch-profile-context-menu.tsx
@@ -12,14 +12,20 @@ import SettingsIcon from "#/icons/settings.svg?react";
import CheckIcon from "#/icons/checkmark.svg?react";
import { cn } from "#/utils/utils";
import type { ProfileInfo } from "#/api/profiles-service/profiles-service.api";
+import {
+ dropdownMenuRowGapClassName,
+ dropdownMenuRowIconWrapperClassName,
+ switchProfileMenuListScrollClassName,
+} from "#/utils/dropdown-classes";
const rowBaseClassName = cn(
"w-full flex flex-col gap-0.5 p-2 rounded",
"text-start hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-nowrap",
);
-const profileRowClassName = cn(rowBaseClassName, "h-auto");
+const profileRowClassName = cn(rowBaseClassName, "h-auto items-stretch");
const linkRowClassName = cn(
- "w-full flex items-center gap-2 p-2 rounded",
+ "group w-full flex items-center p-2 rounded",
+ dropdownMenuRowGapClassName,
"text-start hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-nowrap",
);
@@ -63,55 +69,63 @@ export function SwitchProfileContextMenu({
testId="switch-profile-context-menu"
position="top"
alignment="left"
- className="z-[60] left-0 mb-2 bottom-full min-w-[280px] max-h-[60vh] overflow-y-auto"
+ className="z-[60] left-0 mb-2 bottom-full min-w-[280px] pt-0"
>
- <div className="px-2 pt-1 pb-0.5">
+ <div className="px-2 pb-0.5">
<Typography.Text className="text-[11px] font-medium text-[var(--oh-text-dim)] uppercase tracking-wide leading-4">
{t(I18nKey.SETTINGS$AVAILABLE_PROFILES)}
</Typography.Text>
</div>
- {profiles.map((profile) => {
- const isActive = profile.name === activeProfileName;
- return (
- <ContextMenuListItem
- key={profile.name}
- testId={`switch-profile-option-${profile.name}`}
- onClick={(event) => handleSelect(event, profile.name)}
- className={cn(
- profileRowClassName,
- isActive && "bg-[var(--oh-interactive-hover)]",
- )}
- >
- <span
- className="flex items-center gap-2 min-w-0"
- title={profile.model ?? undefined}
+ <div
+ data-testid="switch-profile-options-list"
+ className={switchProfileMenuListScrollClassName}
+ >
+ {profiles.map((profile) => {
+ const isActive = profile.name === activeProfileName;
+ return (
+ <ContextMenuListItem
+ key={profile.name}
+ testId={`switch-profile-option-${profile.name}`}
+ onClick={(event) => handleSelect(event, profile.name)}
+ className={cn(
+ profileRowClassName,
+ isActive && "bg-[var(--oh-interactive-hover)]",
+ )}
>
- <CircuitIcon
- width={16}
- height={16}
- className="shrink-0"
- aria-hidden
- />
- <span className="flex-1 truncate text-sm leading-5">
- {profile.name}
- </span>
- {isActive && (
- <CheckIcon
- width={14}
- height={14}
- className="shrink-0"
+ <span
+ className={cn(
+ "flex items-center min-w-0",
+ dropdownMenuRowGapClassName,
+ )}
+ title={profile.model ?? undefined}
+ >
+ <span
+ className={dropdownMenuRowIconWrapperClassName}
aria-hidden
- />
- )}
- </span>
- {profile.model && (
- <span className="block truncate text-xs leading-4 text-[var(--oh-muted)] pl-6">
- {profile.model}
+ >
+ <CircuitIcon width={16} height={16} />
+ </span>
+ <span className="flex-1 truncate text-sm leading-5">
+ {profile.name}
+ </span>
+ {isActive && (
+ <CheckIcon
+ width={14}
+ height={14}
+ className="shrink-0"
+ aria-hidden
+ />
+ )}
</span>
- )}
- </ContextMenuListItem>
- );
- })}
+ {profile.model && (
+ <span className="block truncate text-xs leading-4 text-[var(--oh-muted)] pl-6">
+ {profile.model}
+ </span>
+ )}
+ </ContextMenuListItem>
+ );
+ })}
+ </div>
<Divider />
<NavigationLink
to="/settings"
@@ -119,7 +133,9 @@ export function SwitchProfileContextMenu({
data-testid="switch-profile-open-settings"
className={linkRowClassName}
>
- <SettingsIcon width={16} height={16} className="shrink-0" />
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
+ <SettingsIcon width={16} height={16} />
+ </span>
<span className="text-sm leading-5">
{t(I18nKey.MODEL$OPEN_SETTINGS)}
</span>
diff --git a/src/components/features/context-menu/context-menu-icon-text-with-description.tsx b/src/components/features/context-menu/context-menu-icon-text-with-description.tsx
index 2f52866df2..5962ad5d53 100644
--- a/src/components/features/context-menu/context-menu-icon-text-with-description.tsx
+++ b/src/components/features/context-menu/context-menu-icon-text-with-description.tsx
@@ -9,6 +9,7 @@ interface ContextMenuIconTextWithDescriptionProps {
description: string;
className?: string;
iconClassName?: string;
+ isActive?: boolean;
}
export function ContextMenuIconTextWithDescription({
@@ -17,6 +18,7 @@ export function ContextMenuIconTextWithDescription({
description,
className,
iconClassName,
+ isActive = false,
}: ContextMenuIconTextWithDescriptionProps) {
return (
<div
@@ -30,6 +32,7 @@ export function ContextMenuIconTextWithDescription({
text={title}
className="px-0"
iconClassName={iconClassName}
+ isActive={isActive}
/>
<Typography.Text className="text-[var(--oh-muted)] text-[10px] font-normal whitespace-pre-wrap break-words">
{description}
diff --git a/src/components/features/context-menu/context-menu-icon-text.tsx b/src/components/features/context-menu/context-menu-icon-text.tsx
index c016647e76..defd1e665b 100644
--- a/src/components/features/context-menu/context-menu-icon-text.tsx
+++ b/src/components/features/context-menu/context-menu-icon-text.tsx
@@ -1,11 +1,16 @@
import { cn } from "#/utils/utils";
-import { formControlTransitionClassName } from "#/utils/form-control-classes";
+import {
+ dropdownMenuRowGapClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
+import CheckIcon from "#/icons/checkmark.svg?react";
interface ContextMenuIconTextProps {
icon: React.ComponentType<{ className?: string }>;
text: string;
className?: string;
iconClassName?: string;
+ isActive?: boolean;
}
export function ContextMenuIconText({
@@ -13,17 +18,27 @@ export function ContextMenuIconText({
text,
className,
iconClassName,
+ isActive = false,
}: ContextMenuIconTextProps) {
return (
- <div className={cn("flex min-w-0 items-center gap-2", className)}>
+ <div
+ className={cn(
+ "flex min-w-0 items-center",
+ dropdownMenuRowGapClassName,
+ className,
+ )}
+ >
<Icon
className={cn(
- "h-4 w-4 shrink-0 text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)]",
- formControlTransitionClassName,
+ "h-4 w-4",
+ dropdownMenuRowIconWrapperClassName,
iconClassName,
)}
/>
<span className="min-w-0 flex-1 leading-5">{text}</span>
+ {isActive && (
+ <CheckIcon width={14} height={14} className="shrink-0" aria-hidden />
+ )}
</div>
);
}
diff --git a/src/components/features/context-menu/context-menu-list-item.tsx b/src/components/features/context-menu/context-menu-list-item.tsx
index 1c96d4532b..c27c1fd841 100644
--- a/src/components/features/context-menu/context-menu-list-item.tsx
+++ b/src/components/features/context-menu/context-menu-list-item.tsx
@@ -1,4 +1,5 @@
import { cn } from "#/utils/utils";
+import { dropdownMenuRowForegroundClassName } from "#/utils/dropdown-classes";
interface ContextMenuListItemProps {
testId?: string;
@@ -21,9 +22,8 @@ export function ContextMenuListItem({
onClick={onClick}
disabled={isDisabled}
className={cn(
- "group w-full cursor-pointer rounded px-2 py-2 text-start text-nowrap text-sm font-normal",
- "text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]",
- "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",
+ dropdownMenuRowForegroundClassName,
+ "text-nowrap",
className,
)}
>
diff --git a/src/components/features/controls/git-tools-submenu.tsx b/src/components/features/controls/git-tools-submenu.tsx
index a2411cc40d..9404284b7d 100644
--- a/src/components/features/controls/git-tools-submenu.tsx
+++ b/src/components/features/controls/git-tools-submenu.tsx
@@ -52,7 +52,7 @@ export function GitToolsSubmenu({ onClose }: GitToolsSubmenuProps) {
};
return (
- <ContextMenu testId="git-tools-submenu" className="w-max gap-0">
+ <ContextMenu testId="git-tools-submenu" className="w-max">
<ContextMenuListItem
testId="git-pull-button"
onClick={onGitPull}
diff --git a/src/components/features/controls/macros-submenu.tsx b/src/components/features/controls/macros-submenu.tsx
index 3d1110a6e3..4ce549cdac 100644
--- a/src/components/features/controls/macros-submenu.tsx
+++ b/src/components/features/controls/macros-submenu.tsx
@@ -39,7 +39,7 @@ export function MacrosSubmenu({ onClose }: MacrosSubmenuProps) {
};
return (
- <ContextMenu testId="macros-submenu" className="overflow-visible gap-0">
+ <ContextMenu testId="macros-submenu" className="overflow-visible">
<ContextMenuListItem
testId="increase-test-coverage-button"
onClick={onIncreaseTestCoverage}
diff --git a/src/components/features/controls/server-status-context-menu-icon-text.tsx b/src/components/features/controls/server-status-context-menu-icon-text.tsx
index 948811fb4d..de5407f350 100644
--- a/src/components/features/controls/server-status-context-menu-icon-text.tsx
+++ b/src/components/features/controls/server-status-context-menu-icon-text.tsx
@@ -1,6 +1,5 @@
import { ContextMenuListItem } from "#/components/features/context-menu/context-menu-list-item";
-import { formControlTransitionClassName } from "#/utils/form-control-classes";
-import { cn } from "#/utils/utils";
+import { dropdownMenuRowIconWrapperClassName } from "#/utils/dropdown-classes";
interface ServerStatusContextMenuIconTextProps {
icon: React.ReactNode;
@@ -19,13 +18,7 @@ export function ServerStatusContextMenuIconText({
<ContextMenuListItem testId={testId} onClick={onClick}>
<div className="flex min-w-0 w-full items-center justify-between gap-2">
<span className="min-w-0 truncate">{text}</span>
- <span
- className={cn(
- "flex shrink-0 items-center text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:text-current",
- formControlTransitionClassName,
- )}
- aria-hidden
- >
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
{icon}
</span>
</div>
diff --git a/src/components/features/controls/tools-context-menu-icon-text.tsx b/src/components/features/controls/tools-context-menu-icon-text.tsx
index c40f7ee0d0..da092ee756 100644
--- a/src/components/features/controls/tools-context-menu-icon-text.tsx
+++ b/src/components/features/controls/tools-context-menu-icon-text.tsx
@@ -1,5 +1,8 @@
import { cn } from "#/utils/utils";
-import { formControlTransitionClassName } from "#/utils/form-control-classes";
+import {
+ dropdownMenuRowGapClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
interface ToolsContextMenuIconTextProps {
icon: React.ReactNode;
@@ -17,30 +20,21 @@ export function ToolsContextMenuIconText({
return (
<div
className={cn(
- "flex min-w-0 w-full items-center justify-between gap-2",
+ "flex min-w-0 w-full items-center justify-between",
+ dropdownMenuRowGapClassName,
className,
)}
>
- <div className="flex min-w-0 items-center gap-2">
- <span
- className={cn(
- "flex shrink-0 items-center text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:text-current",
- formControlTransitionClassName,
- )}
- aria-hidden
- >
+ <div
+ className={cn("flex min-w-0 items-center", dropdownMenuRowGapClassName)}
+ >
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
{icon}
</span>
<span className="text-sm font-normal leading-5">{text}</span>
</div>
{rightIcon ? (
- <span
- className={cn(
- "flex shrink-0 items-center text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:text-current",
- formControlTransitionClassName,
- )}
- aria-hidden
- >
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
{rightIcon}
</span>
) : null}
diff --git a/src/components/features/controls/tools.tsx b/src/components/features/controls/tools.tsx
index d97658958a..ca0dc733ad 100644
--- a/src/components/features/controls/tools.tsx
+++ b/src/components/features/controls/tools.tsx
@@ -4,12 +4,14 @@ import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import { useOptionalConversationId } from "#/hooks/use-conversation-id";
import { ComboboxCaretInline } from "#/ui/combobox-caret";
+import { chatInputPillButtonClassName } from "#/utils/form-control-classes";
import { ToolsContextMenu } from "./tools-context-menu";
import { useConversationNameContextMenu } from "#/hooks/use-conversation-name-context-menu";
import { useActiveConversation } from "#/hooks/query/use-active-conversation";
import { SystemMessageModal } from "../conversation-panel/system-message-modal";
import { SkillsModal } from "../conversation-panel/skills-modal";
import { HooksModal } from "../conversation-panel/hooks-modal";
+import { cn } from "#/utils/utils";
export function Tools() {
const { t } = useTranslation("openhands");
@@ -49,7 +51,7 @@ export function Tools() {
<div className="relative">
<button
type="button"
- className="group flex items-center gap-1 rounded-[100px] border border-transparent px-1.5 text-[var(--oh-muted)] transition-[border-color,background-color,box-shadow,opacity] duration-150 motion-reduce:transition-none cursor-pointer hover:text-white hover:bg-white/10"
+ className={cn(chatInputPillButtonClassName, "group flex")}
onClick={handleClick}
>
<Wrench
diff --git a/src/components/features/conversation-panel/cloud-new-conversation-menu.tsx b/src/components/features/conversation-panel/cloud-new-conversation-menu.tsx
index 6d8b9fc13a..5c47b85899 100644
--- a/src/components/features/conversation-panel/cloud-new-conversation-menu.tsx
+++ b/src/components/features/conversation-panel/cloud-new-conversation-menu.tsx
@@ -11,6 +11,12 @@ import { useDebounce } from "#/hooks/use-debounce";
import { useHomeStore } from "#/stores/home-store";
import { I18nKey } from "#/i18n/declaration";
import { cn } from "#/utils/utils";
+import {
+ dropdownMenuRowClassName,
+ dropdownInstantColorClassName,
+ dropdownMenuListClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
import { GitRepository } from "#/types/git";
import { Provider } from "#/types/settings";
import RepoIcon from "#/icons/repo.svg?react";
@@ -58,7 +64,9 @@ function RepoListItem({
onClick={() => onSelect(repo)}
className={itemClass}
>
- <RepoIcon width={14} height={14} className="shrink-0" />
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
+ <RepoIcon width={14} height={14} />
+ </span>
<span className="truncate">{repo.full_name}</span>
</button>
</li>
@@ -179,11 +187,7 @@ export function CloudNewConversationMenu({
setQuery("");
};
- const itemClass = cn(
- "flex w-full cursor-pointer items-center gap-2 rounded px-2 py-2 text-left text-sm text-white",
- "font-normal transition-colors hover:bg-[var(--oh-interactive-hover)]",
- "disabled:cursor-not-allowed disabled:opacity-60",
- );
+ const itemClass = dropdownMenuRowClassName;
React.useEffect(() => {
if (!open) return;
@@ -259,8 +263,8 @@ export function CloudNewConversationMenu({
data-testid={`cloud-provider-tab-${provider}`}
onClick={() => handleProviderChange(provider)}
className={cn(
- "flex items-center gap-1 rounded px-2 py-1 text-xs",
- "border transition-colors",
+ "flex items-center gap-1 rounded border px-2 py-1 text-xs",
+ dropdownInstantColorClassName,
isActive
? "border-[var(--oh-border-subtle)] bg-[var(--oh-interactive-hover)] text-white"
: "border-transparent text-[var(--oh-text-secondary)] hover:text-white",
@@ -301,7 +305,12 @@ export function CloudNewConversationMenu({
<Divider inset="menu" />
- <ul className="flex max-h-[40vh] flex-col overflow-y-auto custom-scrollbar-always sm:max-h-[280px]">
+ <ul
+ className={cn(
+ "max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]",
+ dropdownMenuListClassName,
+ )}
+ >
{isListLoading && repositories.length === 0 && (
<li
className="px-2 py-2 text-sm text-[var(--oh-muted)] italic"
diff --git a/src/components/features/conversation-panel/conversation-panel-filter-menu.tsx b/src/components/features/conversation-panel/conversation-panel-filter-menu.tsx
index 7a0c1bdb84..4259b98cb1 100644
--- a/src/components/features/conversation-panel/conversation-panel-filter-menu.tsx
+++ b/src/components/features/conversation-panel/conversation-panel-filter-menu.tsx
@@ -19,7 +19,12 @@ import { I18nKey } from "#/i18n/declaration";
import type { BackendKind } from "#/api/backend-registry/types";
import { Divider } from "#/ui/divider";
import { cn } from "#/utils/utils";
-import { formControlTransitionClassName } from "#/utils/form-control-classes";
+import {
+ dropdownMenuRowClassName,
+ dropdownMenuRowIconClassName,
+ dropdownInstantColorClassName,
+ dropdownMenuListClassName,
+} from "#/utils/dropdown-classes";
import type {
ConversationSortField,
OrganizeMode,
@@ -107,21 +112,19 @@ function MenuRow({
disabled={disabled}
onClick={onClick}
className={cn(
- "group flex w-full items-center gap-2 rounded px-2 py-2 text-left text-sm text-[var(--oh-foreground)]",
- "hover:bg-[var(--oh-interactive-hover)] disabled:cursor-not-allowed disabled:opacity-50",
+ "group",
+ dropdownMenuRowClassName,
+ "text-[var(--oh-foreground)] disabled:opacity-50",
)}
>
<Icon
- className={cn(
- "h-3.5 w-3.5 shrink-0 text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)]",
- formControlTransitionClassName,
- )}
+ className={cn("h-3.5 w-3.5", dropdownMenuRowIconClassName)}
aria-hidden
/>
<span className="min-w-0 flex-1 truncate">{label}</span>
{selected ? (
<Check
- className="ml-auto h-3.5 w-3.5 shrink-0 text-[var(--oh-foreground)]"
+ className="ml-auto h-3.5 w-3.5 shrink-0 text-white"
aria-hidden
/>
) : null}
@@ -240,7 +243,7 @@ export function ConversationPanelFilterMenu({
onClick={() => setFilterMenuOpen(!filterMenuOpen)}
className={cn(
"inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]",
- formControlTransitionClassName,
+ dropdownInstantColorClassName,
)}
>
<ListFilter
@@ -266,7 +269,10 @@ export function ConversationPanelFilterMenu({
tabIndex={-1}
data-testid="older-conversations-filter-menu"
onKeyDown={handleMenuKeyDown}
- className="absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg"
+ className={cn(
+ "absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg",
+ dropdownMenuListClassName,
+ )}
>
<MenuHeading>{t(I18nKey.CONVERSATION_PANEL$ORGANIZE)}</MenuHeading>
<MenuRow
diff --git a/src/components/features/conversation-panel/ellipsis-button.tsx b/src/components/features/conversation-panel/ellipsis-button.tsx
index 1aeea45bba..8e8e381f5b 100644
--- a/src/components/features/conversation-panel/ellipsis-button.tsx
+++ b/src/components/features/conversation-panel/ellipsis-button.tsx
@@ -1,7 +1,10 @@
import React from "react";
import ThreeDotsVerticalIcon from "#/icons/three-dots-vertical.svg?react";
import { cn } from "#/utils/utils";
-import { formControlTransitionClassName } from "#/utils/form-control-classes";
+import {
+ formControlTransitionClassName,
+ formControlMutedHoverClassName,
+} from "#/utils/form-control-classes";
interface EllipsisButtonProps {
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
@@ -52,7 +55,8 @@ export const EllipsisButton = React.forwardRef<
className={cn(
"p-1 rounded-md cursor-pointer",
formControlTransitionClassName,
- "text-[var(--oh-muted)] hover:text-white hover:bg-white/10",
+ "text-[var(--oh-muted)]",
+ formControlMutedHoverClassName,
"flex items-center justify-center",
className,
)}
diff --git a/src/components/features/conversation-panel/local-new-conversation-menu.tsx b/src/components/features/conversation-panel/local-new-conversation-menu.tsx
index adaf6e8708..811cc50d01 100644
--- a/src/components/features/conversation-panel/local-new-conversation-menu.tsx
+++ b/src/components/features/conversation-panel/local-new-conversation-menu.tsx
@@ -14,6 +14,11 @@ import { useLocalWorkspaces } from "#/hooks/query/use-local-workspaces";
import { useResolvedWorkspaces } from "#/hooks/query/use-resolved-workspaces";
import { I18nKey } from "#/i18n/declaration";
import { cn } from "#/utils/utils";
+import {
+ dropdownMenuRowClassName,
+ dropdownMenuListClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
import { getWorkspacesUnsupportedMessage } from "#/utils/workspaces-compatibility";
import RepoIcon from "#/icons/repo.svg?react";
@@ -126,11 +131,7 @@ export function LocalNewConversationMenu({
);
};
- const itemClass = cn(
- "flex w-full cursor-pointer items-center gap-2 rounded px-2 py-2 text-left text-sm text-white",
- "font-normal transition-colors hover:bg-[var(--oh-interactive-hover)]",
- "disabled:cursor-not-allowed disabled:opacity-60",
- );
+ const itemClass = dropdownMenuRowClassName;
const keepPopoverOpenOnMouseDown = React.useCallback(
(event: React.MouseEvent<HTMLButtonElement>) => {
@@ -207,7 +208,12 @@ export function LocalNewConversationMenu({
)}
style={fixedStyle}
>
- <ul className="flex max-h-[40vh] flex-col overflow-y-auto sm:max-h-[280px]">
+ <ul
+ className={cn(
+ "max-h-[40vh] overflow-y-auto sm:max-h-[280px]",
+ dropdownMenuListClassName,
+ )}
+ >
<li>
<button
type="button"
@@ -231,7 +237,12 @@ export function LocalNewConversationMenu({
onClick={() => launch(w.path)}
className={itemClass}
>
- <RepoIcon width={14} height={14} className="shrink-0" />
+ <span
+ className={dropdownMenuRowIconWrapperClassName}
+ aria-hidden
+ >
+ <RepoIcon width={14} height={14} />
+ </span>
<span className="truncate">{w.name}</span>
</button>
</li>
@@ -239,7 +250,7 @@ export function LocalNewConversationMenu({
</ul>
<div
- className="flex flex-col"
+ className={cn("flex flex-col", dropdownMenuListClassName)}
data-testid="new-conversation-menu-footer"
>
<Divider
diff --git a/src/components/features/conversation-panel/new-conversation-dropdown-styles.ts b/src/components/features/conversation-panel/new-conversation-dropdown-styles.ts
index 861780f8cd..5e4bb3b371 100644
--- a/src/components/features/conversation-panel/new-conversation-dropdown-styles.ts
+++ b/src/components/features/conversation-panel/new-conversation-dropdown-styles.ts
@@ -1,6 +1,8 @@
import { cn } from "#/utils/utils";
+import { dropdownMenuListGapClassName } from "#/utils/dropdown-classes";
/** Match conversation panel filter and other sidebar menus */
export const NEW_CONVERSATION_DROPDOWN_SURFACE = cn(
"z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg",
+ dropdownMenuListGapClassName,
);
diff --git a/src/components/features/conversation/conversation-name-context-menu-icon-text.tsx b/src/components/features/conversation/conversation-name-context-menu-icon-text.tsx
index 9822482573..941658598c 100644
--- a/src/components/features/conversation/conversation-name-context-menu-icon-text.tsx
+++ b/src/components/features/conversation/conversation-name-context-menu-icon-text.tsx
@@ -1,5 +1,8 @@
import { cn } from "#/utils/utils";
-import { formControlTransitionClassName } from "#/utils/form-control-classes";
+import {
+ dropdownMenuRowGapClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
interface ConversationNameContextMenuIconTextProps {
icon: React.ReactNode;
@@ -13,14 +16,14 @@ export function ConversationNameContextMenuIconText({
className,
}: ConversationNameContextMenuIconTextProps) {
return (
- <div className={cn("flex min-w-0 w-full items-center gap-2", className)}>
- <span
- className={cn(
- "flex shrink-0 items-center text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:text-current",
- formControlTransitionClassName,
- )}
- aria-hidden
- >
+ <div
+ className={cn(
+ "flex min-w-0 w-full items-center",
+ dropdownMenuRowGapClassName,
+ className,
+ )}
+ >
+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>
{icon}
</span>
<span className="min-w-0 flex-1 truncate">{text}</span>
diff --git a/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx b/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
index 425580933d..4b5c61afa5 100644
--- a/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
+++ b/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
@@ -21,6 +21,10 @@ import { useTaskList } from "#/hooks/use-task-list";
import { useActiveBackend } from "#/contexts/active-backend-context";
import { useSelectConversationTab } from "#/hooks/use-select-conversation-tab";
import { cn } from "#/utils/utils";
+import {
+ dropdownInstantColorClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
interface ConversationTabsContextMenuProps {
isOpen: boolean;
@@ -120,7 +124,7 @@ export function ConversationTabsContextMenu({
<li key={tab} className="list-none">
<div
className={cn(
- "flex h-[30px] w-full min-w-0 items-stretch rounded",
+ "group flex h-[30px] w-full min-w-0 items-stretch rounded",
"hover:bg-[var(--oh-interactive-hover)]",
)}
>
@@ -128,29 +132,50 @@ export function ConversationTabsContextMenu({
type="button"
data-testid={`conversation-tabs-menu-open-${tab}`}
className={cn(
- "flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start",
- "text-white transition-colors",
+ "flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-white",
+ dropdownInstantColorClassName,
)}
onClick={() => handleOpenTab(tab)}
>
- <Icon className="h-4 w-4 shrink-0" />
+ <span
+ className={dropdownMenuRowIconWrapperClassName}
+ aria-hidden
+ >
+ <Icon className="h-4 w-4" />
+ </span>
<span className="text-sm">{t(i18nKey)}</span>
</button>
<button
type="button"
data-testid={`conversation-tabs-menu-pin-${tab}`}
className={cn(
- "flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2",
- "text-white transition-colors hover:bg-white/10",
+ "flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-white hover:bg-white/10",
+ dropdownInstantColorClassName,
)}
aria-pressed={pinned}
aria-label={pinned ? "Unpin tab from bar" : "Pin tab to bar"}
onClick={(e) => handlePinToggle(tab, e)}
>
{pinned ? (
- <PillFillIcon className="-mr-[5px] ml-auto h-7 w-7" />
+ <span
+ className={cn(
+ "-mr-[5px] ml-auto",
+ dropdownMenuRowIconWrapperClassName,
+ )}
+ aria-hidden
+ >
+ <PillFillIcon className="h-7 w-7" />
+ </span>
) : (
- <PillIcon className="ml-auto h-4.5 w-4.5" />
+ <span
+ className={cn(
+ "ml-auto",
+ dropdownMenuRowIconWrapperClassName,
+ )}
+ aria-hidden
+ >
+ <PillIcon className="h-4.5 w-4.5" />
+ </span>
)}
</button>
</div>
diff --git a/src/components/features/home/shared/dropdown-item.tsx b/src/components/features/home/shared/dropdown-item.tsx
index 05cded7fb3..d0ccba3065 100644
--- a/src/components/features/home/shared/dropdown-item.tsx
+++ b/src/components/features/home/shared/dropdown-item.tsx
@@ -1,5 +1,10 @@
import React from "react";
import { cn } from "#/utils/utils";
+import {
+ dropdownInstantColorClassName,
+ dropdownMenuRowGapClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
interface DropdownItemProps<T> {
item: T;
@@ -29,9 +34,10 @@ export function DropdownItem<T>({
item,
className: cn(
isProviderDropdown
- ? "px-2 py-0 cursor-pointer text-xs rounded-md mx-0 my-0 h-6 flex items-center"
- : "px-2 py-2 cursor-pointer text-sm rounded-md mx-0 my-0.5",
+ ? "group px-2 py-0 cursor-pointer text-xs rounded-md mx-0 my-0 h-6 flex items-center"
+ : "group px-2 py-2 cursor-pointer text-sm rounded-md mx-0 my-0.5",
"text-white focus:outline-none font-normal",
+ dropdownInstantColorClassName,
{
"bg-[var(--oh-interactive-selected)] text-white": isSelected,
"hover:bg-[var(--oh-interactive-hover)]": !isSelected,
@@ -42,8 +48,12 @@ export function DropdownItem<T>({
return (
<li key={getItemKey(item)} {...itemProps}>
- <div className="flex items-center gap-2">
- {renderIcon?.(item)}
+ <div className={cn("flex items-center", dropdownMenuRowGapClassName)}>
+ {renderIcon ? (
+ <span className={dropdownMenuRowIconWrapperClassName}>
+ {renderIcon(item)}
+ </span>
+ ) : null}
<span className="font-normal">{getDisplayText(item)}</span>
</div>
</li>
diff --git a/src/components/features/home/shared/generic-dropdown-menu.tsx b/src/components/features/home/shared/generic-dropdown-menu.tsx
index 62841805cd..025b9c434a 100644
--- a/src/components/features/home/shared/generic-dropdown-menu.tsx
+++ b/src/components/features/home/shared/generic-dropdown-menu.tsx
@@ -4,6 +4,7 @@ import {
UseComboboxGetItemPropsOptions,
} from "downshift";
import { cn } from "#/utils/utils";
+import { dropdownMenuListClassName } from "#/utils/dropdown-classes";
export interface GenericDropdownMenuProps<T> {
isOpen: boolean;
@@ -87,6 +88,7 @@ export function GenericDropdownMenu<T>({
ref: menuRef,
className: cn(
"w-full overflow-auto p-1 custom-scrollbar-always",
+ dropdownMenuListClassName,
stickyTopItem || stickyFooterItem
? "max-h-[calc(15rem-3rem)]"
: "max-h-60", // Reserve space for sticky items
diff --git a/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx b/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx
index a5297b424d..51368fa40e 100644
--- a/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx
+++ b/src/components/features/home/workspace-dropdown/folder-browser-modal.tsx
@@ -17,6 +17,7 @@ import {
} from "#/hooks/query/use-search-subdirs";
import { useActiveBackend } from "#/contexts/active-backend-context";
import { cn } from "#/utils/utils";
+import { modalTitleSmClassName } from "#/utils/modal-classes";
import FolderIcon from "#/icons/folder.svg?react";
import ChevronLeft from "#/icons/chevron-left-small.svg?react";
@@ -218,7 +219,7 @@ export function FolderBrowserModal({
{/* Title bar */}
<div className="flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]">
<BaseModalTitle
- className="text-sm font-medium text-white"
+ className={modalTitleSmClassName}
title={t(I18nKey.HOME$ADD_WORKSPACES_TITLE)}
/>
</div>
diff --git a/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx b/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx
index fbbb1c47d6..d75815dd72 100644
--- a/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx
+++ b/src/components/features/home/workspace-dropdown/manage-workspaces-modal.tsx
@@ -12,6 +12,7 @@ import { BrandButton } from "#/components/features/settings/brand-button";
import { I18nKey } from "#/i18n/declaration";
import { LocalWorkspace, LocalWorkspaceParent } from "#/types/workspace";
import { cn } from "#/utils/utils";
+import { modalTitleSmClassName } from "#/utils/modal-classes";
import FolderIcon from "#/icons/folder.svg?react";
import CloseIcon from "#/icons/close.svg?react";
@@ -83,7 +84,7 @@ export function ManageWorkspacesModal({
>
<div className="flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]">
<BaseModalTitle
- className="text-sm font-medium text-white"
+ className={modalTitleSmClassName}
title={t(I18nKey.HOME$MANAGE_WORKSPACES)}
/>
</div>
diff --git a/src/components/features/home/workspace-dropdown/workspace-dropdown.tsx b/src/components/features/home/workspace-dropdown/workspace-dropdown.tsx
index 14e576784c..4f8fe55711 100644
--- a/src/components/features/home/workspace-dropdown/workspace-dropdown.tsx
+++ b/src/components/features/home/workspace-dropdown/workspace-dropdown.tsx
@@ -3,6 +3,10 @@ import { useCombobox } from "downshift";
import { useTranslation } from "react-i18next";
import { cn } from "#/utils/utils";
+import {
+ dropdownFooterActionClassName,
+ dropdownMenuListClassName,
+} from "#/utils/dropdown-classes";
import { formControlFieldClassName } from "#/utils/form-control-classes";
import { LocalWorkspace } from "#/types/workspace";
import { I18nKey } from "#/i18n/declaration";
@@ -128,11 +132,11 @@ export function WorkspaceDropdown({
const stickyFooterItem = useMemo(
() => (
- <div className="flex flex-col">
+ <div className={dropdownMenuListClassName}>
<button
type="button"
data-testid="add-workspaces-button"
- className="flex items-center w-full px-2 py-2 text-sm text-white hover:bg-[var(--oh-interactive-hover)] rounded-md transition-colors duration-150 font-normal"
+ className={cn(dropdownFooterActionClassName, "cursor-pointer")}
onMouseDown={(e) => {
e.preventDefault();
e.stopPropagation();
@@ -150,7 +154,7 @@ export function WorkspaceDropdown({
<button
type="button"
data-testid="manage-workspaces-button"
- className="flex items-center w-full px-2 py-2 text-sm text-white hover:bg-[var(--oh-interactive-hover)] rounded-md transition-colors duration-150 font-normal"
+ className={cn(dropdownFooterActionClassName, "cursor-pointer")}
onMouseDown={(e) => {
e.preventDefault();
e.stopPropagation();
diff --git a/src/components/features/launch/plugin-launch-modal.tsx b/src/components/features/launch/plugin-launch-modal.tsx
index eac99c9059..133deabd55 100644
--- a/src/components/features/launch/plugin-launch-modal.tsx
+++ b/src/components/features/launch/plugin-launch-modal.tsx
@@ -137,7 +137,7 @@ export function PluginLaunchModal({
)}
>
<ModalCloseButton onClose={onClose} testId="close-button" />
- <Typography.H2 className="pr-6 text-content-2">
+ <Typography.H2 className="pr-6">
{t(I18nKey.LAUNCH$MODAL_TITLE)} {modalTitle}
</Typography.H2>
diff --git a/src/components/features/mcp-page/custom-server-editor.tsx b/src/components/features/mcp-page/custom-server-editor.tsx
index e63437cc71..5c388c213d 100644
--- a/src/components/features/mcp-page/custom-server-editor.tsx
+++ b/src/components/features/mcp-page/custom-server-editor.tsx
@@ -20,6 +20,8 @@ import {
displaySuccessToast,
} from "#/utils/custom-toast-handlers";
import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";
+import { cn } from "#/utils/utils";
+import { modalTitleLgClassName } from "#/utils/modal-classes";
interface CustomServerEditorProps {
server: MCPServerConfig;
@@ -148,7 +150,7 @@ export function CustomServerEditor({
testId="mcp-custom-editor-close"
disabled={isDismissBlocked}
/>
- <h2 className="mb-4 pr-6 text-lg font-semibold">
+ <h2 className={cn("mb-4 pr-6", modalTitleLgClassName)}>
{isEditing
? t(I18nKey.MCP$EDIT_CUSTOM_TITLE)
: t(I18nKey.MCP$ADD_CUSTOM_TITLE)}
diff --git a/src/components/features/mcp-page/install-server-modal.tsx b/src/components/features/mcp-page/install-server-modal.tsx
index 62047fca1e..6122f4057f 100644
--- a/src/components/features/mcp-page/install-server-modal.tsx
+++ b/src/components/features/mcp-page/install-server-modal.tsx
@@ -19,6 +19,7 @@ import {
type McpMarketplaceConnectionOption,
} from "#/utils/mcp-marketplace-utils";
import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";
+import { modalTitleLgClassName } from "#/utils/modal-classes";
interface InstallServerModalProps {
entry: MarketplaceEntry;
@@ -337,7 +338,7 @@ export function InstallServerModal({
<div className="flex items-start gap-3 pr-6">
<McpLogoBadge entry={entry} />
<div className="flex flex-col flex-1">
- <h2 className="text-lg font-semibold">{entry.name}</h2>
+ <h2 className={modalTitleLgClassName}>{entry.name}</h2>
<p className="text-xs text-tertiary-light">{entry.description}</p>
</div>
</div>
diff --git a/src/components/features/settings/api-key-modal-base.tsx b/src/components/features/settings/api-key-modal-base.tsx
index 0617b149a7..584d9e2e60 100644
--- a/src/components/features/settings/api-key-modal-base.tsx
+++ b/src/components/features/settings/api-key-modal-base.tsx
@@ -92,11 +92,7 @@ export function ApiKeyModalBase({
MODAL_MAX_WIDTH_VIEWPORT,
)}
>
- <BaseModalTitle
- id="modal-title"
- title={title}
- className="text-xl font-medium text-white"
- />
+ <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/llm-profiles/llm-settings-local-view.tsx b/src/components/features/settings/llm-profiles/llm-settings-local-view.tsx
index d30615eb31..df98ccd078 100644
--- a/src/components/features/settings/llm-profiles/llm-settings-local-view.tsx
+++ b/src/components/features/settings/llm-profiles/llm-settings-local-view.tsx
@@ -31,7 +31,7 @@ import {
normalizeFieldValue,
SettingsFormValues,
} from "#/utils/sdk-settings-schema";
-import { ArrowLeft } from "lucide-react";
+import { BackNavButton } from "#/components/shared/buttons/back-nav-button";
import { Typography } from "#/ui/typography";
import { useSettingsSectionHeader } from "#/contexts/settings-section-header-context";
@@ -346,15 +346,9 @@ export function LlmSettingsLocalView() {
<div className="flex flex-col gap-6">
{/* Header with back button */}
<div className="flex flex-col gap-2">
- <button
- type="button"
- onClick={handleBackToList}
- className="flex items-center gap-2 self-start rounded-lg p-2 text-[var(--oh-muted)] transition-colors hover:bg-tertiary hover:text-white"
- data-testid="back-to-profiles"
- >
- <ArrowLeft size={20} aria-hidden />
- <span className="text-sm leading-5">{t(I18nKey.BUTTON$BACK)}</span>
- </button>
+ <BackNavButton testId="back-to-profiles" onClick={handleBackToList}>
+ {t(I18nKey.BUTTON$BACK)}
+ </BackNavButton>
<Typography.H2 testId="profile-editor-title">
{profileEditorTitle}
</Typography.H2>
@@ -394,11 +388,11 @@ export function LlmSettingsLocalView() {
/>
{/* Action buttons */}
- <div className="flex justify-start gap-3 pt-4 border-t border-[var(--oh-border)]">
+ <div className="flex justify-start gap-3 pt-4">
<BrandButton
testId="cancel-profile-btn"
type="button"
- variant="tertiary"
+ variant="secondary"
onClick={handleBackToList}
>
{t(I18nKey.BUTTON$CANCEL)}
diff --git a/src/components/features/settings/llm-profiles/profile-actions-menu.tsx b/src/components/features/settings/llm-profiles/profile-actions-menu.tsx
index 86bdccde44..aad0012bfc 100644
--- a/src/components/features/settings/llm-profiles/profile-actions-menu.tsx
+++ b/src/components/features/settings/llm-profiles/profile-actions-menu.tsx
@@ -9,6 +9,7 @@ import ReactDOM from "react-dom";
import { useTranslation } from "react-i18next";
import { TextCursor } from "lucide-react";
import { cn } from "#/utils/utils";
+import { dropdownMenuListClassName } from "#/utils/dropdown-classes";
import { I18nKey } from "#/i18n/declaration";
import { ConversationNameContextMenuIconText } from "#/components/features/conversation/conversation-name-context-menu-icon-text";
import EditIcon from "#/icons/u-edit.svg?react";
@@ -179,6 +180,7 @@ export function ProfileActionsMenu({
ref={menuRef}
className={cn(
"absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg",
+ dropdownMenuListClassName,
isPortaled &&
"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0",
)}
diff --git a/src/components/features/skills/add-skill-modal.tsx b/src/components/features/skills/add-skill-modal.tsx
index 585dc5c88e..891bd08ec9 100644
--- a/src/components/features/skills/add-skill-modal.tsx
+++ b/src/components/features/skills/add-skill-modal.tsx
@@ -9,6 +9,7 @@ import {
} from "#/constants/skills-docs";
import { I18nKey } from "#/i18n/declaration";
import { cn } from "#/utils/utils";
+import { modalTitleLgClassName } from "#/utils/modal-classes";
import CheckmarkIcon from "#/icons/checkmark.svg?react";
import CopyIcon from "#/icons/copy.svg?react";
@@ -124,7 +125,7 @@ export function AddSkillModal({ onClose }: AddSkillModalProps) {
>
<ModalCloseButton onClose={onClose} testId="add-skill-modal-close" />
<header className="flex-shrink-0 px-6 pb-4 pt-6">
- <h2 className="pr-6 text-lg font-semibold">
+ <h2 className={cn("pr-6", modalTitleLgClassName)}>
{t(I18nKey.SETTINGS$SKILLS_ADD_MODAL_TITLE)}
</h2>
<p className="mt-4 text-sm text-tertiary-light">
diff --git a/src/components/features/skills/extensions-mobile-hub.tsx b/src/components/features/skills/extensions-mobile-hub.tsx
index ee5673753a..81010ae224 100644
--- a/src/components/features/skills/extensions-mobile-hub.tsx
+++ b/src/components/features/skills/extensions-mobile-hub.tsx
@@ -13,7 +13,7 @@ export function ExtensionsMobileHub() {
data-testid="extensions-mobile-hub"
className="flex flex-col gap-4 px-4 py-2 md:hidden"
>
- <Typography.H2>{t(I18nKey.NAV$EXTENSIONS)}</Typography.H2>
+ <Typography.H2>{t(I18nKey.NAV$CUSTOMIZE)}</Typography.H2>
<nav className="flex flex-col gap-0.5">
{EXTENSIONS_NAV_ITEMS.map((item) => (
<SidebarNavLink
diff --git a/src/components/features/skills/extensions-navigation.tsx b/src/components/features/skills/extensions-navigation.tsx
index d688b57c50..afa7aaf2f6 100644
--- a/src/components/features/skills/extensions-navigation.tsx
+++ b/src/components/features/skills/extensions-navigation.tsx
@@ -99,7 +99,7 @@ export function ExtensionsNavigation() {
className="hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2 md:sticky md:top-8 md:self-start"
>
<span className="px-2 text-sm font-normal text-white">
- {t(I18nKey.NAV$EXTENSIONS)}
+ {t(I18nKey.NAV$CUSTOMIZE)}
</span>
<div className="flex flex-col gap-0.5 pt-0.5">
{EXTENSIONS_NAV_ITEMS.map((item) => {
diff --git a/src/components/features/skills/skill-detail-modal.tsx b/src/components/features/skills/skill-detail-modal.tsx
index f81ce71c0f..48bc1a824c 100644
--- a/src/components/features/skills/skill-detail-modal.tsx
+++ b/src/components/features/skills/skill-detail-modal.tsx
@@ -7,6 +7,7 @@ import { SettingsSwitch } from "#/components/features/settings/settings-switch";
import { I18nKey } from "#/i18n/declaration";
import type { SkillInfo } from "#/types/settings";
import { cn } from "#/utils/utils";
+import { modalTitleLgClassName } from "#/utils/modal-classes";
import CopyIcon from "#/icons/copy.svg?react";
import CheckmarkIcon from "#/icons/checkmark.svg?react";
import MessageSquareShareIcon from "#/icons/message-square-share.svg?react";
@@ -107,7 +108,7 @@ export function SkillDetailModal({
<div className="min-w-0 flex-1">
<h2
data-testid={`skill-modal-name-${skill.name}`}
- className="text-lg font-semibold"
+ className={modalTitleLgClassName}
>
{skill.name}
</h2>
diff --git a/src/components/shared/buttons/back-nav-button.tsx b/src/components/shared/buttons/back-nav-button.tsx
new file mode 100644
index 0000000000..9cefd4c432
--- /dev/null
+++ b/src/components/shared/buttons/back-nav-button.tsx
@@ -0,0 +1,70 @@
+import React from "react";
+import { ArrowLeft } from "lucide-react";
+import { NavigationLink } from "#/components/shared/navigation-link";
+import { cn } from "#/utils/utils";
+import { formControlBackNavButtonClassName } from "#/utils/form-control-classes";
+
+type BackNavButtonBaseProps = {
+ children: React.ReactNode;
+ testId?: string;
+ className?: string;
+};
+
+type BackNavButtonAsButtonProps = BackNavButtonBaseProps & {
+ onClick: () => void;
+};
+
+type BackNavButtonAsLinkProps = BackNavButtonBaseProps & {
+ to: string;
+ onClick?: React.MouseEventHandler<HTMLAnchorElement>;
+};
+
+export type BackNavButtonProps =
+ | BackNavButtonAsButtonProps
+ | BackNavButtonAsLinkProps;
+
+function BackNavButtonContent({
+ children,
+}: Pick<BackNavButtonBaseProps, "children">) {
+ return (
+ <>
+ <ArrowLeft size={20} aria-hidden />
+ {children}
+ </>
+ );
+}
+
+export function BackNavButton(
+ props: BackNavButtonAsLinkProps,
+): React.JSX.Element;
+export function BackNavButton(
+ props: BackNavButtonAsButtonProps,
+): React.JSX.Element;
+export function BackNavButton(props: BackNavButtonProps) {
+ const { children, testId, className } = props;
+ const classes = cn(formControlBackNavButtonClassName, className);
+
+ if ("to" in props) {
+ return (
+ <NavigationLink
+ to={props.to}
+ onClick={props.onClick}
+ data-testid={testId}
+ className={classes}
+ >
+ <BackNavButtonContent>{children}</BackNavButtonContent>
+ </NavigationLink>
+ );
+ }
+
+ return (
+ <button
+ type="button"
+ onClick={props.onClick}
+ data-testid={testId}
+ className={classes}
+ >
+ <BackNavButtonContent>{children}</BackNavButtonContent>
+ </button>
+ );
+}
diff --git a/src/components/shared/filters/enum-filter-dropdown.tsx b/src/components/shared/filters/enum-filter-dropdown.tsx
index e1a812183f..811056ae9a 100644
--- a/src/components/shared/filters/enum-filter-dropdown.tsx
+++ b/src/components/shared/filters/enum-filter-dropdown.tsx
@@ -4,6 +4,11 @@ import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import { useClickOutsideElement } from "#/hooks/use-click-outside-element";
import { cn } from "#/utils/utils";
+import {
+ dropdownFilterTriggerClassName,
+ dropdownMenuListClassName,
+ dropdownMenuRowClassName,
+} from "#/utils/dropdown-classes";
interface EnumFilterDropdownProps<T extends string> {
testId: string;
@@ -43,9 +48,7 @@ export function EnumFilterDropdown<T extends string>({
aria-label={t(I18nKey.CONVERSATION_PANEL$FILTER_LABEL)}
onClick={() => setOpen((prev) => !prev)}
className={cn(
- "inline-flex items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium transition-colors cursor-pointer",
- "border-[var(--oh-border)] bg-base-secondary text-white",
- "focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20",
+ dropdownFilterTriggerClassName,
defaultOption &&
value !== defaultOption &&
"border-white/60 bg-white/10",
@@ -69,6 +72,7 @@ export function EnumFilterDropdown<T extends string>({
className={cn(
"absolute right-0 top-full z-50 mt-1 min-w-full w-max",
"max-h-60 overflow-auto rounded-[6px] bg-tertiary p-1 context-menu-box-shadow",
+ dropdownMenuListClassName,
)}
>
{options.map((option) => {
@@ -85,8 +89,7 @@ export function EnumFilterDropdown<T extends string>({
setOpen(false);
}}
className={cn(
- "flex w-full items-center gap-2 rounded px-2 py-2 text-left text-sm text-white",
- "hover:bg-[var(--oh-interactive-hover)] cursor-pointer",
+ dropdownMenuRowClassName,
selected && "bg-[var(--oh-interactive-selected)]",
)}
>
diff --git a/src/components/shared/modals/confirmation-modals/base-modal.tsx b/src/components/shared/modals/confirmation-modals/base-modal.tsx
index a851a400a7..7a2a2ac410 100644
--- a/src/components/shared/modals/confirmation-modals/base-modal.tsx
+++ b/src/components/shared/modals/confirmation-modals/base-modal.tsx
@@ -2,6 +2,7 @@ import React from "react";
import { ModalBody } from "../modal-body";
import { ModalButton } from "../../buttons/modal-button";
import { cn } from "#/utils/utils";
+import { modalTitleClassName } from "#/utils/modal-classes";
interface ButtonConfig {
text: string;
@@ -17,13 +18,7 @@ interface BaseModalTitleProps {
export function BaseModalTitle({ title, id, className }: BaseModalTitleProps) {
return (
- <span
- id={id}
- className={cn(
- "text-xl leading-6 -tracking-[0.01em] font-medium text-content-2",
- className,
- )}
- >
+ <span id={id} className={cn(modalTitleClassName, className)}>
{title}
</span>
);
diff --git a/src/components/shared/modals/settings/settings-modal.tsx b/src/components/shared/modals/settings/settings-modal.tsx
index 231db086ab..1114145ced 100644
--- a/src/components/shared/modals/settings/settings-modal.tsx
+++ b/src/components/shared/modals/settings/settings-modal.tsx
@@ -7,6 +7,7 @@ import { SettingsForm } from "./settings-form";
import { Settings } from "#/types/settings";
import { DEFAULT_SETTINGS } from "#/services/settings";
import { HelpLink } from "#/ui/help-link";
+import { modalTitleClassName } from "#/utils/modal-classes";
interface SettingsModalProps {
settings?: Settings;
@@ -26,7 +27,7 @@ export function SettingsModal({ onClose, settings }: SettingsModalProps) {
MODAL_MAX_WIDTH_VIEWPORT,
)}
>
- <span className="text-5 leading-6 font-medium -tracking-[0.2px]">
+ <span className={modalTitleClassName}>
{t(I18nKey.AI_SETTINGS$TITLE)}
</span>
<HelpLink
diff --git a/src/constants/acp-providers.ts b/src/constants/acp-providers.ts
index 5b37947e99..b25eeb43af 100644
--- a/src/constants/acp-providers.ts
+++ b/src/constants/acp-providers.ts
@@ -1,6 +1,14 @@
import { getAcpProvider as getClientAcpProvider } from "@openhands/typescript-client";
import { I18nKey } from "#/i18n/declaration";
+/** Upstream registry fields not yet on the pinned client's exported type. */
+type ClientAcpProviderRegistry = NonNullable<
+ ReturnType<typeof getClientAcpProvider>
+> & {
+ available_models?: Array<{ id: string; label: string }>;
+ default_model?: string;
+};
+
export type ACPProviderIcon =
| "claude-code"
| "codex"
@@ -154,7 +162,7 @@ const ACP_PROVIDER_UI: Record<
export const ACP_PROVIDERS: ACPProviderConfig[] = Object.entries(
ACP_PROVIDER_UI,
).map(([key, ui]) => {
- const info = getClientAcpProvider(key);
+ const info = getClientAcpProvider(key) as ClientAcpProviderRegistry | null;
return {
key,
display_name: info?.display_name ?? key,
diff --git a/src/i18n/translation.json b/src/i18n/translation.json
index a914dee718..633ace719d 100644
--- a/src/i18n/translation.json
+++ b/src/i18n/translation.json
@@ -28508,6 +28508,23 @@
"uk": "Бібліотека",
"ca": "Biblioteca"
},
+ "NAV$CUSTOMIZE": {
+ "en": "Customize:",
+ "ja": "カスタマイズ:",
+ "zh-CN": "自定义:",
+ "zh-TW": "自訂:",
+ "ko-KR": "사용자 지정:",
+ "no": "Tilpass:",
+ "ar": "تخصيص:",
+ "de": "Anpassen:",
+ "fr": "Personnaliser :",
+ "it": "Personalizza:",
+ "pt": "Personalizar:",
+ "es": "Personalizar:",
+ "tr": "Özelleştir:",
+ "uk": "Налаштувати:",
+ "ca": "Personalitza:"
+ },
"NAV$EXTENSIONS": {
"en": "Extensions",
"ja": "拡張機能",
diff --git a/src/routes/secrets-settings.tsx b/src/routes/secrets-settings.tsx
index 69b3b08f21..3d6023987b 100644
--- a/src/routes/secrets-settings.tsx
+++ b/src/routes/secrets-settings.tsx
@@ -1,7 +1,7 @@
import { useQueryClient } from "@tanstack/react-query";
import React, { useCallback, useRef } from "react";
import { useTranslation } from "react-i18next";
-import { ArrowLeft } from "lucide-react";
+import { BackNavButton } from "#/components/shared/buttons/back-nav-button";
import { useSearchSecrets } from "#/hooks/query/use-get-secrets";
import { useDeleteSecret } from "#/hooks/mutation/use-delete-secret";
import { SecretForm } from "#/components/features/settings/secrets-settings/secret-form";
@@ -126,15 +126,9 @@ export function SecretsSettingsScreen() {
{isFormView ? (
<div className="flex flex-col gap-2">
- <button
- type="button"
- onClick={handleBackToList}
- className="flex items-center gap-2 self-start rounded-lg p-2 text-[var(--oh-muted)] transition-colors hover:bg-tertiary hover:text-white"
- data-testid="back-to-secrets"
- >
- <ArrowLeft size={20} aria-hidden />
- <span className="text-sm leading-5">{t(I18nKey.BUTTON$BACK)}</span>
- </button>
+ <BackNavButton testId="back-to-secrets" onClick={handleBackToList}>
+ {t(I18nKey.BUTTON$BACK)}
+ </BackNavButton>
<Typography.H2 testId="secret-editor-title">
{formTitle}
</Typography.H2>
diff --git a/src/tailwind.css b/src/tailwind.css
index 62d2553580..17bb1cc0b6 100644
--- a/src/tailwind.css
+++ b/src/tailwind.css
@@ -35,6 +35,7 @@
--color-muted: var(--oh-muted);
--color-text-dim: var(--oh-text-dim);
--color-text-subtle: var(--oh-text-subtle);
+ --color-modal-title: var(--oh-modal-title-foreground);
/* Semantic border aliases */
--color-border-input: var(--oh-border-input);
@@ -82,6 +83,7 @@
--oh-surface-deep: var(--cool-grey-975); /* deep inset, context menus */
--oh-overlay: var(--cool-grey-925);
--oh-overlay-foreground: var(--cool-grey-100);
+ --oh-modal-title-foreground: #ffffff;
--oh-muted: var(--cool-grey-400);
--oh-text-secondary: var(--cool-grey-300); /* readable secondary text */
--oh-text-tertiary: var(--cool-grey-200); /* tertiary, slightly dimmer */
diff --git a/src/ui/combobox-caret.tsx b/src/ui/combobox-caret.tsx
index 474bbdeb45..6e49811804 100644
--- a/src/ui/combobox-caret.tsx
+++ b/src/ui/combobox-caret.tsx
@@ -1,4 +1,5 @@
import { cn } from "#/utils/utils";
+import { formControlTransformTransitionClassName } from "#/utils/form-control-classes";
export function ComboboxCaretIcon({ className }: { className?: string }) {
return (
@@ -22,8 +23,10 @@ export function ComboboxCaretIcon({ className }: { className?: string }) {
}
/** Matches HeroUI Autocomplete selectorButton styling. */
-export const comboboxCaretButtonClassName =
- "inline-flex items-center justify-center shrink-0 rounded-none bg-transparent px-1 min-w-0 w-auto h-auto text-medium cursor-pointer outline-none transition-[transform] duration-150 ease motion-reduce:transition-none";
+export const comboboxCaretButtonClassName = cn(
+ "inline-flex items-center justify-center shrink-0 rounded-none bg-transparent px-1 min-w-0 w-auto h-auto text-medium cursor-pointer outline-none",
+ formControlTransformTransitionClassName,
+);
/** HeroUI Autocomplete selectorButton slot — keep only chevron rotation animated. */
export const heroUiAutocompleteSelectorButtonClassName = cn(
@@ -70,7 +73,8 @@ export function ComboboxCaretInline({
return (
<ComboboxCaretIcon
className={cn(
- "shrink-0 transition-[transform] duration-150 ease motion-reduce:transition-none",
+ "shrink-0",
+ formControlTransformTransitionClassName,
isOpen && "rotate-180",
className,
)}
diff --git a/src/ui/context-menu.tsx b/src/ui/context-menu.tsx
index f05faeb008..4b24a8f99f 100644
--- a/src/ui/context-menu.tsx
+++ b/src/ui/context-menu.tsx
@@ -1,6 +1,7 @@
import React from "react";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "#/utils/utils";
+import { dropdownMenuListGapClassName } from "#/utils/dropdown-classes";
const contextMenuVariants = cva(
"z-50 overflow-hidden text-[var(--oh-foreground)]",
@@ -19,7 +20,7 @@ const contextMenuVariants = cva(
default: "",
},
layout: {
- vertical: "flex flex-col gap-0",
+ vertical: cn("flex flex-col", dropdownMenuListGapClassName),
},
position: {
top: "bottom-full",
diff --git a/src/ui/dropdown/dropdown-menu.tsx b/src/ui/dropdown/dropdown-menu.tsx
index c92665bd42..bf3516b819 100644
--- a/src/ui/dropdown/dropdown-menu.tsx
+++ b/src/ui/dropdown/dropdown-menu.tsx
@@ -2,6 +2,11 @@ import React from "react";
import { Divider } from "#/ui/divider";
import { cn } from "#/utils/utils";
import { DropdownOption } from "./types";
+import {
+ dropdownMenuListClassName,
+ dropdownMenuRowClassName,
+ dropdownMenuRowIconWrapperClassName,
+} from "#/utils/dropdown-classes";
interface DropdownMenuProps {
isOpen: boolean;
@@ -41,7 +46,9 @@ export function DropdownMenu({
!isOpen && "hidden",
)}
>
- <ul {...getMenuProps({ className: "p-0" })}>
+ <ul
+ {...getMenuProps({ className: cn("p-0", dropdownMenuListClassName) })}
+ >
{isOpen && filteredOptions.length === 0 && (
<li className="px-2 py-2 text-sm text-[var(--oh-muted)] italic">
{emptyMessage}
@@ -55,16 +62,18 @@ export function DropdownMenu({
item: option,
index,
className: cn(
- "px-2 py-2 cursor-pointer text-sm rounded",
- "text-white focus:outline-none font-normal",
- "flex items-center gap-2",
- selectedItem?.value === option.value
- ? "bg-[var(--oh-interactive-selected)] text-white"
- : "hover:bg-[var(--oh-interactive-hover)]",
+ dropdownMenuRowClassName,
+ "focus:outline-none",
+ selectedItem?.value === option.value &&
+ "bg-[var(--oh-interactive-selected)] text-white",
),
})}
>
- {option.prefix}
+ {option.prefix ? (
+ <span className={dropdownMenuRowIconWrapperClassName}>
+ {option.prefix}
+ </span>
+ ) : null}
<span className="min-w-0 truncate">{option.label}</span>
</li>
))}
diff --git a/src/ui/dropdown/dropdown.tsx b/src/ui/dropdown/dropdown.tsx
index 7888f7bdf1..f423448af1 100644
--- a/src/ui/dropdown/dropdown.tsx
+++ b/src/ui/dropdown/dropdown.tsx
@@ -2,7 +2,7 @@ import React, { useState } from "react";
import { useCombobox } from "downshift";
import { cn } from "#/utils/utils";
import { DropdownOption } from "./types";
-import { formControlShellClassName } from "#/utils/form-control-classes";
+import { dropdownTriggerShellClassName } from "#/utils/dropdown-classes";
import { LoadingSpinner } from "./loading-spinner";
import { ClearButton } from "./clear-button";
import { ToggleButton } from "./toggle-button";
@@ -171,11 +171,8 @@ export function Dropdown({
{!hideTrigger ? (
<div
className={cn(
- "bg-tertiary border border-[var(--oh-border-input)] rounded p-2",
- "flex items-center gap-2",
+ dropdownTriggerShellClassName,
fitContent ? "w-auto" : "w-full",
- formControlShellClassName,
- "group w-full gap-2 px-3 text-[var(--oh-muted)] hover:text-white",
isDisabled && "cursor-not-allowed opacity-60",
className,
)}
diff --git a/src/utils/dropdown-classes.ts b/src/utils/dropdown-classes.ts
new file mode 100644
index 0000000000..50ace4fa2c
--- /dev/null
+++ b/src/utils/dropdown-classes.ts
@@ -0,0 +1,81 @@
+import { cn } from "#/utils/utils";
+import { formControlShellClassName } from "#/utils/form-control-classes";
+
+/** Snap hover colors instantly — no transition-colors delay on menus/dropdowns. */
+export const dropdownInstantColorClassName = "transition-none";
+
+/** 2px vertical gap between rows in a dropdown/context menu list. */
+export const dropdownMenuListGapClassName = "gap-0.5";
+
+/** Standard horizontal gap between a row icon and its label. */
+export const dropdownMenuRowGapClassName = "gap-2";
+
+/** Flex column shell for a dropdown menu item list. */
+export const dropdownMenuListClassName = cn(
+ "flex flex-col",
+ dropdownMenuListGapClassName,
+);
+
+/** Combobox/select trigger shell with instant hover colors. */
+export const dropdownTriggerShellClassName = cn(
+ "bg-tertiary border border-[var(--oh-border-input)] rounded p-2",
+ "flex items-center gap-2",
+ formControlShellClassName,
+ dropdownInstantColorClassName,
+ "group w-full gap-2 px-3 text-[var(--oh-muted)] hover:text-white",
+);
+
+/** Standard white-label menu row. */
+export const dropdownMenuRowClassName = cn(
+ "group flex w-full cursor-pointer items-center rounded px-2 py-2 text-left text-sm font-normal text-white",
+ dropdownMenuRowGapClassName,
+ "hover:bg-[var(--oh-interactive-hover)] disabled:cursor-not-allowed disabled:opacity-60",
+ dropdownInstantColorClassName,
+);
+
+/** Menu row using foreground token (context menus). */
+export const dropdownMenuRowForegroundClassName = cn(
+ "group flex w-full cursor-pointer items-center rounded px-2 py-2 text-start text-sm font-normal",
+ dropdownMenuRowGapClassName,
+ "text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]",
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",
+ dropdownInstantColorClassName,
+);
+
+/** Icon inside a menu row — muted until row hover/focus. */
+export const dropdownMenuRowIconClassName = cn(
+ "shrink-0 text-[var(--oh-muted)] group-hover:text-white group-focus-visible:text-white",
+ dropdownInstantColorClassName,
+);
+
+/** Wrapper for SVG/React icon nodes inside a menu row. */
+export const dropdownMenuRowIconWrapperClassName = cn(
+ "flex size-4 shrink-0 items-center justify-center [&_svg]:text-current",
+ dropdownMenuRowIconClassName,
+);
+
+/** Enum/filter dropdown trigger chip. */
+export const dropdownFilterTriggerClassName = cn(
+ "inline-flex cursor-pointer items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium",
+ "border-[var(--oh-border)] bg-base-secondary text-white",
+ "focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20",
+ dropdownInstantColorClassName,
+);
+
+/**
+ * Scroll cap for the switch-profile menu: four two-line rows
+ * (p-2 + leading-5 title + gap-0.5 + leading-4 subtitle) plus list gaps.
+ */
+export const switchProfileMenuListScrollClassName = cn(
+ dropdownMenuListClassName,
+ "overflow-y-auto custom-scrollbar-always",
+ "max-h-[13.875rem]",
+);
+
+/** Footer action row inside a dropdown panel. */
+export const dropdownFooterActionClassName = cn(
+ "group flex w-full items-center rounded-md px-2 py-2 text-sm font-normal text-white",
+ dropdownMenuRowGapClassName,
+ "hover:bg-[var(--oh-interactive-hover)]",
+ dropdownInstantColorClassName,
+);
diff --git a/src/utils/form-control-classes.ts b/src/utils/form-control-classes.ts
index 2e233d0e46..2d3c0da9a2 100644
--- a/src/utils/form-control-classes.ts
+++ b/src/utils/form-control-classes.ts
@@ -9,13 +9,56 @@ export const formControlBorderClassName = "border border-[var(--oh-border)]";
export const formControlSurfaceClassName = "bg-base-secondary";
+/** Shared transition duration for form controls and chrome buttons. */
+export const formControlTransitionDurationClassName = "duration-75";
+
+export const formControlHeroUiTransitionDurationClassName = "!duration-75";
+
+export const formControlMotionReduceClassName = "motion-reduce:transition-none";
+
+/** Shell properties that animate on hover/focus; foreground color snaps instantly. */
+export const formControlTransitionPropertiesClassName =
+ "transition-[background-color,border-color,box-shadow,opacity]";
+
/** Animate shell chrome on hover/focus; foreground color snaps instantly. */
-export const formControlTransitionClassName =
- "transition-[background-color,border-color,box-shadow,opacity] duration-150 motion-reduce:transition-none";
+export const formControlTransitionClassName = cn(
+ formControlTransitionPropertiesClassName,
+ formControlTransitionDurationClassName,
+ formControlMotionReduceClassName,
+);
/** HeroUI input wrappers ship `transition-colors`; override so caret/text hover is instant. */
-export const formControlHeroUiWrapperTransitionClassName =
- "!transition-[background-color,border-color,box-shadow,opacity] !duration-150 motion-reduce:transition-none";
+export const formControlHeroUiWrapperTransitionClassName = cn(
+ "!transition-[background-color,border-color,box-shadow,opacity]",
+ formControlHeroUiTransitionDurationClassName,
+ formControlMotionReduceClassName,
+);
+
+/** Transform-only transitions (e.g. combobox carets). */
+export const formControlTransformTransitionClassName = cn(
+ "transition-[transform] ease",
+ formControlTransitionDurationClassName,
+ formControlMotionReduceClassName,
+);
+
+/** Muted icon/pill controls: instant foreground, fading shell on hover. */
+export const formControlMutedHoverClassName =
+ "hover:text-white hover:bg-white/10";
+
+/** Text/icon pill triggers in the chat input actions row. */
+export const chatInputPillButtonClassName = cn(
+ "inline-flex items-center gap-1 rounded-[100px] border border-transparent px-1.5",
+ "text-sm font-normal leading-5 text-[var(--oh-muted)] whitespace-nowrap min-w-0 cursor-pointer",
+ formControlTransitionClassName,
+ formControlMutedHoverClassName,
+);
+
+/** Circular icon triggers in the chat input actions row. */
+export const chatInputIconButtonClassName = cn(
+ "flex items-center justify-center rounded-full text-[var(--oh-muted)] cursor-pointer",
+ formControlTransitionClassName,
+ formControlMutedHoverClassName,
+);
export const formControlFocusClassName =
"focus:border-white/40 focus:ring-1 focus:ring-white/20 focus:outline-none";
@@ -93,3 +136,11 @@ export const formControlFilterTriggerClassName = cn(
formControlSurfaceClassName,
"shrink-0 text-white",
);
+
+/** Muted back navigation control with tertiary hover fill (settings sub-pages, detail views). */
+export const formControlBackNavButtonClassName = cn(
+ "inline-flex items-center gap-2 self-start rounded-lg p-2",
+ "text-sm font-normal leading-5 text-[var(--oh-muted)] cursor-pointer",
+ formControlTransitionClassName,
+ "hover:bg-tertiary hover:text-white",
+);
diff --git a/src/utils/git-control-bar-classes.ts b/src/utils/git-control-bar-classes.ts
new file mode 100644
index 0000000000..be0ff70ee8
--- /dev/null
+++ b/src/utils/git-control-bar-classes.ts
@@ -0,0 +1,20 @@
+import { cn } from "#/utils/utils";
+
+export const gitControlBarActionButtonBaseClassName =
+ "flex flex-row gap-1 items-center justify-center rounded-[100px]";
+
+export function gitControlBarActionButtonClassName(isEnabled: boolean) {
+ return cn(
+ gitControlBarActionButtonBaseClassName,
+ isEnabled
+ ? "bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer text-white"
+ : "bg-[var(--oh-surface)] cursor-not-allowed opacity-50 text-[var(--oh-muted)]",
+ );
+}
+
+export function gitControlBarActionIconColor(isEnabled: boolean) {
+ return isEnabled ? "white" : "var(--oh-muted)";
+}
+
+export const gitControlBarActionLabelClassName =
+ "font-normal text-sm leading-5 truncate";
diff --git a/src/utils/mobile-section-nav.ts b/src/utils/mobile-section-nav.ts
index eeff3eb7a1..fc56479dda 100644
--- a/src/utils/mobile-section-nav.ts
+++ b/src/utils/mobile-section-nav.ts
@@ -40,7 +40,7 @@ export function getMobileTopBarState(pathname: string): MobileTopBarState {
return {
mode: "back",
backTo: CUSTOMIZE_HUB,
- backLabelKey: I18nKey.NAV$EXTENSIONS,
+ backLabelKey: I18nKey.NAV$CUSTOMIZE,
};
}
diff --git a/src/utils/mobile-top-bar-icon-button-classes.ts b/src/utils/mobile-top-bar-icon-button-classes.ts
index b20af8a467..92a7054c3c 100644
--- a/src/utils/mobile-top-bar-icon-button-classes.ts
+++ b/src/utils/mobile-top-bar-icon-button-classes.ts
@@ -1,5 +1,8 @@
import { cn } from "#/utils/utils";
-import { formControlTransitionClassName } from "#/utils/form-control-classes";
+import {
+ formControlTransitionClassName,
+ formControlMutedHoverClassName,
+} from "#/utils/form-control-classes";
/**
* Shared control for icon-only buttons in mobile top bars (global nav, chat
@@ -10,7 +13,7 @@ export const mobileTopBarIconButtonClassName = cn(
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1",
"text-[var(--oh-muted)]",
formControlTransitionClassName,
- "hover:bg-white/10 hover:text-white",
+ formControlMutedHoverClassName,
);
/** Lucide / inline SVG wrapper size aligned with `BlockDrawerLeftIcon` (`w-5 h-5`). */
diff --git a/src/utils/modal-classes.ts b/src/utils/modal-classes.ts
new file mode 100644
index 0000000000..837fe851db
--- /dev/null
+++ b/src/utils/modal-classes.ts
@@ -0,0 +1,19 @@
+import { cn } from "#/utils/utils";
+
+/** Primary modal heading on dark overlay surfaces. */
+export const modalTitleClassName = cn(
+ "text-xl leading-6 -tracking-[0.01em] font-medium text-[var(--oh-modal-title-foreground)]",
+);
+
+/** Compact modal header bar title (folder browser, manage workspaces). */
+export const modalTitleSmClassName = cn(
+ "text-sm font-medium text-[var(--oh-modal-title-foreground)]",
+);
+
+/** Large modal title used by form-style dialogs. */
+export const modalTitleLgClassName = cn(
+ "text-lg font-medium text-[var(--oh-modal-title-foreground)]",
+);
+
+/** Alias of {@link modalTitleLgClassName} for historical call sites. */
+export const modalTitleLgMediumClassName = modalTitleLgClassName;