mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -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
|
// Initially should be witty phrase or tip
|
||||||
expect([...WITTY_LOADING_PHRASES, ...INFORMATIVE_TIPS]).toContain(
|
const possiblePhrases = [
|
||||||
result.current.currentLoadingPhrase,
|
...WITTY_LOADING_PHRASES,
|
||||||
);
|
...INFORMATIVE_TIPS.map((tip) => `Tip: ${tip}`),
|
||||||
|
];
|
||||||
|
expect(possiblePhrases).toContain(result.current.currentLoadingPhrase);
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
rerender({
|
rerender({
|
||||||
|
|||||||
@@ -141,7 +141,11 @@ describe('usePhraseCycler', () => {
|
|||||||
await waitUntilReady();
|
await waitUntilReady();
|
||||||
|
|
||||||
// Initial phrase on first activation should be a tip
|
// 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
|
// After the first interval, it should be a witty phrase
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
|
|||||||
@@ -89,7 +89,10 @@ export const usePhraseCycler = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const randomIndex = Math.floor(Math.random() * phraseList.length);
|
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
|
// Select an initial random phrase
|
||||||
|
|||||||
Reference in New Issue
Block a user