diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index baad2e6a8d..1d6794ac0e 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -140,6 +140,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction(false) const [primaryButtonText, setPrimaryButtonText] = useState(undefined) const [secondaryButtonText, setSecondaryButtonText] = useState(undefined) + const [showSeeAllChangesButton, setShowSeeAllChangesButton] = useState(false) const [_didClickCancel, setDidClickCancel] = useState(false) const virtuosoRef = useRef(null) const [expandedRows, setExpandedRows] = useState>({}) @@ -369,6 +370,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction msg.say === "checkpoint_saved") + setShowSeeAllChangesButton(!isPartial && hasCheckpoints) break case "resume_task": setSendingDisabled(false) @@ -423,6 +427,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction { + // Find the first checkpoint hash to use for the "full" diff + const checkpoints = messagesRef.current.filter((msg) => msg.say === "checkpoint_saved") + if (checkpoints.length > 0) { + // The checkpointDiff with mode "full" needs the first checkpoint's hash as commitHash + // It will compare from the first checkpoint to current workspace + const firstCheckpointHash = checkpoints[0].text + if (firstCheckpointHash) { + vscode.postMessage({ + type: "checkpointDiff", + payload: { + commitHash: firstCheckpointHash, + mode: "full", + }, + }) + } + } + }, []) + const { info: model } = useSelectedModel(apiConfiguration) const selectImages = useCallback(() => vscode.postMessage({ type: "selectImages" }), []) @@ -1545,7 +1570,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction handlePrimaryButtonClick(inputValue, selectedImages)}> {primaryButtonText} )} + {showSeeAllChangesButton && ( + + + + )} {secondaryButtonText && (