Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(settings): use theme contrast ink for Model Router list text (#18013)

Engel Nystae0304e871f3
diff --git a/__tests__/components/settings/meta-llm-profiles/meta-llm-settings-view.test.tsx b/__tests__/components/settings/meta-llm-profiles/meta-llm-settings-view.test.tsx
index 92eae65577..5b8f9dafc1 100644
--- a/__tests__/components/settings/meta-llm-profiles/meta-llm-settings-view.test.tsx
+++ b/__tests__/components/settings/meta-llm-profiles/meta-llm-settings-view.test.tsx
@@ -1,5 +1,5 @@
import { describe, expect, it, vi, beforeEach, type Mock } from "vitest";
-import { fireEvent, screen, waitFor } from "@testing-library/react";
+import { fireEvent, screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { HttpError } from "@openhands/typescript-client";
import { renderWithProviders } from "test-utils";
@@ -165,6 +165,24 @@ describe("MetaLlmSettingsView", () => {
expect(screen.getAllByTestId("meta-profile-active-badge")).toHaveLength(1);
});
+ it("renders the list heading and router names in the theme's contrast ink", () => {
+ // Literal white is invisible on light palettes (#17918); `text-contrast`
+ // follows the selected color theme like the LLM profiles list does.
+ renderWithProviders(<MetaLlmSettingsView />);
+
+ const heading = screen.getByRole("heading", {
+ name: "SETTINGS$META_PROFILES_AVAILABLE",
+ });
+ const routerName = within(
+ screen.getByTestId("meta-profile-row-balanced"),
+ ).getByText("balanced");
+
+ for (const element of [heading, routerName]) {
+ expect(element).toHaveClass("text-contrast");
+ expect(element).not.toHaveClass("text-white");
+ }
+ });
+
it("shows the empty state when there are no meta-profiles", () => {
vi.mocked(useMetaProfilesHook.useMetaProfiles).mockReturnValue({
data: { meta_profiles: [], active_meta_profile: null },
diff --git a/src/components/features/settings/meta-llm-profiles/meta-llm-settings-view.tsx b/src/components/features/settings/meta-llm-profiles/meta-llm-settings-view.tsx
index f7242ca321..d9d0a08e30 100644
--- a/src/components/features/settings/meta-llm-profiles/meta-llm-settings-view.tsx
+++ b/src/components/features/settings/meta-llm-profiles/meta-llm-settings-view.tsx
@@ -324,7 +324,7 @@ export function MetaLlmSettingsView() {
) : null}
<div className="flex flex-wrap items-center justify-between gap-3">
- <h2 className="text-base font-medium text-white">
+ <h2 className="text-base font-medium text-contrast">
{t(I18nKey.SETTINGS$META_PROFILES_AVAILABLE)}
</h2>
<BrandButton
diff --git a/src/components/features/settings/meta-llm-profiles/meta-profile-row.tsx b/src/components/features/settings/meta-llm-profiles/meta-profile-row.tsx
index adf94213af..f6b97efcdd 100644
--- a/src/components/features/settings/meta-llm-profiles/meta-profile-row.tsx
+++ b/src/components/features/settings/meta-llm-profiles/meta-profile-row.tsx
@@ -46,7 +46,7 @@ export function MetaProfileRow({
>
<div className="flex min-w-0 flex-1 items-center gap-3">
<span
- className="min-w-0 max-w-full truncate text-sm font-medium text-white"
+ className="min-w-0 max-w-full truncate text-sm font-medium text-contrast"
title={info.name}
>
{info.name}