mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
fix: Add 'Remove from context' button for file read operations to handle token limit issues
- Added delete button to file read messages in ChatRow component - Button appears only for completed file reads (not during streaming) - Leverages existing deleteMessage infrastructure for proper cleanup - Removes messages from both UI (clineMessages) and API conversation history - Added 'removeFromContext' translation key for button tooltip - Helps users recover from token limit errors by removing large files Fixes #7559
This commit is contained in:
parent
63b71d8299
commit
afa02637a5
2 changed files with 15 additions and 0 deletions
|
|
@ -524,6 +524,20 @@ export const ChatRowContent = ({
|
|||
: t("chat:fileOperations.wantsToRead")
|
||||
: t("chat:fileOperations.didRead")}
|
||||
</span>
|
||||
{/* Add delete button for completed file reads when not streaming */}
|
||||
{message.type === "say" && !isStreaming && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="ml-auto shrink-0"
|
||||
title={t("chat:fileOperations.removeFromContext")}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
vscode.postMessage({ type: "deleteMessage", value: message.ts })
|
||||
}}>
|
||||
<span className="codicon codicon-close" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<ToolUseBlock>
|
||||
<ToolUseBlockHeader
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@
|
|||
"wantsToReadAndXMore": "Roo wants to read this file and {{count}} more:",
|
||||
"wantsToReadOutsideWorkspace": "Roo wants to read this file outside of the workspace:",
|
||||
"didRead": "Roo read this file:",
|
||||
"removeFromContext": "Remove from context",
|
||||
"wantsToEdit": "Roo wants to edit this file:",
|
||||
"wantsToEditOutsideWorkspace": "Roo wants to edit this file outside of the workspace:",
|
||||
"wantsToEditProtected": "Roo wants to edit a protected configuration file:",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue