@devries-cameron20 / t3code Mirror · read-only / commits / 59e2944fb7
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 08:45 UTC

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

The thread error banner had no way to be dismissed. Users hitting unrecoverable errors (e.g. missing gh CLI during PR creation) were stuck with a persistent error banner and no way to clear it. Add a dismiss (X) button to ThreadErrorBanner using the existing AlertAction component, wired to clear the thread error via setThreadError(id, null). Closes #496

0x1f99d committed Mar 9, 2026 at 12:24 UTC 59e2944fb72d8ef8c3b55fec3be766abe48df820
1 file changed +24 -3
apps/web/src/components/ChatView.tsx
+24 -3
@@ -123,7 +123,7 @@ import {
123 } from "../keybindings";
124 import ChatMarkdown from "./ChatMarkdown";
125 import ThreadTerminalDrawer from "./ThreadTerminalDrawer";
126 -import { Alert, AlertDescription, AlertTitle } from "./ui/alert";
126 +import { Alert, AlertAction, AlertDescription, AlertTitle } from "./ui/alert";
127 import {
128 BotIcon,
129 ChevronDownIcon,
@@ -3434,7 +3434,10 @@ export default function ChatView({ threadId }: ChatViewProps) {
3434
3435 {/* Error banner */}
3436 <ProviderHealthBanner status={activeProviderStatus} />
3437 - <ThreadErrorBanner error={activeThread.error} />
3437 + <ThreadErrorBanner
3438 + error={activeThread.error}
3439 + onDismiss={() => setThreadError(activeThread.id, null)}
3440 + />
3441 <PlanModePanel activePlan={activePlan} />
3442
3443 {/* Messages */}
@@ -4095,7 +4098,13 @@ const ChatHeader = memo(function ChatHeader({
4098 );
4099 });
4100
4098 -const ThreadErrorBanner = memo(function ThreadErrorBanner({ error }: { error: string | null }) {
4101 +const ThreadErrorBanner = memo(function ThreadErrorBanner({
4102 + error,
4103 + onDismiss,
4104 +}: {
4105 + error: string | null;
4106 + onDismiss?: () => void;
4107 +}) {
4108 if (!error) return null;
4109 return (
4110 <div className="pt-3 mx-auto max-w-3xl">
@@ -4104,6 +4113,18 @@ const ThreadErrorBanner = memo(function ThreadErrorBanner({ error }: { error: st
4113 <AlertDescription className="line-clamp-3" title={error}>
4114 {error}
4115 </AlertDescription>
4116 + {onDismiss && (
4117 + <AlertAction>
4118 + <button
4119 + type="button"
4120 + aria-label="Dismiss error"
4121 + className="inline-flex size-6 items-center justify-center rounded-md text-destructive/60 transition-colors hover:text-destructive"
4122 + onClick={onDismiss}
4123 + >
4124 + <XIcon className="size-3.5" />
4125 + </button>
4126 + </AlertAction>
4127 + )}
4128 </Alert>
4129 </div>
4130 );