feat: streamline mobile oneliner runtime

This commit is contained in:
kris
2026-03-30 12:02:14 +08:00
parent cb3a4d2755
commit 1d2bbdf201
2 changed files with 30 additions and 0 deletions

View File

@@ -1140,6 +1140,28 @@ function renderOneLinerRunsHtml() {
` : ""} ` : ""}
</div> </div>
<div class="task-item compact oneliner-run-card"> <div class="task-item compact oneliner-run-card">
<div class="mobile-only compact-summary-row">
<span>当前运行</span>
<strong>${escapeHtml(runStatusLabel)}</strong>
<span>${escapeHtml(currentRun.platform_scope === "all_platforms" ? "全平台" : "单平台")}</span>
<strong>${escapeHtml(recommendedAction?.label || "继续这个任务")}</strong>
</div>
<div class="mobile-only mobile-flow-focus-card">
<div class="mobile-flow-focus-head">
<strong>当前运行</strong>
<span class="tag ${statusTone}">${escapeHtml(runStatusLabel)}</span>
</div>
<p>${escapeHtml(currentRun.summary || currentRun.status_summary || "主 Agent 会先给你一张确认卡,再继续执行。")}</p>
<div class="task-meta">
${currentRun.run_status === "needs_confirmation" ? `
<span class="tag clickable-tag" data-action="confirm-oneliner-run" data-run-id="${escapeHtml(currentRun.id)}">确认执行</span>
<span class="tag clickable-tag" data-action="cancel-oneliner-run" data-run-id="${escapeHtml(currentRun.id)}">取消本轮</span>
` : ""}
${canRetryCurrentRun ? `<span class="tag clickable-tag" data-action="retry-oneliner-run" data-run-id="${escapeHtml(currentRun.id)}">重新执行</span>` : ""}
${hasResultPayload ? `<span class="tag clickable-tag" data-action="open-oneliner-run-result" data-run-id="${escapeHtml(currentRun.id)}">查看结果</span>` : ""}
${recommendedAction?.action ? `<span class="tag clickable-tag" data-action="${escapeHtml(recommendedAction.action)}" ${resultLandingAttrs}>${escapeHtml(recommendedAction.label || "继续这个任务")}</span>` : ""}
</div>
</div>
<div class="panel-head"> <div class="panel-head">
<div> <div>
<h4>${escapeHtml(currentRun.title || currentRun.plan?.goal || "主 Agent 任务")}</h4> <h4>${escapeHtml(currentRun.title || currentRun.plan?.goal || "主 Agent 任务")}</h4>

View File

@@ -594,6 +594,14 @@ test("oneliner runtime shows grouped run health summary above the current run ca
assert.match(runtime, /safeArray\(runs\)\.filter\(\(item\) => item\.run_status === "needs_confirmation"\)\.length/); assert.match(runtime, /safeArray\(runs\)\.filter\(\(item\) => item\.run_status === "needs_confirmation"\)\.length/);
}); });
test("oneliner runtime exposes a compact mobile task strip for the current run", () => {
const runtime = extractBetween(APP, "function renderOneLinerRunsHtml()", "function renderOneLinerMessagesHtml()");
assert.match(runtime, /mobile-only compact-summary-row/);
assert.match(runtime, /mobile-only mobile-flow-focus-card/);
assert.match(runtime, /当前运行/);
assert.match(runtime, /继续这个任务/);
});
test("opening a main agent run result keeps that run selected in the floating runtime", () => { test("opening a main agent run result keeps that run selected in the floating runtime", () => {
const resultAction = extractBetween(APP, "function openCurrentOneLinerRunResultAction(runId = \"\")", "function openConfirmOneLinerRunAction(runId = \"\")"); const resultAction = extractBetween(APP, "function openCurrentOneLinerRunResultAction(runId = \"\")", "function openConfirmOneLinerRunAction(runId = \"\")");
assert.match(resultAction, /appState\.selectedOnelinerRunId = currentRun\.id/); assert.match(resultAction, /appState\.selectedOnelinerRunId = currentRun\.id/);