mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 22:55:13 +00:00
chore: revert IDE specific ASCII logo (#17887)
This commit is contained in:
@@ -36,42 +36,3 @@ export const tinyAsciiLogo = `
|
|||||||
███░ ░░█████████
|
███░ ░░█████████
|
||||||
░░░ ░░░░░░░░░
|
░░░ ░░░░░░░░░
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const shortAsciiLogoIde = `
|
|
||||||
░░░░░░░░░ ░░░░░░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░
|
|
||||||
░░░ ░░░ ░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░░ ░░░░░ ░░░
|
|
||||||
░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░
|
|
||||||
█████████░░██████████ ██████ ░░██████░█████░██████ ░░█████ █████░
|
|
||||||
███░░ ███░███░░ ██████ ░██████░░███░░██████ ░█████ ███░░
|
|
||||||
███░░ ░░███░░ ███░███ ███ ███░░███░░███░███ ███░░ ███░░
|
|
||||||
███░░░░████░██████░░░░░███░░█████ ███░░███░░███░░███ ███░░░ ███░░░
|
|
||||||
███ ███ ███ ███ ███ ███ ███ ███ ██████ ███
|
|
||||||
███ ███ ███ ███ ███ ███ ███ █████ ███
|
|
||||||
█████████ ██████████ ███ ███ █████ ███ █████ █████
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const longAsciiLogoIde = `
|
|
||||||
░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░
|
|
||||||
░░░ ░░░ ░░░ ░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░░ ░░░░░ ░░░
|
|
||||||
░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░ ░░░
|
|
||||||
███ ░░░ █████████░░██████████ ██████ ░░██████░█████░██████ ░░█████ █████░
|
|
||||||
███ ░░░ ███░ ███░███░░ ██████ ░██████░░███░░██████ ░█████ ███░░
|
|
||||||
███ ███░░░ ░░███░░ ███░███ ███ ███░░███░░███░███ ███░░ ███░░
|
|
||||||
░░░ ███ ███ ░░░█████░██████░░░░░███░░█████ ███░░███░░███░░███ ███░░░ ███░░░
|
|
||||||
███ ███ ███ ███ ███ ███ ███ ███ ███ ██████ ███
|
|
||||||
███ ███ ███ ███ ███ ███ ███ ███ █████ ███
|
|
||||||
███ █████████ ██████████ ███ ███ █████ ███ █████ █████
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const tinyAsciiLogoIde = `
|
|
||||||
░░░ ░░░░░░░░░
|
|
||||||
░░░ ░░░ ░░░
|
|
||||||
░░░ ░░░
|
|
||||||
███ ░░░ █████████░░░
|
|
||||||
███ ░░░ ███░░ ███░░
|
|
||||||
███ ███░░ ░░░
|
|
||||||
░░░ ███ ███░░░░████░
|
|
||||||
███ ███ ███
|
|
||||||
███ ███ ███
|
|
||||||
███ █████████
|
|
||||||
`;
|
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ import { render } from '../../test-utils/render.js';
|
|||||||
import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
|
import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
|
||||||
import { Header } from './Header.js';
|
import { Header } from './Header.js';
|
||||||
import * as useTerminalSize from '../hooks/useTerminalSize.js';
|
import * as useTerminalSize from '../hooks/useTerminalSize.js';
|
||||||
import { longAsciiLogo, longAsciiLogoIde } from './AsciiArt.js';
|
import { longAsciiLogo } from './AsciiArt.js';
|
||||||
import * as semanticColors from '../semantic-colors.js';
|
import * as semanticColors from '../semantic-colors.js';
|
||||||
import * as terminalSetup from '../utils/terminalSetup.js';
|
|
||||||
import { Text } from 'ink';
|
import { Text } from 'ink';
|
||||||
import type React from 'react';
|
import type React from 'react';
|
||||||
|
|
||||||
@@ -18,9 +17,6 @@ vi.mock('../hooks/useTerminalSize.js');
|
|||||||
vi.mock('../hooks/useSnowfall.js', () => ({
|
vi.mock('../hooks/useSnowfall.js', () => ({
|
||||||
useSnowfall: vi.fn((art) => art),
|
useSnowfall: vi.fn((art) => art),
|
||||||
}));
|
}));
|
||||||
vi.mock('../utils/terminalSetup.js', () => ({
|
|
||||||
getTerminalProgram: vi.fn(),
|
|
||||||
}));
|
|
||||||
vi.mock('ink-gradient', () => {
|
vi.mock('ink-gradient', () => {
|
||||||
const MockGradient = ({ children }: { children: React.ReactNode }) => (
|
const MockGradient = ({ children }: { children: React.ReactNode }) => (
|
||||||
<>{children}</>
|
<>{children}</>
|
||||||
@@ -41,7 +37,6 @@ vi.mock('ink', async () => {
|
|||||||
describe('<Header />', () => {
|
describe('<Header />', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
vi.mocked(terminalSetup.getTerminalProgram).mockReturnValue(null);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders the long logo on a wide terminal', () => {
|
it('renders the long logo on a wide terminal', () => {
|
||||||
@@ -58,22 +53,6 @@ describe('<Header />', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses the IDE logo when running in an IDE', () => {
|
|
||||||
vi.spyOn(useTerminalSize, 'useTerminalSize').mockReturnValue({
|
|
||||||
columns: 120,
|
|
||||||
rows: 20,
|
|
||||||
});
|
|
||||||
vi.mocked(terminalSetup.getTerminalProgram).mockReturnValue('vscode');
|
|
||||||
|
|
||||||
render(<Header version="1.0.0" nightly={false} />);
|
|
||||||
expect(Text).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
children: longAsciiLogoIde,
|
|
||||||
}),
|
|
||||||
undefined,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('renders custom ASCII art when provided', () => {
|
it('renders custom ASCII art when provided', () => {
|
||||||
const customArt = 'CUSTOM ART';
|
const customArt = 'CUSTOM ART';
|
||||||
render(
|
render(
|
||||||
@@ -87,24 +66,13 @@ describe('<Header />', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders custom ASCII art as is when running in an IDE', () => {
|
|
||||||
const customArt = 'CUSTOM ART';
|
|
||||||
vi.mocked(terminalSetup.getTerminalProgram).mockReturnValue('vscode');
|
|
||||||
render(
|
|
||||||
<Header version="1.0.0" nightly={false} customAsciiArt={customArt} />,
|
|
||||||
);
|
|
||||||
expect(Text).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
children: customArt,
|
|
||||||
}),
|
|
||||||
undefined,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('displays the version number when nightly is true', () => {
|
it('displays the version number when nightly is true', () => {
|
||||||
render(<Header version="1.0.0" nightly={true} />);
|
render(<Header version="1.0.0" nightly={true} />);
|
||||||
const textCalls = (Text as Mock).mock.calls;
|
const textCalls = (Text as Mock).mock.calls;
|
||||||
expect(textCalls[1][0].children.join('')).toBe('v1.0.0');
|
const versionText = Array.isArray(textCalls[1][0].children)
|
||||||
|
? textCalls[1][0].children.join('')
|
||||||
|
: textCalls[1][0].children;
|
||||||
|
expect(versionText).toBe('v1.0.0');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not display the version number when nightly is false', () => {
|
it('does not display the version number when nightly is false', () => {
|
||||||
|
|||||||
@@ -7,17 +7,9 @@
|
|||||||
import type React from 'react';
|
import type React from 'react';
|
||||||
import { Box } from 'ink';
|
import { Box } from 'ink';
|
||||||
import { ThemedGradient } from './ThemedGradient.js';
|
import { ThemedGradient } from './ThemedGradient.js';
|
||||||
import {
|
import { shortAsciiLogo, longAsciiLogo, tinyAsciiLogo } from './AsciiArt.js';
|
||||||
shortAsciiLogo,
|
|
||||||
longAsciiLogo,
|
|
||||||
tinyAsciiLogo,
|
|
||||||
shortAsciiLogoIde,
|
|
||||||
longAsciiLogoIde,
|
|
||||||
tinyAsciiLogoIde,
|
|
||||||
} from './AsciiArt.js';
|
|
||||||
import { getAsciiArtWidth } from '../utils/textUtils.js';
|
import { getAsciiArtWidth } from '../utils/textUtils.js';
|
||||||
import { useTerminalSize } from '../hooks/useTerminalSize.js';
|
import { useTerminalSize } from '../hooks/useTerminalSize.js';
|
||||||
import { getTerminalProgram } from '../utils/terminalSetup.js';
|
|
||||||
import { useSnowfall } from '../hooks/useSnowfall.js';
|
import { useSnowfall } from '../hooks/useSnowfall.js';
|
||||||
|
|
||||||
interface HeaderProps {
|
interface HeaderProps {
|
||||||
@@ -32,7 +24,6 @@ export const Header: React.FC<HeaderProps> = ({
|
|||||||
nightly,
|
nightly,
|
||||||
}) => {
|
}) => {
|
||||||
const { columns: terminalWidth } = useTerminalSize();
|
const { columns: terminalWidth } = useTerminalSize();
|
||||||
const isIde = getTerminalProgram();
|
|
||||||
let displayTitle;
|
let displayTitle;
|
||||||
const widthOfLongLogo = getAsciiArtWidth(longAsciiLogo);
|
const widthOfLongLogo = getAsciiArtWidth(longAsciiLogo);
|
||||||
const widthOfShortLogo = getAsciiArtWidth(shortAsciiLogo);
|
const widthOfShortLogo = getAsciiArtWidth(shortAsciiLogo);
|
||||||
@@ -40,11 +31,11 @@ export const Header: React.FC<HeaderProps> = ({
|
|||||||
if (customAsciiArt) {
|
if (customAsciiArt) {
|
||||||
displayTitle = customAsciiArt;
|
displayTitle = customAsciiArt;
|
||||||
} else if (terminalWidth >= widthOfLongLogo) {
|
} else if (terminalWidth >= widthOfLongLogo) {
|
||||||
displayTitle = isIde ? longAsciiLogoIde : longAsciiLogo;
|
displayTitle = longAsciiLogo;
|
||||||
} else if (terminalWidth >= widthOfShortLogo) {
|
} else if (terminalWidth >= widthOfShortLogo) {
|
||||||
displayTitle = isIde ? shortAsciiLogoIde : shortAsciiLogo;
|
displayTitle = shortAsciiLogo;
|
||||||
} else {
|
} else {
|
||||||
displayTitle = isIde ? tinyAsciiLogoIde : tinyAsciiLogo;
|
displayTitle = tinyAsciiLogo;
|
||||||
}
|
}
|
||||||
|
|
||||||
const artWidth = getAsciiArtWidth(displayTitle);
|
const artWidth = getAsciiArtWidth(displayTitle);
|
||||||
|
|||||||
Reference in New Issue
Block a user