| ... | ... | @@ -897,23 +897,32 @@ export default function ChatView() { |
| 897 | 897 | } |
| 898 | 898 | }; |
| 899 | 899 | |
| 900 | | const onModelSelect = (model: ModelSlug) => { |
| 901 | | if (!activeThread) return; |
| 902 | | dispatch({ |
| 903 | | type: "SET_THREAD_MODEL", |
| 904 | | threadId: activeThread.id, |
| 905 | | model: resolveModelSlug(model), |
| 906 | | }); |
| 907 | | scheduleComposerFocus(); |
| 908 | | }; |
| 909 | | const onEffortSelect = (effort: ReasoningEffort) => { |
| 910 | | setSelectedEffort(effort); |
| 911 | | scheduleComposerFocus(); |
| 912 | | }; |
| 913 | | const onEnvModeChange = (mode: "local" | "worktree") => { |
| 914 | | setEnvMode(mode); |
| 915 | | scheduleComposerFocus(); |
| 916 | | }; |
| 900 | const onModelSelect = useCallback( |
| 901 | (model: ModelSlug) => { |
| 902 | if (!activeThread) return; |
| 903 | dispatch({ |
| 904 | type: "SET_THREAD_MODEL", |
| 905 | threadId: activeThread.id, |
| 906 | model: resolveModelSlug(model), |
| 907 | }); |
| 908 | scheduleComposerFocus(); |
| 909 | }, |
| 910 | [activeThread, dispatch, scheduleComposerFocus], |
| 911 | ); |
| 912 | const onEffortSelect = useCallback( |
| 913 | (effort: ReasoningEffort) => { |
| 914 | setSelectedEffort(effort); |
| 915 | scheduleComposerFocus(); |
| 916 | }, |
| 917 | [scheduleComposerFocus], |
| 918 | ); |
| 919 | const onEnvModeChange = useCallback( |
| 920 | (mode: "local" | "worktree") => { |
| 921 | setEnvMode(mode); |
| 922 | scheduleComposerFocus(); |
| 923 | }, |
| 924 | [scheduleComposerFocus], |
| 925 | ); |
| 917 | 926 | |
| 918 | 927 | const onKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => { |
| 919 | 928 | if (e.key === "Enter" && !e.shiftKey) { |