mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-14 08:01:02 -07:00
bug(ui) fix flicker refreshing background color (#19041)
This commit is contained in:
@@ -79,14 +79,12 @@ describe('ThemeDialog Snapshots', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should call refreshStatic when a theme is selected', async () => {
|
||||
const mockRefreshStatic = vi.fn();
|
||||
it('should call onSelect when a theme is selected', async () => {
|
||||
const settings = createMockSettings();
|
||||
const { stdin } = renderWithProviders(
|
||||
<ThemeDialog {...baseProps} settings={settings} />,
|
||||
{
|
||||
settings,
|
||||
uiActions: { refreshStatic: mockRefreshStatic },
|
||||
},
|
||||
);
|
||||
|
||||
@@ -96,7 +94,6 @@ describe('ThemeDialog Snapshots', () => {
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockRefreshStatic).toHaveBeenCalled();
|
||||
expect(baseProps.onSelect).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,7 +22,6 @@ import { getScopeMessageForSetting } from '../../utils/dialogScopeUtils.js';
|
||||
import { useKeypress } from '../hooks/useKeypress.js';
|
||||
import { useAlternateBuffer } from '../hooks/useAlternateBuffer.js';
|
||||
import { ScopeSelector } from './shared/ScopeSelector.js';
|
||||
import { useUIActions } from '../contexts/UIActionsContext.js';
|
||||
import { useUIState } from '../contexts/UIStateContext.js';
|
||||
|
||||
interface ThemeDialogProps {
|
||||
@@ -85,7 +84,6 @@ export function ThemeDialog({
|
||||
terminalWidth,
|
||||
}: ThemeDialogProps): React.JSX.Element {
|
||||
const isAlternateBuffer = useAlternateBuffer();
|
||||
const { refreshStatic } = useUIActions();
|
||||
const { terminalBackgroundColor } = useUIState();
|
||||
const [selectedScope, setSelectedScope] = useState<LoadableSettingScope>(
|
||||
SettingScope.User,
|
||||
@@ -142,9 +140,8 @@ export function ThemeDialog({
|
||||
const handleThemeSelect = useCallback(
|
||||
async (themeName: string) => {
|
||||
await onSelect(themeName, selectedScope);
|
||||
refreshStatic();
|
||||
},
|
||||
[onSelect, selectedScope, refreshStatic],
|
||||
[onSelect, selectedScope],
|
||||
);
|
||||
|
||||
const handleThemeHighlight = (themeName: string) => {
|
||||
@@ -159,9 +156,8 @@ export function ThemeDialog({
|
||||
const handleScopeSelect = useCallback(
|
||||
async (scope: LoadableSettingScope) => {
|
||||
await onSelect(highlightedThemeName, scope);
|
||||
refreshStatic();
|
||||
},
|
||||
[onSelect, highlightedThemeName, refreshStatic],
|
||||
[onSelect, highlightedThemeName],
|
||||
);
|
||||
|
||||
const [mode, setMode] = useState<'theme' | 'scope'>('theme');
|
||||
|
||||
Reference in New Issue
Block a user