Skip to content

Commit 5bf497b

Browse files
roberttwangclaude
andcommitted
Merge main into codex/project-asset-bundles
Resolve conflicts with the latest main; keep both sides' additions (i18n dictionaries, runner/A2A rows, review-mode run header, user turn actions) without dropping either branch's behaviour. Co-Authored-By: Claude Code <noreply@anthropic.com>
2 parents aaac455 + f3c1fcd commit 5bf497b

116 files changed

Lines changed: 5703 additions & 541 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎chatbot/src/ActivityTrace.jsx‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,28 @@ function Narration({
353353
),
354354
);
355355
}
356+
// The history response already contains the visible answer. Fetch the trace
357+
// when the reader opens it, or follows a dispatch into a subagent's process.
358+
export function DeferredActivity({ sessionId, index, activityRef, loadActivity }) {
359+
const [error, setError] = useState("");
360+
const [attempt, setAttempt] = useState(0);
361+
useEffect(() => {
362+
let current = true;
363+
setError("");
364+
loadActivity(sessionId, index, activityRef).catch((e) => {
365+
if (current) setError(e.message || "执行过程加载失败");
366+
});
367+
return () => { current = false; };
368+
}, [sessionId, index, activityRef, loadActivity, attempt]);
369+
return error ? (
370+
<p role="alert" className="execution-empty">
371+
{error} <button type="button" onClick={() => setAttempt(n => n + 1)}>重试</button>
372+
</p>
373+
) : <p role="status" className="execution-empty">正在读取执行过程…</p>;
374+
}
375+
356376
export function ReplyTimeline({
377+
deferredActivity = null,
357378
steps = [],
358379
startedAt,
359380
finishedAt,
@@ -375,6 +396,7 @@ export function ReplyTimeline({
375396
live={live}
376397
interrupted={interrupted}
377398
approvals={approvals}
399+
deferredActivity={deferredActivity}
378400
narration={traceBlocks(steps, { live })}
379401
citationProps={{
380402
knowledgeReads,
@@ -393,6 +415,7 @@ export function ReplyTimeline({
393415
// the whole process into its elapsed-time line; opening it shows every note,
394416
// thought and step between the line and the answer.
395417
export default function ActivityTrace({
418+
deferredActivity = null,
396419
steps = [],
397420
startedAt,
398421
finishedAt,
@@ -505,7 +528,7 @@ export default function ActivityTrace({
505528
</summary>
506529
{expanded ? (
507530
<div className="execution-body" aria-label="执行过程">
508-
{blocks.length ? (
531+
{deferredActivity ? <DeferredActivity {...deferredActivity} /> : blocks.length ? (
509532
<Narration
510533
blocks={blocks}
511534
live={false}

0 commit comments

Comments
 (0)