Skip to content

Self-improving AI Employees for everyone

refactor(ui): semantic --action-X tokens + restore panel colors

trohitg0e3d9b233368
diff --git a/client/src/ParameterPanel.tsx b/client/src/ParameterPanel.tsx
index 2a90c457..e67e4b23 100644
--- a/client/src/ParameterPanel.tsx
+++ b/client/src/ParameterPanel.tsx
@@ -147,7 +147,7 @@ const ParameterPanel: React.FC = () => {
<div className="flex items-center gap-2">
{canExecute && !hideRunButton && (
<ActionButton
- tone="green"
+ intent="run"
onClick={handleRun}
disabled={isExecuting}
title={isExecuting ? 'Execution in progress...' : 'Execute this node'}
@@ -158,7 +158,7 @@ const ParameterPanel: React.FC = () => {
{isExecuting ? 'Running...' : 'Run'}
</ActionButton>
)}
- <ActionButton tone="purple" onClick={handleSave} disabled={!hasUnsavedChanges}>
+ <ActionButton intent="tools" onClick={handleSave} disabled={!hasUnsavedChanges}>
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
<path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" />
<polyline points="17 21 17 13 7 13 7 21" />
@@ -167,7 +167,7 @@ const ParameterPanel: React.FC = () => {
Save
</ActionButton>
<ActionButton
- tone="pink"
+ intent="stop"
onClick={async () => {
if (isWaiting && selectedNode) {
const result = await cancelEventWait(selectedNode.id, nodeStatus?.data?.waiter_id);
diff --git a/client/src/components/LocationParameterPanel.tsx b/client/src/components/LocationParameterPanel.tsx
index 8a1a51b0..f720d84b 100644
--- a/client/src/components/LocationParameterPanel.tsx
+++ b/client/src/components/LocationParameterPanel.tsx
@@ -70,7 +70,7 @@ const LocationParameterPanel: React.FC = () => {
<div className="flex items-center gap-2">
{canExecute && (
<ActionButton
- tone="green"
+ intent="run"
onClick={handleRun}
disabled={isExecuting}
title={isExecuting ? 'Execution in progress...' : 'Execute this node'}
@@ -78,10 +78,10 @@ const LocationParameterPanel: React.FC = () => {
{isExecuting ? 'Running...' : 'Run'}
</ActionButton>
)}
- <ActionButton tone="purple" onClick={handleSave} disabled={!hasUnsavedChanges}>
+ <ActionButton intent="tools" onClick={handleSave} disabled={!hasUnsavedChanges}>
Save
</ActionButton>
- <ActionButton tone="pink" onClick={handleCancel}>
+ <ActionButton intent="stop" onClick={handleCancel}>
Cancel
</ActionButton>
</div>
diff --git a/client/src/components/parameterPanel/MiddleSection.tsx b/client/src/components/parameterPanel/MiddleSection.tsx
index 4a5519e0..e25f754f 100644
--- a/client/src/components/parameterPanel/MiddleSection.tsx
+++ b/client/src/components/parameterPanel/MiddleSection.tsx
@@ -631,7 +631,7 @@ const MiddleSection: React.FC<MiddleSectionProps> = ({
{isSkillNode && (
<div className="mt-3 flex justify-end border-t border-border pt-3">
<ActionButton
- tone="orange"
+ intent="config"
onClick={() => setShowResetSkillDialog(true)}
className="h-8"
>
diff --git a/client/src/components/ui/SettingsPanel.tsx b/client/src/components/ui/SettingsPanel.tsx
index 1c3f7207..017d0778 100644
--- a/client/src/components/ui/SettingsPanel.tsx
+++ b/client/src/components/ui/SettingsPanel.tsx
@@ -155,7 +155,7 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
</div>
<div className="flex items-center gap-2">
<ActionButton
- tone="orange"
+ intent="config"
onClick={handleReset}
disabled={isSaving}
title="Reset to default settings"
@@ -164,7 +164,7 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
Reset
</ActionButton>
<ActionButton
- tone="green"
+ intent="run"
onClick={handleSave}
disabled={isSaving}
title="Save settings"
@@ -172,7 +172,7 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
<Save className="h-3 w-3" />
{isSaving ? 'Saving...' : 'Save'}
</ActionButton>
- <ActionButton tone="pink" onClick={onClose} title="Close settings">
+ <ActionButton intent="stop" onClick={onClose} title="Close settings">
<X className="h-3 w-3" />
Close
</ActionButton>
diff --git a/client/src/components/ui/TopToolbar.tsx b/client/src/components/ui/TopToolbar.tsx
index d6d6bace..d7089d6d 100644
--- a/client/src/components/ui/TopToolbar.tsx
+++ b/client/src/components/ui/TopToolbar.tsx
@@ -164,6 +164,7 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
onClick={onToggleSidebar}
aria-pressed={sidebarVisible}
title={sidebarVisible ? 'Hide sidebar' : 'Show sidebar'}
+ className="border-action-save-border bg-action-save-soft text-action-save hover:bg-action-save/25 aria-pressed:bg-action-save/30"
>
{sidebarVisible ? <PanelLeftClose /> : <PanelLeftOpen />}
</Button>
@@ -173,7 +174,11 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
{/* File menu */}
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <Button variant="outline" size="sm">
+ <Button
+ variant="outline"
+ size="sm"
+ className="border-action-save-border bg-action-save-soft text-action-save hover:bg-action-save/25"
+ >
<FileText />
File
<ChevronDown />
@@ -183,25 +188,25 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
<DropdownMenuLabel className="text-xs uppercase tracking-wider text-muted-foreground">
File Operations
</DropdownMenuLabel>
- <DropdownMenuItem onSelect={onNew}>
+ <DropdownMenuItem onSelect={onNew} className="text-action-run focus:text-action-run">
<FilePlus />
New Workflow
</DropdownMenuItem>
- <DropdownMenuItem onSelect={onOpen}>
+ <DropdownMenuItem onSelect={onOpen} className="text-action-save focus:text-action-save">
<FolderOpen />
Open
</DropdownMenuItem>
<DropdownMenuSeparator />
- <DropdownMenuItem onSelect={onExportFile}>
+ <DropdownMenuItem onSelect={onExportFile} className="text-action-save focus:text-action-save">
<Download />
Export
</DropdownMenuItem>
- <DropdownMenuItem onSelect={onImportJSON}>
+ <DropdownMenuItem onSelect={onImportJSON} className="text-action-save focus:text-action-save">
<Upload />
Import
</DropdownMenuItem>
<DropdownMenuSeparator />
- <DropdownMenuItem onSelect={onExportJSON}>
+ <DropdownMenuItem onSelect={onExportJSON} className="text-action-tools focus:text-action-tools">
<Clipboard />
Copy as JSON
</DropdownMenuItem>
@@ -279,7 +284,7 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
</Select>
{globalSelectValue && (
<ActionButton
- tone="orange"
+ intent="config"
onClick={() => globalModelState.global_provider && globalModelState.global_model && onOverrideAllAgents?.(globalModelState.global_provider, globalModelState.global_model)}
title="Override all agent nodes in this workflow to use the selected model"
className="h-8 px-3 text-xs"
@@ -329,11 +334,23 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
<Divider />
- <Button variant="outline" size="icon-sm" onClick={onOpenSettings} title="Settings">
+ <Button
+ variant="outline"
+ size="icon-sm"
+ onClick={onOpenSettings}
+ title="Settings"
+ className="border-action-config-border bg-action-config-soft text-action-config hover:bg-action-config/25"
+ >
<SettingsIcon />
</Button>
- <Button variant="outline" size="icon-sm" onClick={onOpenCredentials} title="API Credentials">
+ <Button
+ variant="outline"
+ size="icon-sm"
+ onClick={onOpenCredentials}
+ title="API Credentials"
+ className="border-action-secret-border bg-action-secret-soft text-action-secret hover:bg-action-secret/25"
+ >
<KeyRound />
</Button>
@@ -342,6 +359,7 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
size="icon-sm"
onClick={toggleTheme}
title={isDarkMode ? 'Switch to Light mode' : 'Switch to Dark mode'}
+ className="border-action-secret-border bg-action-secret-soft text-action-secret hover:bg-action-secret/25"
>
{isDarkMode ? <Sun /> : <Moon />}
</Button>
@@ -352,7 +370,7 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
size="icon-sm"
onClick={logout}
title={`Logout ${user.display_name}`}
- className="border-destructive/40 text-destructive hover:bg-destructive/10"
+ className="border-action-stop-border bg-action-stop-soft text-action-stop hover:bg-action-stop/25"
>
<LogOut />
</Button>
@@ -363,7 +381,7 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
{/* Start / Stop */}
{!isDeploying ? (
<ActionButton
- tone="green"
+ intent="run"
onClick={onDeploy}
disabled={isRunning}
title="Start workflow"
@@ -373,7 +391,7 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
</ActionButton>
) : (
<ActionButton
- tone="pink"
+ intent="stop"
onClick={onCancelDeployment}
title="Stop workflow"
>
@@ -383,7 +401,7 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
)}
<ActionButton
- tone="cyan"
+ intent="save"
onClick={() => typeof onSave === 'function' && onSave()}
disabled={!hasUnsavedChanges}
title={hasUnsavedChanges ? 'Save changes' : 'No changes to save'}
@@ -416,6 +434,7 @@ const TopToolbar: React.FC<TopToolbarProps> = ({
onClick={onToggleComponentPalette}
aria-pressed={componentPaletteVisible}
title={componentPaletteVisible ? 'Hide components' : 'Show components'}
+ className="border-action-tools-border bg-action-tools-soft text-action-tools hover:bg-action-tools/25 aria-pressed:bg-action-tools/30"
>
{componentPaletteVisible ? <PanelRightClose /> : <PanelRightOpen />}
</Button>
diff --git a/client/src/components/ui/action-button.tsx b/client/src/components/ui/action-button.tsx
index fe6710b4..21a321a1 100644
--- a/client/src/components/ui/action-button.tsx
+++ b/client/src/components/ui/action-button.tsx
@@ -1,13 +1,17 @@
/**
- * ActionButton — colored "soft" toolbar button shared by the parameter
- * panel, location panel, settings header, and top toolbar. Replaces a
- * 14-line `actionButtonStyle(color, isDisabled)` style helper that was
- * copy-pasted across 4 files.
+ * ActionButton -- colored "soft" toolbar button shared by the parameter
+ * panel, location panel, settings header, and top toolbar.
*
- * The dracula palette is fixed (CSS vars, not arbitrary hex) so we use
- * a CVA `tone` variant and let Tailwind compile the static class names.
- * Disabled state automatically swaps tone to muted via `disabled:`
- * utility classes.
+ * The `intent` prop is a semantic role (run / stop / save / ...), not a
+ * palette color, so themes can re-skin without touching call sites.
+ * Each intent reads the matching --action-X / --action-X-soft /
+ * --action-X-border CSS triplet defined in index.css; pressed +
+ * disabled state are baked into the variant so call sites never do
+ * opacity arithmetic.
+ *
+ * Adding a new intent: add the --action-NAME triplet to index.css,
+ * expose the three Tailwind tokens in the @theme inline block, then
+ * add a case to `actionButtonVariants` below.
*/
import * as React from 'react';
@@ -16,43 +20,40 @@ import { cn } from '@/lib/utils';
export const actionButtonVariants = cva(
// Base: 32px tall pill with icon-text gap, semibold, focus ring, smooth hover.
- // Disabled state is handled per-tone (different opacity/colors).
'inline-flex h-8 items-center gap-1.5 rounded-md border px-3.5 text-[13px] font-semibold transition-all outline-none select-none disabled:cursor-not-allowed focus-visible:ring-2 focus-visible:ring-ring/40',
{
variants: {
- tone: {
- green:
- 'border-dracula-green/60 bg-dracula-green/15 text-dracula-green hover:bg-dracula-green/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
- purple:
- 'border-dracula-purple/60 bg-dracula-purple/15 text-dracula-purple hover:bg-dracula-purple/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
- pink:
- 'border-dracula-pink/60 bg-dracula-pink/15 text-dracula-pink hover:bg-dracula-pink/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
- cyan:
- 'border-dracula-cyan/60 bg-dracula-cyan/15 text-dracula-cyan hover:bg-dracula-cyan/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
- orange:
- 'border-dracula-orange/60 bg-dracula-orange/15 text-dracula-orange hover:bg-dracula-orange/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
- yellow:
- 'border-dracula-yellow/60 bg-dracula-yellow/15 text-dracula-yellow hover:bg-dracula-yellow/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
- red:
- 'border-dracula-red/60 bg-dracula-red/15 text-dracula-red hover:bg-dracula-red/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
+ intent: {
+ run:
+ 'border-action-run-border bg-action-run-soft text-action-run hover:bg-action-run/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
+ stop:
+ 'border-action-stop-border bg-action-stop-soft text-action-stop hover:bg-action-stop/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
+ save:
+ 'border-action-save-border bg-action-save-soft text-action-save hover:bg-action-save/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
+ config:
+ 'border-action-config-border bg-action-config-soft text-action-config hover:bg-action-config/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
+ secret:
+ 'border-action-secret-border bg-action-secret-soft text-action-secret hover:bg-action-secret/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
+ tools:
+ 'border-action-tools-border bg-action-tools-soft text-action-tools hover:bg-action-tools/25 disabled:border-primary/40 disabled:bg-primary/10 disabled:text-primary',
},
},
- defaultVariants: { tone: 'cyan' },
+ defaultVariants: { intent: 'save' },
},
);
-export type ActionButtonTone = NonNullable<VariantProps<typeof actionButtonVariants>['tone']>;
+export type ActionButtonIntent = NonNullable<VariantProps<typeof actionButtonVariants>['intent']>;
export interface ActionButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof actionButtonVariants> {}
export const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProps>(
- ({ className, tone, ...props }, ref) => (
+ ({ className, intent, ...props }, ref) => (
<button
ref={ref}
type={props.type ?? 'button'}
- className={cn(actionButtonVariants({ tone }), className)}
+ className={cn(actionButtonVariants({ intent }), className)}
{...props}
/>
),
diff --git a/client/src/index.css b/client/src/index.css
index 4b94d7b7..99da6a85 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -106,6 +106,37 @@
* change the canonical alphas without touching call sites. */
--tint-soft: 8%;
--tint-border: 30%;
+
+ /* Toolbar / action role tokens — semantic names so call sites read
+ * `bg-action-run` instead of a palette color. Themes redefine these
+ * in their own scope; no component imports a palette name directly.
+ * Each role exposes the base + a -soft (tinted bg) + a -border
+ * (tinted outline) variant so opacity arithmetic stays out of the
+ * call site (mirrors the --node-X / --node-X-soft / -border
+ * convention). */
+ --action-run: 135 94% 65%; /* primary CTA: deploy / run */
+ --action-run-soft: 135 94% 65% / 0.15;
+ --action-run-border: 135 94% 65% / 0.6;
+
+ --action-stop: 326 100% 74%; /* destructive: stop / cancel / logout */
+ --action-stop-soft: 326 100% 74% / 0.15;
+ --action-stop-border: 326 100% 74% / 0.6;
+
+ --action-save: 191 97% 77%; /* commit / save / panel toggle */
+ --action-save-soft: 191 97% 77% / 0.15;
+ --action-save-border: 191 97% 77% / 0.6;
+
+ --action-config: 27 100% 71%; /* settings / config / warning */
+ --action-config-soft: 27 100% 71% / 0.15;
+ --action-config-border: 27 100% 71% / 0.6;
+
+ --action-secret: 65 92% 76%; /* credentials / theme toggle */
+ --action-secret-soft: 65 92% 76% / 0.15;
+ --action-secret-border: 65 92% 76% / 0.6;
+
+ --action-tools: 265 89% 78%; /* component palette / creative */
+ --action-tools-soft: 265 89% 78% / 0.15;
+ --action-tools-border: 265 89% 78% / 0.6;
}
.dark {
@@ -229,6 +260,28 @@
--color-node-workflow-soft: hsl(var(--node-workflow-soft));
--color-node-workflow-border: hsl(var(--node-workflow-border));
+ /* Toolbar / action role tokens — same triplet pattern as --node-X.
+ * Use bg-action-X-soft + text-action-X + border-action-X-border for
+ * the standard "soft tinted button" look (see ActionButton CVA). */
+ --color-action-run: hsl(var(--action-run));
+ --color-action-run-soft: hsl(var(--action-run-soft));
+ --color-action-run-border: hsl(var(--action-run-border));
+ --color-action-stop: hsl(var(--action-stop));
+ --color-action-stop-soft: hsl(var(--action-stop-soft));
+ --color-action-stop-border: hsl(var(--action-stop-border));
+ --color-action-save: hsl(var(--action-save));
+ --color-action-save-soft: hsl(var(--action-save-soft));
+ --color-action-save-border: hsl(var(--action-save-border));
+ --color-action-config: hsl(var(--action-config));
+ --color-action-config-soft: hsl(var(--action-config-soft));
+ --color-action-config-border: hsl(var(--action-config-border));
+ --color-action-secret: hsl(var(--action-secret));
+ --color-action-secret-soft: hsl(var(--action-secret-soft));
+ --color-action-secret-border: hsl(var(--action-secret-border));
+ --color-action-tools: hsl(var(--action-tools));
+ --color-action-tools-soft: hsl(var(--action-tools-soft));
+ --color-action-tools-border: hsl(var(--action-tools-border));
+
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);