perf: make relation directionality changes instant

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 <noreply@anthropic.com>
This commit is contained in:
Jan-Henrik Bruhn 2025-10-11 12:07:53 +02:00
parent 7f8af78432
commit e3e5b0768b

View file

@ -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"