From 8a2cbfd7da3da96d2f772e2cd3843f74fc08b6e8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 03:38:36 +0000 Subject: [PATCH] feat: Add 'Clear' button to reset the mind map This commit introduces a new "Clear" button to the application's header. This button allows users to easily reset the mind map by removing all nodes and edges from the canvas. The button is disabled when the application is in a loading state or when the canvas is already empty. --- src/App.jsx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/App.jsx b/src/App.jsx index 5f3df15..9d5cf4c 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -161,6 +161,11 @@ export default function App() { setLoading(false); }; + const handleClear = () => { + setNodes(initialNodes); + setEdges(initialEdges); + }; + const onNodeClick = async (_event, node) => { stopGenerationRef.current = false; setLoading(true); @@ -246,6 +251,22 @@ export default function App() { > Export as PNG +