diff --git a/web/static/app.js b/web/static/app.js
index c0cda82..66b9181 100644
--- a/web/static/app.js
+++ b/web/static/app.js
@@ -521,22 +521,26 @@ function routeButtons(routes) {
`;
}
-function searchSteps(steps = []) {
+function searchActivity(steps = []) {
+ const current =
+ steps.find((step) => step.status === "running") ||
+ [...steps].reverse().find((step) => step.status === "done") ||
+ steps[0] ||
+ {};
+ const doneCount = steps.filter((step) => step.status === "done").length;
+ const currentIndex = Math.min(doneCount + (current.status === "running" ? 1 : 0), steps.length || 1);
+ const statusLabel = current.status === "running" ? "working" : current.status || "pending";
return `
-
- ${steps
- .map(
- (step) => `
-
-
-
- ${escapeHtml(step.label)}
- ${escapeHtml(step.detail || step.status)}
-
-
- `,
- )
- .join("")}
+
+
+
+
+ Search Agent
+ ${escapeHtml(current.label || "准备搜索")}
+
+
${escapeHtml(current.detail || "正在准备检索上下文")}
+
+
${escapeHtml(statusLabel)} · ${currentIndex}/${steps.length || 1}
`;
}
@@ -596,10 +600,7 @@ function renderSearchRunning(job) {
elements.lensTitle.textContent = job?.query || elements.searchInput.value.trim() || "搜索";
elements.lensBody.innerHTML = `
- Search Agent 正在理解问题、扩展关键词并检索本地论文库。
-
-
- ${searchSteps(job?.steps || [])}
+ ${searchActivity(job?.steps || [])}
`;
}
@@ -873,6 +874,7 @@ async function runSearch() {
],
};
renderSearchRunning(starter);
+ scrollLensIntoView();
try {
const payload = await api("/api/search/agent", {
method: "POST",
diff --git a/web/static/index.html b/web/static/index.html
index ca86d7f..f572d1f 100644
--- a/web/static/index.html
+++ b/web/static/index.html
@@ -5,7 +5,7 @@
Agent Knowledge Atlas
-
+
@@ -79,6 +79,6 @@
-
+