fix: show canvas enhance processing placeholder
This commit is contained in:
parent
1fd9be49c7
commit
abc6a7266a
@ -6607,7 +6607,9 @@ export function ImageNode({
|
|||||||
return;
|
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);
|
setIsProcessing(true);
|
||||||
try {
|
try {
|
||||||
const command = createCanvasCapabilityClientCommand({
|
const command = createCanvasCapabilityClientCommand({
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import { expect, test } from "@playwright/test";
|
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 { resolveCanvasRuntimeEndpoint } from "@/lib/canvas/capabilities/internal-endpoint";
|
||||||
import {
|
import {
|
||||||
@ -7,6 +9,25 @@ import {
|
|||||||
} from "@/lib/canvas/capabilities/task-queue";
|
} from "@/lib/canvas/capabilities/task-queue";
|
||||||
|
|
||||||
test.describe("canvas runtime internal endpoints", () => {
|
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", () => {
|
test("uses the local HTTP listener for server-internal capability calls", () => {
|
||||||
expect(
|
expect(
|
||||||
resolveCanvasRuntimeEndpoint(
|
resolveCanvasRuntimeEndpoint(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user