Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

fix(web): add dismiss button to thread error banner (#588)

0x1f99d59e2944fb72d
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index 05b3eee27..b284523c5 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -123,7 +123,7 @@ import {
} from "../keybindings";
import ChatMarkdown from "./ChatMarkdown";
import ThreadTerminalDrawer from "./ThreadTerminalDrawer";
-import { Alert, AlertDescription, AlertTitle } from "./ui/alert";
+import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert";
import {
BotIcon,
ChevronDownIcon,
@@ -3434,7 +3434,10 @@ export default function ChatView({ threadId }: ChatViewProps) {
{/* Error banner */}
<ProviderHealthBanner status={activeProviderStatus} />
- <ThreadErrorBanner error={activeThread.error} />
+ <ThreadErrorBanner
+ error={activeThread.error}
+ onDismiss={() => setThreadError(activeThread.id, null)}
+ />
<PlanModePanel activePlan={activePlan} />
{/* Messages */}
@@ -4095,7 +4098,13 @@ const ChatHeader = memo(function ChatHeader({
);
});
-const ThreadErrorBanner = memo(function ThreadErrorBanner({ error }: { error: string | null }) {
+const ThreadErrorBanner = memo(function ThreadErrorBanner({
+ error,
+ onDismiss,
+}: {
+ error: string | null;
+ onDismiss?: () => void;
+}) {
if (!error) return null;
return (
<div className="pt-3 mx-auto max-w-3xl">
@@ -4104,6 +4113,18 @@ const ThreadErrorBanner = memo(function ThreadErrorBanner({ error }: { error: st
<AlertDescription className="line-clamp-3" title={error}>
{error}
</AlertDescription>
+ {onDismiss && (
+ <AlertAction>
+ <button
+ type="button"
+ aria-label="Dismiss error"
+ className="inline-flex size-6 items-center justify-center rounded-md text-destructive/60 transition-colors hover:text-destructive"
+ onClick={onDismiss}
+ >
+ <XIcon className="size-3.5" />
+ </button>
+ </AlertAction>
+ )}
</Alert>
</div>
);