fix(frontend): WAF 规则编辑器缩小编排区高度和首次适配缩放比例,默认显示更多画布上下文

This commit is contained in:
ryan
2026-07-13 15:26:04 +08:00
parent 1eff7878a1
commit 9dc3983e0f
6 changed files with 12 additions and 3 deletions
@@ -13,6 +13,7 @@ import {
type Connection,
type Edge,
type EdgeChange,
type FitViewOptions,
type Node,
type NodeChange,
type ReactFlowInstance,
@@ -43,6 +44,10 @@ import { NodeLibrary } from './node-library';
import { RuleNode, type RuleFlowNodeData } from './rule-node';
const nodeTypes = { rule: RuleNode };
const initialFitViewOptions = {
padding: 0.3,
maxZoom: 0.85,
} satisfies FitViewOptions;
type FlowNode = Node<RuleFlowNodeData>;
type FlowEdge = Edge;
@@ -323,6 +328,7 @@ export function RuleFlowCanvas({
onSelectEdge(undefined);
}}
fitView
fitViewOptions={initialFitViewOptions}
deleteKeyCode={['Backspace', 'Delete']}
>
<Background gap={20} size={1} />
@@ -184,7 +184,7 @@ function EditorContent() {
return <EditorSkeleton />;
return (
<div className='flex h-[calc(100dvh-4rem)] w-full flex-col px-1 py-6'>
<div className='flex h-[calc(100dvh-8rem)] w-full flex-col px-1 py-6'>
<UnsavedChanges dirty={dirty} />
<header className='mb-4 flex items-center justify-between gap-4'>
<div className='flex min-w-0 items-center gap-2'>
+1 -1
View File
@@ -4559,4 +4559,4 @@
}
}
}
]
]