feat: direct-execute copy entry when context exists
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user