mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-25 21:41:12 -07:00
feat(cli): prepend Tip: to informative tips in loading area
This commit is contained in:
@@ -107,9 +107,11 @@ describe('useLoadingIndicator', () => {
|
||||
);
|
||||
|
||||
// Initially should be witty phrase or tip
|
||||
expect([...WITTY_LOADING_PHRASES, ...INFORMATIVE_TIPS]).toContain(
|
||||
result.current.currentLoadingPhrase,
|
||||
);
|
||||
const possiblePhrases = [
|
||||
...WITTY_LOADING_PHRASES,
|
||||
...INFORMATIVE_TIPS.map((tip) => `Tip: ${tip}`),
|
||||
];
|
||||
expect(possiblePhrases).toContain(result.current.currentLoadingPhrase);
|
||||
|
||||
await act(async () => {
|
||||
rerender({
|
||||
|
||||
@@ -141,7 +141,11 @@ describe('usePhraseCycler', () => {
|
||||
await waitUntilReady();
|
||||
|
||||
// Initial phrase on first activation should be a tip
|
||||
expect(INFORMATIVE_TIPS).toContain(lastFrame().trim());
|
||||
await act(async () => {
|
||||
await vi.advanceTimersByTimeAsync(0);
|
||||
});
|
||||
expect(lastFrame()?.startsWith('Tip: ')).toBe(true);
|
||||
expect(INFORMATIVE_TIPS).toContain(lastFrame()!.replace('Tip: ', ''));
|
||||
|
||||
// After the first interval, it should be a witty phrase
|
||||
await act(async () => {
|
||||
|
||||
@@ -89,7 +89,10 @@ export const usePhraseCycler = (
|
||||
}
|
||||
|
||||
const randomIndex = Math.floor(Math.random() * phraseList.length);
|
||||
setCurrentLoadingPhrase(phraseList[randomIndex]);
|
||||
const phrase = phraseList[randomIndex];
|
||||
setCurrentLoadingPhrase(
|
||||
phraseList === INFORMATIVE_TIPS ? `Tip: ${phrase}` : phrase,
|
||||
);
|
||||
};
|
||||
|
||||
// Select an initial random phrase
|
||||
|
||||
Reference in New Issue
Block a user