fix: simplify folder icon handling
This commit is contained in:
parent
e27bc62ca7
commit
760fae4920
File diff suppressed because it is too large
Load Diff
@ -31,4 +31,5 @@ export interface MonitorDriver {
|
||||
previewSceneProgress(name: string): void;
|
||||
playScene(name: string, payload: Record<string, any>, runtime: MonitorSceneRuntime): Promise<void>;
|
||||
destroy(): void;
|
||||
preparePendingCreation?(path?: string | null): void;
|
||||
}
|
||||
|
||||
@ -149,7 +149,12 @@ export const useMonitorStore = defineStore('monitor', {
|
||||
actions: {
|
||||
registerDriver(driver: MonitorDriver) {
|
||||
this.driver = driver;
|
||||
this.driver.resetScene({ desktopRoots: this.lastTreeSnapshot, preserveBubble: this.bubbleActive });
|
||||
this.driver.resetScene({
|
||||
desktopRoots: this.lastTreeSnapshot,
|
||||
preserveBubble: this.bubbleActive,
|
||||
preservePointer: false, // 初次挂载重置指针
|
||||
preserveWindows: false
|
||||
});
|
||||
if (this.speechBuffer) {
|
||||
this.driver.showSpeechBubble(this.speechBuffer, { variant: 'info', duration: 0 });
|
||||
this.bubbleActive = true;
|
||||
@ -191,7 +196,7 @@ export const useMonitorStore = defineStore('monitor', {
|
||||
preserveAwaitingTools?: boolean;
|
||||
}) {
|
||||
const preserveBubble = !!options?.preserveBubble;
|
||||
const preservePointer = !!options?.preservePointer;
|
||||
const preservePointer = options?.preservePointer !== false;
|
||||
const preserveWindows = !!options?.preserveWindows;
|
||||
const preserveQueue = !!options?.preserveQueue;
|
||||
const preservePendingResults = !!options?.preservePendingResults;
|
||||
@ -362,6 +367,20 @@ export const useMonitorStore = defineStore('monitor', {
|
||||
this.ensurePendingResult(id);
|
||||
this.queue.push({ id, script, payload: { ...payload, executionId: id } });
|
||||
this.awaitingTools[id] = payload.name;
|
||||
|
||||
// 提前为创建类工具标记“待创建”路径,避免动画开始前图标闪现
|
||||
if (this.driver && typeof this.driver.preparePendingCreation === 'function') {
|
||||
if (payload.name === 'create_folder' || payload.name === 'create_file') {
|
||||
const pendingPath =
|
||||
payload?.arguments?.path ||
|
||||
payload?.arguments?.target_path ||
|
||||
payload?.arguments?.targetPath ||
|
||||
payload?.argumentSnapshot?.path ||
|
||||
payload?.argumentSnapshot?.target_path;
|
||||
this.driver.preparePendingCreation(pendingPath);
|
||||
}
|
||||
}
|
||||
|
||||
monitorLifecycleLog('enqueue', {
|
||||
id,
|
||||
tool: payload.name,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user