feat: direct-execute copy entry when context exists
Some checks failed
StoryForge CI / Baseline checks (push) Has been cancelled
StoryForge CI / Backend tests (push) Has been cancelled
StoryForge CI / Web tests (push) Has been cancelled

This commit is contained in:
kris
2026-04-05 08:36:14 +08:00
parent 3c50be4f59
commit 0061909cdf
3 changed files with 22 additions and 0 deletions

View File

@@ -12331,6 +12331,24 @@ document.addEventListener("click", async (event) => {
return;
}
if (name === "open-generate-copy") {
const fallbackJob = getLatestCompletedProjectJob();
if (fallbackJob?.id) {
const brief = `基于任务「${fallbackJob.title}」的结果,生成一版可发布的短视频文案。参考摘要:${getJobSeedBrief(fallbackJob)}`;
await runDirectWorkbenchAction("generate-copy", {
busyLabel: "正在生成文案...",
errorTitle: "生成文案失败",
followRecommendedAction: false,
payload: {
source_job_id: fallbackJob.id,
brief
},
afterResult: async (result) => {
cacheGeneratedCopyResult(result, { brief });
focusRecentGeneratedCopy();
}
});
return;
}
openGenerateCopyAction();
return;
}

View File

@@ -1034,6 +1034,9 @@ test("playbook and review high-frequency actions now reuse direct execute handle
assert.match(clickActions, /name === "open-create-review"[\s\S]*const fallbackJob = getLatestCompletedProjectJob\(\)/);
assert.match(clickActions, /name === "open-create-review"[\s\S]*runDirectWorkbenchAction\("review-draft"/);
assert.match(clickActions, /name === "open-create-review"[\s\S]*openReviewAction\(\)/);
assert.match(clickActions, /name === "open-generate-copy"[\s\S]*const fallbackJob = getLatestCompletedProjectJob\(\)/);
assert.match(clickActions, /name === "open-generate-copy"[\s\S]*runDirectWorkbenchAction\("generate-copy"/);
assert.match(clickActions, /name === "open-generate-copy"[\s\S]*openGenerateCopyAction\(\)/);
});
test("main agent landing notices expose a compact mobile follow-up strip", () => {