Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

Commit ae98953

Browse files
authored
Merge branch 'google-gemini:main' into main
2 parents 887a967 + 567761f commit ae98953

3 files changed

Lines changed: 9 additions & 89 deletions

File tree

packages/cli/src/ui/components/AsciiArt.ts

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,3 @@ export const tinyAsciiLogo = `
3636
███░ ░░█████████
3737
░░░ ░░░░░░░░░
3838
`;
39-
40-
export const shortAsciiLogoIde = `
41-
░░░░░░░░░ ░░░░░░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░
42-
░░░ ░░░ ░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░░ ░░░░░ ░░░
43-
░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░
44-
█████████░░██████████ ██████ ░░██████░█████░██████ ░░█████ █████░
45-
███░░ ███░███░░ ██████ ░██████░░███░░██████ ░█████ ███░░
46-
███░░ ░░███░░ ███░███ ███ ███░░███░░███░███ ███░░ ███░░
47-
███░░░░████░██████░░░░░███░░█████ ███░░███░░███░░███ ███░░░ ███░░░
48-
███ ███ ███ ███ ███ ███ ███ ███ ██████ ███
49-
███ ███ ███ ███ ███ ███ ███ █████ ███
50-
█████████ ██████████ ███ ███ █████ ███ █████ █████
51-
`;
52-
53-
export const longAsciiLogoIde = `
54-
░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░
55-
░░░ ░░░ ░░░ ░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░░ ░░░░░ ░░░
56-
░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░
57-
███ ░░░ █████████░░██████████ ██████ ░░██████░█████░██████ ░░█████ █████░
58-
███ ░░░ ███░ ███░███░░ ██████ ░██████░░███░░██████ ░█████ ███░░
59-
███ ███░░░ ░░███░░ ███░███ ███ ███░░███░░███░███ ███░░ ███░░
60-
░░░ ███ ███ ░░░█████░██████░░░░░███░░█████ ███░░███░░███░░███ ███░░░ ███░░░
61-
███ ███ ███ ███ ███ ███ ███ ███ ███ ██████ ███
62-
███ ███ ███ ███ ███ ███ ███ ███ █████ ███
63-
███ █████████ ██████████ ███ ███ █████ ███ █████ █████
64-
`;
65-
66-
export const tinyAsciiLogoIde = `
67-
░░░ ░░░░░░░░░
68-
░░░ ░░░ ░░░
69-
░░░ ░░░
70-
███ ░░░ █████████░░░
71-
███ ░░░ ███░░ ███░░
72-
███ ███░░ ░░░
73-
░░░ ███ ███░░░░████░
74-
███ ███ ███
75-
███ ███ ███
76-
███ █████████
77-
`;

packages/cli/src/ui/components/Header.test.tsx

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,15 @@ import { render } from '../../test-utils/render.js';
88
import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
99
import { Header } from './Header.js';
1010
import * as useTerminalSize from '../hooks/useTerminalSize.js';
11-
import { longAsciiLogo, longAsciiLogoIde } from './AsciiArt.js';
11+
import { longAsciiLogo } from './AsciiArt.js';
1212
import * as semanticColors from '../semantic-colors.js';
13-
import * as terminalSetup from '../utils/terminalSetup.js';
1413
import { Text } from 'ink';
1514
import type React from 'react';
1615

1716
vi.mock('../hooks/useTerminalSize.js');
1817
vi.mock('../hooks/useSnowfall.js', () => ({
1918
useSnowfall: vi.fn((art) => art),
2019
}));
21-
vi.mock('../utils/terminalSetup.js', () => ({
22-
getTerminalProgram: vi.fn(),
23-
}));
2420
vi.mock('ink-gradient', () => {
2521
const MockGradient = ({ children }: { children: React.ReactNode }) => (
2622
<>{children}</>
@@ -41,7 +37,6 @@ vi.mock('ink', async () => {
4137
describe('<Header />', () => {
4238
beforeEach(() => {
4339
vi.clearAllMocks();
44-
vi.mocked(terminalSetup.getTerminalProgram).mockReturnValue(null);
4540
});
4641

4742
it('renders the long logo on a wide terminal', () => {
@@ -58,22 +53,6 @@ describe('<Header />', () => {
5853
);
5954
});
6055

61-
it('uses the IDE logo when running in an IDE', () => {
62-
vi.spyOn(useTerminalSize, 'useTerminalSize').mockReturnValue({
63-
columns: 120,
64-
rows: 20,
65-
});
66-
vi.mocked(terminalSetup.getTerminalProgram).mockReturnValue('vscode');
67-
68-
render(<Header version="1.0.0" nightly={false} />);
69-
expect(Text).toHaveBeenCalledWith(
70-
expect.objectContaining({
71-
children: longAsciiLogoIde,
72-
}),
73-
undefined,
74-
);
75-
});
76-
7756
it('renders custom ASCII art when provided', () => {
7857
const customArt = 'CUSTOM ART';
7958
render(
@@ -87,24 +66,13 @@ describe('<Header />', () => {
8766
);
8867
});
8968

90-
it('renders custom ASCII art as is when running in an IDE', () => {
91-
const customArt = 'CUSTOM ART';
92-
vi.mocked(terminalSetup.getTerminalProgram).mockReturnValue('vscode');
93-
render(
94-
<Header version="1.0.0" nightly={false} customAsciiArt={customArt} />,
95-
);
96-
expect(Text).toHaveBeenCalledWith(
97-
expect.objectContaining({
98-
children: customArt,
99-
}),
100-
undefined,
101-
);
102-
});
103-
10469
it('displays the version number when nightly is true', () => {
10570
render(<Header version="1.0.0" nightly={true} />);
10671
const textCalls = (Text as Mock).mock.calls;
107-
expect(textCalls[1][0].children.join('')).toBe('v1.0.0');
72+
const versionText = Array.isArray(textCalls[1][0].children)
73+
? textCalls[1][0].children.join('')
74+
: textCalls[1][0].children;
75+
expect(versionText).toBe('v1.0.0');
10876
});
10977

11078
it('does not display the version number when nightly is false', () => {

packages/cli/src/ui/components/Header.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,9 @@
77
import type React from 'react';
88
import { Box } from 'ink';
99
import { ThemedGradient } from './ThemedGradient.js';
10-
import {
11-
shortAsciiLogo,
12-
longAsciiLogo,
13-
tinyAsciiLogo,
14-
shortAsciiLogoIde,
15-
longAsciiLogoIde,
16-
tinyAsciiLogoIde,
17-
} from './AsciiArt.js';
10+
import { shortAsciiLogo, longAsciiLogo, tinyAsciiLogo } from './AsciiArt.js';
1811
import { getAsciiArtWidth } from '../utils/textUtils.js';
1912
import { useTerminalSize } from '../hooks/useTerminalSize.js';
20-
import { getTerminalProgram } from '../utils/terminalSetup.js';
2113
import { useSnowfall } from '../hooks/useSnowfall.js';
2214

2315
interface HeaderProps {
@@ -32,19 +24,18 @@ export const Header: React.FC<HeaderProps> = ({
3224
nightly,
3325
}) => {
3426
const { columns: terminalWidth } = useTerminalSize();
35-
const isIde = getTerminalProgram();
3627
let displayTitle;
3728
const widthOfLongLogo = getAsciiArtWidth(longAsciiLogo);
3829
const widthOfShortLogo = getAsciiArtWidth(shortAsciiLogo);
3930

4031
if (customAsciiArt) {
4132
displayTitle = customAsciiArt;
4233
} else if (terminalWidth >= widthOfLongLogo) {
43-
displayTitle = isIde ? longAsciiLogoIde : longAsciiLogo;
34+
displayTitle = longAsciiLogo;
4435
} else if (terminalWidth >= widthOfShortLogo) {
45-
displayTitle = isIde ? shortAsciiLogoIde : shortAsciiLogo;
36+
displayTitle = shortAsciiLogo;
4637
} else {
47-
displayTitle = isIde ? tinyAsciiLogoIde : tinyAsciiLogo;
38+
displayTitle = tinyAsciiLogo;
4839
}
4940

5041
const artWidth = getAsciiArtWidth(displayTitle);

0 commit comments

Comments
 (0)