feat: direct-execute review entry when context exists
This commit is contained in:
@@ -479,3 +479,4 @@
|
|||||||
- SQLite 连接现在保持 `WAL` 优先,但在临时盘或受限文件系统无法启用 `WAL` 时会自动回退到 `DELETE`,避免测试环境和受限部署因为 `disk I/O error` 直接起不来。
|
- 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 护栏。
|
- `generate-copy` 这条执行链现在会直接推荐回到“最近生成”结果区,而不是再打开旧文案表单;LAN smoke 也同步把 `track-account / import-video-link / import-text / generate-copy / create-assistant` 纳入 action-registry 护栏。
|
||||||
- 全局 `AI 视频 / 实拍剪辑` 主按钮也已经切到 direct-execute,会直接承接最近可派生任务,不再优先打开旧表单。
|
- 全局 `AI 视频 / 实拍剪辑` 主按钮也已经切到 direct-execute,会直接承接最近可派生任务,不再优先打开旧表单。
|
||||||
|
- 全局 `写复盘` 旧入口现在也会优先围绕最近已完成任务 direct-execute;只有当前项目还没有可承接任务时,才回退到手工复盘表单。
|
||||||
|
|||||||
@@ -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) {
|
function getProjectStats(projectId) {
|
||||||
const dashboard = appState.dashboard || {};
|
const dashboard = appState.dashboard || {};
|
||||||
const knowledgeBases = safeArray(dashboard.knowledge_bases).filter((item) => item.project_id === projectId);
|
const knowledgeBases = safeArray(dashboard.knowledge_bases).filter((item) => item.project_id === projectId);
|
||||||
@@ -12381,6 +12390,15 @@ document.addEventListener("click", async (event) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (name === "open-create-review") {
|
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();
|
openReviewAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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", () => {
|
test("playbook and review high-frequency actions now reuse direct execute handlers", () => {
|
||||||
const playbook = extractBetween(APP, "function renderPlaybookScreen()", "function renderProductionScreen()");
|
const playbook = extractBetween(APP, "function renderPlaybookScreen()", "function renderProductionScreen()");
|
||||||
const review = extractBetween(APP, "function renderReviewScreen()", "function renderStrategyScreen()");
|
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(playbook, /direct-create-assistant/);
|
||||||
assert.match(review, /direct-review-draft/);
|
assert.match(review, /direct-review-draft/);
|
||||||
assert.match(APP, /payload: action\.dataset\.jobId \? \{ source_job_id: action\.dataset\.jobId \} : \{\}/);
|
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", () => {
|
test("main agent landing notices expose a compact mobile follow-up strip", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user