feat: 省略旧消息的代码 diff 展示,仅保留最新消息的完整 diff

This commit is contained in:
claude-code-best
2026-04-27 10:37:49 +08:00
parent bcbb8a6e93
commit c6338917e5
5 changed files with 27 additions and 1 deletions

View File

@@ -814,6 +814,12 @@ const MessagesImpl = ({
streamingToolUseIDs,
))
// Collapse diffs for messages beyond the latest N messages.
// verbose (ctrl+o) overrides and always shows full diffs.
const DIFF_COLLAPSE_DISTANCE = 0
const shouldCollapseDiffs =
renderableMessages.length - 1 - index > DIFF_COLLAPSE_DISTANCE
const k = messageKey(msg)
const row = (
<MessageRow
@@ -838,6 +844,7 @@ const MessagesImpl = ({
columns={columns}
isLoading={isLoading}
lookups={lookups}
shouldCollapseDiffs={shouldCollapseDiffs}
/>
)