fix(webui): keep edit diffs visible and distinguish file creation (#6049)

This commit is contained in:
chengyongru authored and GitHub committed 2026-10-04 16:55:48 +08:00
1 parent acdae3d0ae
commit ed022e447f
17 files changed
+181 -36

No files matched your search

@@ -179,7 +179,7 @@ export function AgentActivityCluster(props: AgentActivityClusterProps) {
() => summarizeFileEditsByMessage(messages, props.isTurnStreaming),
[messages, props.isTurnStreaming],
);
if (props.expanded !== undefined || displayMode === "summary" || !editsByMessage.size) {
if (displayMode === "summary" || !editsByMessage.size) {
return <FoldedAgentActivity {...props} />;
}
@@ -192,6 +192,7 @@ export function AgentActivityCluster(props: AgentActivityClusterProps) {
items.push(
<FoldedAgentActivity
{...props}
detailsId={undefined}
key={pending[0]?.id ?? "tail-status"}
messages={pending}
isTurnStreaming={last && props.isTurnStreaming}
@@ -225,7 +226,7 @@ export function AgentActivityCluster(props: AgentActivityClusterProps) {
}
flush(true);
return (
<div className={cn("flex w-full flex-col gap-0.5", props.hasBodyBelow && "mb-2")}>
<div id={props.detailsId} className={cn("flex w-full flex-col gap-0.5", props.hasBodyBelow && "mb-2")}>
{items}
</div>
);
@@ -155,6 +155,7 @@ function fileEditAction(
const deleting = edit.operation === "delete";
if (failed) return t(`message.agentActivity.${deleting ? "deleteFileFailed" : "editFileFailedShort"}`);
if (editing) return t(`message.agentActivity.${deleting ? "deletingFile" : "editingFileShort"}`);
if (edit.operation === "create") return t("message.agentActivity.createdFile");
return t(`message.agentActivity.${deleting ? "deletedFile" : "editedFileShort"}`);
}