From e3e5b0768b892d9caf1f52739c10acc53cf90c5b Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Sat, 11 Oct 2025 12:07:53 +0200 Subject: [PATCH] perf: make relation directionality changes instant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes the 500ms debounce delay when changing edge directionality in the right panel. Directionality toggle buttons now apply changes immediately, providing instant visual feedback. Text fields (relation type and custom label) still use debounced saves to avoid excessive updates while typing. Improves UX by making toggle interactions feel more responsive. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/Panels/RightPanel.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Panels/RightPanel.tsx b/src/components/Panels/RightPanel.tsx index 6c13b4f..f71f851 100644 --- a/src/components/Panels/RightPanel.tsx +++ b/src/components/Panels/RightPanel.tsx @@ -482,9 +482,14 @@ const RightPanel = ({ selectedNode, selectedEdge, onClose }: Props) => { value={relationDirectionality} exclusive onChange={(_, newValue) => { - if (newValue !== null) { + if (newValue !== null && selectedEdge) { setRelationDirectionality(newValue); - setHasEdgeChanges(true); + // Apply directionality change instantly (no debounce) + updateEdge(selectedEdge.id, { + type: relationType, + label: relationLabel.trim() || undefined, + directionality: newValue, + }); } }} size="small"