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

@@ -480,3 +480,4 @@
- `generate-copy` 这条执行链现在会直接推荐回到“最近生成”结果区而不是再打开旧文案表单LAN smoke 也同步把 `track-account / import-video-link / import-text / generate-copy / create-assistant` 纳入 action-registry 护栏。
- 全局 `AI 视频 / 实拍剪辑` 主按钮也已经切到 direct-execute会直接承接最近可派生任务不再优先打开旧表单。
- 全局 `写复盘` 旧入口现在也会优先围绕最近已完成任务 direct-execute只有当前项目还没有可承接任务时才回退到手工复盘表单。
- 全局 `生成文案` 旧入口也已经做成相同分流:优先围绕最近完成任务直接生成,只有没有可承接任务时才回退到旧文案表单。

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", () => {