mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-03 02:22:24 +00:00
Merge 2f3b136ad0 into c3cae397a1
This commit is contained in:
commit
b4d15ff996
2 changed files with 46 additions and 2 deletions
|
|
@ -150,6 +150,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
||||||
const [enableButtons, setEnableButtons] = useState<boolean>(false)
|
const [enableButtons, setEnableButtons] = useState<boolean>(false)
|
||||||
const [primaryButtonText, setPrimaryButtonText] = useState<string | undefined>(undefined)
|
const [primaryButtonText, setPrimaryButtonText] = useState<string | undefined>(undefined)
|
||||||
const [secondaryButtonText, setSecondaryButtonText] = useState<string | undefined>(undefined)
|
const [secondaryButtonText, setSecondaryButtonText] = useState<string | undefined>(undefined)
|
||||||
|
const [showSeeAllChangesButton, setShowSeeAllChangesButton] = useState<boolean>(false)
|
||||||
const [_didClickCancel, setDidClickCancel] = useState(false)
|
const [_didClickCancel, setDidClickCancel] = useState(false)
|
||||||
const virtuosoRef = useRef<VirtuosoHandle>(null)
|
const virtuosoRef = useRef<VirtuosoHandle>(null)
|
||||||
const [expandedRows, setExpandedRows] = useState<Record<number, boolean>>({})
|
const [expandedRows, setExpandedRows] = useState<Record<number, boolean>>({})
|
||||||
|
|
@ -388,6 +389,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
||||||
setEnableButtons(!isPartial)
|
setEnableButtons(!isPartial)
|
||||||
setPrimaryButtonText(t("chat:startNewTask.title"))
|
setPrimaryButtonText(t("chat:startNewTask.title"))
|
||||||
setSecondaryButtonText(undefined)
|
setSecondaryButtonText(undefined)
|
||||||
|
// Show "See All Changes" button if there are checkpoints
|
||||||
|
const hasCheckpoints = messages.some((msg) => msg.say === "checkpoint_saved")
|
||||||
|
setShowSeeAllChangesButton(!isPartial && hasCheckpoints)
|
||||||
break
|
break
|
||||||
case "resume_task":
|
case "resume_task":
|
||||||
setSendingDisabled(false)
|
setSendingDisabled(false)
|
||||||
|
|
@ -442,6 +446,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
||||||
setEnableButtons(false)
|
setEnableButtons(false)
|
||||||
setPrimaryButtonText(undefined)
|
setPrimaryButtonText(undefined)
|
||||||
setSecondaryButtonText(undefined)
|
setSecondaryButtonText(undefined)
|
||||||
|
setShowSeeAllChangesButton(false)
|
||||||
break
|
break
|
||||||
case "api_req_finished":
|
case "api_req_finished":
|
||||||
case "error":
|
case "error":
|
||||||
|
|
@ -848,6 +853,26 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
||||||
[clineAsk, startNewTask, isStreaming, setDidClickCancel],
|
[clineAsk, startNewTask, isStreaming, setDidClickCancel],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Handler for "See All Changes" button
|
||||||
|
const handleSeeAllChangesClick = useCallback(() => {
|
||||||
|
// 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 { info: model } = useSelectedModel(apiConfiguration)
|
||||||
|
|
||||||
const selectImages = useCallback(() => vscode.postMessage({ type: "selectImages" }), [])
|
const selectImages = useCallback(() => vscode.postMessage({ type: "selectImages" }), [])
|
||||||
|
|
@ -1522,7 +1547,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
||||||
vscode.postMessage({ type: "condenseTaskContextRequest", text: taskId })
|
vscode.postMessage({ type: "condenseTaskContextRequest", text: taskId })
|
||||||
}
|
}
|
||||||
|
|
||||||
const areButtonsVisible = showScrollToBottom || primaryButtonText || secondaryButtonText
|
const areButtonsVisible = showScrollToBottom || primaryButtonText || secondaryButtonText || showSeeAllChangesButton
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
@ -1677,12 +1702,27 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
|
||||||
<Button
|
<Button
|
||||||
variant="primary"
|
variant="primary"
|
||||||
disabled={!enableButtons}
|
disabled={!enableButtons}
|
||||||
className={secondaryButtonText ? "flex-1 mr-[6px]" : "flex-[2] mr-0"}
|
className={
|
||||||
|
secondaryButtonText || showSeeAllChangesButton
|
||||||
|
? "flex-1 mr-[6px]"
|
||||||
|
: "flex-[2] mr-0"
|
||||||
|
}
|
||||||
onClick={() => handlePrimaryButtonClick(inputValue, selectedImages)}>
|
onClick={() => handlePrimaryButtonClick(inputValue, selectedImages)}>
|
||||||
{primaryButtonText}
|
{primaryButtonText}
|
||||||
</Button>
|
</Button>
|
||||||
</StandardTooltip>
|
</StandardTooltip>
|
||||||
)}
|
)}
|
||||||
|
{showSeeAllChangesButton && (
|
||||||
|
<StandardTooltip content={t("chat:seeAllChanges.tooltip")}>
|
||||||
|
<Button
|
||||||
|
variant="secondary"
|
||||||
|
disabled={!enableButtons}
|
||||||
|
className="flex-1 ml-[6px]"
|
||||||
|
onClick={handleSeeAllChangesClick}>
|
||||||
|
{t("chat:seeAllChanges.title")}
|
||||||
|
</Button>
|
||||||
|
</StandardTooltip>
|
||||||
|
)}
|
||||||
{secondaryButtonText && (
|
{secondaryButtonText && (
|
||||||
<StandardTooltip
|
<StandardTooltip
|
||||||
content={
|
content={
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@
|
||||||
"title": "Start New Task",
|
"title": "Start New Task",
|
||||||
"tooltip": "Begin a new task"
|
"tooltip": "Begin a new task"
|
||||||
},
|
},
|
||||||
|
"seeAllChanges": {
|
||||||
|
"title": "See All Changes",
|
||||||
|
"tooltip": "View a diff of all changes made during this task"
|
||||||
|
},
|
||||||
"proceedAnyways": {
|
"proceedAnyways": {
|
||||||
"title": "Proceed Anyways",
|
"title": "Proceed Anyways",
|
||||||
"tooltip": "Continue while command executes"
|
"tooltip": "Continue while command executes"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue