mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-25 21:41:12 -07:00
feat: launch Gemini 3 in Gemini CLI 🚀🚀🚀 (in main) (#13287)
Co-authored-by: Adam Weidman <65992621+adamfweidman@users.noreply.github.com> Co-authored-by: Sehoon Shon <sshon@google.com> Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com> Co-authored-by: Sandy Tao <sandytao520@icloud.com> Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com> Co-authored-by: Aishanee Shah <aishaneeshah@gmail.com> Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com> Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com> Co-authored-by: Jacob Richman <jacob314@gmail.com> Co-authored-by: joshualitt <joshualitt@google.com> Co-authored-by: Jenna Inouye <jinouye@google.com>
This commit is contained in:
@@ -10,6 +10,11 @@ import { Tips } from './Tips.js';
|
||||
import { useSettings } from '../contexts/SettingsContext.js';
|
||||
import { useConfig } from '../contexts/ConfigContext.js';
|
||||
import { useUIState } from '../contexts/UIStateContext.js';
|
||||
import { Banner } from './Banner.js';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
import { Colors } from '../colors.js';
|
||||
import { persistentState } from '../../utils/persistentState.js';
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
|
||||
interface AppHeaderProps {
|
||||
version: string;
|
||||
@@ -18,12 +23,46 @@ interface AppHeaderProps {
|
||||
export const AppHeader = ({ version }: AppHeaderProps) => {
|
||||
const settings = useSettings();
|
||||
const config = useConfig();
|
||||
const { nightly } = useUIState();
|
||||
const { nightly, mainAreaWidth, bannerData, bannerVisible } = useUIState();
|
||||
|
||||
const [defaultBannerShownCount] = useState(
|
||||
() => persistentState.get('defaultBannerShownCount') || 0,
|
||||
);
|
||||
|
||||
const { defaultText, warningText } = bannerData;
|
||||
|
||||
const showDefaultBanner =
|
||||
warningText === '' &&
|
||||
!config.getPreviewFeatures() &&
|
||||
defaultBannerShownCount < 5;
|
||||
const bannerText = showDefaultBanner ? defaultText : warningText;
|
||||
const unescapedBannerText = bannerText.replace(/\\n/g, '\n');
|
||||
|
||||
const defaultColor = Colors.AccentBlue;
|
||||
const fontColor = warningText === '' ? defaultColor : theme.status.warning;
|
||||
|
||||
const hasIncrementedRef = useRef(false);
|
||||
useEffect(() => {
|
||||
if (showDefaultBanner && defaultText && !hasIncrementedRef.current) {
|
||||
hasIncrementedRef.current = true;
|
||||
const current = persistentState.get('defaultBannerShownCount') || 0;
|
||||
persistentState.set('defaultBannerShownCount', current + 1);
|
||||
}
|
||||
}, [showDefaultBanner, defaultText]);
|
||||
|
||||
return (
|
||||
<Box flexDirection="column">
|
||||
{!(settings.merged.ui?.hideBanner || config.getScreenReader()) && (
|
||||
<Header version={version} nightly={nightly} />
|
||||
<>
|
||||
<Header version={version} nightly={nightly} />
|
||||
{bannerVisible && unescapedBannerText && (
|
||||
<Banner
|
||||
width={mainAreaWidth}
|
||||
bannerText={unescapedBannerText}
|
||||
color={fontColor}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{!(settings.merged.ui?.hideTips || config.getScreenReader()) && (
|
||||
<Tips config={config} />
|
||||
|
||||
Reference in New Issue
Block a user