feat: direct-execute review 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:32:54 +08:00
parent 1ea00ff5e4
commit 3c50be4f59
3 changed files with 23 additions and 0 deletions

View File

@@ -479,3 +479,4 @@
- SQLite 连接现在保持 `WAL` 优先,但在临时盘或受限文件系统无法启用 `WAL` 时会自动回退到 `DELETE`,避免测试环境和受限部署因为 `disk I/O error` 直接起不来。
- `generate-copy` 这条执行链现在会直接推荐回到“最近生成”结果区而不是再打开旧文案表单LAN smoke 也同步把 `track-account / import-video-link / import-text / generate-copy / create-assistant` 纳入 action-registry 护栏。
- 全局 `AI 视频 / 实拍剪辑` 主按钮也已经切到 direct-execute会直接承接最近可派生任务不再优先打开旧表单。
- 全局 `写复盘` 旧入口现在也会优先围绕最近已完成任务 direct-execute只有当前项目还没有可承接任务时才回退到手工复盘表单。

View File

@@ -3043,6 +3043,15 @@ function getCompletedJobOptions() {
}));
}
function getLatestCompletedProjectJob() {
const projectId = appState.selectedProjectId || "";
return safeArray(appState.dashboard?.recent_jobs).find((item) => {
if (item.status !== "completed") return false;
if (!projectId) return true;
return String(item.project_id || "") === projectId;
}) || null;
}
function getProjectStats(projectId) {
const dashboard = appState.dashboard || {};
const knowledgeBases = safeArray(dashboard.knowledge_bases).filter((item) => item.project_id === projectId);
@@ -12381,6 +12390,15 @@ document.addEventListener("click", async (event) => {
return;
}
if (name === "open-create-review") {
const fallbackJob = getLatestCompletedProjectJob();
if (fallbackJob?.id) {
await runDirectWorkbenchAction("review-draft", {
busyLabel: "正在生成复盘草稿...",
errorTitle: "生成复盘草稿失败",
payload: { source_job_id: fallbackJob.id }
});
return;
}
openReviewAction();
return;
}

View File

@@ -1027,9 +1027,13 @@ test("main agent landing quick actions prefer direct execute flows where executo
test("playbook and review high-frequency actions now reuse direct execute handlers", () => {
const playbook = extractBetween(APP, "function renderPlaybookScreen()", "function renderProductionScreen()");
const review = extractBetween(APP, "function renderReviewScreen()", "function renderStrategyScreen()");
const clickActions = extractBetween(APP, "document.addEventListener(\"click\", async (event) => {", "document.addEventListener(\"submit\", async (event) => {");
assert.match(playbook, /direct-create-assistant/);
assert.match(review, /direct-review-draft/);
assert.match(APP, /payload: action\.dataset\.jobId \? \{ source_job_id: action\.dataset\.jobId \} : \{\}/);
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\(\)/);
});
test("main agent landing notices expose a compact mobile follow-up strip", () => {