Checkbox to experiment with letting Cline edit through diffs (#48)

Co-authored-by: Jozi <jozigila@gmail.com>
This commit is contained in:
Matt Rubens
2024-12-07 16:35:55 -05:00
committed by GitHub
parent dafe286076
commit 5d9d36c128
15 changed files with 174 additions and 14 deletions

View File

@@ -213,10 +213,11 @@ export const ChatRowContent = ({
switch (tool.tool) {
case "editedExistingFile":
case "appliedDiff":
return (
<>
<div style={headerStyle}>
{toolIcon("edit")}
{toolIcon(tool.tool === "appliedDiff" ? "diff" : "edit")}
<span style={{ fontWeight: "bold" }}>Cline wants to edit this file:</span>
</div>
<CodeAccordian

View File

@@ -121,6 +121,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
const tool = JSON.parse(lastMessage.text || "{}") as ClineSayTool
switch (tool.tool) {
case "editedExistingFile":
case "appliedDiff":
case "newFileCreated":
setPrimaryButtonText("Save")
setSecondaryButtonText("Reject")
@@ -747,7 +748,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
const lastMessage = messages.at(-1)
if (lastMessage?.type === "ask" && lastMessage.text) {
const tool = JSON.parse(lastMessage.text)
return ["editedExistingFile", "newFileCreated"].includes(tool.tool)
return ["editedExistingFile", "appliedDiff", "newFileCreated"].includes(tool.tool)
}
return false
}