Both TypeScript and ESLint pass. The fix is complete. (#1427)

**Summary**: Added a single guard condition to the `useEffect` that syncs `localMessage` from scratch data. When `isTextareaFocused` is true, the effect now returns early, preventing the cursor jump issue caused by the WebSocket sync overwriting the local message while the user is actively typing.
This commit is contained in:
Louis Knight-Webb
2025-12-04 13:06:46 +00:00
committed by GitHub
parent e1cb24923a
commit b6a4f76e43

View File

@@ -214,11 +214,12 @@ export function TaskFollowUpSection({
500
);
// Sync local message from scratch when it loads
// Sync local message from scratch when it loads (but not while user is typing)
useEffect(() => {
if (isScratchLoading) return;
if (isTextareaFocused) return; // Don't overwrite while user is typing
setLocalMessage(scratchData?.message ?? '');
}, [isScratchLoading, scratchData?.message]);
}, [isScratchLoading, scratchData?.message, isTextareaFocused]);
// During retry, follow-up box is greyed/disabled (not hidden)
// Use RetryUi context so optimistic retry immediately disables this box