fix(web): 链相位语义色/失败可重试 + 模板填入中文标签/删除可撤销/工具卡文案 + 模板库 PageHeader

This commit is contained in:
Yaojia Wang
2026-06-30 08:56:23 +02:00
parent 6bb3559e25
commit 164e98887e
10 changed files with 235 additions and 74 deletions

View File

@@ -10,6 +10,7 @@ import {
previewRows,
resolveLegacyRoute,
templateFillTarget,
toolKeyOptions,
} from "./toolbox";
const field = (over: Partial<ToolInputFieldView> = {}): ToolInputFieldView => ({
@@ -210,6 +211,22 @@ describe("isLegacyTool", () => {
isLegacyTool(tool({ is_legacy: false, legacy_route: "/x/{id}" })),
).toBe(false);
});
it("maps descriptors to key/title options", () => {
expect(
toolKeyOptions([
tool({ key: "idea", title: "脑洞生成器" }),
tool({ key: "title", title: "书名生成器" }),
]),
).toEqual([
{ key: "idea", title: "脑洞生成器" },
{ key: "title", title: "书名生成器" },
]);
});
it("returns empty array for undefined tools", () => {
expect(toolKeyOptions(undefined)).toEqual([]);
});
});
describe("templateFillTarget", () => {