Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@foxschema/ui-shared": "*",
"@foxschema/workflow-engine": "*",
"@monaco-editor/react": "4.7.0",
"@xyflow/react": "12.12.1",
"@xyflow/react": "13.0.2",
"ajv": "8.20.0",
"better-sqlite3": "13.2.0",
"cron-parser": "5.10.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,11 @@ export const LokeeWeavePage: React.FC<LokeeWeavePageProps> = ({
minZoom={0.35}
maxZoom={1.75}
defaultViewport={{ x: 24, y: 24, zoom: 1 }}
// React Flow 12 drew this canvas light unless told otherwise and
// left selected edges under the nodes; 13 changed both defaults.
// Keep it as it was.
forceColorMode="light"
elevateEdgesOnSelect={false}
style={{ width: '100%', height: '100%' }}
/**
* React Flow is plain MIT (see node_modules/@xyflow/react/LICENSE).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,16 @@ function Designer() {
[],
);

/** Pan and zoom to one pipe, once its stage is on the canvas and measured. */
/**
* Pan and zoom to one pipe, once its stage is on the canvas and measured.
* React Flow 13 reads a bare padding number as pixels, so the paddings here
* are percentages (22% and 6.5% are the old 0.8 and 0.15 ratios).
*/
const focusNode = useCallback(
(id: string) => {
requestAnimationFrame(() =>
requestAnimationFrame(() => {
void fitView({ nodes: [{ id }], duration: 300, maxZoom: 1.25, padding: 0.8 });
void fitView({ nodes: [{ id }], duration: 300, maxZoom: 1.25, padding: '22%' });
}),
);
},
Expand Down Expand Up @@ -818,7 +822,7 @@ function Designer() {
});
});
if (options.fit) {
requestAnimationFrame(() => void fitView({ duration: 250, padding: 0.15 }));
requestAnimationFrame(() => void fitView({ duration: 250, padding: '6.5%' }));
}
},
[edges, fitView, setNodes],
Expand Down Expand Up @@ -1671,7 +1675,9 @@ function Designer() {
onSelectionChange={onSelectionChange}
nodeTypes={nodeTypes}
edgeTypes={edgeTypes}
colorMode={colorMode}
forceColorMode={colorMode}
// React Flow 13 raises selected edges above the pipes by default.
elevateEdgesOnSelect={false}
fitView
connectionLineType={ConnectionLineType.SmoothStep}
defaultEdgeOptions={DEFAULT_EDGE_OPTIONS}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/frontend/features/workflow/workflow.css
Original file line number Diff line number Diff line change
Expand Up @@ -2181,8 +2181,8 @@ button.run-status {

}
/*
* React Flow sets its theme variables in unlayered CSS (.react-flow.dark), which
* would beat anything in the layer above, so these overrides sit outside it.
* React Flow sets its theme variables in its own layer (@layer xyflow), declared
* after the one above and so beating it; these overrides sit outside both.
*/
.fox-workflow .react-flow,
.fox-workflow .react-flow.dark {
Expand Down
Loading
Loading