android-midscene-automation 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +12 -0
- package/package.json +1 -1
- package/server/appium-auto-save.test.ts +12 -0
- package/server/appium-config.test.ts +18 -1
- package/server/appium-recorder/appium-runner.ts +4 -1
- package/server/appium-recorder/element-tap.test.ts +61 -0
- package/server/appium-recorder/flow-layout.test.ts +52 -0
- package/server/appium-recorder/request-timeout.test.ts +34 -0
- package/server/appium-recorder/request-timeout.ts +7 -3
- package/server/config.ts +18 -3
- package/src/App.vue +4 -0
- package/src/appium-recorder/AppiumPage.vue +15 -4
- package/src/appium-recorder/components/AiRecognitionSettings.vue +1 -1
- package/src/appium-recorder/components/FlowCanvas.vue +109 -25
- package/src/appium-recorder/components/FlowNodeCard.vue +39 -19
- package/src/appium-recorder/components/FlowRoundedEdge.vue +31 -46
- package/src/appium-recorder/components/FlowStepEditor.vue +45 -10
- package/src/appium-recorder/components/LongPressSettings.vue +1 -1
- package/src/appium-recorder/components/RecordedSteps.vue +9 -1
- package/src/appium-recorder/flow-appearance.ts +46 -2
- package/src/appium-recorder/flow-graph.ts +44 -28
- package/src/components/config/AppiumConfigPanel.vue +10 -2
- package/src/components/config/FlowAppearanceSettings.vue +123 -43
- package/src/config/use-appium-auto-save.ts +2 -0
- package/src/config/use-model-config.ts +5 -1
- package/src/pages/ConfigPage.vue +6 -6
- package/src/style.css +57 -41
- package/src/types.ts +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Position, type Edge, type Node } from '@vue-flow/core';
|
|
2
2
|
import * as dagre from '@dagrejs/dagre';
|
|
3
3
|
import type { AppiumRecordedStep } from './types';
|
|
4
|
+
import type { FlowLayoutDirection } from './flow-appearance';
|
|
4
5
|
import { defaultFlowKind as defaultKind, flowBranchLabel, isBooleanCondition } from './flow-labels';
|
|
5
6
|
|
|
6
7
|
type DagreApi = typeof dagre;
|
|
@@ -140,6 +141,7 @@ type StepItem = {
|
|
|
140
141
|
};
|
|
141
142
|
|
|
142
143
|
type BuildFlowGraphOptions = {
|
|
144
|
+
layoutDirection?: FlowLayoutDirection;
|
|
143
145
|
aiRecognitionModelConfigured?: boolean;
|
|
144
146
|
expandedStepIndex: number | null;
|
|
145
147
|
selectedCopyIndexes: number[];
|
|
@@ -307,7 +309,15 @@ export function buildFlowGraph(
|
|
|
307
309
|
steps: AppiumRecordedStep[],
|
|
308
310
|
options: BuildFlowGraphOptions,
|
|
309
311
|
) {
|
|
312
|
+
const horizontal = options.layoutDirection === 'horizontal';
|
|
313
|
+
const branchMinWidth = horizontal ? FLOW_STEP_NODE_HEIGHT : FLOW_STEP_NODE_WIDTH;
|
|
314
|
+
const branchMinSpread = horizontal ? 100 : FLOW_BRANCH_MIN_SPREAD;
|
|
310
315
|
const items = steps.map((step, index) => ({ step, index }));
|
|
316
|
+
const stepNodeHeight = ({ step, index }: StepItem) => {
|
|
317
|
+
const estimated = estimateStepNodeHeight(options.labelStep(step), step.type === 'aiRecognition' ? 3 : undefined)
|
|
318
|
+
+ (options.expandedStepIndex === index ? FLOW_EXPANDED_NODE_HEIGHT : 0);
|
|
319
|
+
return Math.max(FLOW_STEP_NODE_HEIGHT, Math.ceil(options.measuredNodeHeights?.[nodeIdForStep(step)] || estimated));
|
|
320
|
+
};
|
|
311
321
|
const nodes: FlowGraphNode[] = [];
|
|
312
322
|
const links: Link[] = [];
|
|
313
323
|
const layoutLinks: Link[] = [];
|
|
@@ -321,26 +331,26 @@ export function buildFlowGraph(
|
|
|
321
331
|
if (cached) return cached;
|
|
322
332
|
if (measuringBranches.has(condition.id)) {
|
|
323
333
|
return {
|
|
324
|
-
yesWidth:
|
|
325
|
-
noWidth:
|
|
326
|
-
centerGap:
|
|
327
|
-
totalWidth:
|
|
334
|
+
yesWidth: branchMinWidth,
|
|
335
|
+
noWidth: branchMinWidth,
|
|
336
|
+
centerGap: branchMinSpread * 2,
|
|
337
|
+
totalWidth: branchMinSpread * 2 + branchMinWidth,
|
|
328
338
|
};
|
|
329
339
|
}
|
|
330
340
|
|
|
331
341
|
measuringBranches.add(condition.id);
|
|
332
342
|
const branchWidth = (branch: FlowBranch) => Math.max(
|
|
333
|
-
|
|
334
|
-
...directBranchItems(items, condition.id, branch).map((
|
|
335
|
-
defaultKind(step) === 'condition'
|
|
336
|
-
? conditionBranchLayout(step).totalWidth
|
|
337
|
-
:
|
|
343
|
+
branchMinWidth,
|
|
344
|
+
...directBranchItems(items, condition.id, branch).map((item) => (
|
|
345
|
+
defaultKind(item.step) === 'condition'
|
|
346
|
+
? Math.max(conditionBranchLayout(item.step).totalWidth, horizontal ? stepNodeHeight(item) : branchMinWidth)
|
|
347
|
+
: horizontal ? stepNodeHeight(item) : branchMinWidth
|
|
338
348
|
)),
|
|
339
349
|
);
|
|
340
350
|
const yesWidth = branchWidth('yes');
|
|
341
351
|
const noWidth = branchWidth('no');
|
|
342
352
|
const centerGap = Math.max(
|
|
343
|
-
|
|
353
|
+
branchMinSpread * 2,
|
|
344
354
|
yesWidth / 2 + noWidth / 2 + FLOW_BRANCH_SUBTREE_GAP,
|
|
345
355
|
);
|
|
346
356
|
const sideExtent = Math.max(
|
|
@@ -351,7 +361,7 @@ export function buildFlowGraph(
|
|
|
351
361
|
yesWidth,
|
|
352
362
|
noWidth,
|
|
353
363
|
centerGap,
|
|
354
|
-
totalWidth: Math.max(
|
|
364
|
+
totalWidth: Math.max(branchMinWidth, sideExtent * 2),
|
|
355
365
|
};
|
|
356
366
|
measuringBranches.delete(condition.id);
|
|
357
367
|
branchLayouts.set(condition.id, layout);
|
|
@@ -363,12 +373,14 @@ export function buildFlowGraph(
|
|
|
363
373
|
.forEach(({ step }) => conditionBranchLayout(step));
|
|
364
374
|
|
|
365
375
|
const addNode = (node: FlowGraphNode) => {
|
|
376
|
+
// 在逻辑纵向坐标中复用分支、汇合和避让算法,横向布局交换节点尺寸后计算。
|
|
377
|
+
const width = Number(node.width) || FLOW_STEP_NODE_WIDTH;
|
|
378
|
+
const height = Number(node.height) || FLOW_STEP_NODE_HEIGHT;
|
|
366
379
|
nodes.push({
|
|
367
380
|
...node,
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
},
|
|
381
|
+
width: horizontal ? height : width,
|
|
382
|
+
height: horizontal ? width : height,
|
|
383
|
+
dimensions: { width: horizontal ? height : width, height: horizontal ? width : height },
|
|
372
384
|
} as FlowGraphNode);
|
|
373
385
|
};
|
|
374
386
|
const addVisibleLink = (source: string, target: string, branch?: FlowBranch) => {
|
|
@@ -427,14 +439,7 @@ export function buildFlowGraph(
|
|
|
427
439
|
const label = options.labelStep(item.step);
|
|
428
440
|
// 字数估算仅用于首次布局,不强制卡片高度;实际换行由浏览器决定。
|
|
429
441
|
const cardMinHeight = FLOW_STEP_NODE_HEIGHT;
|
|
430
|
-
const
|
|
431
|
-
label,
|
|
432
|
-
item.step.type === 'aiRecognition' ? 3 : undefined,
|
|
433
|
-
);
|
|
434
|
-
const estimatedNodeHeight = options.expandedStepIndex === item.index
|
|
435
|
-
? estimatedCardHeight + FLOW_EXPANDED_NODE_HEIGHT
|
|
436
|
-
: estimatedCardHeight;
|
|
437
|
-
const nodeHeight = Math.max(cardMinHeight, Math.ceil(options.measuredNodeHeights?.[id] || estimatedNodeHeight));
|
|
442
|
+
const nodeHeight = stepNodeHeight(item);
|
|
438
443
|
addNode({
|
|
439
444
|
id,
|
|
440
445
|
type: 'flow-node',
|
|
@@ -789,10 +794,10 @@ export function buildFlowGraph(
|
|
|
789
794
|
const joinOwner = joins.get(target.id);
|
|
790
795
|
if (joinOwner && target.id !== joinOwner) {
|
|
791
796
|
const incoming = links.filter((edge) => edge.target === target.id).map((edge) => nodeById.get(edge.source)!).filter(Boolean);
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
setCenterX(target,
|
|
797
|
+
if (incoming.length) {
|
|
798
|
+
target.position.y = Math.round(Math.max(...incoming.map((node) => node.position.y + nodeHeight(node))) + FLOW_STANDARD_LINE_GAP * 8);
|
|
799
|
+
const incomingCenters = incoming.map(centerX);
|
|
800
|
+
setCenterX(target, (Math.min(...incomingCenters) + Math.max(...incomingCenters)) / 2);
|
|
796
801
|
}
|
|
797
802
|
return;
|
|
798
803
|
}
|
|
@@ -806,7 +811,7 @@ export function buildFlowGraph(
|
|
|
806
811
|
let x = centerX(source);
|
|
807
812
|
if (target.data.kind === 'branch') {
|
|
808
813
|
const conditionId = steps[target.data.conditionIndex].id;
|
|
809
|
-
const spread = (branchLayouts.get(conditionId)?.centerGap ||
|
|
814
|
+
const spread = (branchLayouts.get(conditionId)?.centerGap || branchMinSpread * 2) / 2;
|
|
810
815
|
x += target.data.branch === 'yes' ? -spread : spread;
|
|
811
816
|
}
|
|
812
817
|
setCenterX(target, x);
|
|
@@ -838,6 +843,17 @@ export function buildFlowGraph(
|
|
|
838
843
|
data: { branch: link.branch, merge: joins.has(link.target) },
|
|
839
844
|
}));
|
|
840
845
|
|
|
846
|
+
if (horizontal) {
|
|
847
|
+
positionedNodes.forEach((node) => {
|
|
848
|
+
node.position = { x: node.position.y, y: node.position.x };
|
|
849
|
+
const width = node.width;
|
|
850
|
+
node.width = node.height;
|
|
851
|
+
node.height = width;
|
|
852
|
+
Object.assign(node, { dimensions: { width: Number(node.width), height: Number(node.height) } });
|
|
853
|
+
node.sourcePosition = Position.Right;
|
|
854
|
+
node.targetPosition = Position.Left;
|
|
855
|
+
});
|
|
856
|
+
}
|
|
841
857
|
return { nodes: positionedNodes, edges };
|
|
842
858
|
}
|
|
843
859
|
|
|
@@ -68,8 +68,16 @@ defineEmits<{
|
|
|
68
68
|
</section>
|
|
69
69
|
|
|
70
70
|
<section class="appium-config-section" aria-labelledby="appium-editor-title">
|
|
71
|
-
<header class="appium-section-heading"><div><h2 id="appium-editor-title">流程编辑器</h2><p
|
|
72
|
-
<FlowAppearanceSettings
|
|
71
|
+
<header class="appium-section-heading"><div><h2 id="appium-editor-title">流程编辑器</h2><p>选择流程主题,调整画布、节点和连接线颜色,以及横纵布局。</p></div></header>
|
|
72
|
+
<FlowAppearanceSettings
|
|
73
|
+
v-model="configForm.appium.flowBackgroundColor"
|
|
74
|
+
v-model:node-color="configForm.appium.flowNodeColor"
|
|
75
|
+
v-model:node-border-color="configForm.appium.flowNodeBorderColor"
|
|
76
|
+
v-model:line-color="configForm.appium.flowLineColor"
|
|
77
|
+
v-model:line-style="configForm.appium.flowLineStyle"
|
|
78
|
+
v-model:layout-direction="configForm.appium.flowLayoutDirection"
|
|
79
|
+
@apply-theme="Object.assign(configForm.appium, $event.colors)"
|
|
80
|
+
/>
|
|
73
81
|
</section>
|
|
74
82
|
</div>
|
|
75
83
|
</template>
|
|
@@ -2,69 +2,149 @@
|
|
|
2
2
|
import { computed } from 'vue';
|
|
3
3
|
import { RefreshLeft } from '@element-plus/icons-vue';
|
|
4
4
|
import {
|
|
5
|
-
DEFAULT_FLOW_BACKGROUND, FLOW_BACKGROUND_PRESETS, normalizeFlowBackground,
|
|
5
|
+
DEFAULT_FLOW_BACKGROUND, FLOW_BACKGROUND_PRESETS, normalizeFlowBackground, normalizeFlowLineStyle, type FlowLineStyle, normalizeFlowLayoutDirection, type FlowLayoutDirection,
|
|
6
6
|
DEFAULT_FLOW_LINE_COLOR, FLOW_LINE_COLOR_PRESETS, normalizeFlowLineColor, isHexColor,
|
|
7
|
+
DEFAULT_FLOW_NODE_COLOR, DEFAULT_FLOW_NODE_BORDER_COLOR, normalizeFlowNodeColor, normalizeFlowNodeBorderColor,
|
|
8
|
+
FLOW_APPEARANCE_THEMES, type FlowAppearanceTheme,
|
|
7
9
|
} from '../../appium-recorder/flow-appearance';
|
|
8
10
|
|
|
9
|
-
const props = defineProps<{
|
|
10
|
-
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
modelValue?: string;
|
|
13
|
+
nodeColor?: string;
|
|
14
|
+
nodeBorderColor?: string;
|
|
15
|
+
lineColor?: string;
|
|
16
|
+
lineStyle?: FlowLineStyle;
|
|
17
|
+
layoutDirection?: FlowLayoutDirection;
|
|
18
|
+
}>();
|
|
19
|
+
const emit = defineEmits<{
|
|
20
|
+
'update:modelValue': [color: string];
|
|
21
|
+
'update:lineColor': [color: string];
|
|
22
|
+
'update:nodeColor': [color: string];
|
|
23
|
+
'update:nodeBorderColor': [color: string];
|
|
24
|
+
'update:lineStyle': [style: FlowLineStyle];
|
|
25
|
+
'update:layoutDirection': [direction: FlowLayoutDirection];
|
|
26
|
+
applyTheme: [theme: FlowAppearanceTheme];
|
|
27
|
+
}>();
|
|
11
28
|
const panels = computed(() => [
|
|
12
|
-
{ key: 'background' as const, title: '
|
|
29
|
+
{ key: 'background' as const, title: '画布背景色', color: props.modelValue ?? DEFAULT_FLOW_BACKGROUND,
|
|
13
30
|
fallback: DEFAULT_FLOW_BACKGROUND, presets: FLOW_BACKGROUND_PRESETS, normalize: normalizeFlowBackground,
|
|
14
|
-
inputLabel: '十六进制背景色', pickerLabel: '
|
|
31
|
+
inputLabel: '十六进制背景色', pickerLabel: '选择画布背景色', resetLabel: '恢复默认颜色' },
|
|
32
|
+
{ key: 'node' as const, title: '节点填充色', color: props.nodeColor ?? DEFAULT_FLOW_NODE_COLOR,
|
|
33
|
+
fallback: DEFAULT_FLOW_NODE_COLOR, presets: FLOW_APPEARANCE_THEMES.map(theme => theme.colors.flowNodeColor), normalize: normalizeFlowNodeColor,
|
|
34
|
+
inputLabel: '十六进制节点填充色', pickerLabel: '选择节点填充色', resetLabel: '恢复默认节点填充色' },
|
|
35
|
+
{ key: 'border' as const, title: '节点边框色', color: props.nodeBorderColor ?? DEFAULT_FLOW_NODE_BORDER_COLOR,
|
|
36
|
+
fallback: DEFAULT_FLOW_NODE_BORDER_COLOR, presets: FLOW_APPEARANCE_THEMES.map(theme => theme.colors.flowNodeBorderColor), normalize: normalizeFlowNodeBorderColor,
|
|
37
|
+
inputLabel: '十六进制节点边框色', pickerLabel: '选择节点边框色', resetLabel: '恢复默认节点边框色' },
|
|
15
38
|
{ key: 'line' as const, title: '连接线条颜色', color: props.lineColor ?? DEFAULT_FLOW_LINE_COLOR,
|
|
16
39
|
fallback: DEFAULT_FLOW_LINE_COLOR, presets: FLOW_LINE_COLOR_PRESETS, normalize: normalizeFlowLineColor,
|
|
17
|
-
inputLabel: '十六进制线条颜色', pickerLabel: '选择连接线条颜色', resetLabel: '恢复默认线条颜色'
|
|
40
|
+
inputLabel: '十六进制线条颜色', pickerLabel: '选择连接线条颜色', resetLabel: '恢复默认线条颜色' },
|
|
18
41
|
].map(panel => ({ ...panel, error: isHexColor(panel.color) ? '' : '请输入有效的十六进制颜色,如 #ABC 或 #AABBCC' })));
|
|
19
|
-
function update(key: 'background' | 'line', color: string) {
|
|
42
|
+
function update(key: 'background' | 'node' | 'border' | 'line', color: string) {
|
|
20
43
|
if (key === 'background') emit('update:modelValue', color);
|
|
44
|
+
else if (key === 'node') emit('update:nodeColor', color);
|
|
45
|
+
else if (key === 'border') emit('update:nodeBorderColor', color);
|
|
21
46
|
else emit('update:lineColor', color);
|
|
22
47
|
}
|
|
48
|
+
|
|
49
|
+
const selectedTheme = computed(() => {
|
|
50
|
+
if (panels.value.some(panel => panel.error)) return undefined;
|
|
51
|
+
return FLOW_APPEARANCE_THEMES.find(theme => (
|
|
52
|
+
normalizeFlowBackground(props.modelValue) === theme.colors.flowBackgroundColor
|
|
53
|
+
&& normalizeFlowNodeColor(props.nodeColor) === theme.colors.flowNodeColor
|
|
54
|
+
&& normalizeFlowNodeBorderColor(props.nodeBorderColor) === theme.colors.flowNodeBorderColor
|
|
55
|
+
&& normalizeFlowLineColor(props.lineColor) === theme.colors.flowLineColor
|
|
56
|
+
))?.id;
|
|
57
|
+
});
|
|
23
58
|
</script>
|
|
24
59
|
|
|
25
60
|
<template>
|
|
26
61
|
<el-card shadow="never" class="config-module-card config-appium-card flow-appearance-settings">
|
|
27
62
|
<template #header><div class="panel-header"><span>流程外观</span></div></template>
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
<section class="flow-theme-settings" aria-label="预设流程主题">
|
|
64
|
+
<div class="flow-theme-heading"><h3>预设主题</h3><span>同时应用画布、节点和连接线配色,可继续单独调整。</span></div>
|
|
65
|
+
<div class="flow-theme-presets">
|
|
66
|
+
<button v-for="theme in FLOW_APPEARANCE_THEMES" :key="theme.id" type="button" class="flow-theme"
|
|
67
|
+
:aria-label="`应用${theme.name}主题`" :aria-pressed="selectedTheme === theme.id" @click="emit('applyTheme', theme)">
|
|
68
|
+
<svg viewBox="0 0 160 72" aria-hidden="true" :style="{ backgroundColor: theme.colors.flowBackgroundColor }">
|
|
69
|
+
<path d="M 60 24 C 92 24 68 48 100 48" fill="none" :stroke="theme.colors.flowLineColor" stroke-width="2.5" />
|
|
70
|
+
<rect x="10" y="12" width="50" height="24" rx="5" :fill="theme.colors.flowNodeColor" :stroke="theme.colors.flowNodeBorderColor" />
|
|
71
|
+
<rect x="100" y="36" width="50" height="24" rx="5" :fill="theme.colors.flowNodeColor" :stroke="theme.colors.flowNodeBorderColor" />
|
|
72
|
+
<circle cx="60" cy="24" r="3" :fill="theme.colors.flowLineColor" /><circle cx="100" cy="48" r="3" :fill="theme.colors.flowLineColor" />
|
|
73
|
+
</svg>
|
|
74
|
+
<span>{{ theme.name }}</span>
|
|
75
|
+
</button>
|
|
76
|
+
</div>
|
|
77
|
+
</section>
|
|
78
|
+
<div class="flow-behavior-settings">
|
|
79
|
+
<div class="flow-behavior-setting">
|
|
80
|
+
<span>布局方向</span>
|
|
81
|
+
<el-radio-group :model-value="normalizeFlowLayoutDirection(layoutDirection)" aria-label="流程布局方向"
|
|
82
|
+
@update:model-value="emit('update:layoutDirection', normalizeFlowLayoutDirection($event))">
|
|
83
|
+
<el-radio-button value="vertical">纵向</el-radio-button>
|
|
84
|
+
<el-radio-button value="horizontal">横向</el-radio-button>
|
|
85
|
+
</el-radio-group>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="flow-behavior-setting">
|
|
88
|
+
<span>连接线</span>
|
|
89
|
+
<el-radio-group :model-value="normalizeFlowLineStyle(lineStyle)" aria-label="连接线条样式"
|
|
90
|
+
@update:model-value="emit('update:lineStyle', normalizeFlowLineStyle($event))">
|
|
91
|
+
<el-radio-button value="straight">直线</el-radio-button>
|
|
92
|
+
<el-radio-button value="curved">曲线</el-radio-button>
|
|
93
|
+
</el-radio-group>
|
|
94
|
+
</div>
|
|
51
95
|
</div>
|
|
96
|
+
<el-form label-position="left" label-width="90px" class="flow-colors" aria-label="自定义流程配色">
|
|
97
|
+
<el-form-item v-for="panel in panels" :key="panel.key" :label="panel.title" :error="panel.error"
|
|
98
|
+
class="flow-color-row" :class="{ 'flow-color-row--invalid': panel.error }">
|
|
99
|
+
<div class="flow-color-input">
|
|
100
|
+
<el-color-picker :model-value="panel.normalize(panel.color)" color-format="hex" :predefine="panel.presets"
|
|
101
|
+
:aria-label="panel.pickerLabel" @update:model-value="update(panel.key, $event || panel.fallback)" />
|
|
102
|
+
<el-input :model-value="panel.color" :aria-label="panel.inputLabel" :placeholder="panel.fallback"
|
|
103
|
+
@update:model-value="update(panel.key, String($event))" />
|
|
104
|
+
<el-button text circle :icon="RefreshLeft" :title="panel.resetLabel" :aria-label="panel.resetLabel"
|
|
105
|
+
@click="update(panel.key, panel.fallback)" />
|
|
106
|
+
</div>
|
|
107
|
+
</el-form-item>
|
|
108
|
+
</el-form>
|
|
52
109
|
</el-card>
|
|
53
110
|
</template>
|
|
54
111
|
|
|
55
112
|
<style scoped>
|
|
56
|
-
.flow-
|
|
57
|
-
.flow-
|
|
58
|
-
.flow-
|
|
59
|
-
.flow-
|
|
60
|
-
.flow-
|
|
61
|
-
.flow-
|
|
62
|
-
.flow-
|
|
63
|
-
.flow-
|
|
64
|
-
.flow-
|
|
65
|
-
.flow-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
113
|
+
.flow-theme-settings { margin-bottom: 24px; }
|
|
114
|
+
.flow-theme-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
|
|
115
|
+
.flow-theme-heading h3 { margin: 0; color: var(--ui-text); font-size: 15px; }
|
|
116
|
+
.flow-theme-heading span { color: var(--ui-text-muted); font-size: 12px; }
|
|
117
|
+
.flow-theme-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
|
|
118
|
+
.flow-theme { min-width: 0; overflow: hidden; padding: 0; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-control); background: var(--ui-surface); color: var(--ui-text-secondary); cursor: pointer; }
|
|
119
|
+
.flow-theme svg { display: block; width: 100%; border-bottom: 1px solid var(--ui-border); }
|
|
120
|
+
.flow-theme span { display: block; padding: 8px; font-size: 13px; }
|
|
121
|
+
.flow-theme:hover, .flow-theme[aria-pressed="true"] { border-color: var(--ui-primary); color: var(--ui-primary); }
|
|
122
|
+
.flow-theme[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--el-color-primary-light-8); }
|
|
123
|
+
.flow-theme:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 3px; }
|
|
124
|
+
.flow-behavior-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 40px; margin-bottom: 20px; }
|
|
125
|
+
.flow-behavior-setting { display: flex; align-items: center; gap: 14px; min-height: 36px; }
|
|
126
|
+
.flow-behavior-setting > span { color: var(--ui-text-secondary); font-size: 13px; font-weight: 500; }
|
|
127
|
+
.flow-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-control); }
|
|
128
|
+
.flow-colors .flow-color-row { min-width: 0; margin: 0; padding: 12px 16px; align-items: center; }
|
|
129
|
+
.flow-color-row:nth-child(even) { border-left: 1px solid var(--ui-border); }
|
|
130
|
+
.flow-color-row:nth-child(-n+2) { border-bottom: 1px solid var(--ui-border); }
|
|
131
|
+
.flow-colors .flow-color-row--invalid { padding-bottom: 28px; }
|
|
132
|
+
.flow-colors :deep(.el-form-item__label) { align-items: center; margin: 0; font-size: 13px; color: var(--ui-text-secondary); }
|
|
133
|
+
.flow-colors :deep(.el-form-item__content) { min-width: 0; }
|
|
134
|
+
.flow-color-input { display: flex; align-items: center; gap: 8px; width: 100%; }
|
|
135
|
+
.flow-color-input .el-color-picker { flex-shrink: 0; }
|
|
136
|
+
.flow-color-input .el-input { flex: 1; min-width: 0; max-width: 200px; }
|
|
137
|
+
.flow-color-input :deep(.el-input__wrapper) { min-height: 30px; }
|
|
138
|
+
.flow-color-input :deep(.el-input__inner) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
|
|
139
|
+
.flow-color-input .el-button { flex-shrink: 0; width: 28px; height: 28px; margin: 0; color: var(--ui-text-muted); }
|
|
140
|
+
@media (max-width: 900px) {
|
|
141
|
+
.flow-colors { grid-template-columns: minmax(0, 1fr); }
|
|
142
|
+
.flow-color-row:nth-child(even) { border-left: 0; }
|
|
143
|
+
.flow-color-row:not(:last-child) { border-bottom: 1px solid var(--ui-border); }
|
|
144
|
+
}
|
|
145
|
+
@media (max-width: 480px) {
|
|
146
|
+
.flow-colors .flow-color-row { padding-left: 10px; padding-right: 10px; }
|
|
147
|
+
.flow-colors :deep(.el-form-item__label) { width: 78px !important; font-size: 12px; }
|
|
148
|
+
.flow-color-input { gap: 6px; }
|
|
69
149
|
}
|
|
70
150
|
</style>
|
|
@@ -56,6 +56,8 @@ export function useAppiumAutoSave(config: ConfigForm, save: (value: Omit<ConfigF
|
|
|
56
56
|
pending = undefined;
|
|
57
57
|
const value = config.appium;
|
|
58
58
|
if ((value.flowBackgroundColor !== undefined && !isHexColor(value.flowBackgroundColor))
|
|
59
|
+
|| (value.flowNodeColor !== undefined && !isHexColor(value.flowNodeColor))
|
|
60
|
+
|| (value.flowNodeBorderColor !== undefined && !isHexColor(value.flowNodeBorderColor))
|
|
59
61
|
|| (value.flowLineColor !== undefined && !isHexColor(value.flowLineColor))) {
|
|
60
62
|
status.value = '颜色格式有误,尚未保存';
|
|
61
63
|
return;
|
|
@@ -4,7 +4,7 @@ import { resolveReportSummary } from '../appium-recorder/report-summary';
|
|
|
4
4
|
import { isAiRecognitionModelConfigured } from '../appium-recorder/ai-recognition';
|
|
5
5
|
import { resolveAiDeduplication } from '../appium-recorder/ai-deduplication';
|
|
6
6
|
import { resolveAiPromptPresets } from '../appium-recorder/ai-prompt-presets';
|
|
7
|
-
import { normalizeFlowBackground, normalizeFlowLineColor } from '../appium-recorder/flow-appearance';
|
|
7
|
+
import { normalizeFlowBackground, normalizeFlowLineColor, normalizeFlowLineStyle, normalizeFlowLayoutDirection, normalizeFlowNodeColor, normalizeFlowNodeBorderColor } from '../appium-recorder/flow-appearance';
|
|
8
8
|
import { selectMidsceneModelProvider, type MidsceneModelProvider } from './midscene-model-presets';
|
|
9
9
|
import { useAppiumAutoSave } from './use-appium-auto-save';
|
|
10
10
|
import type { ConfigForm } from '../types';
|
|
@@ -75,7 +75,11 @@ export function useModelConfig() {
|
|
|
75
75
|
configForm.appium.aiDeduplication = resolveAiDeduplication(payload.appium?.aiDeduplication);
|
|
76
76
|
configForm.appium.aiPromptPresets = resolveAiPromptPresets(payload.appium?.aiPromptPresets);
|
|
77
77
|
configForm.appium.flowBackgroundColor = normalizeFlowBackground(payload.appium?.flowBackgroundColor);
|
|
78
|
+
configForm.appium.flowNodeColor = normalizeFlowNodeColor(payload.appium?.flowNodeColor);
|
|
79
|
+
configForm.appium.flowNodeBorderColor = normalizeFlowNodeBorderColor(payload.appium?.flowNodeBorderColor);
|
|
78
80
|
configForm.appium.flowLineColor = normalizeFlowLineColor(payload.appium?.flowLineColor);
|
|
81
|
+
configForm.appium.flowLineStyle = normalizeFlowLineStyle(payload.appium?.flowLineStyle);
|
|
82
|
+
configForm.appium.flowLayoutDirection = normalizeFlowLayoutDirection(payload.appium?.flowLayoutDirection);
|
|
79
83
|
appiumAutoSave.initialize();
|
|
80
84
|
ready.value = true;
|
|
81
85
|
aiRecognitionModelConfigured.value = isAiRecognitionModelConfigured(configForm.appium.model);
|
package/src/pages/ConfigPage.vue
CHANGED
|
@@ -131,17 +131,17 @@ function handleTabKeydown(event: KeyboardEvent, index: number) {
|
|
|
131
131
|
width: fit-content;
|
|
132
132
|
max-width: calc(100% - 48px);
|
|
133
133
|
flex-wrap: wrap;
|
|
134
|
-
gap:
|
|
134
|
+
gap: 2px;
|
|
135
135
|
margin: 20px 24px 0;
|
|
136
136
|
padding: 4px;
|
|
137
137
|
border: 1px solid var(--ui-border);
|
|
138
|
-
border-radius:
|
|
138
|
+
border-radius: var(--ui-radius-pill);
|
|
139
139
|
background: var(--ui-bg-soft);
|
|
140
|
-
box-shadow: var(--ui-shadow-
|
|
140
|
+
box-shadow: var(--ui-shadow-inset);
|
|
141
141
|
}
|
|
142
142
|
.config-tabs .subnav__item {
|
|
143
|
-
min-height:
|
|
144
|
-
padding: 6px
|
|
143
|
+
min-height: 32px;
|
|
144
|
+
padding: 6px 14px;
|
|
145
145
|
border: 0;
|
|
146
146
|
border-radius: var(--ui-radius-pill);
|
|
147
147
|
font-size: 13px;
|
|
@@ -149,7 +149,7 @@ function handleTabKeydown(event: KeyboardEvent, index: number) {
|
|
|
149
149
|
.config-tabs .subnav__item--active {
|
|
150
150
|
background: var(--ui-surface);
|
|
151
151
|
color: var(--ui-primary);
|
|
152
|
-
box-shadow: var(--ui-shadow-
|
|
152
|
+
box-shadow: var(--ui-shadow-control);
|
|
153
153
|
}
|
|
154
154
|
.config-page > [role="tabpanel"] { padding: 24px; }
|
|
155
155
|
:deep(.config-module-card > .el-card__header) { padding: 18px 24px; font-size: 16px; font-weight: 600; }
|