Spaces:
Running
Running
Rename Report to Result and update welcome diagram labels
Browse files- Timeline tag: REPORT → RESULT
- Welcome SVG: Task Center → Main Agent, Agent → Sub-Agent,
Task → Sub-Agent, Report/Report summary → Result
- Status messages: "Generating report..." → "Generating result..."
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- backend/research.py +1 -1
- frontend/index.html +11 -11
- frontend/research-ui.js +1 -1
- frontend/script.js +3 -3
backend/research.py
CHANGED
|
@@ -301,7 +301,7 @@ def stream_research(
|
|
| 301 |
# Check for final answer
|
| 302 |
answer = parse_answer(assistant_message)
|
| 303 |
if answer:
|
| 304 |
-
yield {"type": "status", "message": "Research complete! Generating
|
| 305 |
|
| 306 |
# Wrap in <result> tags for compatibility with command center
|
| 307 |
result_content = answer
|
|
|
|
| 301 |
# Check for final answer
|
| 302 |
answer = parse_answer(assistant_message)
|
| 303 |
if answer:
|
| 304 |
+
yield {"type": "status", "message": "Research complete! Generating result..."}
|
| 305 |
|
| 306 |
# Wrap in <result> tags for compatibility with command center
|
| 307 |
result_content = answer
|
frontend/index.html
CHANGED
|
@@ -109,25 +109,25 @@
|
|
| 109 |
</marker>
|
| 110 |
</defs>
|
| 111 |
|
| 112 |
-
<!--
|
| 113 |
<rect x="20" y="10" width="180" height="160" rx="4" fill="#fafafa" stroke="#e0e0e0" stroke-width="1"/>
|
| 114 |
-
<text x="110" y="28" text-anchor="middle" font-size="11" font-weight="600" fill="var(--theme-accent)">
|
| 115 |
|
| 116 |
<!-- User Message -->
|
| 117 |
<rect x="35" y="40" width="150" height="24" rx="3" fill="white" stroke="var(--theme-accent)" stroke-width="1"/>
|
| 118 |
<text x="110" y="56" text-anchor="middle" font-size="9" fill="#333">User input</text>
|
| 119 |
|
| 120 |
-
<!--
|
| 121 |
<rect x="35" y="74" width="150" height="86" rx="3" fill="white" stroke="#ccc" stroke-width="1"/>
|
| 122 |
<rect x="35" y="74" width="150" height="20" rx="3" fill="var(--theme-accent)"/>
|
| 123 |
-
<text x="110" y="88" text-anchor="middle" font-size="9" font-weight="500" fill="white">
|
| 124 |
<text x="110" y="115" text-anchor="middle" font-size="9" fill="#666">processing...</text>
|
| 125 |
<line x1="45" y1="130" x2="175" y2="130" stroke="#eee" stroke-width="1"/>
|
| 126 |
-
<text x="110" y="150" text-anchor="middle" font-size="9" fill="#333">
|
| 127 |
|
| 128 |
-
<!-- Agent Box -->
|
| 129 |
<rect x="300" y="10" width="180" height="160" rx="4" fill="#fafafa" stroke="#e0e0e0" stroke-width="1"/>
|
| 130 |
-
<text x="390" y="28" text-anchor="middle" font-size="11" font-weight="600" fill="var(--theme-accent)">AGENT</text>
|
| 131 |
|
| 132 |
<!-- Query (top of agent) -->
|
| 133 |
<rect x="315" y="40" width="150" height="24" rx="3" fill="white" stroke="var(--theme-accent)" stroke-width="1"/>
|
|
@@ -141,15 +141,15 @@
|
|
| 141 |
<rect x="315" y="108" width="150" height="14" rx="2" fill="#fbfbfb" stroke="#f0f0f0" stroke-width="1"/>
|
| 142 |
<text x="390" y="118" text-anchor="middle" font-size="8" fill="#ccc">...</text>
|
| 143 |
|
| 144 |
-
<!--
|
| 145 |
<rect x="315" y="130" width="150" height="30" rx="3" fill="white" stroke="var(--theme-accent)" stroke-width="1"/>
|
| 146 |
-
<text x="390" y="150" text-anchor="middle" font-size="9" fill="#333">
|
| 147 |
|
| 148 |
<!-- Arrows (drawn last to be on top) -->
|
| 149 |
-
<!-- Arrow from
|
| 150 |
<polyline points="185,84 250,84 250,52 307,52" fill="none" stroke="var(--theme-accent)" stroke-width="1.5" marker-end="url(#arrowhead)" stroke-dasharray="4,2"/>
|
| 151 |
|
| 152 |
-
<!-- Arrow from
|
| 153 |
<line x1="315" y1="150" x2="193" y2="150" stroke="var(--theme-accent)" stroke-width="1.5" marker-end="url(#arrowhead)"/>
|
| 154 |
</svg>
|
| 155 |
</div>
|
|
|
|
| 109 |
</marker>
|
| 110 |
</defs>
|
| 111 |
|
| 112 |
+
<!-- Main Agent Box -->
|
| 113 |
<rect x="20" y="10" width="180" height="160" rx="4" fill="#fafafa" stroke="#e0e0e0" stroke-width="1"/>
|
| 114 |
+
<text x="110" y="28" text-anchor="middle" font-size="11" font-weight="600" fill="var(--theme-accent)">MAIN AGENT</text>
|
| 115 |
|
| 116 |
<!-- User Message -->
|
| 117 |
<rect x="35" y="40" width="150" height="24" rx="3" fill="white" stroke="var(--theme-accent)" stroke-width="1"/>
|
| 118 |
<text x="110" y="56" text-anchor="middle" font-size="9" fill="#333">User input</text>
|
| 119 |
|
| 120 |
+
<!-- Sub-Agent Widget (combined task + result) -->
|
| 121 |
<rect x="35" y="74" width="150" height="86" rx="3" fill="white" stroke="#ccc" stroke-width="1"/>
|
| 122 |
<rect x="35" y="74" width="150" height="20" rx="3" fill="var(--theme-accent)"/>
|
| 123 |
+
<text x="110" y="88" text-anchor="middle" font-size="9" font-weight="500" fill="white">SUB-AGENT</text>
|
| 124 |
<text x="110" y="115" text-anchor="middle" font-size="9" fill="#666">processing...</text>
|
| 125 |
<line x1="45" y1="130" x2="175" y2="130" stroke="#eee" stroke-width="1"/>
|
| 126 |
+
<text x="110" y="150" text-anchor="middle" font-size="9" fill="#333">Result</text>
|
| 127 |
|
| 128 |
+
<!-- Sub-Agent Box -->
|
| 129 |
<rect x="300" y="10" width="180" height="160" rx="4" fill="#fafafa" stroke="#e0e0e0" stroke-width="1"/>
|
| 130 |
+
<text x="390" y="28" text-anchor="middle" font-size="11" font-weight="600" fill="var(--theme-accent)">SUB-AGENT</text>
|
| 131 |
|
| 132 |
<!-- Query (top of agent) -->
|
| 133 |
<rect x="315" y="40" width="150" height="24" rx="3" fill="white" stroke="var(--theme-accent)" stroke-width="1"/>
|
|
|
|
| 141 |
<rect x="315" y="108" width="150" height="14" rx="2" fill="#fbfbfb" stroke="#f0f0f0" stroke-width="1"/>
|
| 142 |
<text x="390" y="118" text-anchor="middle" font-size="8" fill="#ccc">...</text>
|
| 143 |
|
| 144 |
+
<!-- Result (bottom of sub-agent) - aligned with sub-agent result area at y=145 -->
|
| 145 |
<rect x="315" y="130" width="150" height="30" rx="3" fill="white" stroke="var(--theme-accent)" stroke-width="1"/>
|
| 146 |
+
<text x="390" y="150" text-anchor="middle" font-size="9" fill="#333">Result</text>
|
| 147 |
|
| 148 |
<!-- Arrows (drawn last to be on top) -->
|
| 149 |
+
<!-- Arrow from Sub-Agent widget to Query (straight with corners) -->
|
| 150 |
<polyline points="185,84 250,84 250,52 307,52" fill="none" stroke="var(--theme-accent)" stroke-width="1.5" marker-end="url(#arrowhead)" stroke-dasharray="4,2"/>
|
| 151 |
|
| 152 |
+
<!-- Arrow from Result back to Main Agent (straight horizontal) -->
|
| 153 |
<line x1="315" y1="150" x2="193" y2="150" stroke="var(--theme-accent)" stroke-width="1.5" marker-end="url(#arrowhead)"/>
|
| 154 |
</svg>
|
| 155 |
</div>
|
frontend/research-ui.js
CHANGED
|
@@ -300,7 +300,7 @@ function createAssessmentMessage(chatContainer, sufficient, missingAspects, find
|
|
| 300 |
if (reasoning) {
|
| 301 |
reasoningText = reasoning;
|
| 302 |
} else if (sufficient) {
|
| 303 |
-
reasoningText = `Research complete - ${findingsCount} relevant sources found. Generating
|
| 304 |
} else {
|
| 305 |
reasoningText = `Continuing research - ${findingsCount} relevant sources found. Missing: ${missingAspects.join(', ')}`;
|
| 306 |
}
|
|
|
|
| 300 |
if (reasoning) {
|
| 301 |
reasoningText = reasoning;
|
| 302 |
} else if (sufficient) {
|
| 303 |
+
reasoningText = `Research complete - ${findingsCount} relevant sources found. Generating result...`;
|
| 304 |
} else {
|
| 305 |
reasoningText = `Continuing research - ${findingsCount} relevant sources found. Missing: ${missingAspects.join(', ')}`;
|
| 306 |
}
|
frontend/script.js
CHANGED
|
@@ -2076,10 +2076,10 @@ async function streamChatResponse(messages, chatContainer, agentType, tabId) {
|
|
| 2076 |
`;
|
| 2077 |
chatContainer.appendChild(resultDiv);
|
| 2078 |
scrollChatToBottom(chatContainer);
|
| 2079 |
-
// Add
|
| 2080 |
const figCount = data.figures ? Object.keys(data.figures).length : 0;
|
| 2081 |
const reportDesc = figCount > 0 ? `${figCount} figures` : (data.content?.replace(/<[^>]+>/g, '').trim().substring(0, 60) || 'done');
|
| 2082 |
-
const resEvIdx = addTimelineEvent(tabId, 'assistant', reportDesc, null, { tag: '
|
| 2083 |
resultDiv.dataset.timelineIndex = resEvIdx;
|
| 2084 |
|
| 2085 |
} else if (data.type === 'status') {
|
|
@@ -2146,7 +2146,7 @@ async function streamChatResponse(messages, chatContainer, agentType, tabId) {
|
|
| 2146 |
createReportMessage(chatContainer, data.content, data.sources_count, data.websites_visited);
|
| 2147 |
scrollChatToBottom(chatContainer);
|
| 2148 |
// Add to timeline
|
| 2149 |
-
const rptEvIdx = addTimelineEvent(tabId, 'assistant', `${data.sources_count || 0} sources, ${data.websites_visited || 0} sites`, null, { tag: '
|
| 2150 |
chatContainer.lastElementChild.dataset.timelineIndex = rptEvIdx;
|
| 2151 |
|
| 2152 |
} else if (data.type === 'tool_start') {
|
|
|
|
| 2076 |
`;
|
| 2077 |
chatContainer.appendChild(resultDiv);
|
| 2078 |
scrollChatToBottom(chatContainer);
|
| 2079 |
+
// Add result dot to parent research timeline
|
| 2080 |
const figCount = data.figures ? Object.keys(data.figures).length : 0;
|
| 2081 |
const reportDesc = figCount > 0 ? `${figCount} figures` : (data.content?.replace(/<[^>]+>/g, '').trim().substring(0, 60) || 'done');
|
| 2082 |
+
const resEvIdx = addTimelineEvent(tabId, 'assistant', reportDesc, null, { tag: 'RESULT' });
|
| 2083 |
resultDiv.dataset.timelineIndex = resEvIdx;
|
| 2084 |
|
| 2085 |
} else if (data.type === 'status') {
|
|
|
|
| 2146 |
createReportMessage(chatContainer, data.content, data.sources_count, data.websites_visited);
|
| 2147 |
scrollChatToBottom(chatContainer);
|
| 2148 |
// Add to timeline
|
| 2149 |
+
const rptEvIdx = addTimelineEvent(tabId, 'assistant', `${data.sources_count || 0} sources, ${data.websites_visited || 0} sites`, null, { tag: 'RESULT' });
|
| 2150 |
chatContainer.lastElementChild.dataset.timelineIndex = rptEvIdx;
|
| 2151 |
|
| 2152 |
} else if (data.type === 'tool_start') {
|