From d872527e789c964aff5b41bfb8e9ee817bcd3d0b Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 31 May 2026 01:12:38 -0700 Subject: [PATCH] perf: clean smart name focus frame effect (#4012) --- .../new-workspace/SmartWorkspaceNameField.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx b/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx index 14a66888b..71f3299ac 100644 --- a/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx +++ b/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx @@ -231,15 +231,6 @@ export default function SmartWorkspaceNameField({ [gitlabAvailable, linearAvailable, textOnly] ) - const setInputNode = useCallback( - (node: HTMLInputElement | null) => { - localInputRef.current = node - if (inputRef) { - inputRef.current = node - } - }, - [inputRef] - ) const selectedSourceFocusKey = selectedSource ? `${selectedSource.kind}:${selectedSource.label}:${selectedSource.url ?? ''}` : null @@ -271,7 +262,18 @@ export default function SmartWorkspaceNameField({ localInputFocusFrameRef.current = null }, []) - useEffect(() => cancelLocalInputFocusFrame, [cancelLocalInputFocusFrame]) + const setInputNode = useCallback( + (node: HTMLInputElement | null) => { + if (node === null) { + cancelLocalInputFocusFrame() + } + localInputRef.current = node + if (inputRef) { + inputRef.current = node + } + }, + [cancelLocalInputFocusFrame, inputRef] + ) useEffect(() => { if (disabled || textOnly) {