From bb52149a06012ddb5e5535d60decf40aa11ac344 Mon Sep 17 00:00:00 2001
From: Seth Troisi <sethtroisi@google.com>
Date: Mon, 5 May 2025 20:48:34 +0000
Subject: Move Intro to Help and only display after help command.

---
 packages/cli/src/ui/App.tsx | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

(limited to 'packages/cli/src/ui/App.tsx')

diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx
index e116c524..3052fb17 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -4,7 +4,7 @@
  * SPDX-License-Identifier: Apache-2.0
  */
 
-import React, { useCallback, useMemo, useRef, useState } from 'react';
+import React, { useCallback, useMemo, useState } from 'react';
 import { Box, Static, Text, useStdout } from 'ink';
 import { StreamingState, type HistoryItem } from './types.js';
 import { useGeminiStream } from './hooks/useGeminiStream.js';
@@ -19,7 +19,7 @@ import { ThemeDialog } from './components/ThemeDialog.js';
 import { useStartupWarnings } from './hooks/useAppEffects.js';
 import { shortenPath, type Config } from '@gemini-code/server';
 import { Colors } from './colors.js';
-import { Intro } from './components/Intro.js';
+import { Help } from './components/Help.js';
 import { LoadedSettings } from '../config/settings.js';
 import { Tips } from './components/Tips.js';
 import { ConsoleOutput } from './components/ConsolePatcher.js';
@@ -37,6 +37,7 @@ interface AppProps {
 export const App = ({ config, settings, cliVersion }: AppProps) => {
   const [history, setHistory] = useState<HistoryItem[]>([]);
   const [startupWarnings, setStartupWarnings] = useState<string[]>([]);
+  const [showHelp, setShowHelp] = useState<boolean>(false);
   const {
     isThemeDialogOpen,
     openThemeDialog,
@@ -55,7 +56,13 @@ export const App = ({ config, settings, cliVersion }: AppProps) => {
     initError,
     debugMessage,
     slashCommands,
-  } = useGeminiStream(setHistory, refreshStatic, config, openThemeDialog);
+  } = useGeminiStream(
+    setHistory,
+    refreshStatic,
+    setShowHelp,
+    config,
+    openThemeDialog,
+  );
   const { elapsedTime, currentLoadingPhrase } =
     useLoadingIndicator(streamingState);
 
@@ -139,7 +146,6 @@ export const App = ({ config, settings, cliVersion }: AppProps) => {
               <Box flexDirection="column" key={'header-' + index}>
                 <Header />
                 <Tips />
-                <Intro commands={slashCommands} />
               </Box>
             );
           }
@@ -167,6 +173,8 @@ export const App = ({ config, settings, cliVersion }: AppProps) => {
         </Box>
       )}
 
+      {showHelp && <Help commands={slashCommands} />}
+
       {startupWarnings.length > 0 && (
         <Box
           borderStyle="round"
-- 
cgit v1.2.3

