From 7923148490250a9ce8ad4fc052f3ae3238091470 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Thu, 11 Jun 2026 14:03:16 -0700 Subject: [PATCH] FN-6211: prevent QuickEntry option taps from refocusing input Prevents mobile option taps from re-opening the QuickEntry textarea keyboard. - suppresses textarea refocus briefly while QuickEntry action buttons handle touch interactions - only prevents default touch behavior when the textarea is already focused - adds mobile regression coverage for blurred action toggles, menus, attachments, refine, planning, subtasks, and save flows Files changed: .../dashboard/app/components/QuickEntryBox.tsx | 17 ++- .../components/__tests__/QuickEntryBox.test.tsx | 148 +++++++++++++++++++++ 2 files changed, 164 insertions(+), 1 deletion(-) Fusion-Task-Id: FN-6211 Fusion-Task-Lineage: 9e20c4e3-8b19-4374-b492-745a92c7bb10 --- .../app/components/QuickEntryBox.tsx | 17 +- .../__tests__/QuickEntryBox.test.tsx | 148 ++++++++++++++++++ 2 files changed, 164 insertions(+), 1 deletion(-) diff --git a/packages/dashboard/app/components/QuickEntryBox.tsx b/packages/dashboard/app/components/QuickEntryBox.tsx index 4a639b7bca..f2520b6122 100644 --- a/packages/dashboard/app/components/QuickEntryBox.tsx +++ b/packages/dashboard/app/components/QuickEntryBox.tsx @@ -105,6 +105,7 @@ export function QuickEntryBox({ onCreate, addToast, tasks = [], availableModels, const textareaRef = useRef(null); const fileInputRef = useRef(null); const touchButtonRef = useRef(null); + const suppressRefocusRef = useRef(false); const justResetRef = useRef(false); const previousProjectIdRef = useRef(projectId); const [pendingImages, setPendingImages] = useState([]); @@ -736,6 +737,11 @@ export function QuickEntryBox({ onCreate, addToast, tasks = [], availableModels, }, []); const handleFocus = useCallback(() => { + if (suppressRefocusRef.current) { + textareaRef.current?.blur(); + return; + } + // Auto-expand on focus when autoExpand prop is true (default) if (autoExpand) { setIsExpanded(true); @@ -1487,15 +1493,24 @@ export function QuickEntryBox({ onCreate, addToast, tasks = [], availableModels, if (!(target instanceof Element)) return; const button = target.closest("button"); if (button && !button.disabled) { - e.preventDefault(); + if (document.activeElement === textareaRef.current) { + e.preventDefault(); + } touchButtonRef.current = button; + suppressRefocusRef.current = true; } }} onTouchEnd={() => { touchButtonRef.current = null; + window.setTimeout(() => { + suppressRefocusRef.current = false; + }, 150); }} onTouchCancel={() => { touchButtonRef.current = null; + window.setTimeout(() => { + suppressRefocusRef.current = false; + }, 150); }} >