From 9c1a0d8661bce6ea83b22feb9089e190c3ce5703 Mon Sep 17 00:00:00 2001 From: Nikhil-Doye Date: Tue, 14 Oct 2025 22:37:29 -0400 Subject: [PATCH] Enhance WorkflowToolbar and localStorage management for workflows - Added success feedback in WorkflowToolbar upon saving a workflow, including visual changes to the save button. - Implemented localStorage operations for saving, loading, and clearing workflows in workflowStore. - Updated workflow management functions to persist changes to localStorage, ensuring data consistency across sessions. --- src/components/WorkflowToolbar.tsx | 20 ++++-- src/store/workflowStore.ts | 105 +++++++++++++++++++++++++---- test-localStorage.html | 81 ++++++++++++++++++++++ 3 files changed, 188 insertions(+), 18 deletions(-) create mode 100644 test-localStorage.html diff --git a/src/components/WorkflowToolbar.tsx b/src/components/WorkflowToolbar.tsx index f8bb4b5..558be7d 100644 --- a/src/components/WorkflowToolbar.tsx +++ b/src/components/WorkflowToolbar.tsx @@ -1,4 +1,4 @@ -import React, { useRef, useState } from "react"; +import React, { useRef, useState, useEffect } from "react"; import { useWorkflowStore } from "../store/workflowStore"; import { Download, @@ -8,6 +8,7 @@ import { Square, RotateCcw, Settings, + Check, } from "lucide-react"; import { downloadWorkflow, @@ -26,10 +27,13 @@ export const WorkflowToolbar: React.FC = () => { const fileInputRef = useRef(null); const [showOpenAIConfig, setShowOpenAIConfig] = useState(false); + const [showSaveSuccess, setShowSaveSuccess] = useState(false); const handleSave = () => { if (currentWorkflow) { saveWorkflow(); + setShowSaveSuccess(true); + setTimeout(() => setShowSaveSuccess(false), 2000); } }; @@ -86,11 +90,19 @@ export const WorkflowToolbar: React.FC = () => {
+ + +

+
+    
+  
+