I will start by listing the files in the project to understand the structure and find where App.tsx and other key files are located.
I will now read the package.json file to check the installed dependencies and see if any icon libraries or canvas utilities are already available.
I will install lucide-react to enable a rich set of icons for the application (zooms, pans, edits, undo/redo, colors, etc.).
I will create the type definitions in src/types/mindmap.ts for our mind map data structures. This includes configurations for individual nodes, themes, line styles, canvas zoom/pan settings, and layout choices.
I will create src/utils/layout.ts to implement the layout algorithms. It will support three types of layouts:
- Symmetrical Mind Map: Branches outward to both Left and Right from the central node.
- Right-Branching Tree: Standard flow from Left to Right.
- Downward Tree: Flow from Top to Bottom (like an organizational chart).
This ensures users can re-organize and auto-align their mind map at any point with a single click. Let's write the complete code.
I will create src/utils/templates.ts to define the pre-built templates:
- Product Launch Plan (Operations, Engineering, Marketing, etc.)
- Holistic Growth Plan (Physical, Mental, Professional, Relationships)
- React 19 Mastery Roadmap (Server Components, Suspense, Compiler, etc.)
We define the relationships in a flat structure, and then we will run our auto-layout function on them before loading, ensuring that they display beautifully without hardcoding dozens of coordinates! This is a very clean design choice. Let's create the file.
I will create src/components/HelpModal.tsx to provide users with an elegant overlay explaining how to use the interactive mind map, the keyboard shortcuts (like Tab to add a child, Enter to add a sibling, Delete to remove, arrow keys to navigate), and mouse gestures. Let's create the file.
I will fix the unused imports in src/components/HelpModal.tsx to ensure there are no TypeScript compiler warnings.
I will create src/components/SidebarEditor.tsx to handle deep customizations of any selected mind map node. It will let users modify titles, select shapes (Pill, Round, Bracket, etc.), pick color presets or customize hex, assign priority badges, slide progress bars, add extensive descriptions/notes, and invoke node action operations (Add Child, Add Sibling, Collapse Subtree, Delete). Let's write this component.
I will edit src/components/SidebarEditor.tsx to clean up the unused imports and unused props (ChevronRight, allNodes), which keeps the build compiling correctly without any TypeScript warnings.
I will fix the functional component declaration of SidebarEditor to remove the allNodes parameter from the destructured arguments list, matching our updated props interface.
I will create src/components/NodeListPanel.tsx which houses the interactive hierarchical Outline Tree view and the global search. It helps users see a high-level table of contents of their mind map. Clicking any element instantly focuses and centers the viewport on that specific node on the canvas, even in a huge mind map. It also highlights matches as you search in real time! Let's write the file.
I will fix the TypeScript error in src/components/NodeListPanel.tsx by wrapping the EyeOff Lucide icon inside a span containing the title attribute, ensuring clean compilation.
I will create src/components/MindMapCanvas.tsx. This is the core canvas component that provides:
- Infinite Vector Drawing: An SVG layer drawn behind the nodes using the zero-overhead infinite canvas trick (
width: 1px; height: 1px; overflow: visible).
- Bezier, Straight, and Orthogonal Line Connections: Renders gorgeous curves between parent and child nodes, colored and styled dynamically based on the parent node's palette.
- Smooth Pan & Zoom Controls: Supports click-and-drag panning, middle-click panning, spacebar panning, and precise scroll-wheel zoom anchored directly on the cursor.
- Drag-and-Drop Node Positioner: Intuitive node dragging. If "Drag Subtree" is enabled, dragging a parent node organically drags all of its children with it, preserving their relative offsets.
- Add-on Hover Buttons: Easy "+" buttons hovering at the sides of the nodes for quick branching.
- Keybind Listeners: Fully listens to
Tab (add child), Enter (add sibling), Delete/Backspace (remove node), and standard Arrow keys (navigating selection) for an extremely fluid desktop-app feel. Let's write this component.
I will clean up the unused variables and imports in src/components/MindMapCanvas.tsx to maintain TypeScript compilation standards.
I will now remove the unused destructuring parameters and local variables (onOpenHelp, parentStyles, isRoot) inside src/components/MindMapCanvas.tsx to ensure absolute type safety and a clean build.
I will locate the occurrences of parentStyles and isRoot within src/components/MindMapCanvas.tsx to remove them.
I will now replace the lines containing the unused variables parentStyles and isRoot inside src/components/MindMapCanvas.tsx using edit_file.
I will now edit src/components/MindMapCanvas.tsx to remove the unused variable isRoot.
I will create src/components/Toolbar.tsx to handle the workspace management and mind map customizers. This component will feature:
- Glassmorphic Title & Logo with an interactive layout.
- Template Injector: A clean select menu allowing instant swapping between our preloaded mind maps (Product Launch, Habits, React 19 Mastery).
- Workspace Theme Switcher: Standard and dark themes, including Warm Sand, Cyber Neon, Forest Mint, and Clean Light.
- Connection Curve Toggle: Instantly switch lines between Smooth Bezier, Sharp Straight, and Orthogonal Elbow paths.
- Auto-Align Layout Triggers: Re-arrange elements symmetrically (left-and-right split), right-branching, or downward org-chart.
- Undo & Redo Action Buttons: Complete with stack counters.
- Bullet-outline Markdown Exporter: Converts the graphical mind map into a indented markdown file (
.md) compatible with Notion/Obsidian.
- JSON Export & Import File Reader: For backup/restore of custom mind map saves.
- Focus/Presentation Mode Toggle: Collapses side panels to maximize canvas workspace.
Let's write this component.
I will edit src/components/Toolbar.tsx to remove the unused Share2 import, keeping the TypeScript environment clear of warnings.
I will read the index.html file to see how we can update the title of the website to something fitting, like "MindWeaver Studio | Interactive Mind Map Planner".
I will update the HTML title in index.html to a fitting name: "MindWeaver Studio | Interactive Mind Mapping & Brainstorming".
I will now create the main entry point src/App.tsx. This file brings all of our sub-components together. It manages the global React state for the mind map:
- Interactive Workspace: Displays the double-sidebar structure with a left outline tree panel and right detailed customizer, which can be collapsed manually or auto-hidden in Focus Mode.
- State & Undo/Redo Engine: Full history recording, allowing deep rollbacks on node deletions, text updates, style modifications, and automatic layout runs.
- Smart Spawning Physics: Automatically spaces children out depending on their relative side of branching, so nodes never overlap when spawned.
- Recursive Cleaners: Ensures deleting any branch recursively cleans up all nested grandchildren, avoiding memory/visual leakage of orphan nodes.
- Preloaded Workspace Themes & Presets: Sets default Midnight Dark as the initial view, presenting a gorgeous, high-contrast digital planner experience immediately upon loading.
Let's write the complete code.
I will read the src/main.tsx file to verify that the entry point correctly mounts and executes our App.tsx component.
I will read src/index.css to ensure standard Tailwind classes, scrollbars, and keyframe animations are properly integrated.
I will update src/index.css to include custom scrollbar stylings for the side panels and an elegant slow-rotation keyframe animation (animate-spin-slow) for the branding icon, so everything matches our futuristic UI theme.
I will run the project build check to ensure that all TypeScript types, component configurations, and assets compile correctly without any issues.
I have successfully created and built a complete, fully featured Mind Mapping & Brainstorming Web Application (called MindWeaver Studio) using React, Vite, and Tailwind CSS.
Here is a summary of the systems and components I implemented:
1. Unified Types & Models (src/types/mindmap.ts)
MindMapNode: A flat dictionary model representing each node's content, child links, absolute canvas position, custom shape styles (Pill, Round Rect, Standard, Bracket, etc.), custom colors, text overrides, and rich metadata (detail notes, progress bar percent, priority levels, and custom emojis).
CanvasState: Tracks zoom multipliers and pan offsets.
MindMapTheme: Defines the styles of custom workspaces (Midnight Dark, Sand, Cyber Neon, Forest Mint, etc.).
2. Auto-Align Layout Algorithms (src/utils/layout.ts)
To prevent messy maps, three automatic alignment engines are built to arrange elements cleanly with a single click:
- Symmetrical Split: Branches children outward in both left and right directions symmetrically from the central root.
- Right Tree Flow: Positions all sub-branches sequentially flow-chart style to the right.
- Downward Org Chart: Arranges parent-to-child flow vertically downwards.
3. High-Quality Sample Mind Maps (src/utils/templates.ts)
To let users play with fully populated charts right away, three real-world preloaded templates are available:
- 🚀 Product Launch Planning (Business template): Covers Marketing, Tech execution, PR, and Operations.
- 🌱 Life & Habit Tracker (Personal template): Integrates fitness routines, professional development, and relationships.
- ⚛️ React 19 Mastery Path (Tech template): Outlines Server Actions, the React Compiler, new hooks like
useActionState, and asset preloading.
4. Collapsible Tree Outline Panel (src/components/NodeListPanel.tsx)
- Provides an interactive Table of Contents nested list.
- Has Live Fuzzy Search which filters and highlights node matching titles and descriptions.
- Includes a Compass / Center button on each node row: clicking it smoothly pans and zooms the main viewport directly to center on that node.
5. Detailed Customization Sidebar (src/components/SidebarEditor.tsx)
- A rich editor panel that slides out from the right when a node is selected.
- Enables title editing, assigning a Node Emoji Icon, configuring shapes (Pill, Rounded Rect, Sharp Square, Bracket, Circle), and choosing color presets or picking custom hex colors.
- Houses Task Management features: a Progress Slider (0% - 100%) that renders a visual bar on the node, and Priority Level pills (High, Med, Low, None).
- Features a large Notes & Reminders text area to store checklists or descriptions.
6. Vector Mind Map Canvas (src/components/MindMapCanvas.tsx)
- Infinite Canvas Grid: Leverages a zero-overhead infinite vector layer (
width:1px; height:1px; overflow:visible) where connection paths are drawn with SVG.
- Connection Curves: Renders lines dynamically connecting parent edges to child edges with Smooth Bezier curves, Direct Straight lines, or Orthogonal Elbow routes. Lines automatically match the parent node's color with adjustable stroke-weights depending on priority.
- Panning & Zooming Physics: Enables panning (via mouse drag, middle click, or holding
Spacebar) and mouse scroll zooming that locks directly onto the user's cursor.
- Subtree Dragging: Moving a parent node automatically moves all of its descendants with it, preserving their relative spacings perfectly.
- Hover Adding & Hiding: A "+" button slides out on hover to spawn sub-branches instantly. Clicking node toggles collapses/expands children to hide huge branches in presentation views.
- Keyboard Binding Engines: Allows navigating selected nodes with Arrow keys, creating branches with
Tab (child node) and Enter (sibling node), and deleting with Delete/Backspace.
7. Global Control Hub (src/components/Toolbar.tsx)
- Manages Undo / Redo memory stacks so users can rollback accidental deletes.
- Provides Export as indented Markdown (
.md) outline so mind maps can be exported as clean text directly into Notion, Obsidian, or Google Docs.
- Enables Export JSON Backups and JSON Import to restore work later.
- Toggles Focus / Presentation Mode which hides sidebars to maximize screen space for meetings.
Files built: src/types/mindmap.ts, src/utils/layout.ts, src/utils/templates.ts, src/components/HelpModal.tsx, src/components/SidebarEditor.tsx, src/components/NodeListPanel.tsx, src/components/MindMapCanvas.tsx, src/components/Toolbar.tsx, index.html, src/App.tsx, src/index.css