fix(canvas): label the generating skeleton with status, not the planned title

Show a localized "Generating" label on the artboard generation skeleton
while keeping the planned title as the aria-label, so in-progress nodes read
as a status instead of prematurely displaying their eventual name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-17 09:07:37 +08:00
parent f5a1ae7961
commit 9da13d2814
4 changed files with 20 additions and 4 deletions
+14
View File
@@ -0,0 +1,14 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
test("shows generation status instead of the planned image title", async () => {
const [localeSource, componentSource] = await Promise.all([
readFile(new URL("../src/i18n/locales/zh-CN.json", import.meta.url), "utf8"),
readFile(new URL("../src/ui/components/ArtboardPreview/index.tsx", import.meta.url), "utf8")
]);
const locale = JSON.parse(localeSource);
assert.equal(locale.generatingImage, "正在生成中");
assert.match(componentSource, /GeneratingArtboardSkeleton ariaLabel=\{node\.title\} label=\{t\("generatingImage"\)\}/);
});