Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(automations): keep the setup error pill at 4.5:1 on every theme (#18482)

Engel Nystcb835dd3283b
diff --git a/__tests__/themes/color-themes.test.tsx b/__tests__/themes/color-themes.test.tsx
index bce84d7cf1..1247439a4a 100644
--- a/__tests__/themes/color-themes.test.tsx
+++ b/__tests__/themes/color-themes.test.tsx
@@ -60,6 +60,21 @@ describe("color themes", () => {
).toBeGreaterThanOrEqual(4.5);
}
+ // @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);
+
// @spec HL-001 β€” Home mode labels stay readable on the hover pill
expect(
contrast(
diff --git a/src/components/features/automations/setup/automation-setup-panel.tsx b/src/components/features/automations/setup/automation-setup-panel.tsx
index f0df5ba40b..8af56138a7 100644
--- a/src/components/features/automations/setup/automation-setup-panel.tsx
+++ b/src/components/features/automations/setup/automation-setup-panel.tsx
@@ -445,10 +445,12 @@ function DraftStatusBar({
const validationMessage = draft.validationErrors?.[0]?.message ?? null;
const statusText = getDraftExecutionStatusText(draft, runs, t);
+ // @spec FF-001 β€” Theme-aware validation and load errors
+ // A 5% tint keeps the error text at 4.5:1 on every theme's surface.
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/10 text-feedback-error"
+ ? "w-fit bg-red-500/5 text-feedback-error"
: "bg-[var(--oh-success)]/10 text-[var(--oh-success)]",
);