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 22, 19:30 UTC
refactor(web): ChatView's timeline banners render in ChatBannerLane (#23101)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 21, 2026 at 14:39 UTC
a642ab2bd5d3dcc98217d60073ea0feb234c1aa1
2 files changed
+74
-23
apps/web/src/components/ChatView.tsx
+17
-23
@@ -48,6 +48,7 @@ import { feedbackBannerItem } from "./chat/ComposerFeedback";
48
import { useUsageLimitsPanel } from "./chat/useUsageLimitsPanel";
49
import { useWorktreeSetup } from "./chat/useWorktreeSetup";
50
import { useChatShortcuts } from "./chat/useChatShortcuts";
51
+import { ChatBannerLane } from "./chat/ChatBannerLane";
52
import * as Schema from "effect/Schema";
53
import {
54
AuthOrchestrationOperateScope,
@@ -282,15 +283,12 @@ import {
283
} from "./BranchToolbar.logic";
284
import {
285
getProviderStatusBannerKey,
285
- ProviderStatusBanner,
286
shouldShowProviderStatusBanner,
287
} from "./chat/ProviderStatusBanner";
288
import {
289
- dismissThreadErrorBannerForSession,
289
getThreadErrorBannerKey,
290
isThreadErrorBannerDismissedForSession,
291
shouldShowThreadErrorBanner,
293
- ThreadErrorBanner,
292
} from "./chat/ThreadErrorBanner";
293
import { QueuedRunsControl, type QueuedRunsControlHandle } from "./chat/QueuedRunsControl";
294
import { useThreadLinkedPullRequest } from "./pullRequest/useThreadLinkedPullRequest";
@@ -3229,26 +3227,22 @@ export default function ChatView(props: ChatViewProps) {
3227
>
3228
<ThreadFind onClose={focusComposerStable} />
3229
{isWorkspaceFileDragActive ? <WorkspaceFileDropOverlay /> : null}
3232
- <div className="chat-banner-lane pointer-events-none absolute top-0 z-30 flex flex-col">
3233
- <ProviderStatusBanner
3234
- status={visibleProviderStatus}
3235
- onDismiss={() => setDismissedProviderStatusBannerKey(providerStatusBannerKey)}
3236
- onOpenProviderSetup={openProviderSetupStable}
3237
- />
3238
- <ThreadErrorBanner
3239
- error={timelineThreadError}
3240
- errorClass={
3241
- localServerError === null && visibleThreadError === serverRuntime?.lastError
3242
- ? (serverRuntime?.lastErrorClass ?? null)
3243
- : null
3244
- }
3245
- onDismiss={() => {
3246
- setThreadError(activeThread.id, null);
3247
- dismissThreadErrorBannerForSession(threadErrorBannerKey);
3248
- setThreadErrorBannerDismissTick((tick) => tick + 1);
3249
- }}
3250
- />
3251
- </div>
3230
+ <ChatBannerLane
3231
+ providerStatus={visibleProviderStatus}
3232
+ providerStatusBannerKey={providerStatusBannerKey}
3233
+ setDismissedProviderStatusBannerKey={setDismissedProviderStatusBannerKey}
3234
+ onOpenProviderSetup={openProviderSetupStable}
3235
+ threadId={activeThread.id}
3236
+ threadError={timelineThreadError}
3237
+ threadErrorClass={
3238
+ localServerError === null && visibleThreadError === serverRuntime?.lastError
3239
+ ? (serverRuntime?.lastErrorClass ?? null)
3240
+ : null
3241
+ }
3242
+ threadErrorBannerKey={threadErrorBannerKey}
3243
+ setThreadError={setThreadError}
3244
+ setThreadErrorBannerDismissTick={setThreadErrorBannerDismissTick}
3245
+ />
3246
<div className="relative flex min-h-0 flex-1 flex-col bg-background">
3247
<MessagesTimeline
3248
citationRequest={paintOnlyDisplayedTimeline ? null : citationRequest}
apps/web/src/components/chat/ChatBannerLane.tsx
new
+57
@@ -0,0 +1,57 @@
1
+import type {
2
+ OrchestrationV2ProviderFailureClass,
3
+ ProviderInstanceId,
4
+ ServerProvider,
5
+ ThreadId,
6
+} from "@t3tools/contracts";
7
+import type { Dispatch, SetStateAction } from "react";
8
+import { ProviderStatusBanner } from "./ProviderStatusBanner";
9
+import { dismissThreadErrorBannerForSession, ThreadErrorBanner } from "./ThreadErrorBanner";
10
+
11
+/**
12
+ * The banners pinned above the timeline. The dismiss handlers are built here from plain
13
+ * values, so a ChatView render that changes neither banner leaves both cached.
14
+ */
15
+export function ChatBannerLane(props: {
16
+ providerStatus: ServerProvider | null;
17
+ providerStatusBannerKey: string | null;
18
+ setDismissedProviderStatusBannerKey: Dispatch<SetStateAction<string | null>>;
19
+ onOpenProviderSetup: (instanceId: ProviderInstanceId) => void;
20
+ threadId: ThreadId;
21
+ threadError: string | null;
22
+ threadErrorClass: OrchestrationV2ProviderFailureClass | null;
23
+ threadErrorBannerKey: string | null;
24
+ setThreadError: (threadId: ThreadId | null, error: string | null) => void;
25
+ setThreadErrorBannerDismissTick: Dispatch<SetStateAction<number>>;
26
+}) {
27
+ const {
28
+ providerStatus,
29
+ providerStatusBannerKey,
30
+ setDismissedProviderStatusBannerKey,
31
+ onOpenProviderSetup,
32
+ threadId,
33
+ threadError,
34
+ threadErrorClass,
35
+ threadErrorBannerKey,
36
+ setThreadError,
37
+ setThreadErrorBannerDismissTick,
38
+ } = props;
39
+ return (
40
+ <div className="chat-banner-lane pointer-events-none absolute top-0 z-30 flex flex-col">
41
+ <ProviderStatusBanner
42
+ status={providerStatus}
43
+ onDismiss={() => setDismissedProviderStatusBannerKey(providerStatusBannerKey)}
44
+ onOpenProviderSetup={onOpenProviderSetup}
45
+ />
46
+ <ThreadErrorBanner
47
+ error={threadError}
48
+ errorClass={threadErrorClass}
49
+ onDismiss={() => {
50
+ setThreadError(threadId, null);
51
+ dismissThreadErrorBannerForSession(threadErrorBannerKey);
52
+ setThreadErrorBannerDismissTick((tick) => tick + 1);
53
+ }}
54
+ />
55
+ </div>
56
+ );
57
+}