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:
committed by
GitHub
parent
e1cb24923a
commit
b6a4f76e43
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user