fix: clean invisible edge when toggling tool mode (#4795)
* Fix invisible edges bug * Removed elevate edges on select * Fix style of reconnecting edge
This commit is contained in:
parent
ef2199b317
commit
1120915577
3 changed files with 9 additions and 3 deletions
|
|
@ -144,6 +144,12 @@ body {
|
||||||
transition-duration: 150ms;
|
transition-duration: 150ms;
|
||||||
stroke-width: 2px !important;
|
stroke-width: 2px !important;
|
||||||
}
|
}
|
||||||
|
.react-flow__connection path {
|
||||||
|
transition: color;
|
||||||
|
stroke: var(--connection) !important;
|
||||||
|
transition-duration: 150ms;
|
||||||
|
stroke-width: 2px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.react-flow__edge.running .react-flow__edge-path {
|
.react-flow__edge.running .react-flow__edge-path {
|
||||||
stroke: hsl(var(--foreground)) !important;
|
stroke: hsl(var(--foreground)) !important;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ import { useTypesStore } from "../../../../stores/typesStore";
|
||||||
import { APIClassType } from "../../../../types/api";
|
import { APIClassType } from "../../../../types/api";
|
||||||
import { NodeType } from "../../../../types/flow";
|
import { NodeType } from "../../../../types/flow";
|
||||||
import {
|
import {
|
||||||
checkOldComponents,
|
|
||||||
generateFlow,
|
generateFlow,
|
||||||
generateNodeFromFlow,
|
generateNodeFromFlow,
|
||||||
getNodeId,
|
getNodeId,
|
||||||
|
|
@ -535,7 +534,6 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
|
||||||
onSelectionEnd={onSelectionEnd}
|
onSelectionEnd={onSelectionEnd}
|
||||||
onSelectionStart={onSelectionStart}
|
onSelectionStart={onSelectionStart}
|
||||||
connectionRadius={30}
|
connectionRadius={30}
|
||||||
elevateEdgesOnSelect={true}
|
|
||||||
edgeTypes={edgeTypes}
|
edgeTypes={edgeTypes}
|
||||||
connectionLineComponent={ConnectionLineComponent}
|
connectionLineComponent={ConnectionLineComponent}
|
||||||
onDragOver={onDragOver}
|
onDragOver={onDragOver}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import { FlowStoreType, VertexLayerElementType } from "../types/zustand/flow";
|
||||||
import { buildFlowVerticesWithFallback } from "../utils/buildUtils";
|
import { buildFlowVerticesWithFallback } from "../utils/buildUtils";
|
||||||
import {
|
import {
|
||||||
checkChatInput,
|
checkChatInput,
|
||||||
checkOldComponents,
|
|
||||||
cleanEdges,
|
cleanEdges,
|
||||||
detectBrokenEdgesEdges,
|
detectBrokenEdgesEdges,
|
||||||
getHandleId,
|
getHandleId,
|
||||||
|
|
@ -278,6 +277,8 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
return node;
|
return node;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const newEdges = cleanEdges(newNodes, get().edges);
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
// Defer the callback execution to ensure it runs after state updates are fully applied.
|
// Defer the callback execution to ensure it runs after state updates are fully applied.
|
||||||
queueMicrotask(callback);
|
queueMicrotask(callback);
|
||||||
|
|
@ -286,6 +287,7 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
nodes: newNodes,
|
nodes: newNodes,
|
||||||
|
edges: newEdges,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue