mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 18:11:02 -07:00
fix(ui): Clear input prompt on Escape key press (#13335)
This commit is contained in:
@@ -1050,7 +1050,7 @@ describe('useGeminiStream', () => {
|
||||
|
||||
simulateEscapeKeyPress();
|
||||
|
||||
expect(cancelSubmitSpy).toHaveBeenCalled();
|
||||
expect(cancelSubmitSpy).toHaveBeenCalledWith(false);
|
||||
});
|
||||
|
||||
it('should call setShellInputFocused(false) when escape is pressed', async () => {
|
||||
@@ -1968,7 +1968,7 @@ describe('useGeminiStream', () => {
|
||||
|
||||
// Check that onCancelSubmit was called
|
||||
await waitFor(() => {
|
||||
expect(onCancelSubmitSpy).toHaveBeenCalled();
|
||||
expect(onCancelSubmitSpy).toHaveBeenCalledWith(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ export const useGeminiStream = (
|
||||
modelSwitchedFromQuotaError: boolean,
|
||||
setModelSwitchedFromQuotaError: React.Dispatch<React.SetStateAction<boolean>>,
|
||||
onEditorClose: () => void,
|
||||
onCancelSubmit: () => void,
|
||||
onCancelSubmit: (shouldRestorePrompt?: boolean) => void,
|
||||
setShellInputFocused: (value: boolean) => void,
|
||||
terminalWidth: number,
|
||||
terminalHeight: number,
|
||||
@@ -324,7 +324,7 @@ export const useGeminiStream = (
|
||||
setIsResponding(false);
|
||||
}
|
||||
|
||||
onCancelSubmit();
|
||||
onCancelSubmit(false);
|
||||
setShellInputFocused(false);
|
||||
}, [
|
||||
streamingState,
|
||||
@@ -690,7 +690,7 @@ export const useGeminiStream = (
|
||||
|
||||
const handleContextWindowWillOverflowEvent = useCallback(
|
||||
(estimatedRequestTokenCount: number, remainingTokenCount: number) => {
|
||||
onCancelSubmit();
|
||||
onCancelSubmit(true);
|
||||
|
||||
const limit = tokenLimit(config.getModel());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user