fix: remove conflicting suggestions visibility notifications

Remove duplicate useEffect that was causing suggestions visibility state
to diverge from the actual active completion. The original useEffect at
line 760 already correctly tracks activeCompletion.showSuggestions, which
dynamically selects the current active completion source (regular, reverse
search, or command search).

The removed useEffect used OR logic across all three completion sources,
which caused hasSuggestionsVisible in AppContainer to flip incorrectly
during command-search mode when background completion state changed.

This fix ensures Tab key blocking/unblocking happens at the correct times
on Windows.
This commit is contained in:
LaZzyMan 2026-02-06 17:10:27 +08:00
parent 9a6aafa721
commit 2fe9cbcd17

View file

@ -188,22 +188,6 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
}
}, [showEscapePrompt, onEscapePromptChange]);
// Notify parent component about suggestions visibility changes
useEffect(() => {
if (onSuggestionsVisibilityChange) {
const hasSuggestions =
completion.showSuggestions ||
reverseSearchCompletion.showSuggestions ||
commandSearchCompletion.showSuggestions;
onSuggestionsVisibilityChange(hasSuggestions);
}
}, [
completion.showSuggestions,
reverseSearchCompletion.showSuggestions,
commandSearchCompletion.showSuggestions,
onSuggestionsVisibilityChange,
]);
// Clear escape prompt timer on unmount
useEffect(
() => () => {