The best way to control Claude Code, Codex and more from any computer or phone
perf(web): main thread updates no longer re-render an open side chat (#28264)
Yuruzuu committed
Nov 1, 2026 at 10:48 UTC
2f777bdd497aecc9bb7221d106d338f1a8784d6f
2 files changed
+8
-6
apps/web/src/components/ChatView.tsx
+6
-4
@@ -3177,6 +3177,11 @@ export default function ChatView(props: ChatViewProps) {
3177
(folders: Parameters<ChatComposerHandle["addDroppedFolders"]>[0]) =>
3178
composerRef.current?.addDroppedFolders(folders),
3179
);
3180
+ // Above the early return, where React Compiler can cache it for the side chat pane.
3181
+ const sideChatParentPanel = {
3182
+ openToolDiff: onOpenToolDiffStable,
3183
+ runShellCommand: runSideChatShellCommandStable,
3184
+ };
3185
3186
if (!activeThread) {
3187
return embedded ? null : <NoActiveThreadState />;
@@ -3196,10 +3201,7 @@ export default function ChatView(props: ChatViewProps) {
3201
getShortcutContext={getShortcutContextStable}
3202
onSendAnnotation={sendPreviewAnnotationStable}
3203
onCloseSurface={closeRightPanelSurface}
3199
- sideChatParentPanel={{
3200
- openToolDiff: onOpenToolDiffStable,
3201
- runShellCommand: runSideChatShellCommandStable,
3202
- }}
3204
+ sideChatParentPanel={sideChatParentPanel}
3205
terminal={{
3206
launchContext: activeTerminalLaunchContext ?? null,
3207
keybindings,
apps/web/src/components/chat/RightPanelSurfaceContent.tsx
+2
-2
@@ -79,7 +79,7 @@ export function RightPanelSurfaceContent(props: {
79
readonly files: RightPanelFileProps;
80
readonly sideChatParentPanel: SideChatParentPanel;
81
}) {
82
- const { surface, threadRef, visible } = props;
82
+ const { surface, threadRef, visible, onCloseSurface } = props;
83
if (surface === null) return null;
84
switch (surface.kind) {
85
case "preview":
@@ -176,7 +176,7 @@ export function RightPanelSurfaceContent(props: {
176
parentRef={threadRef}
177
threadId={surface.threadId}
178
parentPanel={props.sideChatParentPanel}
179
- onClose={() => props.onCloseSurface(surface)}
179
+ onClose={() => onCloseSurface(surface)}
180
/>
181
);
182
case "device":