feat: enhance variable handling and UI components with business labels and descriptions

This commit is contained in:
mlogclub
2026-06-29 18:37:31 +08:00
parent 295c7b4bea
commit 87760d5e89
8 changed files with 166 additions and 85 deletions
@@ -226,6 +226,26 @@ describe("getAvailableVariables", () => {
})
})
describe("workflow variable display helpers", () => {
it("builds business-first variable options with technical details", async () => {
const { buildVariableOption } = await loadModule()
assert.deepEqual(plain(buildVariableOption({
nodeId: "start_1",
nodeName: "开始",
field: "userMessage",
label: "用户消息",
type: "string",
description: "客户本轮发送的消息内容",
})), {
value: "start_1.userMessage",
label: "开始 / 用户消息",
subtitle: "start_1.userMessage · string",
description: "客户本轮发送的消息内容",
})
})
})
describe("workflow definition mutations", () => {
it("updates node data without changing unrelated nodes", async () => {
const { updateWorkflowNodeData } = await loadModule()