feat: direct-execute review and playbook quick actions
This commit is contained in:
@@ -5693,7 +5693,7 @@ function renderDashboardScreen() {
|
||||
return screenShell(
|
||||
"项目总台",
|
||||
"先做最能推进当前项目的一步,再按需看概览。",
|
||||
`${button("新建项目", "create-project")} ${button("导入主页", "open-import-homepage")} ${button("创建 Agent", "open-create-assistant", "primary")}`,
|
||||
`${button("新建项目", "create-project")} ${button("导入主页", "open-import-homepage")} ${button("创建 Agent", "direct-create-assistant", "primary")}`,
|
||||
dashboardHomeRenderer?.renderDashboardHome
|
||||
? `<div id="dashboard-workspace-anchor">${dashboardHomeRenderer.renderDashboardHome(homeModel, { escapeHtml })}</div>`
|
||||
: renderEmptyState("首页模块未加载", "请刷新页面后重试。")
|
||||
@@ -6698,7 +6698,7 @@ function renderPlaybookScreen() {
|
||||
return screenShell(
|
||||
"Agent",
|
||||
"这里接真实 Agent 列表,当前已经支持切换和编辑 Agent。",
|
||||
`${button("配置 OneLiner", "open-oneliner-profile")} ${button("看配置历史", "open-oneliner-profile-history", "secondary")} ${button("交给主 Agent", "handoff-to-main-agent", "secondary", { attrs: playbookHandoffAttrs })} ${button("设主模型", "open-preferred-model")} ${button("新建 Agent", "open-create-assistant")} ${button("去生产", "goto-production", "primary")}`,
|
||||
`${button("配置 OneLiner", "open-oneliner-profile")} ${button("看配置历史", "open-oneliner-profile-history", "secondary")} ${button("交给主 Agent", "handoff-to-main-agent", "secondary", { attrs: playbookHandoffAttrs })} ${button("设主模型", "open-preferred-model")} ${button("新建 Agent", "direct-create-assistant")} ${button("去生产", "goto-production", "primary")}`,
|
||||
`
|
||||
${renderMainAgentLandingNotice("playbook")}
|
||||
<div class="hero-card mobile-secondary-card">
|
||||
@@ -6736,7 +6736,7 @@ function renderPlaybookScreen() {
|
||||
? `${actionTag("看平台 Agent", "select-page-tab", `data-page-tab-key="playbookDetailTab" data-page-tab-value="platform_agents"`)} ${actionTag("交给主 Agent", "handoff-to-main-agent", playbookHandoffAttrs)}`
|
||||
: activeTab === "models"
|
||||
? `${actionTag("设主模型", "open-preferred-model")} ${actionTag("回工作区", "select-page-tab", `data-page-tab-key="playbookDetailTab" data-page-tab-value="workspace"`)}`
|
||||
: `${actionTag("配置 OneLiner", "open-oneliner-profile")} ${actionTag("看配置历史", "open-oneliner-profile-history")} ${actionTag(currentAssistant ? "去生产" : "新建 Agent", currentAssistant ? "goto-production" : "open-create-assistant")} ${actionTag("交给主 Agent", "handoff-to-main-agent", playbookHandoffAttrs)}`
|
||||
: `${actionTag("配置 OneLiner", "open-oneliner-profile")} ${actionTag("看配置历史", "open-oneliner-profile-history")} ${actionTag(currentAssistant ? "去生产" : "新建 Agent", currentAssistant ? "goto-production" : "direct-create-assistant")} ${actionTag("交给主 Agent", "handoff-to-main-agent", playbookHandoffAttrs)}`
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -7296,7 +7296,7 @@ function renderReviewScreen() {
|
||||
return screenShell(
|
||||
"发布与复盘",
|
||||
"先看已保存复盘,再把完成任务转成结构化复盘。",
|
||||
`${button("写复盘", "open-create-review")} ${button("刷新", "refresh-data")} ${button("交给主 Agent", "handoff-to-main-agent", "secondary", { attrs: reviewHandoffAttrs })} ${button("去生产", "goto-production", "primary")}`,
|
||||
`${button("写复盘", "direct-review-draft")} ${button("刷新", "refresh-data")} ${button("交给主 Agent", "handoff-to-main-agent", "secondary", { attrs: reviewHandoffAttrs })} ${button("去生产", "goto-production", "primary")}`,
|
||||
`
|
||||
${renderMainAgentLandingNotice("review")}
|
||||
<div class="hero-card mobile-secondary-card">
|
||||
@@ -7313,7 +7313,7 @@ function renderReviewScreen() {
|
||||
<h4>${escapeHtml(reviewTaskTitle)}</h4>
|
||||
<p>${escapeHtml(reviewTaskSummary)}</p>
|
||||
<div class="task-meta">
|
||||
${actionTag(completed.length ? "写复盘" : reviews.length ? "看复盘" : "去生产", completed.length ? "open-review-from-job" : reviews.length ? "goto-review" : "goto-production", completed[0]?.id ? `data-job-id="${escapeHtml(completed[0].id)}"` : "")}
|
||||
${actionTag(completed.length ? "写复盘" : reviews.length ? "看复盘" : "去生产", completed.length ? "direct-review-draft" : reviews.length ? "goto-review" : "goto-production", completed[0]?.id ? `data-job-id="${escapeHtml(completed[0].id)}"` : "")}
|
||||
${actionTag("交给主 Agent", "handoff-to-main-agent", reviewHandoffAttrs)}
|
||||
<span class="tag blue">${escapeHtml(`已保存 ${formatNumber(reviews.length)} 条`)}</span>
|
||||
<span class="tag">${escapeHtml(`已发布 ${formatNumber(publishedReviewCount)} 条`)}</span>
|
||||
@@ -7333,7 +7333,7 @@ function renderReviewScreen() {
|
||||
: "当前还没有可用复盘,先回到生产中心跑出一条完成链路。"
|
||||
)}</p>
|
||||
<div class="task-meta">
|
||||
${actionTag(completed.length ? "写复盘" : "去生产", completed.length ? "open-review-from-job" : "goto-production", completed[0]?.id ? `data-job-id="${escapeHtml(completed[0].id)}"` : "")}
|
||||
${actionTag(completed.length ? "写复盘" : "去生产", completed.length ? "direct-review-draft" : "goto-production", completed[0]?.id ? `data-job-id="${escapeHtml(completed[0].id)}"` : "")}
|
||||
${actionTag("刷新", "refresh-data")}
|
||||
${actionTag("交给主 Agent", "handoff-to-main-agent", reviewHandoffAttrs)}
|
||||
</div>
|
||||
@@ -7375,7 +7375,7 @@ function renderReviewScreen() {
|
||||
<div class="task-meta">
|
||||
<span class="tag green">已完成</span>
|
||||
<span class="tag">${escapeHtml(job.line_type || "analysis")}</span>
|
||||
${actionTag("写复盘", "open-review-from-job", `data-job-id="${escapeHtml(job.id)}"`)}
|
||||
${actionTag("写复盘", "direct-review-draft", `data-job-id="${escapeHtml(job.id)}"`)}
|
||||
${canDeriveAiVideo(job) ? renderPipelineJobTag("aiVideo", job, "做 AI 视频") : ""}
|
||||
${canDeriveRealCut(job) ? renderPipelineJobTag("realCut", job, "做实拍剪辑") : ""}
|
||||
${actionTag("看详情", "open-job-detail", `data-job-id="${escapeHtml(job.id)}"`)}
|
||||
@@ -8968,7 +8968,7 @@ function renderLastJobDetailCard() {
|
||||
<div class="task-meta">
|
||||
<span class="tag">${escapeHtml(detail.job.line_type || "-")}</span>
|
||||
${detail.job.status === "failed" ? `<span class="tag ${recovery.recoverable ? "green" : "orange"}">${escapeHtml(recovery.reason)}</span>` : ""}
|
||||
${detail.job.status === "completed" ? actionTag("写复盘", "open-review-from-job", `data-job-id="${escapeHtml(detail.job.id)}"`) : ""}
|
||||
${detail.job.status === "completed" ? actionTag("写复盘", "direct-review-draft", `data-job-id="${escapeHtml(detail.job.id)}"`) : ""}
|
||||
${detail.job.status === "failed" ? actionTag(
|
||||
recovery.actionLabel,
|
||||
recovery.recoverable ? "recover-job" : recovery.actionKey,
|
||||
@@ -12361,7 +12361,8 @@ document.addEventListener("click", async (event) => {
|
||||
if (name === "direct-create-ai-video") {
|
||||
await runDirectWorkbenchAction("create-ai-video", {
|
||||
busyLabel: "正在创建 AI 视频任务...",
|
||||
errorTitle: "创建 AI 视频任务失败"
|
||||
errorTitle: "创建 AI 视频任务失败",
|
||||
payload: action.dataset.jobId ? { source_job_id: action.dataset.jobId } : {}
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -12372,7 +12373,8 @@ document.addEventListener("click", async (event) => {
|
||||
if (name === "direct-create-real-cut") {
|
||||
await runDirectWorkbenchAction("create-real-cut", {
|
||||
busyLabel: "正在创建实拍剪辑任务...",
|
||||
errorTitle: "创建实拍剪辑任务失败"
|
||||
errorTitle: "创建实拍剪辑任务失败",
|
||||
payload: action.dataset.jobId ? { source_job_id: action.dataset.jobId } : {}
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -12383,7 +12385,8 @@ document.addEventListener("click", async (event) => {
|
||||
if (name === "direct-review-draft") {
|
||||
await runDirectWorkbenchAction("review-draft", {
|
||||
busyLabel: "正在生成复盘草稿...",
|
||||
errorTitle: "生成复盘草稿失败"
|
||||
errorTitle: "生成复盘草稿失败",
|
||||
payload: action.dataset.jobId ? { source_job_id: action.dataset.jobId } : {}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -998,6 +998,14 @@ test("main agent landing quick actions prefer direct execute flows where executo
|
||||
assert.match(APP, /async function runDirectWorkbenchAction\(executorKey, options = \{\}\)/);
|
||||
});
|
||||
|
||||
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()");
|
||||
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 \} : \{\}/);
|
||||
});
|
||||
|
||||
test("main agent landing notices expose a compact mobile follow-up strip", () => {
|
||||
const landing = extractBetween(APP, "function renderMainAgentLandingNotice(screenKey)", "function renderEmptyState(title, description)");
|
||||
assert.match(landing, /mobile-only compact-summary-row/);
|
||||
|
||||
Reference in New Issue
Block a user