feat: compact main agent landing notices on mobile

This commit is contained in:
kris
2026-03-30 11:53:17 +08:00
parent a50d1b00f1
commit cb3a4d2755
2 changed files with 25 additions and 0 deletions

View File

@@ -4734,6 +4734,23 @@ function renderMainAgentLandingNotice(screenKey) {
const recommendedAction = landingRun?.result?.recommended_action || null;
return `
<div class="task-item compact" style="margin-bottom:18px; border-color:rgba(59, 130, 246, 0.24); background:linear-gradient(180deg, rgba(239, 246, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);">
<div class="mobile-only compact-summary-row">
<span>主 Agent 结果</span>
<strong>${escapeHtml(resultSections.workstream_label || recommendedAction?.label || landing.title || "继续处理")}</strong>
<span>${escapeHtml(landing.runId ? "可继续处理" : "已生成提示")}</span>
<strong>${escapeHtml(recommendedAction?.label || "继续处理")}</strong>
</div>
<div class="mobile-only mobile-flow-focus-card">
<div class="mobile-flow-focus-head">
<strong>主 Agent 结果</strong>
<span class="tag blue">${escapeHtml(resultSections.workstream_label || "继续处理")}</span>
</div>
<p>${escapeHtml(landing.summary || landing.title || "这是主 Agent 刚刚给出的下一步落点。")}</p>
<div class="task-meta">
${landing.runId ? `<span class="tag clickable-tag" data-action="open-oneliner-run-result" data-run-id="${escapeHtml(landing.runId)}">查看结果</span>` : ""}
<span class="tag clickable-tag" data-action="dismiss-main-agent-landing">收起提示</span>
</div>
</div>
<h4>你正在处理主 Agent 的结果</h4>
<p>${escapeHtml(landing.summary || landing.title || "这是主 Agent 刚刚给出的下一步落点。")}</p>
${cards.length ? `

View File

@@ -540,6 +540,14 @@ test("main agent route actions keep landing context and destination screens rend
assert.match(production, /renderMainAgentLandingNotice\("production"\)/);
});
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/);
assert.match(landing, /mobile-only mobile-flow-focus-card/);
assert.match(landing, /主 Agent 结果/);
assert.match(landing, /继续处理/);
});
test("key workbench screens expose contextual handoff-to-main-agent actions", () => {
const discovery = extractBetween(APP, "function renderDiscoveryScreen()", "function renderTrackingScreen()");
const tracking = extractBetween(APP, "function renderTrackingScreen()", "function renderAutomationScreen()");