π OpenHands: AI-Driven Development
fix(lint): theme automation validation decorations (#18526)
Engel Nyste29a3631128e
diff --git a/__tests__/themes/color-themes.test.tsx b/__tests__/themes/color-themes.test.tsxindex 5e3595b4fe..7cd8cfd851 100644--- a/__tests__/themes/color-themes.test.tsx+++ b/__tests__/themes/color-themes.test.tsx@@ -137,19 +137,24 @@ describe("color themes", () => {}// @spec FF-001 β Theme-aware validation and load errors- // The automation setup draft bar's error pill: Tailwind red-500- // (#fb2c36) at 5% over the theme surface.- const surface = channels(resolve("--oh-surface"));- const errorPillSurface = channels("#fb2c36").map(- (channel, index) => channel * 0.05 + surface[index] * 0.95,- );- expect(- contrast(- luminance(resolve("--oh-feedback-error")),- luminance(errorPillSurface),- ),- "--oh-feedback-error against the draft bar error pill",- ).toBeGreaterThanOrEqual(4.5);+ // Validate the automation pill and Test runs alert on their actual surfaces.+ for (const [surfaceRole, opacity] of [+ ["--oh-surface", 0.05],+ ["--oh-color-base", 0.1],+ ] as const) {+ const surface = channels(resolve(surfaceRole));+ const tintedSurface = channels(resolve("--oh-feedback-error")).map(+ (channel, index) =>+ channel * opacity + surface[index] * (1 - opacity),+ );+ expect(+ contrast(+ luminance(resolve("--oh-feedback-error")),+ luminance(tintedSurface),+ ),+ `--oh-feedback-error against its ${opacity * 100}% tint over ${surfaceRole}`,+ ).toBeGreaterThanOrEqual(4.5);+ }// @spec HL-001 β Home mode labels stay readable on the hover pillexpect(diff --git a/src/components/features/automations/setup/automation-setup-panel.tsx b/src/components/features/automations/setup/automation-setup-panel.tsxindex 15fff8e7e2..31fd1f504e 100644--- a/src/components/features/automations/setup/automation-setup-panel.tsx+++ b/src/components/features/automations/setup/automation-setup-panel.tsx@@ -450,7 +450,7 @@ function DraftStatusBar({const validityClassName = cn("max-w-full min-w-0 whitespace-normal rounded-full px-2.5 py-0.5 text-left text-xs leading-4",validationMessage- ? "w-fit bg-red-500/5 text-feedback-error"+ ? "w-fit bg-feedback-error/5 text-feedback-error": "bg-[var(--oh-success)]/10 text-[var(--oh-success)]",);@@ -581,7 +581,7 @@ function DraftRunsPage({key={message}role="alert"data-testid="automation-setup-draft-runs-error"- className="rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3 text-sm text-feedback-error"+ className="rounded-xl border border-feedback-error/40 bg-feedback-error/10 px-4 py-3 text-sm text-feedback-error">{message}</p>