Skip to content

πŸ™Œ OpenHands: AI-Driven Development

1.2 KB
Raw Blame
export type AutomationViewMode = "grid" | "list";

export const AUTOMATIONS_VIEW_MODE_STORAGE_KEY = "openhands-automations-view";

export function readStoredAutomationViewMode(): AutomationViewMode {
  if (typeof window === "undefined") {
    return "grid";
  }

  const stored = window.localStorage.getItem(AUTOMATIONS_VIEW_MODE_STORAGE_KEY);
  return stored === "list" ? "list" : "grid";
}

export function writeStoredAutomationViewMode(view: AutomationViewMode): void {
  window.localStorage.setItem(AUTOMATIONS_VIEW_MODE_STORAGE_KEY, view);
}

/** Shared chrome for the dashboard list and the home activity list. */
export const automationActivityListClassName =
  "divide-y divide-border-subtle overflow-hidden rounded-xl border border-border-subtle bg-surface";

export const automationActivityRowClassName =
  "group relative flex items-stretch transition-colors hover:bg-surface-raised has-[:focus-visible]:bg-surface-raised";

/** Inset last-run strip used under the trigger/sparkline row. */
export const automationCardStatusStripClassName =
  "mt-3 flex min-h-9 items-center justify-between gap-2 overflow-hidden rounded-md border border-border-subtle bg-surface px-3 py-2 text-xs";