Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/tools/applyDiffTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export async function applyDiffTool(
}

if (currentCount >= 2) {
await cline.say("error", formattedError)
await cline.say("diff_error", formattedError)
}
pushToolResult(formattedError)
return
Expand Down
2 changes: 2 additions & 0 deletions src/exports/roo-code.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ type ClineMessage = {
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
| "diff_error"
)
| undefined
text?: string | undefined
Expand Down Expand Up @@ -467,6 +468,7 @@ type RooCodeEvents = {
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
| "diff_error"
)
| undefined
text?: string | undefined
Expand Down
2 changes: 2 additions & 0 deletions src/exports/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ type ClineMessage = {
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
| "diff_error"
)
| undefined
text?: string | undefined
Expand Down Expand Up @@ -476,6 +477,7 @@ type RooCodeEvents = {
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
| "diff_error"
)
| undefined
text?: string | undefined
Expand Down
1 change: 1 addition & 0 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ export const clineSays = [
"subtask_result",
"checkpoint_saved",
"rooignore_error",
"diff_error",
] as const

export const clineSaySchema = z.enum(clineSays)
Expand Down
95 changes: 95 additions & 0 deletions webview-ui/src/components/chat/ChatRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ export const ChatRowContent = ({
const { t } = useTranslation()
const { mcpServers, alwaysAllowMcp, currentCheckpoint } = useExtensionState()
const [reasoningCollapsed, setReasoningCollapsed] = useState(true)
const [isDiffErrorExpanded, setIsDiffErrorExpanded] = useState(false)
const [showCopySuccess, setShowCopySuccess] = useState(false)
const { copyWithFeedback } = useCopyToClipboard()

const [cost, apiReqCancelReason, apiReqStreamingFailedMessage] = useMemo(() => {
if (message.text !== null && message.text !== undefined && message.say === "api_req_started") {
Expand Down Expand Up @@ -602,6 +605,98 @@ export const ChatRowContent = ({
switch (message.type) {
case "say":
switch (message.say) {
case "diff_error":
return (
<div>
<div
style={{
marginTop: "0px",
overflow: "hidden",
marginBottom: "8px",
}}>
<div
style={{
borderBottom: isDiffErrorExpanded
? "1px solid var(--vscode-editorGroup-border)"
: "none",
fontWeight: "normal",
fontSize: "var(--vscode-font-size)",
color: "var(--vscode-editor-foreground)",
display: "flex",
alignItems: "center",
justifyContent: "space-between",
cursor: "pointer",
}}
onClick={() => setIsDiffErrorExpanded(!isDiffErrorExpanded)}>
<div
style={{
display: "flex",
alignItems: "center",
gap: "10px",
flexGrow: 1,
}}>
<span
className="codicon codicon-warning"
style={{
color: "var(--vscode-editorWarning-foreground)",
opacity: 0.8,
fontSize: 16,
marginBottom: "-1.5px",
}}></span>
<span style={{ fontWeight: "bold" }}>{t("chat:diffError.title")}</span>
</div>
<div style={{ display: "flex", alignItems: "center" }}>
<VSCodeButton
appearance="icon"
style={{
padding: "3px",
height: "24px",
marginRight: "4px",
color: "var(--vscode-editor-foreground)",
display: "flex",
alignItems: "center",
justifyContent: "center",
background: "transparent",
}}
onClick={(e) => {
e.stopPropagation()

// Call copyWithFeedback and handle the Promise
copyWithFeedback(message.text || "").then((success) => {
if (success) {
// Show checkmark
setShowCopySuccess(true)

// Reset after a brief delay
setTimeout(() => {
setShowCopySuccess(false)
}, 1000)
}
})
}}>
<span
className={`codicon codicon-${showCopySuccess ? "check" : "copy"}`}></span>
</VSCodeButton>
<span
className={`codicon codicon-chevron-${isDiffErrorExpanded ? "up" : "down"}`}></span>
</div>
</div>
{isDiffErrorExpanded && (
<div
style={{
padding: "8px",
backgroundColor: "var(--vscode-editor-background)",
borderTop: "none",
}}>
<CodeBlock
source={`${"```"}plaintext\n${message.text || ""}\n${"```"}`}
forceWrap={true}
/>
</div>
)}
</div>
</div>
)
case "subtask_result":
return (
<div>
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/ca/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "Edita...",
"forNextMode": "per al següent mode",
"error": "Error",
"diffError": {
"title": "Edició fallida"
},
"troubleMessage": "Roo està tenint problemes...",
"apiRequest": {
"title": "Sol·licitud API",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/de/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "Bearbeiten...",
"forNextMode": "für nächsten Modus",
"error": "Fehler",
"diffError": {
"title": "Bearbeitung fehlgeschlagen"
},
"troubleMessage": "Roo hat Probleme...",
"apiRequest": {
"title": "API-Anfrage",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@
},
"taskCompleted": "Task Completed",
"error": "Error",
"diffError": {
"title": "Edit Unsuccessful"
},
"troubleMessage": "Roo is having trouble...",
"shellIntegration": {
"unavailable": "Shell Integration Unavailable",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/es/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "Editar...",
"forNextMode": "para el siguiente modo",
"error": "Error",
"diffError": {
"title": "Edición fallida"
},
"troubleMessage": "Roo está teniendo problemas...",
"apiRequest": {
"title": "Solicitud API",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/fr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "Éditer...",
"forNextMode": "pour le prochain mode",
"error": "Erreur",
"diffError": {
"title": "Modification échouée"
},
"troubleMessage": "Roo rencontre des difficultés...",
"apiRequest": {
"title": "Requête API",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/hi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "संपादित करें...",
"forNextMode": "अगले मोड के लिए",
"error": "त्रुटि",
"diffError": {
"title": "संपादन असफल"
},
"troubleMessage": "Roo को समस्या हो रही है...",
"apiRequest": {
"title": "API अनुरोध",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/it/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
"wantsToFetch": "Roo vuole recuperare istruzioni dettagliate per aiutare con l'attività corrente"
},
"error": "Errore",
"diffError": {
"title": "Modifica non riuscita"
},
"troubleMessage": "Roo sta avendo problemi...",
"apiRequest": {
"title": "Richiesta API",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/ja/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "編集...",
"forNextMode": "次のモード用",
"error": "エラー",
"diffError": {
"title": "編集に失敗しました"
},
"troubleMessage": "Rooに問題が発生しています...",
"apiRequest": {
"title": "APIリクエスト",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/ko/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "편집...",
"forNextMode": "다음 모드용",
"error": "오류",
"diffError": {
"title": "편집 실패"
},
"troubleMessage": "Roo에 문제가 발생했습니다...",
"apiRequest": {
"title": "API 요청",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/pl/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "Edytuj...",
"forNextMode": "dla następnego trybu",
"error": "Błąd",
"diffError": {
"title": "Edycja nieudana"
},
"troubleMessage": "Roo ma problemy...",
"apiRequest": {
"title": "Zapytanie API",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/pt-BR/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "Editar...",
"forNextMode": "para o próximo modo",
"error": "Erro",
"diffError": {
"title": "Edição mal-sucedida"
},
"troubleMessage": "Roo está tendo problemas...",
"apiRequest": {
"title": "Requisição API",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/tr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "Düzenle...",
"forNextMode": "sonraki mod için",
"error": "Hata",
"diffError": {
"title": "Düzenleme Başarısız"
},
"troubleMessage": "Roo sorun yaşıyor...",
"apiRequest": {
"title": "API İsteği",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/vi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "Chỉnh sửa...",
"forNextMode": "cho chế độ tiếp theo",
"error": "Lỗi",
"diffError": {
"title": "Chỉnh sửa không thành công"
},
"troubleMessage": "Roo đang gặp sự cố...",
"apiRequest": {
"title": "Yêu cầu API",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/zh-CN/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "编辑...",
"forNextMode": "用于下一个模式",
"error": "错误",
"diffError": {
"title": "编辑失败"
},
"troubleMessage": "Roo遇到问题...",
"apiRequest": {
"title": "API请求",
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/i18n/locales/zh-TW/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
"edit": "編輯...",
"forNextMode": "用於下一個模式",
"error": "錯誤",
"diffError": {
"title": "編輯失敗"
},
"troubleMessage": "Roo 遇到問題...",
"apiRequest": {
"title": "API 請求",
Expand Down