fix: /help remove flickering and respect clear shortcut (ctr+l) (#3611)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: Allen Hutchison <adh@google.com>
This commit is contained in:
Pyush Sinha
2025-08-04 09:53:50 -07:00
committed by GitHub
parent 16d29e2d6f
commit ca19aa9125
10 changed files with 72 additions and 70 deletions

View File

@@ -30,7 +30,6 @@ import {
SlashCommandProcessorResult,
StreamingState,
} from '../types.js';
import { Dispatch, SetStateAction } from 'react';
import { LoadedSettings } from '../../config/settings.js';
// --- MOCKS ---
@@ -257,7 +256,6 @@ describe('mergePartListUnions', () => {
// --- Tests for useGeminiStream Hook ---
describe('useGeminiStream', () => {
let mockAddItem: Mock;
let mockSetShowHelp: Mock;
let mockConfig: Config;
let mockOnDebugMessage: Mock;
let mockHandleSlashCommand: Mock;
@@ -269,7 +267,6 @@ describe('useGeminiStream', () => {
vi.clearAllMocks(); // Clear mocks before each test
mockAddItem = vi.fn();
mockSetShowHelp = vi.fn();
// Define the mock for getGeminiClient
const mockGetGeminiClient = vi.fn().mockImplementation(() => {
// MockedGeminiClientClass is defined in the module scope by the previous change.
@@ -382,7 +379,6 @@ describe('useGeminiStream', () => {
client: any;
history: HistoryItem[];
addItem: UseHistoryManagerReturn['addItem'];
setShowHelp: Dispatch<SetStateAction<boolean>>;
config: Config;
onDebugMessage: (message: string) => void;
handleSlashCommand: (
@@ -400,7 +396,6 @@ describe('useGeminiStream', () => {
props.client,
props.history,
props.addItem,
props.setShowHelp,
props.config,
props.onDebugMessage,
props.handleSlashCommand,
@@ -417,7 +412,6 @@ describe('useGeminiStream', () => {
client,
history: [],
addItem: mockAddItem as unknown as UseHistoryManagerReturn['addItem'],
setShowHelp: mockSetShowHelp,
config: mockConfig,
onDebugMessage: mockOnDebugMessage,
handleSlashCommand: mockHandleSlashCommand as unknown as (
@@ -542,7 +536,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -610,7 +603,6 @@ describe('useGeminiStream', () => {
client,
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -707,7 +699,6 @@ describe('useGeminiStream', () => {
client,
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -810,7 +801,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1161,7 +1151,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1213,7 +1202,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(testConfig),
[],
mockAddItem,
mockSetShowHelp,
testConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1262,7 +1250,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1309,7 +1296,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1357,7 +1343,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1445,7 +1430,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1500,7 +1484,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1577,7 +1560,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,
@@ -1630,7 +1612,6 @@ describe('useGeminiStream', () => {
new MockedGeminiClientClass(mockConfig),
[],
mockAddItem,
mockSetShowHelp,
mockConfig,
mockOnDebugMessage,
mockHandleSlashCommand,