diff --git a/src/components/Panels/EdgeEditorPanel.tsx b/src/components/Panels/EdgeEditorPanel.tsx index a5835bd..78d0cb8 100644 --- a/src/components/Panels/EdgeEditorPanel.tsx +++ b/src/components/Panels/EdgeEditorPanel.tsx @@ -11,6 +11,7 @@ import { useDocumentHistory } from '../../hooks/useDocumentHistory'; import { useConfirm } from '../../hooks/useConfirm'; import ConnectionDisplay from '../Common/ConnectionDisplay'; import EdgeTypeConfigModal from '../Config/EdgeTypeConfig'; +import LabelConfigModal from '../Config/LabelConfig'; import AutocompleteLabelSelector from '../Common/AutocompleteLabelSelector'; import type { Relation, EdgeDirectionality } from '../../types'; @@ -37,6 +38,9 @@ const EdgeEditorPanel = ({ selectedEdge, onClose }: EdgeEditorPanelProps) => { const [showRelationTypeModal, setShowRelationTypeModal] = useState(false); const [editingRelationTypeId, setEditingRelationTypeId] = useState(null); + // Label modal state + const [showLabelModal, setShowLabelModal] = useState(false); + // Update state when selected edge changes useEffect(() => { if (selectedEdge.data) { @@ -218,9 +222,20 @@ const EdgeEditorPanel = ({ selectedEdge, onClose }: EdgeEditorPanelProps) => { {/* Labels */}
- +
+ + + setShowLabelModal(true)} + sx={{ padding: '2px' }} + > + + + +
{ @@ -326,6 +341,10 @@ const EdgeEditorPanel = ({ selectedEdge, onClose }: EdgeEditorPanelProps) => { onClose={handleCloseRelationTypeModal} initialEditingTypeId={editingRelationTypeId} /> + setShowLabelModal(false)} + /> ); }; diff --git a/src/components/Panels/NodeEditorPanel.tsx b/src/components/Panels/NodeEditorPanel.tsx index 1c1cee0..46d28a3 100644 --- a/src/components/Panels/NodeEditorPanel.tsx +++ b/src/components/Panels/NodeEditorPanel.tsx @@ -6,6 +6,7 @@ import { useGraphWithHistory } from '../../hooks/useGraphWithHistory'; import { useConfirm } from '../../hooks/useConfirm'; import ConnectionDisplay from '../Common/ConnectionDisplay'; import NodeTypeConfigModal from '../Config/NodeTypeConfig'; +import LabelConfigModal from '../Config/LabelConfig'; import AutocompleteLabelSelector from '../Common/AutocompleteLabelSelector'; import type { Actor } from '../../types'; @@ -32,6 +33,9 @@ const NodeEditorPanel = ({ selectedNode, onClose }: NodeEditorPanelProps) => { const [showActorTypeModal, setShowActorTypeModal] = useState(false); const [editingActorTypeId, setEditingActorTypeId] = useState(null); + // Label modal state + const [showLabelModal, setShowLabelModal] = useState(false); + // Update state when selected node changes useEffect(() => { setActorType(selectedNode.data?.type || ''); @@ -204,9 +208,20 @@ const NodeEditorPanel = ({ selectedNode, onClose }: NodeEditorPanelProps) => { {/* Labels */}
- +
+ + + setShowLabelModal(true)} + sx={{ padding: '2px' }} + > + + + +
{ @@ -295,6 +310,10 @@ const NodeEditorPanel = ({ selectedNode, onClose }: NodeEditorPanelProps) => { onClose={handleCloseActorTypeModal} initialEditingTypeId={editingActorTypeId} /> + setShowLabelModal(false)} + /> ); };