android-midscene-automation 1.1.7 → 1.1.9

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.
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ import { shallowRef } from 'vue';
2
3
  import ReplayReportSummarySettings from './ReplayReportSummarySettings.vue';
3
4
  import type { ConfigForm } from '../../types';
4
5
  import FlowAppearanceSettings from './FlowAppearanceSettings.vue';
@@ -16,15 +17,25 @@ defineProps<{
16
17
  }>();
17
18
  defineEmits<{
18
19
  retrySave: []; testModel: []; testPromptOptimizerModel: [] }>();
20
+
21
+ const activeSection = shallowRef<'basic' | 'models'>('basic');
19
22
  </script>
20
23
 
21
24
  <template>
22
25
  <div class="appium-config-stack">
23
- <section class="appium-config-section" aria-labelledby="appium-models-title">
24
- <header class="appium-section-heading">
25
- <div><h2 id="appium-models-title">模型服务</h2><p>不同任务使用独立模型,配置修改需测试通过后保存。</p></div>
26
+ <header class="appium-config-toolbar">
27
+ <el-radio-group v-model="activeSection" aria-label="Appium配置分类">
28
+ <el-radio-button value="basic">基础配置</el-radio-button>
29
+ <el-radio-button value="models">模型配置</el-radio-button>
30
+ </el-radio-group>
31
+ <div v-if="saveStatus || saveFailed" class="appium-config-save-state">
26
32
  <span v-if="saveStatus" class="config-save-status" role="status">{{ saveStatus }}</span>
27
33
  <el-button v-if="saveFailed" link type="primary" @click="$emit('retrySave')">重试保存</el-button>
34
+ </div>
35
+ </header>
36
+ <section v-show="activeSection === 'models'" class="appium-config-section" aria-labelledby="appium-models-title">
37
+ <header class="appium-section-heading">
38
+ <div><h2 id="appium-models-title">模型服务</h2><p>不同任务使用独立模型,配置修改需测试通过后保存。</p></div>
28
39
  </header>
29
40
  <div class="appium-model-grid">
30
41
  <AppiumModelSettings v-model="configForm.appium.model" title="AI 识别模型" badge="视觉"
@@ -37,8 +48,8 @@ defineEmits<{
37
48
  </div>
38
49
  </section>
39
50
 
40
- <section class="appium-config-section" aria-labelledby="appium-recognition-title">
41
- <header class="appium-section-heading"><div><h2 id="appium-recognition-title">AI 识别设置</h2><p>控制持续观察的截图筛选,并管理录制节点可选的常用提示词。</p></div></header>
51
+ <section v-show="activeSection === 'models'" class="appium-config-section" aria-labelledby="appium-recognition-title">
52
+ <header class="appium-section-heading"><div><h2 id="appium-recognition-title">AI 应用设置</h2><p>配置持续观察的截图筛选、常用提示词,以及回放报告总结。</p></div></header>
42
53
  <div class="appium-settings-grid">
43
54
  <el-card shadow="never" class="config-module-card config-appium-card">
44
55
  <template #header><div class="panel-header"><span>持续观察截图去重</span></div></template>
@@ -49,10 +60,11 @@ defineEmits<{
49
60
  <AiPromptPresetsSettings v-model="configForm.appium.aiPromptPresets" />
50
61
  </el-card>
51
62
  </div>
63
+ <ReplayReportSummarySettings v-if="configForm.appium.reportSummary" :config="configForm.appium.reportSummary" :testing-model-key="testingModelKey" />
52
64
  </section>
53
65
 
54
- <section class="appium-config-section" aria-labelledby="appium-replay-title">
55
- <header class="appium-section-heading"><div><h2 id="appium-replay-title">回放与报告</h2><p>配置回放证据、基础报告和 AI 总结。</p></div></header>
66
+ <section v-show="activeSection === 'basic'" class="appium-config-section" aria-labelledby="appium-replay-title">
67
+ <header class="appium-section-heading"><div><h2 id="appium-replay-title">回放与报告</h2><p>配置节点截图和 HTML 报告。</p></div></header>
56
68
  <el-card shadow="never" class="config-module-card config-appium-card">
57
69
  <template #header>
58
70
  <div class="panel-header">
@@ -64,12 +76,19 @@ defineEmits<{
64
76
  </template>
65
77
  <el-alert title="开启后会在节点执行前后截图并生成 HTML 报告。截图会增加回放耗时,实际操作间隔可能超过设置的延时时间。" type="info" :closable="false" show-icon />
66
78
  </el-card>
67
- <ReplayReportSummarySettings v-if="configForm.appium.reportSummary" :config="configForm.appium.reportSummary" :testing-model-key="testingModelKey" />
68
79
  </section>
69
80
 
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>调整流程画布颜色、连接线颜色和曲直样式。</p></div></header>
72
- <FlowAppearanceSettings v-model="configForm.appium.flowBackgroundColor" v-model:line-color="configForm.appium.flowLineColor" v-model:line-style="configForm.appium.flowLineStyle" />
81
+ <section v-show="activeSection === 'basic'" class="appium-config-section" aria-labelledby="appium-editor-title">
82
+ <header class="appium-section-heading"><div><h2 id="appium-editor-title">流程编辑器</h2><p>选择流程主题,调整画布、节点和连接线颜色,以及横纵布局。</p></div></header>
83
+ <FlowAppearanceSettings
84
+ v-model="configForm.appium.flowBackgroundColor"
85
+ v-model:node-color="configForm.appium.flowNodeColor"
86
+ v-model:node-border-color="configForm.appium.flowNodeBorderColor"
87
+ v-model:line-color="configForm.appium.flowLineColor"
88
+ v-model:line-style="configForm.appium.flowLineStyle"
89
+ v-model:layout-direction="configForm.appium.flowLayoutDirection"
90
+ @apply-theme="Object.assign(configForm.appium, $event.colors)"
91
+ />
73
92
  </section>
74
93
  </div>
75
94
  </template>
@@ -77,6 +96,8 @@ defineEmits<{
77
96
  <style scoped>
78
97
  .config-save-status { font-size: 12px; font-weight: 400; color: var(--el-text-color-secondary); }
79
98
  .appium-config-stack { display: grid; gap: 28px; }
99
+ .appium-config-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
100
+ .appium-config-save-state { display: flex; align-items: center; gap: 8px; }
80
101
  .appium-config-section { display: grid; gap: 14px; min-width: 0; }
81
102
  .appium-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 4px; }
82
103
  .appium-section-heading h2 { margin: 0; color: var(--el-text-color-primary); font-size: 16px; line-height: 1.4; }
@@ -2,76 +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, normalizeFlowLineStyle, type FlowLineStyle,
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<{ modelValue?: string; lineColor?: string; lineStyle?: FlowLineStyle }>();
10
- const emit = defineEmits<{ 'update:modelValue': [color: string]; 'update:lineColor': [color: string]; 'update:lineStyle': [style: FlowLineStyle] }>();
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
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: '选择画布背景色', resetLabel: '恢复默认颜色', presetLabel: '选择颜色' },
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: '恢复默认线条颜色', presetLabel: '选择线条颜色' },
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
- <div class="flow-appearance-columns">
29
- <section v-for="panel in panels" :key="panel.key" class="flow-appearance-section" :aria-label="panel.title">
30
- <h3>{{ panel.title }}</h3>
31
- <el-form label-position="top">
32
- <el-form-item v-if="panel.key === 'line'" label="连接线条样式">
33
- <el-radio-group :model-value="normalizeFlowLineStyle(lineStyle)" aria-label="连接线条样式"
34
- @update:model-value="emit('update:lineStyle', normalizeFlowLineStyle($event))">
35
- <el-radio-button value="straight">直线</el-radio-button>
36
- <el-radio-button value="curved">曲线</el-radio-button>
37
- </el-radio-group>
38
- </el-form-item>
39
- <el-form-item label="预选颜色">
40
- <div class="flow-color-presets">
41
- <button v-for="preset in panel.presets" :key="preset" type="button"
42
- :style="{ backgroundColor: preset }" :aria-label="`${panel.presetLabel} ${preset}`" :title="preset"
43
- :aria-pressed="panel.normalize(panel.color) === preset && !panel.error"
44
- @click="update(panel.key, preset)" />
45
- </div>
46
- </el-form-item>
47
- <el-form-item label="自定义颜色" :error="panel.error">
48
- <div class="flow-color-input">
49
- <el-color-picker :model-value="panel.normalize(panel.color)" color-format="hex" :predefine="panel.presets"
50
- :aria-label="panel.pickerLabel" @update:model-value="update(panel.key, $event || panel.fallback)" />
51
- <el-input :model-value="panel.color" :aria-label="panel.inputLabel" :placeholder="panel.fallback"
52
- @update:model-value="update(panel.key, String($event))" />
53
- <el-button :icon="RefreshLeft" :title="panel.resetLabel" :aria-label="panel.resetLabel" @click="update(panel.key, panel.fallback)" />
54
- </div>
55
- </el-form-item>
56
- </el-form>
57
- </section>
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>
58
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>
59
109
  </el-card>
60
110
  </template>
61
111
 
62
112
  <style scoped>
63
- .flow-appearance-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
64
- .flow-appearance-section { min-width: 0; }
65
- .flow-appearance-section + .flow-appearance-section { padding-left: 32px; border-left: 1px solid var(--ui-border); }
66
- .flow-appearance-section h3 { margin: 0 0 20px; font-size: 15px; font-weight: 600; color: var(--el-text-color-primary); }
67
- .flow-color-presets, .flow-color-input { display: flex; align-items: center; gap: 10px; }
68
- .flow-color-presets { flex-wrap: wrap; }
69
- .flow-color-presets button { width: 32px; height: 32px; border: 1px solid var(--el-border-color-darker); border-radius: 4px; cursor: pointer; }
70
- .flow-color-presets button[aria-pressed="true"] { outline: 2px solid var(--el-color-primary); outline-offset: 2px; }
71
- .flow-color-input { width: 100%; }
72
- .flow-color-input .el-input { flex: 1; min-width: 0; }
73
- @media (max-width: 800px) {
74
- .flow-appearance-columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
75
- .flow-appearance-section + .flow-appearance-section { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--ui-border); }
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; }
76
149
  }
77
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, normalizeFlowLineStyle } 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,8 +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);
79
81
  configForm.appium.flowLineStyle = normalizeFlowLineStyle(payload.appium?.flowLineStyle);
82
+ configForm.appium.flowLayoutDirection = normalizeFlowLayoutDirection(payload.appium?.flowLayoutDirection);
80
83
  appiumAutoSave.initialize();
81
84
  ready.value = true;
82
85
  aiRecognitionModelConfigured.value = isAiRecognitionModelConfigured(configForm.appium.model);
package/src/style.css CHANGED
@@ -2668,7 +2668,7 @@ select {
2668
2668
  width: 100%;
2669
2669
  height: 100%;
2670
2670
  background:
2671
- radial-gradient(circle at 1px 1px, #cbd5e1 1px, transparent 0) 0 0 / 22px 22px,
2671
+ radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--flow-background) 75%, var(--ui-text-muted)) 1px, transparent 0) 0 0 / 22px 22px,
2672
2672
  var(--flow-background, var(--ui-bg-soft));
2673
2673
  }
2674
2674
 
@@ -2703,7 +2703,7 @@ select {
2703
2703
  .appium-vue-flow .vue-flow__edge-path,
2704
2704
  .appium-vue-flow .vue-flow__connection-path {
2705
2705
  stroke: var(--appium-flow-line-color, #94a3b8);
2706
- stroke-width: 2.5;
2706
+ stroke-width: 2.25;
2707
2707
  stroke-linecap: round;
2708
2708
  stroke-linejoin: round;
2709
2709
  fill: none;
@@ -2752,12 +2752,15 @@ select {
2752
2752
  pointer-events: none;
2753
2753
  }
2754
2754
 
2755
- .appium-flow-handle--top {
2756
- top: 0;
2757
- }
2758
-
2759
- .appium-flow-handle--bottom {
2760
- bottom: 0;
2755
+ .appium-flow-graph-node--step .appium-flow-handle {
2756
+ width: 7px;
2757
+ height: 7px;
2758
+ min-width: 7px;
2759
+ min-height: 7px;
2760
+ border: 1px solid var(--ui-surface);
2761
+ border-radius: 50%;
2762
+ background: var(--appium-flow-line-color, #94a3b8);
2763
+ opacity: 1;
2761
2764
  }
2762
2765
 
2763
2766
  /* Invisible split handles share one point; Vue Flow's 5px minimum creates a gap. */
@@ -2768,6 +2771,8 @@ select {
2768
2771
  min-height: 0;
2769
2772
  top: 50%;
2770
2773
  bottom: auto;
2774
+ left: 50%;
2775
+ right: auto;
2771
2776
  transform: translate(-50%, -50%);
2772
2777
  }
2773
2778
 
@@ -2778,9 +2783,9 @@ select {
2778
2783
  width: 180px;
2779
2784
  height: 62px;
2780
2785
  padding: 10px 14px;
2781
- border: 1px solid #e6edf5;
2786
+ border: 1px solid var(--ui-border);
2782
2787
  border-radius: 8px;
2783
- background: #fff;
2788
+ background: var(--ui-surface);
2784
2789
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
2785
2790
  }
2786
2791
 
@@ -2803,14 +2808,14 @@ select {
2803
2808
  }
2804
2809
 
2805
2810
  .appium-flow-start-card strong {
2806
- color: #1f2937;
2811
+ color: var(--ui-text);
2807
2812
  font-size: 14px;
2808
2813
  line-height: 1.2;
2809
2814
  }
2810
2815
 
2811
2816
  .appium-flow-start-card small {
2812
2817
  margin-top: 4px;
2813
- color: #64748b;
2818
+ color: var(--ui-text-muted);
2814
2819
  font-size: 12px;
2815
2820
  }
2816
2821
 
@@ -2885,9 +2890,9 @@ select {
2885
2890
  width: 340px;
2886
2891
  min-height: 78px;
2887
2892
  padding: 10px 14px;
2888
- border: 1px solid #dfe8f3;
2893
+ border: 1px solid var(--ui-border);
2889
2894
  border-radius: 8px;
2890
- background: #fff;
2895
+ background: var(--ui-surface);
2891
2896
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
2892
2897
  color: inherit;
2893
2898
  text-align: left;
@@ -2909,18 +2914,20 @@ select {
2909
2914
  }
2910
2915
 
2911
2916
  .appium-flow-step-shell--condition .appium-flow-step-card {
2912
- border-color: #f6a23a;
2913
- background: #fffbf4;
2917
+ border-color: var(--ui-border);
2918
+ border-left: 3px solid #f6a23a;
2919
+ background: color-mix(in srgb, var(--ui-surface) 94%, #f6a23a);
2914
2920
  }
2915
2921
 
2916
2922
  .appium-flow-step-shell--assertion .appium-flow-step-card {
2917
- border-color: #95d475;
2918
- background: #f7fff5;
2923
+ border-color: var(--ui-border);
2924
+ border-left: 3px solid #95d475;
2925
+ background: color-mix(in srgb, var(--ui-surface) 94%, #95d475);
2919
2926
  }
2920
2927
 
2921
2928
  .appium-flow-step-shell--selected .appium-flow-step-card {
2922
2929
  border-color: #2f7df6;
2923
- background: #eaf2ff;
2930
+ background: color-mix(in srgb, var(--ui-surface) 90%, var(--ui-primary));
2924
2931
  box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.16);
2925
2932
  }
2926
2933
 
@@ -2944,21 +2951,21 @@ select {
2944
2951
  }
2945
2952
 
2946
2953
  .appium-flow-step-card__content strong {
2947
- color: #1f2937;
2954
+ color: var(--ui-text);
2948
2955
  font-size: 14px;
2949
2956
  line-height: 1.35;
2950
2957
  }
2951
2958
 
2952
2959
  .appium-flow-step-card__content small {
2953
2960
  margin-top: 3px;
2954
- color: #64748b;
2961
+ color: var(--ui-text-muted);
2955
2962
  font-size: 12px;
2956
2963
  line-height: 1.35;
2957
2964
  }
2958
2965
 
2959
2966
  .appium-flow-step-card__content em {
2960
2967
  margin-top: 3px;
2961
- color: #1f2937;
2968
+ color: var(--ui-text);
2962
2969
  font-style: normal;
2963
2970
  font-size: 12px;
2964
2971
  line-height: 1.35;
@@ -2979,16 +2986,16 @@ select {
2979
2986
  width: 22px;
2980
2987
  height: 22px;
2981
2988
  margin: 0;
2982
- color: #64748b;
2989
+ color: var(--ui-text-muted);
2983
2990
  }
2984
2991
 
2985
2992
  .appium-flow-step-editor {
2986
2993
  grid-area: 2 / 1;
2987
2994
  width: 340px;
2988
2995
  margin-top: 8px;
2989
- border-color: #dfe8f3;
2996
+ border-color: var(--ui-border);
2990
2997
  border-radius: 8px;
2991
- background: #fff;
2998
+ background: var(--ui-surface);
2992
2999
  }
2993
3000
 
2994
3001
  .appium-action-dropdown .el-dropdown-menu {
@@ -4167,3 +4174,10 @@ button:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: -2p
4167
4174
  .el-input .el-input__wrapper, .el-select .el-select__wrapper,
4168
4175
  .el-textarea .el-textarea__inner { transition: none; }
4169
4176
  }
4177
+
4178
+ /* Dark flow palettes are scoped to the canvas; the surrounding app keeps its theme. */
4179
+ .appium-flow-canvas--dark-nodes {
4180
+ --ui-shadow-card: 0 2px 10px rgb(0 0 0 / 20%);
4181
+ --ui-shadow-control: 0 2px 5px rgb(0 0 0 / 20%);
4182
+ --ui-shadow-inset: inset 0 1px 3px rgb(0 0 0 / 15%);
4183
+ }
package/src/types.ts CHANGED
@@ -21,7 +21,7 @@ export type GeneratorForm = {
21
21
  };
22
22
 
23
23
  export type ConfigForm = {
24
- appium: { reportSummary?: ReportSummaryConfig; model: AiRecognitionModel; promptOptimizer?: { model: AiRecognitionModel }; aiPromptPresets?: AiPromptPreset[]; aiDeduplication?: AiDeduplicationConfig; flowBackgroundColor?: string; flowLineColor?: string; flowLineStyle?: 'straight' | 'curved'; screenshotReport?: boolean };
24
+ appium: { reportSummary?: ReportSummaryConfig; model: AiRecognitionModel; promptOptimizer?: { model: AiRecognitionModel }; aiPromptPresets?: AiPromptPreset[]; aiDeduplication?: AiDeduplicationConfig; flowBackgroundColor?: string; flowNodeColor?: string; flowNodeBorderColor?: string; flowLineColor?: string; flowLineStyle?: 'straight' | 'curved'; flowLayoutDirection?: 'vertical' | 'horizontal'; screenshotReport?: boolean };
25
25
  runtime: {
26
26
  androidSdkPath: string;
27
27
  reportOutputPath: string;