Skip to content

Commit 3cb4a15

Browse files
committed
chore(user-input): remove extraneous comments
1 parent a495d3a commit 3cb4a15

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/home/components/user-input

apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ export const UserInput = forwardRef<UserInputHandle, UserInputProps>(function Us
216216
}
217217
}, []) // eslint-disable-line react-hooks/exhaustive-deps -- intentional mount-only restore
218218

219-
// Skip the initial save — restore's setState calls haven't propagated yet, so
220-
// files/contexts are still empty and would transiently wipe a file-only draft.
221219
const isFirstSaveRef = useRef(true)
222220
useEffect(() => {
223221
if (isFirstSaveRef.current) {
@@ -426,7 +424,6 @@ export const UserInput = forwardRef<UserInputHandle, UserInputProps>(function Us
426424

427425
const newValue = `${before}${insertText}${after}`
428426
pendingCursorRef.current = newPos
429-
// Eagerly sync refs so successive drop-handler iterations see the updated position
430427
valueRef.current = newValue
431428
atInsertPosRef.current = newPos
432429
mentionRangeRef.current = null
@@ -536,9 +533,6 @@ export const UserInput = forwardRef<UserInputHandle, UserInputProps>(function Us
536533
wasSendingRef.current = isSending
537534
}, [isSending, textareaRef])
538535

539-
// Auto-focus on mount. The RAF runs after all synchronous mount effects, so if
540-
// the draft-restore effect already focused the textarea the isEditingElsewhere
541-
// guard below will be true and we skip the re-focus, preserving cursor position.
542536
useEffect(() => {
543537
const raf = window.requestAnimationFrame(() => {
544538
const active = document.activeElement

0 commit comments

Comments
 (0)