Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(frontend): align Automations pages with Automation repo color scheme (#176)

Hiep Le498f44359fc2
diff --git a/__tests__/components/automations/detail/active-status-badge.test.tsx b/__tests__/components/automations/detail/active-status-badge.test.tsx
new file mode 100644
index 0000000000..824ba8c06f
--- /dev/null
+++ b/__tests__/components/automations/detail/active-status-badge.test.tsx
@@ -0,0 +1,23 @@
+import { render, screen } from "@testing-library/react";
+import { describe, it, expect } from "vitest";
+import { ActiveStatusBadge } from "#/components/features/automations/detail/active-status-badge";
+import { I18nKey } from "#/i18n/declaration";
+
+describe("ActiveStatusBadge", () => {
+ it.each([
+ [true, I18nKey.AUTOMATIONS$DETAIL$ACTIVE, "active-status-badge-active"],
+ [
+ false,
+ I18nKey.AUTOMATIONS$DETAIL$INACTIVE,
+ "active-status-badge-inactive",
+ ],
+ ])(
+ "renders the matching label and testid when active=%s",
+ (active, labelKey, testId) => {
+ render(<ActiveStatusBadge active={active} />);
+
+ expect(screen.getByText(labelKey)).toBeInTheDocument();
+ expect(screen.getByTestId(testId)).toBeInTheDocument();
+ },
+ );
+});
diff --git a/__tests__/components/automations/detail/run-status-badge.test.tsx b/__tests__/components/automations/detail/run-status-badge.test.tsx
index f2d8569c90..afeab3abf0 100644
--- a/__tests__/components/automations/detail/run-status-badge.test.tsx
+++ b/__tests__/components/automations/detail/run-status-badge.test.tsx
@@ -2,41 +2,31 @@ import { render, screen } from "@testing-library/react";
import { describe, it, expect } from "vitest";
import { RunStatusBadge } from "#/components/features/automations/detail/run-status-badge";
import { AutomationRunStatus } from "#/types/automation";
+import { I18nKey } from "#/i18n/declaration";
describe("RunStatusBadge", () => {
- it("renders badge with correct style for completed status", () => {
- const { container } = render(
- <RunStatusBadge status={AutomationRunStatus.COMPLETED} />,
- );
- const badge = container.querySelector("span");
- expect(badge).toBeInTheDocument();
- expect(badge?.className).toContain("text-success");
- });
+ it.each([
+ [AutomationRunStatus.COMPLETED, I18nKey.AUTOMATIONS$DETAIL$SUCCESSFUL],
+ [AutomationRunStatus.FAILED, I18nKey.AUTOMATIONS$DETAIL$FAILED],
+ [AutomationRunStatus.PENDING, I18nKey.AUTOMATIONS$DETAIL$PENDING],
+ [AutomationRunStatus.RUNNING, I18nKey.AUTOMATIONS$DETAIL$RUNNING],
+ ])("renders the %s label for the matching status", (status, labelKey) => {
+ render(<RunStatusBadge status={status} />);
- it("renders badge with correct style for failed status", () => {
- const { container } = render(
- <RunStatusBadge status={AutomationRunStatus.FAILED} />,
- );
- const badge = container.querySelector("span");
- expect(badge).toBeInTheDocument();
- expect(badge?.className).toContain("text-red-400");
+ expect(screen.getByText(labelKey)).toBeInTheDocument();
});
- it("renders badge with correct style for pending status", () => {
- const { container } = render(
- <RunStatusBadge status={AutomationRunStatus.PENDING} />,
- );
- const badge = container.querySelector("span");
- expect(badge).toBeInTheDocument();
- expect(badge?.className).toContain("text-neutral-400");
- });
+ it.each([
+ [AutomationRunStatus.COMPLETED, "run-status-icon-completed"],
+ [AutomationRunStatus.FAILED, "run-status-icon-failed"],
+ [AutomationRunStatus.PENDING, "run-status-icon-pending"],
+ [AutomationRunStatus.RUNNING, "run-status-icon-pending"],
+ ])(
+ "renders the %s icon variant for the matching status",
+ (status, testId) => {
+ render(<RunStatusBadge status={status} />);
- it("renders badge with correct style for running status", () => {
- const { container } = render(
- <RunStatusBadge status={AutomationRunStatus.RUNNING} />,
- );
- const badge = container.querySelector("span");
- expect(badge).toBeInTheDocument();
- expect(badge?.className).toContain("text-neutral-400");
- });
+ expect(screen.getByTestId(testId)).toBeInTheDocument();
+ },
+ );
});
diff --git a/src/components/features/automations/automation-card-skeleton.tsx b/src/components/features/automations/automation-card-skeleton.tsx
index 7b29d8833f..54cf90883f 100644
--- a/src/components/features/automations/automation-card-skeleton.tsx
+++ b/src/components/features/automations/automation-card-skeleton.tsx
@@ -2,17 +2,17 @@ export function AutomationCardSkeleton() {
return (
<div
data-testid="automation-card-skeleton"
- className="rounded-2xl border border-neutral-700 bg-neutral-800 p-5"
+ className="rounded-2xl border border-border bg-surface-card p-5"
>
<div className="flex items-start justify-between">
- <div className="h-5 w-40 animate-pulse rounded bg-neutral-700" />
- <div className="h-5 w-10 animate-pulse rounded-full bg-neutral-700" />
+ <div className="h-5 w-40 animate-pulse rounded bg-surface-elevated" />
+ <div className="h-5 w-10 animate-pulse rounded-full bg-surface-elevated" />
</div>
- <div className="mt-2 h-4 w-72 animate-pulse rounded bg-neutral-700" />
+ <div className="mt-2 h-4 w-72 animate-pulse rounded bg-surface-elevated" />
<div className="mt-4 flex gap-2">
- <div className="h-7 w-32 animate-pulse rounded-full bg-neutral-700" />
- <div className="h-7 w-28 animate-pulse rounded-full bg-neutral-700" />
- <div className="h-7 w-24 animate-pulse rounded-full bg-neutral-700" />
+ <div className="h-7 w-32 animate-pulse rounded-full bg-surface-elevated" />
+ <div className="h-7 w-28 animate-pulse rounded-full bg-surface-elevated" />
+ <div className="h-7 w-24 animate-pulse rounded-full bg-surface-elevated" />
</div>
</div>
);
diff --git a/src/components/features/automations/automation-card.tsx b/src/components/features/automations/automation-card.tsx
index 416000e794..0a64b68711 100644
--- a/src/components/features/automations/automation-card.tsx
+++ b/src/components/features/automations/automation-card.tsx
@@ -59,14 +59,14 @@ export function AutomationCard({
onKeyDown={(e) => {
if (e.key === "Enter") handleCardClick();
}}
- className="cursor-pointer rounded-2xl border border-neutral-700 bg-neutral-800 p-5 transition-colors hover:border-neutral-600"
+ className="cursor-pointer rounded-2xl border border-border bg-surface-card p-5 transition-colors hover:border-border-hover"
>
<div className="flex items-start justify-between">
<div className="min-w-0 flex-1">
<h3 className="truncate text-base font-semibold text-white">
{automation.name}
</h3>
- <p className="mt-1 line-clamp-2 text-sm text-neutral-400">
+ <p className="mt-1 line-clamp-2 text-sm text-content-muted">
{automation.prompt}
</p>
</div>
diff --git a/src/components/features/automations/create-instructions.tsx b/src/components/features/automations/create-instructions.tsx
index 8f6aa479a8..65a631a7a9 100644
--- a/src/components/features/automations/create-instructions.tsx
+++ b/src/components/features/automations/create-instructions.tsx
@@ -27,14 +27,14 @@ export function CreateInstructions({
<>
<div className="mt-4 grid gap-4 sm:grid-cols-2">
{/* Option 1: Claude Code / Codex */}
- <div className="rounded-lg border border-default bg-base-secondary p-4">
+ <div className="rounded-lg border border-border bg-surface-card p-4">
<div className="flex items-center gap-2">
- <TerminalIcon className="size-5 text-basic" />
+ <TerminalIcon className="size-5 text-content-muted" />
<span className="text-sm font-medium text-content">
{t(I18nKey.AUTOMATIONS$EMPTY_OPTION_PLUGIN_TITLE)}
</span>
</div>
- <p className="mt-2 text-sm text-basic">
+ <p className="mt-2 text-sm text-content-muted">
<a
href={PLUGIN_INSTALL_URL}
target="_blank"
@@ -45,25 +45,25 @@ export function CreateInstructions({
</a>{" "}
{t(I18nKey.AUTOMATIONS$EMPTY_OPTION_PLUGIN_DESC)}
</p>
- <code className="mt-2 block rounded bg-base px-3 py-2 font-mono text-xs text-content">
+ <code className="mt-2 block rounded bg-surface-elevated px-3 py-2 font-mono text-xs text-content">
{PLUGIN_COMMAND}
</code>
</div>
{/* Option 2: OpenHands Cloud conversation */}
- <div className="rounded-lg border border-default bg-base-secondary p-4">
+ <div className="rounded-lg border border-border bg-surface-card p-4">
<div className="flex items-center gap-2">
- <SparkleIcon className="size-5 text-basic" />
+ <SparkleIcon className="size-5 text-content-muted" />
<span className="text-sm font-medium text-content">
{t(I18nKey.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_TITLE)}
</span>
</div>
- <p className="mt-2 text-sm text-basic">
+ <p className="mt-2 text-sm text-content-muted">
{t(I18nKey.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC)}
</p>
<a
href={NEW_CONVERSATION_URL}
- className="mt-2 inline-flex items-center gap-1 rounded-md bg-base px-3 py-2 text-xs font-medium text-content hover:bg-default transition-colors"
+ className="mt-2 inline-flex items-center gap-1 rounded-md bg-surface-elevated px-3 py-2 text-xs font-medium text-content hover:bg-border transition-colors"
>
{t(I18nKey.AUTOMATIONS$EMPTY_START_CONVERSATION)}
<span aria-hidden="true">β†’</span>
@@ -72,7 +72,7 @@ export function CreateInstructions({
</div>
{/* Documentation link */}
- <p className="mt-4 text-center text-sm text-basic">
+ <p className="mt-4 text-center text-sm text-content-muted">
<a
href={DOCS_URL}
target="_blank"
@@ -87,18 +87,18 @@ export function CreateInstructions({
if (collapsible) {
return (
- <div className="w-full rounded-lg border border-default bg-base-secondary">
+ <div className="w-full rounded-lg border border-border bg-surface-card">
<button
type="button"
onClick={() => setIsExpanded(!isExpanded)}
aria-expanded={isExpanded}
- className="flex w-full items-center justify-between p-4 text-left hover:bg-base transition-colors rounded-lg"
+ className="flex w-full items-center justify-between p-4 text-left hover:bg-surface-elevated transition-colors rounded-lg"
>
<span className="text-sm font-medium text-content">
{t(I18nKey.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}
</span>
<ChevronDownIcon
- className={`size-5 text-basic transition-transform ${
+ className={`size-5 text-content-muted transition-transform ${
isExpanded ? "rotate-180" : ""
}`}
/>
diff --git a/src/components/features/automations/delete-confirmation-modal.tsx b/src/components/features/automations/delete-confirmation-modal.tsx
index 1cdb98f5d5..213af32b4c 100644
--- a/src/components/features/automations/delete-confirmation-modal.tsx
+++ b/src/components/features/automations/delete-confirmation-modal.tsx
@@ -29,11 +29,11 @@ export function DeleteConfirmationModal({
}}
role="presentation"
/>
- <div className="relative w-full max-w-sm rounded-xl border border-neutral-700 bg-neutral-800 p-6">
+ <div className="relative w-full max-w-sm rounded-xl border border-border bg-surface-card p-6">
<button
type="button"
onClick={onCancel}
- className="absolute right-4 top-4 text-neutral-400 hover:text-white"
+ className="absolute right-4 top-4 text-content-muted hover:text-content"
aria-label="Close"
>
<XMarkIcon className="size-5" />
@@ -42,7 +42,7 @@ export function DeleteConfirmationModal({
<h2 className="text-lg font-semibold text-white">
{t(I18nKey.AUTOMATIONS$DELETE_CONFIRM_TITLE)}
</h2>
- <p className="mt-2 text-sm text-neutral-400">
+ <p className="mt-2 text-sm text-content-muted">
{t(I18nKey.AUTOMATIONS$DELETE_CONFIRM_MESSAGE, {
name: automationName,
})}
@@ -52,14 +52,14 @@ export function DeleteConfirmationModal({
<button
type="button"
onClick={onCancel}
- className="rounded-lg border border-neutral-600 px-4 py-2 text-sm text-white hover:bg-neutral-700"
+ className="rounded-lg border border-border px-4 py-2 text-sm text-white hover:bg-surface-elevated"
>
{t(I18nKey.AUTOMATIONS$CANCEL)}
</button>
<button
type="button"
onClick={onConfirm}
- className="rounded-lg bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700"
+ className="rounded-lg bg-status-fail-solid px-4 py-2 text-sm text-white hover:bg-status-fail-solid-hover"
>
{t(I18nKey.AUTOMATIONS$DELETE)}
</button>
diff --git a/src/components/features/automations/detail/active-status-badge.tsx b/src/components/features/automations/detail/active-status-badge.tsx
index a85041eaef..3dfde68050 100644
--- a/src/components/features/automations/detail/active-status-badge.tsx
+++ b/src/components/features/automations/detail/active-status-badge.tsx
@@ -10,10 +10,13 @@ export function ActiveStatusBadge({ active }: ActiveStatusBadgeProps) {
return (
<span
+ data-testid={
+ active ? "active-status-badge-active" : "active-status-badge-inactive"
+ }
className={`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium ${
active
- ? "bg-success/20 text-success"
- : "bg-neutral-700 text-neutral-400"
+ ? "bg-status-success-badge-bg text-status-success-text"
+ : "bg-border text-content-muted"
}`}
>
{active
diff --git a/src/components/features/automations/detail/activity-log-item.tsx b/src/components/features/automations/detail/activity-log-item.tsx
index 0fc27184ca..142f4c3140 100644
--- a/src/components/features/automations/detail/activity-log-item.tsx
+++ b/src/components/features/automations/detail/activity-log-item.tsx
@@ -31,11 +31,11 @@ export function ActivityLogItem({ run }: ActivityLogItemProps) {
const content = (
<>
<div className="flex items-center gap-3">
- <span className="text-sm text-neutral-200">
+ <span className="text-sm text-content">
{formatRunTimestamp(run.started_at, i18n.language)}
</span>
{!hasConversation && (
- <span className="text-xs text-neutral-500 italic">
+ <span className="text-xs text-content-muted italic">
({t(I18nKey.AUTOMATIONS$DETAIL$NO_CONVERSATION)})
</span>
)}
@@ -48,7 +48,7 @@ export function ActivityLogItem({ run }: ActivityLogItemProps) {
return (
<a
href={getConversationUrl(run.conversation_id)}
- className="flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-neutral-700/50 focus:bg-neutral-700/50 focus:outline-none"
+ className="flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-surface-elevated focus:bg-surface-elevated focus:outline-none"
aria-label={`View conversation for run at ${formatRunTimestamp(run.started_at, i18n.language)}`}
>
{content}
diff --git a/src/components/features/automations/detail/activity-log-section.tsx b/src/components/features/automations/detail/activity-log-section.tsx
index 3be3724ac4..1c9bc0abe2 100644
--- a/src/components/features/automations/detail/activity-log-section.tsx
+++ b/src/components/features/automations/detail/activity-log-section.tsx
@@ -19,12 +19,12 @@ export function ActivityLogSection({ automationId }: ActivityLogSectionProps) {
const hasMore = data ? data.total > data.runs.length : false;
return (
- <div className="rounded-2xl border border-neutral-700 bg-neutral-800">
- <div className="flex items-center gap-2 border-b border-neutral-700 px-5 pb-3 pt-4">
- <span className="size-4 text-neutral-400">
+ <div className="rounded-2xl border border-border bg-surface-card">
+ <div className="flex items-center gap-2 border-b border-border px-5 pb-3 pt-4">
+ <span className="size-4 text-content-muted">
<ActivityIcon className="size-4" />
</span>
- <h3 className="text-sm font-medium text-neutral-200">
+ <h3 className="text-sm font-medium text-content">
{t(I18nKey.AUTOMATIONS$DETAIL$ACTIVITY_LOG)}
</h3>
</div>
@@ -36,15 +36,15 @@ export function ActivityLogSection({ automationId }: ActivityLogSectionProps) {
key={`skeleton-${i}`}
className="flex items-center justify-between py-3"
>
- <div className="h-5 w-64 animate-pulse rounded bg-neutral-700" />
- <div className="h-6 w-24 animate-pulse rounded-full bg-neutral-700" />
+ <div className="h-5 w-64 animate-pulse rounded bg-surface-elevated" />
+ <div className="h-6 w-24 animate-pulse rounded-full bg-surface-elevated" />
</div>
))}
</div>
)}
{!isLoading && data && data.runs.length === 0 && (
- <p className="px-5 py-8 text-center text-sm text-neutral-400">
+ <p className="px-5 py-8 text-center text-sm text-content-muted">
{t(I18nKey.AUTOMATIONS$DETAIL$NO_RUNS)}
</p>
)}
@@ -54,18 +54,18 @@ export function ActivityLogSection({ automationId }: ActivityLogSectionProps) {
{data.runs.map((run, index) => (
<div
key={run.id}
- className={index > 0 ? "border-t border-neutral-700" : ""}
+ className={index > 0 ? "border-t border-border" : ""}
>
<ActivityLogItem run={run} />
</div>
))}
{hasMore && (
- <div className="border-t border-neutral-700 px-5 py-3">
+ <div className="border-t border-border px-5 py-3">
<button
type="button"
onClick={() => setLimit((prev) => prev + PAGE_SIZE)}
- className="text-sm text-neutral-400 hover:text-neutral-200"
+ className="text-sm text-content-muted hover:text-content"
>
{t(I18nKey.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)}
</button>
diff --git a/src/components/features/automations/detail/back-link.tsx b/src/components/features/automations/detail/back-link.tsx
index bce6eb2407..b238736ed0 100644
--- a/src/components/features/automations/detail/back-link.tsx
+++ b/src/components/features/automations/detail/back-link.tsx
@@ -9,7 +9,7 @@ export function BackLink() {
return (
<NavigationLink
to="/automations"
- className="inline-flex items-center gap-1.5 text-sm text-neutral-400 hover:text-neutral-200"
+ className="inline-flex items-center gap-1.5 text-sm text-content-muted hover:text-content"
>
<ChevronLeftIcon className="size-4" />
{t(I18nKey.AUTOMATIONS$DETAIL$BACK_TO_LIST)}
diff --git a/src/components/features/automations/detail/branch-badge.tsx b/src/components/features/automations/detail/branch-badge.tsx
index 05511e2941..380f47fd9c 100644
--- a/src/components/features/automations/detail/branch-badge.tsx
+++ b/src/components/features/automations/detail/branch-badge.tsx
@@ -4,7 +4,7 @@ interface BranchBadgeProps {
export function BranchBadge({ branch }: BranchBadgeProps) {
return (
- <span className="inline-flex items-center rounded-full border border-neutral-600 bg-neutral-700/50 px-2.5 py-0.5 text-xs text-neutral-400">
+ <span className="inline-flex items-center rounded-full border border-border bg-pill-bg px-2.5 py-0.5 text-xs text-content-muted">
{branch}
</span>
);
diff --git a/src/components/features/automations/detail/config-field.tsx b/src/components/features/automations/detail/config-field.tsx
index 817e06aa87..1c68981280 100644
--- a/src/components/features/automations/detail/config-field.tsx
+++ b/src/components/features/automations/detail/config-field.tsx
@@ -8,10 +8,10 @@ export function ConfigField({ icon, label, children }: ConfigFieldProps) {
return (
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2">
- <span className="size-3.5 text-neutral-400">{icon}</span>
- <span className="text-xs font-medium text-neutral-400">{label}</span>
+ <span className="size-3.5 text-content-muted">{icon}</span>
+ <span className="text-xs font-medium text-content-muted">{label}</span>
</div>
- <div className="text-sm text-neutral-200">{children}</div>
+ <div className="text-sm text-content">{children}</div>
</div>
);
}
diff --git a/src/components/features/automations/detail/detail-header.tsx b/src/components/features/automations/detail/detail-header.tsx
index 2865ceb734..f2b5b94fda 100644
--- a/src/components/features/automations/detail/detail-header.tsx
+++ b/src/components/features/automations/detail/detail-header.tsx
@@ -42,7 +42,7 @@ export function DetailHeader({
<div className="flex flex-col gap-4">
<div className="flex items-start justify-between">
<div className="flex items-center gap-3">
- <h1 className="text-xl font-semibold text-neutral-100">
+ <h1 className="text-xl font-semibold text-content">
{automation.name}
</h1>
<ActiveStatusBadge active={automation.enabled} />
diff --git a/src/components/features/automations/detail/detail-skeleton.tsx b/src/components/features/automations/detail/detail-skeleton.tsx
index 07d2fdd59c..277a483d34 100644
--- a/src/components/features/automations/detail/detail-skeleton.tsx
+++ b/src/components/features/automations/detail/detail-skeleton.tsx
@@ -1,6 +1,6 @@
function SkeletonBlock({ className }: { className: string }) {
return (
- <div className={`animate-pulse rounded bg-neutral-700 ${className}`} />
+ <div className={`animate-pulse rounded bg-surface-elevated ${className}`} />
);
}
diff --git a/src/components/features/automations/detail/not-found-state.tsx b/src/components/features/automations/detail/not-found-state.tsx
index 785da91960..85069801a7 100644
--- a/src/components/features/automations/detail/not-found-state.tsx
+++ b/src/components/features/automations/detail/not-found-state.tsx
@@ -8,11 +8,11 @@ export function NotFoundState() {
return (
<div className="flex flex-col items-center justify-center py-20">
- <ExclamationCircleIcon className="size-12 text-neutral-400" />
- <p className="mt-4 text-sm font-medium text-neutral-200">
+ <ExclamationCircleIcon className="size-12 text-content-muted" />
+ <p className="mt-4 text-sm font-medium text-content">
{t(I18nKey.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}
</p>
- <p className="mt-2 text-sm text-neutral-400">
+ <p className="mt-2 text-sm text-content-muted">
{t(I18nKey.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}
</p>
<div className="mt-6">
diff --git a/src/components/features/automations/detail/plugin-chip.tsx b/src/components/features/automations/detail/plugin-chip.tsx
index 077981a7c0..d95f9a989e 100644
--- a/src/components/features/automations/detail/plugin-chip.tsx
+++ b/src/components/features/automations/detail/plugin-chip.tsx
@@ -4,7 +4,7 @@ interface PluginChipProps {
export function PluginChip({ name }: PluginChipProps) {
return (
- <span className="inline-flex items-center rounded-full border border-neutral-600 bg-neutral-700/30 px-3.5 py-1.5 text-sm text-neutral-200">
+ <span className="inline-flex items-center rounded-full border border-border bg-muted-overlay px-3.5 py-1.5 text-sm text-content">
{name}
</span>
);
diff --git a/src/components/features/automations/detail/prompt-section.tsx b/src/components/features/automations/detail/prompt-section.tsx
index 188807958a..052561e22f 100644
--- a/src/components/features/automations/detail/prompt-section.tsx
+++ b/src/components/features/automations/detail/prompt-section.tsx
@@ -15,8 +15,8 @@ export function PromptSection({ prompt }: PromptSectionProps) {
icon={<TerminalIcon className="size-4" />}
title={t(I18nKey.AUTOMATIONS$DETAIL$PROMPT)}
>
- <div className="rounded-xl bg-neutral-900/50">
- <p className="whitespace-pre-wrap text-sm leading-6 text-neutral-200">
+ <div className="rounded-xl bg-muted-overlay">
+ <p className="whitespace-pre-wrap text-sm leading-6 text-content">
{prompt}
</p>
</div>
diff --git a/src/components/features/automations/detail/run-status-badge.tsx b/src/components/features/automations/detail/run-status-badge.tsx
index b053729c6f..cea0fdb535 100644
--- a/src/components/features/automations/detail/run-status-badge.tsx
+++ b/src/components/features/automations/detail/run-status-badge.tsx
@@ -15,30 +15,43 @@ const statusConfig: Record<
> = {
[AutomationRunStatus.COMPLETED]: {
label: I18nKey.AUTOMATIONS$DETAIL$SUCCESSFUL,
- style: "border-success/50 bg-success/10 text-success",
+ style:
+ "border-status-success-border bg-status-success-bg text-status-success-text",
},
[AutomationRunStatus.FAILED]: {
label: I18nKey.AUTOMATIONS$DETAIL$FAILED,
- style: "border-red-500/50 bg-red-500/10 text-red-400",
+ style: "border-status-fail-border bg-status-fail-bg text-status-fail-text",
},
[AutomationRunStatus.PENDING]: {
label: I18nKey.AUTOMATIONS$DETAIL$PENDING,
- style: "border-neutral-600 bg-neutral-700 text-neutral-400",
+ style: "border-border bg-surface-elevated text-content-muted",
},
[AutomationRunStatus.RUNNING]: {
label: I18nKey.AUTOMATIONS$DETAIL$RUNNING,
- style: "border-neutral-600 bg-neutral-700 text-neutral-400",
+ style: "border-border bg-surface-elevated text-content-muted",
},
};
function StatusIcon({ status }: { status: AutomationRunStatus }) {
switch (status) {
case AutomationRunStatus.COMPLETED:
- return <CheckCircleIcon className="size-3.5" />;
+ return (
+ <CheckCircleIcon
+ data-testid="run-status-icon-completed"
+ className="size-3.5"
+ />
+ );
case AutomationRunStatus.FAILED:
- return <XCircleIcon className="size-3.5" />;
+ return (
+ <XCircleIcon
+ data-testid="run-status-icon-failed"
+ className="size-3.5"
+ />
+ );
default:
- return <ClockIcon className="size-3.5" />;
+ return (
+ <ClockIcon data-testid="run-status-icon-pending" className="size-3.5" />
+ );
}
}
diff --git a/src/components/features/automations/detail/section-card.tsx b/src/components/features/automations/detail/section-card.tsx
index b50df654c2..acbce725f5 100644
--- a/src/components/features/automations/detail/section-card.tsx
+++ b/src/components/features/automations/detail/section-card.tsx
@@ -6,10 +6,10 @@ interface SectionCardProps {
export function SectionCard({ icon, title, children }: SectionCardProps) {
return (
- <div className="rounded-2xl border border-neutral-700 bg-neutral-800">
- <div className="flex items-center gap-2 border-b border-neutral-700 px-5 pb-3 pt-4">
- <span className="size-4 text-neutral-400">{icon}</span>
- <h3 className="text-sm font-medium text-neutral-200">{title}</h3>
+ <div className="rounded-2xl border border-border bg-surface-card">
+ <div className="flex items-center gap-2 border-b border-border px-5 pb-3 pt-4">
+ <span className="size-4 text-content-muted">{icon}</span>
+ <h3 className="text-sm font-medium text-content">{title}</h3>
</div>
<div className="px-5 py-5">{children}</div>
</div>
diff --git a/src/components/features/automations/empty-state.tsx b/src/components/features/automations/empty-state.tsx
index 51f1bcbed6..99ecae1d15 100644
--- a/src/components/features/automations/empty-state.tsx
+++ b/src/components/features/automations/empty-state.tsx
@@ -8,8 +8,8 @@ export function EmptyState() {
return (
<div className="flex flex-col items-center justify-center py-12">
- <DatabaseIcon className="size-12 text-neutral-500" />
- <p className="mt-4 text-sm text-neutral-400">
+ <DatabaseIcon className="size-12 text-content-icon" />
+ <p className="mt-4 text-sm text-content-muted">
{t(I18nKey.AUTOMATIONS$EMPTY)}
</p>
diff --git a/src/components/features/automations/error-state.tsx b/src/components/features/automations/error-state.tsx
index d2c6b2fc8d..9738c93c52 100644
--- a/src/components/features/automations/error-state.tsx
+++ b/src/components/features/automations/error-state.tsx
@@ -11,14 +11,14 @@ export function ErrorState({ onRetry }: ErrorStateProps) {
return (
<div className="flex flex-col items-center justify-center py-20">
- <ExclamationCircleIcon className="size-12 text-red-400" />
- <p className="mt-4 text-sm text-neutral-400">
+ <ExclamationCircleIcon className="size-12 text-status-fail-text" />
+ <p className="mt-4 text-sm text-content-muted">
{t(I18nKey.AUTOMATIONS$ERROR_TITLE)}
</p>
<button
type="button"
onClick={onRetry}
- className="mt-4 rounded-lg border border-neutral-600 px-4 py-2 text-sm text-white hover:bg-neutral-700"
+ className="mt-4 rounded-lg border border-border px-4 py-2 text-sm text-white hover:bg-surface-elevated"
>
{t(I18nKey.AUTOMATIONS$ERROR_RETRY)}
</button>
diff --git a/src/components/features/automations/kebab-menu.tsx b/src/components/features/automations/kebab-menu.tsx
index bf656e7286..552356f320 100644
--- a/src/components/features/automations/kebab-menu.tsx
+++ b/src/components/features/automations/kebab-menu.tsx
@@ -37,14 +37,14 @@ export function KebabMenu({ items }: KebabMenuProps) {
e.stopPropagation();
setOpen(!open);
}}
- className="flex size-8 cursor-pointer items-center justify-center rounded border border-neutral-600 bg-neutral-800 hover:bg-neutral-700"
+ className="flex size-8 cursor-pointer items-center justify-center rounded border border-border bg-surface hover:bg-surface-elevated"
aria-label="Automation actions"
>
- <KebabVerticalIcon className="size-4 text-neutral-400" />
+ <KebabVerticalIcon className="size-4 text-content-muted" />
</button>
{open && (
- <div className="absolute right-0 top-full z-10 mt-1 w-36 rounded-lg border border-neutral-600 bg-neutral-800 py-1 shadow-lg">
+ <div className="absolute right-0 top-full z-10 mt-1 w-36 rounded-lg border border-border bg-surface-elevated py-1 shadow-lg">
{items.map((item) => (
<button
key={item.label}
@@ -54,8 +54,10 @@ export function KebabMenu({ items }: KebabMenuProps) {
item.onClick();
setOpen(false);
}}
- className={`flex w-full cursor-pointer items-center gap-2 px-4 py-2 text-sm hover:bg-neutral-700 ${
- item.variant === "danger" ? "text-red-400" : "text-white"
+ className={`flex w-full cursor-pointer items-center gap-2 px-4 py-2 text-sm hover:bg-border ${
+ item.variant === "danger"
+ ? "text-status-fail-text"
+ : "text-white"
}`}
>
{item.icon}
diff --git a/src/components/features/automations/metadata-chip.tsx b/src/components/features/automations/metadata-chip.tsx
index c8871c3be2..af2b6fab04 100644
--- a/src/components/features/automations/metadata-chip.tsx
+++ b/src/components/features/automations/metadata-chip.tsx
@@ -5,7 +5,7 @@ interface MetadataChipProps {
export function MetadataChip({ icon, label }: MetadataChipProps) {
return (
- <span className="inline-flex items-center gap-1.5 rounded-full border border-neutral-600 px-3 py-1 text-xs text-neutral-400">
+ <span className="inline-flex items-center gap-1.5 rounded-full border border-border px-3 py-1 text-xs text-content-muted">
{icon}
{label}
</span>
diff --git a/src/components/features/automations/search-input.tsx b/src/components/features/automations/search-input.tsx
index 03b48f0d58..35f855f571 100644
--- a/src/components/features/automations/search-input.tsx
+++ b/src/components/features/automations/search-input.tsx
@@ -12,13 +12,13 @@ export function SearchInput({ value, onChange }: SearchInputProps) {
return (
<div className="relative">
- <SearchIcon className="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-neutral-400" />
+ <SearchIcon className="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-content-muted" />
<input
type="text"
value={value}
onChange={(e) => onChange(e.target.value)}
placeholder={t(I18nKey.AUTOMATIONS$SEARCH_PLACEHOLDER)}
- className="w-full max-w-sm rounded-lg border border-neutral-600 bg-neutral-800 py-2 pl-10 pr-3 text-sm text-white placeholder:text-neutral-400 focus:border-neutral-500 focus:outline-none"
+ className="w-full max-w-sm rounded-lg border border-border bg-surface-card py-2 pl-10 pr-3 text-sm text-white placeholder:text-content-muted focus:border-border-hover focus:outline-none"
/>
</div>
);
diff --git a/src/components/features/automations/status-badge.tsx b/src/components/features/automations/status-badge.tsx
index 88af655078..2a6af72c2e 100644
--- a/src/components/features/automations/status-badge.tsx
+++ b/src/components/features/automations/status-badge.tsx
@@ -4,7 +4,7 @@ interface StatusBadgeProps {
export function StatusBadge({ count }: StatusBadgeProps) {
return (
- <span className="ml-2 inline-flex items-center justify-center rounded-full bg-neutral-700 px-2 py-0.5 text-xs text-white">
+ <span className="ml-2 inline-flex items-center justify-center rounded-full bg-border px-2 py-0.5 text-xs text-white">
{count}
</span>
);
diff --git a/src/components/features/automations/toggle-switch.tsx b/src/components/features/automations/toggle-switch.tsx
index debb1cfd68..2d07919fa3 100644
--- a/src/components/features/automations/toggle-switch.tsx
+++ b/src/components/features/automations/toggle-switch.tsx
@@ -17,15 +17,15 @@ export function ToggleSwitch({ enabled, label, onToggle }: ToggleSwitchProps) {
}}
className={`relative inline-flex h-[22px] w-[40px] shrink-0 cursor-pointer items-center rounded-full border transition-colors ${
enabled
- ? "border-success bg-success/20"
- : "border-neutral-600 bg-neutral-700"
+ ? "border-toggle-active-border bg-toggle-active-bg"
+ : "border-toggle-inactive-border bg-toggle-inactive"
}`}
>
<span
className={`inline-block size-4 rounded-full transition-transform ${
enabled
- ? "translate-x-[20px] bg-success"
- : "translate-x-[3px] bg-neutral-400"
+ ? "translate-x-[20px] bg-toggle-active"
+ : "translate-x-[3px] bg-toggle-inactive-knob"
}`}
/>
</button>
diff --git a/src/routes/automation-detail.tsx b/src/routes/automation-detail.tsx
index a81dea44a0..056a8e5afc 100644
--- a/src/routes/automation-detail.tsx
+++ b/src/routes/automation-detail.tsx
@@ -40,24 +40,30 @@ export default function AutomationDetail() {
if (isLoading) {
return (
- <div className="p-6 max-w-4xl mx-auto">
- <DetailSkeleton />
+ <div className="min-h-full bg-surface">
+ <div className="p-6 max-w-4xl mx-auto">
+ <DetailSkeleton />
+ </div>
</div>
);
}
if (is404) {
return (
- <div className="p-6 max-w-4xl mx-auto">
- <NotFoundState />
+ <div className="min-h-full bg-surface">
+ <div className="p-6 max-w-4xl mx-auto">
+ <NotFoundState />
+ </div>
</div>
);
}
if (isError || !automation) {
return (
- <div className="p-6 max-w-4xl mx-auto">
- <ErrorState onRetry={() => refetch()} />
+ <div className="min-h-full bg-surface">
+ <div className="p-6 max-w-4xl mx-auto">
+ <ErrorState onRetry={() => refetch()} />
+ </div>
</div>
);
}
@@ -78,30 +84,32 @@ export default function AutomationDetail() {
};
return (
- <div className="p-6 max-w-4xl mx-auto">
- <div className="flex flex-col gap-4">
- <BackLink />
- <DetailHeader
- automation={automation}
- onToggle={handleToggle}
- onDelete={() => setShowDeleteModal(true)}
- />
- {automation.prompt && <PromptSection prompt={automation.prompt} />}
- <ConfigurationSection automation={automation} />
- {automation.plugins && automation.plugins.length > 0 && (
- <PluginsSection plugins={automation.plugins} />
- )}
- <ActivitySection
- createdAt={automation.created_at}
- lastRunAt={automation.last_triggered_at}
- />
- <ActivityLogSection automationId={automation.id} />
- <DeleteConfirmationModal
- automationName={automation.name}
- isOpen={showDeleteModal}
- onConfirm={handleDelete}
- onCancel={() => setShowDeleteModal(false)}
- />
+ <div className="min-h-full bg-surface">
+ <div className="p-6 max-w-4xl mx-auto">
+ <div className="flex flex-col gap-4">
+ <BackLink />
+ <DetailHeader
+ automation={automation}
+ onToggle={handleToggle}
+ onDelete={() => setShowDeleteModal(true)}
+ />
+ {automation.prompt && <PromptSection prompt={automation.prompt} />}
+ <ConfigurationSection automation={automation} />
+ {automation.plugins && automation.plugins.length > 0 && (
+ <PluginsSection plugins={automation.plugins} />
+ )}
+ <ActivitySection
+ createdAt={automation.created_at}
+ lastRunAt={automation.last_triggered_at}
+ />
+ <ActivityLogSection automationId={automation.id} />
+ <DeleteConfirmationModal
+ automationName={automation.name}
+ isOpen={showDeleteModal}
+ onConfirm={handleDelete}
+ onCancel={() => setShowDeleteModal(false)}
+ />
+ </div>
</div>
</div>
);
diff --git a/src/routes/automations-list.tsx b/src/routes/automations-list.tsx
index 879ef6807c..daf57d7408 100644
--- a/src/routes/automations-list.tsx
+++ b/src/routes/automations-list.tsx
@@ -69,76 +69,78 @@ export default function AutomationsList() {
const hasMore = data ? data.total > data.automations.length : false;
return (
- <div className="p-6 max-w-4xl mx-auto">
- {/* Header */}
- <h1 className="text-xl font-semibold text-neutral-100">
- {t(I18nKey.AUTOMATIONS$TITLE)}
- </h1>
- <p className="mt-1 text-sm text-neutral-400">
- {t(I18nKey.AUTOMATIONS$SUBTITLE)}
- </p>
-
- {/* Search */}
- <div className="mt-6">
- <SearchInput value={searchQuery} onChange={setSearchQuery} />
+ <div className="min-h-full bg-surface">
+ <div className="p-6 max-w-4xl mx-auto">
+ {/* Header */}
+ <h1 className="text-xl font-semibold text-content">
+ {t(I18nKey.AUTOMATIONS$TITLE)}
+ </h1>
+ <p className="mt-1 text-sm text-content-muted">
+ {t(I18nKey.AUTOMATIONS$SUBTITLE)}
+ </p>
+
+ {/* Search */}
+ <div className="mt-6">
+ <SearchInput value={searchQuery} onChange={setSearchQuery} />
+ </div>
+
+ {/* Content */}
+ <div className="mt-6 flex flex-col gap-6">
+ {isLoading && (
+ <div className="flex flex-col gap-3">
+ {Array.from({ length: 3 }).map((_, i) => (
+ <AutomationCardSkeleton key={`skeleton-${String(i)}`} />
+ ))}
+ </div>
+ )}
+
+ {isError && !isLoading && <ErrorState onRetry={refetch} />}
+
+ {!isLoading && !isError && data && data.automations.length === 0 && (
+ <EmptyState />
+ )}
+
+ {!isLoading && !isError && data && data.automations.length > 0 && (
+ <>
+ {/* Collapsible creation instructions at the top */}
+ <CreateInstructions collapsible />
+
+ <AutomationGroup
+ title={t(I18nKey.AUTOMATIONS$ACTIVE)}
+ count={active.length}
+ automations={active}
+ onToggle={handleToggle}
+ onDelete={handleDeleteRequest}
+ />
+ <AutomationGroup
+ title={t(I18nKey.AUTOMATIONS$INACTIVE)}
+ count={inactive.length}
+ automations={inactive}
+ onToggle={handleToggle}
+ onDelete={handleDeleteRequest}
+ />
+
+ {hasMore && (
+ <button
+ type="button"
+ onClick={() => setLimit((prev) => prev + PAGE_SIZE)}
+ className="self-center rounded-lg border border-border px-6 py-2 text-sm text-white hover:bg-surface-elevated"
+ >
+ {t(I18nKey.AUTOMATIONS$LOAD_MORE)}
+ </button>
+ )}
+ </>
+ )}
+ </div>
+
+ {/* Delete confirmation modal */}
+ <DeleteConfirmationModal
+ automationName={deleteTarget?.name ?? ""}
+ isOpen={deleteTarget !== null}
+ onConfirm={handleDeleteConfirm}
+ onCancel={() => setDeleteTarget(null)}
+ />
</div>
-
- {/* Content */}
- <div className="mt-6 flex flex-col gap-6">
- {isLoading && (
- <div className="flex flex-col gap-3">
- {Array.from({ length: 3 }).map((_, i) => (
- <AutomationCardSkeleton key={`skeleton-${String(i)}`} />
- ))}
- </div>
- )}
-
- {isError && !isLoading && <ErrorState onRetry={refetch} />}
-
- {!isLoading && !isError && data && data.automations.length === 0 && (
- <EmptyState />
- )}
-
- {!isLoading && !isError && data && data.automations.length > 0 && (
- <>
- {/* Collapsible creation instructions at the top */}
- <CreateInstructions collapsible />
-
- <AutomationGroup
- title={t(I18nKey.AUTOMATIONS$ACTIVE)}
- count={active.length}
- automations={active}
- onToggle={handleToggle}
- onDelete={handleDeleteRequest}
- />
- <AutomationGroup
- title={t(I18nKey.AUTOMATIONS$INACTIVE)}
- count={inactive.length}
- automations={inactive}
- onToggle={handleToggle}
- onDelete={handleDeleteRequest}
- />
-
- {hasMore && (
- <button
- type="button"
- onClick={() => setLimit((prev) => prev + PAGE_SIZE)}
- className="self-center rounded-lg border border-neutral-600 px-6 py-2 text-sm text-white hover:bg-neutral-700"
- >
- {t(I18nKey.AUTOMATIONS$LOAD_MORE)}
- </button>
- )}
- </>
- )}
- </div>
-
- {/* Delete confirmation modal */}
- <DeleteConfirmationModal
- automationName={deleteTarget?.name ?? ""}
- isOpen={deleteTarget !== null}
- onConfirm={handleDeleteConfirm}
- onCancel={() => setDeleteTarget(null)}
- />
</div>
);
}
diff --git a/src/ui/pagination.tsx b/src/ui/pagination.tsx
index 284bb8f213..87e1a45b75 100644
--- a/src/ui/pagination.tsx
+++ b/src/ui/pagination.tsx
@@ -74,7 +74,7 @@ export function Pagination({
className={cn(
"p-2 rounded-md transition-colors",
canGoPrevious
- ? "hover:bg-surface-border cursor-pointer"
+ ? "hover:bg-surface-outline cursor-pointer"
: "opacity-50 cursor-not-allowed",
)}
aria-label="Previous page"
@@ -100,7 +100,7 @@ export function Pagination({
"min-w-[32px] h-8 px-2 text-sm rounded-md transition-colors cursor-pointer",
currentPage === page
? "bg-surface-button text-white font-medium"
- : "text-tertiary-alt hover:bg-surface-border",
+ : "text-tertiary-alt hover:bg-surface-outline",
)}
aria-current={currentPage === page ? "page" : undefined}
>
@@ -117,7 +117,7 @@ export function Pagination({
className={cn(
"p-2 rounded-md transition-colors",
canGoNext
- ? "hover:bg-surface-border cursor-pointer"
+ ? "hover:bg-surface-outline cursor-pointer"
: "opacity-50 cursor-not-allowed",
)}
aria-label="Next page"
diff --git a/tailwind.config.js b/tailwind.config.js
index b80b1fcad3..e520b2db9e 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -13,12 +13,45 @@ export default {
muted: "#A3A3A3",
},
surface: {
- border: "#171717",
+ DEFAULT: "#050505",
+ card: "#0a0a0a",
+ elevated: "#1a1a1a",
+ outline: "#171717",
background: "#262626",
divider: "#525252",
button: "#737373",
text: "#A3A3A3",
},
+ border: {
+ DEFAULT: "#242424",
+ hover: "#3a3a3a",
+ },
+ content: {
+ DEFAULT: "#fafafa",
+ muted: "#8c8c8c",
+ icon: "#3a3a3a",
+ },
+ status: {
+ "success-bg": "rgba(16, 185, 129, 0.1)",
+ "success-border": "rgba(16, 185, 129, 0.4)",
+ "success-text": "#6ee7b7",
+ "success-badge-bg": "rgba(16, 185, 129, 0.15)",
+ "fail-bg": "rgba(244, 63, 94, 0.1)",
+ "fail-border": "rgba(244, 63, 94, 0.4)",
+ "fail-text": "#fda4af",
+ "fail-solid": "#dc2626",
+ "fail-solid-hover": "#b91c1c",
+ },
+ toggle: {
+ active: "#34d399",
+ "active-bg": "rgba(52, 211, 153, 0.2)",
+ "active-border": "rgba(52, 211, 153, 0.5)",
+ inactive: "#242424",
+ "inactive-knob": "#8c8c8c",
+ "inactive-border": "#3a3a3a",
+ },
+ "muted-overlay": "rgba(5, 5, 5, 0.4)",
+ "pill-bg": "rgba(31, 31, 31, 0.3)",
},
},
},