Skip to content

Self-improving AI Employees for everyone

feat(ui): Phase 4 (cont.) - Buttons in OnboardingWizard/PricingConfigModal/SettingsPanel/MasterSkillEditor

trohitg3cf0cd7b2758
diff --git a/client/src/components/PricingConfigModal.tsx b/client/src/components/PricingConfigModal.tsx
index 7c287742..c47bfafb 100644
--- a/client/src/components/PricingConfigModal.tsx
+++ b/client/src/components/PricingConfigModal.tsx
@@ -4,8 +4,10 @@
*/
import React, { useState, useEffect, useCallback } from 'react';
-import { Button, InputNumber } from 'antd';
-import { Loader2 } from 'lucide-react';
+import { InputNumber } from 'antd';
+import { Loader2, RefreshCw, Save } from 'lucide-react';
+
+import { Button } from '@/components/ui/button';
import {
Accordion,
AccordionItem,
@@ -14,11 +16,7 @@ import {
} from '@/components/ui/accordion';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import { toast } from 'sonner';
-import {
- SaveOutlined,
- ReloadOutlined,
- DollarOutlined,
-} from '@ant-design/icons';
+import { DollarOutlined } from '@ant-design/icons';
import Modal from './ui/Modal';
import { usePricing, PricingConfig, LLMPricing } from '../hooks/usePricing';
import { useAppTheme } from '../hooks/useAppTheme';
@@ -359,26 +357,24 @@ const PricingConfigModal: React.FC<Props> = ({ visible, onClose }) => {
maxHeight="85vh"
headerActions={
<div style={{ display: 'flex', gap: 8 }}>
- <Button
- size="small"
- icon={<ReloadOutlined />}
- onClick={loadConfig}
- loading={loading}
- >
+ <Button size="sm" variant="outline" onClick={loadConfig} disabled={loading}>
+ {loading ? <Loader2 className="h-3 w-3 animate-spin" /> : <RefreshCw className="h-3 w-3" />}
Reload
</Button>
<Button
- type="primary"
- size="small"
- icon={<SaveOutlined />}
+ size="sm"
onClick={handleSave}
- loading={saving}
- disabled={!isDirty}
- style={{
- backgroundColor: isDirty ? theme.dracula.green : undefined,
- borderColor: isDirty ? theme.dracula.green : undefined,
- }}
+ disabled={!isDirty || saving}
+ style={
+ isDirty
+ ? {
+ backgroundColor: theme.dracula.green,
+ borderColor: theme.dracula.green,
+ }
+ : undefined
+ }
>
+ {saving ? <Loader2 className="h-3 w-3 animate-spin" /> : <Save className="h-3 w-3" />}
Save
</Button>
</div>
diff --git a/client/src/components/onboarding/OnboardingWizard.tsx b/client/src/components/onboarding/OnboardingWizard.tsx
index 2dd40d06..6e7b9245 100644
--- a/client/src/components/onboarding/OnboardingWizard.tsx
+++ b/client/src/components/onboarding/OnboardingWizard.tsx
@@ -1,6 +1,8 @@
import React from 'react';
-import { Steps, Button } from 'antd';
-import { ArrowLeftOutlined, ArrowRightOutlined, CheckOutlined } from '@ant-design/icons';
+import { Steps } from 'antd';
+import { ArrowLeft, ArrowRight, Check } from 'lucide-react';
+
+import { Button } from '@/components/ui/button';
import Modal from '../ui/Modal';
import { useOnboarding } from '../../hooks/useOnboarding';
import { useAppTheme } from '../../hooks/useAppTheme';
@@ -94,45 +96,39 @@ const OnboardingWizard: React.FC<OnboardingWizardProps> = ({ onOpenCredentials,
borderTop: `1px solid ${theme.colors.border}`,
}}>
{/* Left: Skip */}
- <Button type="text" onClick={skip} size="small" style={{ color: theme.colors.textSecondary }}>
+ <Button variant="ghost" size="sm" onClick={skip} className="text-muted-foreground">
Skip for now
</Button>
{/* Right: Back + Next/Finish */}
<div className="flex items-center gap-2">
{currentStep > 0 && (
- <Button
- icon={<ArrowLeftOutlined />}
- onClick={prevStep}
- size="middle"
- >
+ <Button variant="outline" onClick={prevStep}>
+ <ArrowLeft className="h-4 w-4" />
Back
</Button>
)}
{isLastStep ? (
<Button
- type="primary"
- icon={<CheckOutlined />}
onClick={complete}
- size="middle"
style={{
backgroundColor: theme.dracula.green,
borderColor: theme.dracula.green,
}}
>
+ <Check className="h-4 w-4" />
Start Building
</Button>
) : (
<Button
- type="primary"
onClick={nextStep}
- size="middle"
style={{
backgroundColor: theme.dracula.purple,
borderColor: theme.dracula.purple,
}}
>
- Next <ArrowRightOutlined />
+ Next
+ <ArrowRight className="h-4 w-4" />
</Button>
)}
</div>
diff --git a/client/src/components/parameterPanel/MasterSkillEditor.tsx b/client/src/components/parameterPanel/MasterSkillEditor.tsx
index bc02995b..f8d66a45 100644
--- a/client/src/components/parameterPanel/MasterSkillEditor.tsx
+++ b/client/src/components/parameterPanel/MasterSkillEditor.tsx
@@ -11,8 +11,10 @@
*/
import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react';
-import { Input, Select, Checkbox, Button, List, Badge, Empty } from 'antd';
-import { Loader2, Info } from 'lucide-react';
+import { Input, Select, Checkbox, List, Badge, Empty } from 'antd';
+import { Loader2, Info, Plus, Trash2, Save, X, RotateCcw } from 'lucide-react';
+
+import { Button } from '@/components/ui/button';
import { Alert as DSAlert, AlertDescription } from '@/components/ui/alert';
import {
Tooltip,
@@ -32,7 +34,7 @@ import {
AlertDialogTrigger,
} from '@/components/ui/alert-dialog';
import { toast } from 'sonner';
-import { SearchOutlined, ReloadOutlined, FolderOutlined, PlusOutlined, DeleteOutlined, SaveOutlined, CloseOutlined } from '@ant-design/icons';
+import { SearchOutlined, FolderOutlined, PlusOutlined } from '@ant-design/icons';
import { useAppTheme } from '../../hooks/useAppTheme';
import { useWebSocket } from '../../contexts/WebSocketContext';
import { skillNodes, SKILL_NODE_TYPES } from '../../nodeDefinitions/skillNodes';
@@ -610,8 +612,8 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({
<Tooltip>
<TooltipTrigger asChild>
<Button
- size="small"
- icon={<PlusOutlined />}
+ size="icon-sm"
+ variant="outline"
onClick={handleCreateSkill}
disabled={isCreatingNew}
style={{
@@ -619,7 +621,9 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({
borderColor: theme.dracula.green,
color: theme.dracula.green,
}}
- />
+ >
+ <Plus className="h-3.5 w-3.5" />
+ </Button>
</TooltipTrigger>
<TooltipContent>Create new skill</TooltipContent>
</Tooltip>
@@ -813,8 +817,8 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({
</div>
</div>
<Button
- icon={<CloseOutlined />}
- size="small"
+ size="sm"
+ variant="outline"
onClick={handleCancelCreate}
style={{
backgroundColor: `${theme.dracula.red}15`,
@@ -822,19 +826,21 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({
color: theme.dracula.red,
}}
>
+ <X className="h-3.5 w-3.5" />
Cancel
</Button>
<Button
- icon={<SaveOutlined />}
- size="small"
+ size="sm"
+ variant="outline"
onClick={handleSaveSkill}
- loading={savingSkill}
+ disabled={savingSkill}
style={{
backgroundColor: `${theme.dracula.green}15`,
borderColor: `${theme.dracula.green}40`,
color: theme.dracula.green,
}}
>
+ {savingSkill ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <Save className="h-3.5 w-3.5" />}
Save
</Button>
</div>
@@ -990,30 +996,32 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({
<>
{hasUnsavedChanges && (
<Button
- icon={<SaveOutlined />}
- size="small"
+ size="sm"
+ variant="outline"
onClick={handleSaveSkill}
- loading={savingSkill}
+ disabled={savingSkill}
style={{
backgroundColor: `${theme.dracula.green}15`,
borderColor: `${theme.dracula.green}40`,
color: theme.dracula.green,
}}
>
+ {savingSkill ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <Save className="h-3.5 w-3.5" />}
Save
</Button>
)}
<AlertDialog>
<AlertDialogTrigger asChild>
<Button
- icon={<DeleteOutlined />}
- size="small"
- danger
+ size="sm"
+ variant="outline"
style={{
backgroundColor: `${theme.dracula.red}15`,
borderColor: `${theme.dracula.red}40`,
+ color: theme.dracula.red,
}}
>
+ <Trash2 className="h-3.5 w-3.5" />
Delete
</Button>
</AlertDialogTrigger>
@@ -1042,16 +1050,17 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({
{/* Reset Button for built-in skills */}
{!isEditingUserSkill && selectedSkillConfig?.isCustomized && (
<Button
- icon={<ReloadOutlined />}
- size="small"
+ size="sm"
+ variant="outline"
onClick={() => handleResetToDefault(selectedSkillName!)}
- loading={isLoading}
+ disabled={isLoading}
style={{
backgroundColor: `${theme.dracula.orange}15`,
borderColor: `${theme.dracula.orange}40`,
color: theme.dracula.orange,
}}
>
+ {isLoading ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <RotateCcw className="h-3.5 w-3.5" />}
Reset
</Button>
)}
diff --git a/client/src/components/ui/SettingsPanel.tsx b/client/src/components/ui/SettingsPanel.tsx
index 3b8ac1ce..d9a2e05f 100644
--- a/client/src/components/ui/SettingsPanel.tsx
+++ b/client/src/components/ui/SettingsPanel.tsx
@@ -1,7 +1,9 @@
import React, { useState, useEffect, useCallback } from 'react';
-import { Switch, InputNumber, Slider, Button } from 'antd';
+import { Switch, InputNumber, Slider } from 'antd';
import { toast } from 'sonner';
-import { QuestionCircleOutlined } from '@ant-design/icons';
+import { HelpCircle } from 'lucide-react';
+
+import { Button } from '@/components/ui/button';
import Modal from './Modal';
import { useAppTheme } from '../../hooks/useAppTheme';
import { useWebSocket } from '../../contexts/WebSocketContext';
@@ -506,7 +508,7 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
<div style={sectionStyle}>
<div style={sectionHeaderStyle}>
<div style={{ ...sectionIconStyle, backgroundColor: `${theme.dracula.cyan}20` }}>
- <QuestionCircleOutlined style={{ color: theme.dracula.cyan }} />
+ <HelpCircle className="h-4 w-4" style={{ color: theme.dracula.cyan }} />
</div>
<div style={sectionTitleStyle}>Help</div>
</div>
@@ -517,8 +519,8 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
<div style={descriptionStyle}>Show the onboarding wizard again to review platform features</div>
</div>
<Button
- size="small"
- icon={<QuestionCircleOutlined />}
+ size="sm"
+ variant="outline"
onClick={onReplayOnboarding}
disabled={!onReplayOnboarding}
style={{
@@ -527,6 +529,7 @@ const SettingsPanel: React.FC<SettingsPanelProps> = ({
borderColor: `${theme.dracula.cyan}60`,
}}
>
+ <HelpCircle className="h-3.5 w-3.5" />
Replay
</Button>
</div>