diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 7008dbe590..afa1c76e2b 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -150,6 +150,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>({}) @@ -388,6 +389,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction msg.say === "checkpoint_saved") + setShowSeeAllChangesButton(!isPartial && hasCheckpoints) break case "resume_task": setSendingDisabled(false) @@ -442,6 +446,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" }), []) @@ -1564,7 +1589,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction handlePrimaryButtonClick(inputValue, selectedImages)}> {primaryButtonText} )} + {showSeeAllChangesButton && ( + + + + )} {secondaryButtonText && (