The best way to control Claude Code, Codex and more from any computer or phone
perf(web): the traits picker compiles without manual memoization (#20540)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 22:08 UTC
b78296a60b63f8721ae28b3c8a1b517f33bef90e
1 file changed
+16
-19
apps/web/src/components/chat/TraitsPicker.tsx
+16
-19
@@ -16,7 +16,7 @@ import {
16
isClaudeUltrathinkPrompt,
17
normalizeModelSlug,
18
} from "@t3tools/shared/model";
19
-import { memo, useCallback } from "react";
19
+import { memo } from "react";
20
import { BrainIcon } from "lucide-react";
21
import {
22
Menu,
@@ -296,24 +296,21 @@ export const TraitsMenuContent = memo(function TraitsMenuContentImpl({
296
const modelSelection =
297
instanceId && model ? { instanceId, model, options: modelOptions ?? [] } : null;
298
const setProviderModelOptions = useComposerDraftStore((store) => store.setProviderModelOptions);
299
- const updateModelOptions = useCallback(
300
- (nextOptions: ProviderOptions | undefined) => {
301
- if ("onModelOptionsChange" in persistence) {
302
- persistence.onModelOptionsChange(nextOptions);
303
- return;
304
- }
305
- const threadTarget = persistence.threadRef ?? persistence.draftId;
306
- if (!threadTarget) {
307
- return;
308
- }
309
- setProviderModelOptions(threadTarget, provider, nextOptions, {
310
- ...(instanceId ? { instanceId } : {}),
311
- model,
312
- persistSticky: true,
313
- });
314
- },
315
- [instanceId, model, persistence, provider, setProviderModelOptions],
316
- );
299
+ const updateModelOptions = (nextOptions: ProviderOptions | undefined) => {
300
+ if ("onModelOptionsChange" in persistence) {
301
+ persistence.onModelOptionsChange(nextOptions);
302
+ return;
303
+ }
304
+ const threadTarget = persistence.threadRef ?? persistence.draftId;
305
+ if (!threadTarget) {
306
+ return;
307
+ }
308
+ setProviderModelOptions(threadTarget, provider, nextOptions, {
309
+ ...(instanceId ? { instanceId } : {}),
310
+ model,
311
+ persistSticky: true,
312
+ });
313
+ };
314
const {
315
descriptors,
316
selectDescriptors,