The best way to control Claude Code, Codex and more from any computer or phone
perf(web): typing no longer re-renders the composer's footer controls (#32323)
Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Omar Espinosa committed
Nov 14, 2026 at 23:32 UTC
e2afd2546eb34fde33ac9fb24c052e8a9d63b519
2 files changed
+5
-1
apps/web/src/components/chat/ChatComposer.tsx
+3
-1
@@ -910,13 +910,15 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
910
? providerInstanceEntries.find((entry) => hasProviderSetup(entry.snapshot))?.instanceId
911
: undefined))
912
: undefined;
913
+ // Called before the derivation below: a hook between it and its uses stops React Compiler
914
+ // from caching the mode options, and the footer then re-renders on every keystroke.
915
+ const managedPolicy = useManagedPolicy(environmentId);
916
const { modes: compatibleRuntimeModes, mode: compatibleRuntimeMode } =
917
resolveCompatibleRuntimeMode(
918
runtimeMode,
919
selectedProviderEntry?.snapshot.supportedRuntimeModes,
920
);
921
// Modes above an administrator's ceiling stay listed, disabled with the reason.
919
- const managedPolicy = useManagedPolicy(environmentId);
922
const compatibleRuntimeModeOptions = resolveRuntimeModeOptions(
923
compatibleRuntimeModes,
924
managedPolicy,
apps/web/test/appScenarios.renders.tsx
+2
@@ -274,6 +274,8 @@ it("app-type-in-composer", async () => {
274
await userEvent.type(editor, TYPED_TEXT);
275
await expect.element(editor).toHaveTextContent(TYPED_TEXT);
276
});
277
+ // The footer controls re-render for the first character only, not per keystroke.
278
+ expect(counted.components.ComposerControlsBar).toBe(1);
279
await report("app-type-in-composer", [counted]);
280
});
281