mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-13 23:01:09 -07:00
feat(cli): add global setting to disable UI spinners (#17234)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -7,16 +7,27 @@
|
||||
import Spinner from 'ink-spinner';
|
||||
import { type ComponentProps, useEffect } from 'react';
|
||||
import { debugState } from '../debug.js';
|
||||
import { useSettings } from '../contexts/SettingsContext.js';
|
||||
|
||||
export type SpinnerProps = ComponentProps<typeof Spinner>;
|
||||
|
||||
export const CliSpinner = (props: SpinnerProps) => {
|
||||
const settings = useSettings();
|
||||
const shouldShow = settings.merged.ui?.showSpinner !== false;
|
||||
|
||||
useEffect(() => {
|
||||
debugState.debugNumAnimatedComponents++;
|
||||
return () => {
|
||||
debugState.debugNumAnimatedComponents--;
|
||||
};
|
||||
}, []);
|
||||
if (shouldShow) {
|
||||
debugState.debugNumAnimatedComponents++;
|
||||
return () => {
|
||||
debugState.debugNumAnimatedComponents--;
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}, [shouldShow]);
|
||||
|
||||
if (!shouldShow) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <Spinner {...props} />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user