diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 8f34de2cda3..99510edfb3d 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -142,6 +142,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>({}) @@ -360,6 +361,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction msg.say === "checkpoint_saved") + setShowSeeAllChangesButton(!isPartial && hasCheckpoints) break case "resume_task": setSendingDisabled(false) @@ -410,6 +414,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" }), []) @@ -1410,7 +1435,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction handlePrimaryButtonClick(inputValue, selectedImages)}> {primaryButtonText} )} + {showSeeAllChangesButton && ( + + + + )} {secondaryButtonText && (