Keep dataflow nodes initialized
This commit is contained in:
@@ -14,6 +14,8 @@ const checks = [
|
|||||||
[canvas.includes("application/x-govoplan-dataflow-node"), "palette drop handling"],
|
[canvas.includes("application/x-govoplan-dataflow-node"), "palette drop handling"],
|
||||||
[canvas.includes("isValidConnection"), "edge validation"],
|
[canvas.includes("isValidConnection"), "edge validation"],
|
||||||
[canvas.includes("connectionRadius={32}"), "visible connection drop radius"],
|
[canvas.includes("connectionRadius={32}"), "visible connection drop radius"],
|
||||||
|
[canvas.includes("initialWidth: 180"), "known initial node width"],
|
||||||
|
[canvas.includes('change.type !== "dimensions"'), "measurement-only change filtering"],
|
||||||
[
|
[
|
||||||
moduleEntry.indexOf("@xyflow/react/dist/style.css") <
|
moduleEntry.indexOf("@xyflow/react/dist/style.css") <
|
||||||
moduleEntry.indexOf("./styles/dataflow.css"),
|
moduleEntry.indexOf("./styles/dataflow.css"),
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ export default function DataflowCanvas({
|
|||||||
id: node.id,
|
id: node.id,
|
||||||
type: "dataflow",
|
type: "dataflow",
|
||||||
position: node.position,
|
position: node.position,
|
||||||
|
initialWidth: 180,
|
||||||
|
initialHeight: node.type.startsWith("combine.") ? 64 : 54,
|
||||||
selected: node.id === selectedNodeId,
|
selected: node.id === selectedNodeId,
|
||||||
data: {
|
data: {
|
||||||
label: node.label,
|
label: node.label,
|
||||||
@@ -180,7 +182,10 @@ export default function DataflowCanvas({
|
|||||||
onInit={setInstance}
|
onInit={setInstance}
|
||||||
onNodesChange={(changes) => {
|
onNodesChange={(changes) => {
|
||||||
if (readOnly) return;
|
if (readOnly) return;
|
||||||
updateNodes(applyNodeChanges(changes, nodes));
|
const graphChanges = changes.filter((change) => change.type !== "dimensions");
|
||||||
|
if (graphChanges.length) {
|
||||||
|
updateNodes(applyNodeChanges(graphChanges, nodes));
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
onEdgesChange={(changes) => {
|
onEdgesChange={(changes) => {
|
||||||
if (readOnly) return;
|
if (readOnly) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user