From 9348dd488f155aa731b5062a0b10c7cd2e5d9399 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Thu, 28 May 2026 16:55:22 -0400 Subject: [PATCH] fix: advance create workspace after PR link selection (#3010) Co-authored-by: Orca --- .../new-workspace/SmartWorkspaceNameField.tsx | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx b/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx index 96b9a9f6f..f3356ce7a 100644 --- a/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx +++ b/src/renderer/src/components/new-workspace/SmartWorkspaceNameField.tsx @@ -199,6 +199,7 @@ export default function SmartWorkspaceNameField({ const [linearLoading, setLinearLoading] = useState(false) const [commandValue, setCommandValue] = useState('') const localInputRef = useRef(null) + const selectedSourceRef = useRef(null) const tabsListRef = useRef(null) const repoSlugCacheRef = useRef>(new Map()) const handledCrossRepoUrlRef = useRef(null) @@ -309,6 +310,9 @@ export default function SmartWorkspaceNameField({ useEffect(() => { if (selectedSource) { setOpen(false) + // Why: after Enter accepts a PR/issue row, the input unmounts. Keep the + // keyboard flow on the source field so the next Enter advances to Agent. + requestAnimationFrame(() => selectedSourceRef.current?.focus({ preventScroll: true })) } }, [selectedSource]) @@ -974,7 +978,25 @@ export default function SmartWorkspaceNameField({ // parent; without them the inner truncate's intrinsic // min-content (long PR title) propagates up and pushes the // dialog wider than its max-w. -
+
{ + if ( + event.currentTarget !== event.target || + event.key !== 'Enter' || + event.metaKey || + event.ctrlKey || + event.shiftKey || + event.altKey + ) { + return + } + event.preventDefault() + onPlainEnter?.() + }} + className="flex h-9 w-full min-w-0 items-center gap-2 rounded-md border border-input bg-transparent px-2.5 text-sm shadow-xs outline-none focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50" + > {selectedSource.label}