Skip to content

Commit e2bc1af

Browse files
committed
fix(visualizer): update Insight references to Service
- Updated ExecutionTaskInsightLocate to ExecutionTaskServiceLocate - Changed task.type check from 'Insight' to 'Service' - Renamed insightTask variable to serviceTask for consistency
1 parent 01fe97e commit e2bc1af

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/visualizer/src/utils/replay-scripts.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { paramStr, typeStr } from '@midscene/core/agent';
55
import type {
66
ExecutionDump,
77
ExecutionTask,
8-
ExecutionTaskInsightLocate,
8+
ExecutionTaskServiceLocate,
99
ExecutionTaskPlanning,
1010
GroupedActionDump,
1111
LocateResultElement,
@@ -321,9 +321,9 @@ export const generateAnimationScripts = (
321321
imageHeight: task.uiContext?.size?.height || imageHeight,
322322
});
323323
}
324-
} else if (task.type === 'Insight' && task.subType === 'Locate') {
325-
const insightTask = task as ExecutionTaskInsightLocate;
326-
const resultElement = insightTask.output?.element;
324+
} else if (task.type === 'Service' && task.subType === 'Locate') {
325+
const serviceTask = task as ExecutionTaskServiceLocate;
326+
const resultElement = serviceTask.output?.element;
327327
const title = typeStr(task);
328328
const subTitle = paramStr(task);
329329
if (resultElement?.rect) {
@@ -333,9 +333,9 @@ export const generateAnimationScripts = (
333333
pointerTop: resultElement.center[1],
334334
};
335335
}
336-
const context = insightTask.uiContext;
336+
const context = serviceTask.uiContext;
337337
if (context?.screenshotBase64) {
338-
const insightDump = insightTask.log;
338+
const insightDump = serviceTask.log;
339339
const insightContentLength = 0;
340340

341341
if (context.screenshotBase64) {
@@ -368,7 +368,7 @@ export const generateAnimationScripts = (
368368
img: context.screenshotBase64,
369369
context: context,
370370
camera: cameraState,
371-
highlightElement: insightTask.output?.element || undefined,
371+
highlightElement: serviceTask.output?.element || undefined,
372372
searchArea: insightDump?.taskInfo?.searchArea,
373373
duration:
374374
insightContentLength > 20 ? locateDuration : locateDuration * 0.5,

0 commit comments

Comments
 (0)