fix: keyboard shortcut toast disappears after 6 seconds

Philip Zeyliger and Shelley created

Prompt: [user showed screenshot of stuck toast] I was expecting the toast
for shelley's keyboard shortcuts to disappear after a while.

Split the keyboard hint logic into two effects:
1. One to show the hint on first open (when fileDiff is ready)
2. One to auto-hide after 6 seconds (triggered by showKeyboardHint changing)

This ensures the timer runs reliably regardless of how the dependencies
of the first effect change.

Co-authored-by: Shelley <shelley@exe.dev>

Change summary

ui/src/components/DiffViewer.tsx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Detailed changes

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(() => {