From 7f8af78432955168f4daddf8fb6e25004c6dd4a6 Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Sat, 11 Oct 2025 12:06:11 +0200 Subject: [PATCH] feat: add settings icons to left panel section headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds quick access to configuration modals from the left panel: - Settings icon (⚙️) next to "Add Actors" section opens Actor Type config - Settings icon next to "Relations" section opens Relation Type config - Icons positioned between section title and expand/collapse chevron - Tooltips provide clear indication of functionality This provides convenient access to type configuration without needing to navigate through the menu bar, improving workflow efficiency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/Panels/LeftPanel.tsx | 75 +++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 15 deletions(-) diff --git a/src/components/Panels/LeftPanel.tsx b/src/components/Panels/LeftPanel.tsx index 1815da4..828d7fe 100644 --- a/src/components/Panels/LeftPanel.tsx +++ b/src/components/Panels/LeftPanel.tsx @@ -1,15 +1,18 @@ -import { useCallback } from 'react'; +import { useCallback, useState } from 'react'; import { IconButton, Tooltip } from '@mui/material'; import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; import ChevronRightIcon from '@mui/icons-material/ChevronRight'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ExpandLessIcon from '@mui/icons-material/ExpandLess'; +import SettingsIcon from '@mui/icons-material/Settings'; import { usePanelStore } from '../../stores/panelStore'; import { useGraphWithHistory } from '../../hooks/useGraphWithHistory'; import { useEditorStore } from '../../stores/editorStore'; import { createNode } from '../../utils/nodeUtils'; import { getIconComponent } from '../../utils/iconUtils'; import { getContrastColor } from '../../utils/colorUtils'; +import NodeTypeConfigModal from '../Config/NodeTypeConfig'; +import EdgeTypeConfigModal from '../Config/EdgeTypeConfig'; /** * LeftPanel - Collapsible tools panel on the left side @@ -40,6 +43,8 @@ const LeftPanel = ({ onDeselectAll, onAddNode }: LeftPanelProps) => { const { nodeTypes, edgeTypes, addNode } = useGraphWithHistory(); const { selectedRelationType, setSelectedRelationType } = useEditorStore(); + const [showNodeConfig, setShowNodeConfig] = useState(false); + const [showEdgeConfig, setShowEdgeConfig] = useState(false); const handleAddNode = useCallback( (nodeTypeId: string) => { @@ -100,13 +105,28 @@ const LeftPanel = ({ onDeselectAll, onAddNode }: LeftPanelProps) => {
{/* Add Actors Section */}
- +
+ + + setShowNodeConfig(true)} + > + + + + toggleLeftPanelSection('addActors')} + > + {leftPanelSections.addActors ? : } + +
{leftPanelSections.addActors && (
{nodeTypes.map((nodeType) => { @@ -150,13 +170,28 @@ const LeftPanel = ({ onDeselectAll, onAddNode }: LeftPanelProps) => { {/* Relations Section */}
- +
+ + + setShowEdgeConfig(true)} + > + + + + toggleLeftPanelSection('relations')} + > + {leftPanelSections.relations ? : } + +
{leftPanelSections.relations && (
+ + {/* Configuration Modals */} + setShowNodeConfig(false)} + /> + setShowEdgeConfig(false)} + />
); };