Roo-Code/webview-ui/src/components/chat/CommandExecutionError.tsx
Bruno Bergher 0eddc97d13
ux: improved error messages and documentation links (#9777)
* Minor ui tweaks

* Basic setup for richer API request errors

* Better errors messages and contact link

* i18n

* Update webview-ui/src/i18n/locales/en/chat.json

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>

* Update webview-ui/src/i18n/locales/en/chat.json

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>

* Empty better than null

* Update webview-ui/src/i18n/locales/nl/chat.json

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* i18n

* Start retryAttempt at 1

* Reverse retryAttempt number, just ommit it from the message

---------

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-12-04 15:25:23 +00:00

40 lines
1.3 KiB
TypeScript

import { useCallback } from "react"
import { useTranslation, Trans } from "react-i18next"
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"
import { buildDocLink } from "../../utils/docLinks"
export const CommandExecutionError = () => {
const { t } = useTranslation()
const onClick = useCallback((e: React.MouseEvent<HTMLAnchorElement>) => {
e.preventDefault()
window.postMessage({ type: "action", action: "settingsButtonClicked", values: { section: "terminal" } }, "*")
}, [])
return (
<div className="text-sm bg-vscode-editor-background border border-vscode-border rounded-lg p-3 ml-6">
<div className="flex flex-col gap-2">
<div className="flex items-center">
<i className="codicon codicon-warning mr-1 text-vscode-editorWarning-foreground" />
<span className="text-vscode-editorWarning-foreground font-semibold">
{t("chat:shellIntegration.title")}
</span>
</div>
<div>
<Trans
i18nKey="chat:shellIntegration.description"
components={{
settingsLink: <VSCodeLink href="#" onClick={onClick} className="inline" />,
}}
/>
</div>
<a
href={buildDocLink("troubleshooting/shell-integration/", "error_tooltip")}
className="underline"
style={{ color: "inherit" }}>
{t("chat:shellIntegration.troubleshooting")}
</a>
</div>
</div>
)
}