diff --git a/ui/src/components/DiffViewer.tsx b/ui/src/components/DiffViewer.tsx index 83bf2250910d53913c9e062c911065ce97c5533e..043488b9d1f2ae612e67398d10823ad14c792958 100644 --- a/ui/src/components/DiffViewer.tsx +++ b/ui/src/components/DiffViewer.tsx @@ -164,10 +164,16 @@ function DiffViewer({ cwd, isOpen, onClose, onCommentTextChange, initialCommit } if (isOpen && !isMobile && !hasShownKeyboardHint.current && fileDiff) { hasShownKeyboardHint.current = true; setShowKeyboardHint(true); + } + }, [isOpen, isMobile, fileDiff]); + + // Auto-hide keyboard hint after 6 seconds + useEffect(() => { + if (showKeyboardHint) { const timer = setTimeout(() => setShowKeyboardHint(false), 6000); return () => clearTimeout(timer); } - }, [isOpen, isMobile, fileDiff]); + }, [showKeyboardHint]); // Load diffs when viewer opens, reset state when it closes useEffect(() => {