fix: show canvas enhance processing placeholder

This commit is contained in:
134 2026-07-14 16:15:49 +08:00
parent 1fd9be49c7
commit abc6a7266a
2 changed files with 24 additions and 1 deletions

View File

@ -6607,7 +6607,9 @@ export function ImageNode({
return;
}
setIsCreatingDetachedResultNode(true);
// The server creates the result node after completion. Keep the source-node
// processing overlay visible while that detached result is pending.
setIsCreatingDetachedResultNode(false);
setIsProcessing(true);
try {
const command = createCanvasCapabilityClientCommand({

View File

@ -1,4 +1,6 @@
import { expect, test } from "@playwright/test";
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { resolveCanvasRuntimeEndpoint } from "@/lib/canvas/capabilities/internal-endpoint";
import {
@ -7,6 +9,25 @@ import {
} from "@/lib/canvas/capabilities/task-queue";
test.describe("canvas runtime internal endpoints", () => {
test("keeps the image processing placeholder visible for shared toolbar actions", () => {
const source = readFileSync(
resolve(process.cwd(), "components/canvas/nodes/ImageNode.tsx"),
"utf8"
);
const start = source.indexOf("const executeSharedToolbarCapability = async");
const end = source.indexOf("// 处理图片编辑操作", start);
expect(start).toBeGreaterThanOrEqual(0);
expect(end).toBeGreaterThan(start);
const sharedCapabilityFlow = source.slice(start, end);
expect(sharedCapabilityFlow).toContain(
"setIsCreatingDetachedResultNode(false);"
);
expect(sharedCapabilityFlow).not.toContain(
"setIsCreatingDetachedResultNode(true);"
);
});
test("uses the local HTTP listener for server-internal capability calls", () => {
expect(
resolveCanvasRuntimeEndpoint(