mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-20 02:51:55 -07:00
feat(cli): add ui.hideFooterDuringApproval setting and improve dialog instructions
This commit is contained in:
@@ -619,6 +619,16 @@ const SETTINGS_SCHEMA = {
|
||||
description: 'Hide the footer from the UI',
|
||||
showInDialog: true,
|
||||
},
|
||||
hideFooterDuringApproval: {
|
||||
type: 'boolean',
|
||||
label: 'Hide Footer During Approval',
|
||||
category: 'UI',
|
||||
requiresRestart: false,
|
||||
default: true,
|
||||
description:
|
||||
'Hide the footer when a tool approval request is displayed.',
|
||||
showInDialog: true,
|
||||
},
|
||||
newFooterLayout: {
|
||||
type: 'enum',
|
||||
label: 'New Footer Layout',
|
||||
|
||||
@@ -136,7 +136,7 @@ HistoryItemDisplay
|
||||
│ Allow execution of: 'ls'? │
|
||||
│ │
|
||||
│ ● 1. Allow once │
|
||||
│ 2. Allow for this session │
|
||||
│ 2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to cancel │
|
||||
│ 3. No, suggest changes (esc) │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
@@ -751,6 +751,8 @@ export const Composer = ({ isFocused = true }: { isFocused?: boolean }) => {
|
||||
|
||||
{showUiDetails &&
|
||||
!settings.merged.ui.hideFooter &&
|
||||
(!hasPendingActionRequired ||
|
||||
!settings.merged.ui.hideFooterDuringApproval) &&
|
||||
!isScreenReaderEnabled && <Footer />}
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -9,6 +9,7 @@ import { type ReactNode } from 'react';
|
||||
import { theme } from '../semantic-colors.js';
|
||||
import { MarkdownDisplay } from '../utils/MarkdownDisplay.js';
|
||||
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
|
||||
import { DialogFooter } from './shared/DialogFooter.js';
|
||||
|
||||
type ConsentPromptProps = {
|
||||
// If a simple string is given, it will render using markdown by default.
|
||||
@@ -37,7 +38,7 @@ export const ConsentPrompt = (props: ConsentPromptProps) => {
|
||||
) : (
|
||||
prompt
|
||||
)}
|
||||
<Box marginTop={1}>
|
||||
<Box marginTop={1} flexDirection="column">
|
||||
<RadioButtonSelect
|
||||
items={[
|
||||
{ label: 'Yes', value: true, key: 'Yes' },
|
||||
@@ -45,6 +46,10 @@ export const ConsentPrompt = (props: ConsentPromptProps) => {
|
||||
]}
|
||||
onSelect={onConfirm}
|
||||
/>
|
||||
<DialogFooter
|
||||
primaryAction="Enter to select"
|
||||
navigationActions="↑/↓ to navigate"
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -11,8 +11,8 @@ exports[`ToolConfirmationQueue > calculates availableContentHeight based on avai
|
||||
│ Apply this change? │
|
||||
│ │
|
||||
│ ● 1. Allow once │
|
||||
│ 2. Allow for this session │
|
||||
│ 3. Modify with external editor │
|
||||
│ 2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to │
|
||||
│ 3. Modify with external edi…cancel │
|
||||
│ 4. No, suggest changes (esc) │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────╯
|
||||
@@ -33,8 +33,8 @@ exports[`ToolConfirmationQueue > does not render expansion hint when constrainHe
|
||||
│ Apply this change? │
|
||||
│ │
|
||||
│ ● 1. Allow once │
|
||||
│ 2. Allow for this session │
|
||||
│ 3. Modify with external editor │
|
||||
│ 2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to │
|
||||
│ 3. Modify with external edi…cancel │
|
||||
│ 4. No, suggest changes (esc) │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────╯
|
||||
@@ -101,8 +101,8 @@ exports[`ToolConfirmationQueue > renders expansion hint when content is long and
|
||||
│ Apply this change? │
|
||||
│ │
|
||||
│ ● 1. Allow once │
|
||||
│ 2. Allow for this session │
|
||||
│ 3. Modify with external editor │
|
||||
│ 2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to │
|
||||
│ 3. Modify with external edi…cancel │
|
||||
│ 4. No, suggest changes (esc) │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────╯
|
||||
@@ -120,8 +120,8 @@ exports[`ToolConfirmationQueue > renders the confirming tool with progress indic
|
||||
│ Allow execution of: 'ls'? │
|
||||
│ │
|
||||
│ ● 1. Allow once │
|
||||
│ 2. Allow for this session │
|
||||
│ 3. No, suggest changes (esc) │
|
||||
│ 2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to │
|
||||
│ 3. No, suggest changes (e… cancel │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────╯
|
||||
"
|
||||
|
||||
@@ -574,7 +574,7 @@ describe('ToolConfirmationMessage', () => {
|
||||
|
||||
const output = lastFrame();
|
||||
expect(output).toContain('MCP Tool Details:');
|
||||
expect(output).toContain('(press Ctrl+O to expand MCP tool details)');
|
||||
expect(output).toContain('Ctrl+O to expand details');
|
||||
expect(output).not.toContain('https://www.google.co.jp');
|
||||
expect(output).not.toContain('Navigates browser to a URL.');
|
||||
unmount();
|
||||
@@ -606,7 +606,7 @@ describe('ToolConfirmationMessage', () => {
|
||||
|
||||
const output = lastFrame();
|
||||
expect(output).toContain('MCP Tool Details:');
|
||||
expect(output).toContain('(press Ctrl+O to expand MCP tool details)');
|
||||
expect(output).toContain('Ctrl+O to expand details');
|
||||
expect(output).not.toContain('Invocation Arguments:');
|
||||
unmount();
|
||||
});
|
||||
|
||||
@@ -40,6 +40,7 @@ import {
|
||||
import { AskUserDialog } from '../AskUserDialog.js';
|
||||
import { ExitPlanModeDialog } from '../ExitPlanModeDialog.js';
|
||||
import { WarningMessage } from './WarningMessage.js';
|
||||
import { DialogFooter } from '../shared/DialogFooter.js';
|
||||
import {
|
||||
getDeceptiveUrlDetails,
|
||||
toUnicodeUrl,
|
||||
@@ -603,17 +604,8 @@ export const ToolConfirmationMessage: React.FC<
|
||||
{hasMcpToolDetails && (
|
||||
<Box flexDirection="column" marginTop={1}>
|
||||
<Text color={theme.text.primary}>MCP Tool Details:</Text>
|
||||
{isMcpToolDetailsExpanded ? (
|
||||
<>
|
||||
<Text color={theme.text.secondary}>
|
||||
(press {expandDetailsHintKey} to collapse MCP tool details)
|
||||
</Text>
|
||||
<Text color={theme.text.link}>{mcpToolDetailsText}</Text>
|
||||
</>
|
||||
) : (
|
||||
<Text color={theme.text.secondary}>
|
||||
(press {expandDetailsHintKey} to expand MCP tool details)
|
||||
</Text>
|
||||
{isMcpToolDetailsExpanded && (
|
||||
<Text color={theme.text.link}>{mcpToolDetailsText}</Text>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
@@ -632,7 +624,6 @@ export const ToolConfirmationMessage: React.FC<
|
||||
isMcpToolDetailsExpanded,
|
||||
hasMcpToolDetails,
|
||||
mcpToolDetailsText,
|
||||
expandDetailsHintKey,
|
||||
getPreferredEditor,
|
||||
]);
|
||||
|
||||
@@ -698,6 +689,17 @@ export const ToolConfirmationMessage: React.FC<
|
||||
onSelect={handleSelect}
|
||||
isFocused={isFocused}
|
||||
/>
|
||||
<DialogFooter
|
||||
primaryAction="Enter to select"
|
||||
navigationActions="↑/↓ to navigate"
|
||||
extraParts={
|
||||
hasMcpToolDetails
|
||||
? [
|
||||
`${expandDetailsHintKey} to ${isMcpToolDetailsExpanded ? 'collapse' : 'expand'} details`,
|
||||
]
|
||||
: []
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -8,7 +8,7 @@ Tip: Toggle auto-edit (Shift+Tab) to allow redirection in the future.
|
||||
Allow execution of: 'echo, redirection (>)'?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow for this session
|
||||
2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. No, suggest changes (esc)
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -7,7 +7,7 @@ whoami
|
||||
Allow execution of 3 commands?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow for this session
|
||||
2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. No, suggest changes (esc)
|
||||
"
|
||||
`;
|
||||
@@ -20,7 +20,7 @@ URLs to fetch:
|
||||
Do you want to proceed?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow for this session
|
||||
2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. No, suggest changes (esc)
|
||||
"
|
||||
`;
|
||||
@@ -30,7 +30,7 @@ exports[`ToolConfirmationMessage > should not display urls if prompt and url are
|
||||
Do you want to proceed?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow for this session
|
||||
2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. No, suggest changes (esc)
|
||||
"
|
||||
`;
|
||||
@@ -41,7 +41,7 @@ Tool: testtool
|
||||
Allow execution of MCP tool "testtool" from server "testserver"?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow tool for this session
|
||||
2. Allow tool for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. Allow all server tools for this session
|
||||
4. No, suggest changes (esc)
|
||||
"
|
||||
@@ -56,7 +56,7 @@ exports[`ToolConfirmationMessage > with folder trust > 'for edit confirmations'
|
||||
Apply this change?
|
||||
|
||||
● 1. Allow once
|
||||
2. Modify with external editor
|
||||
2. Modify with external editorEnter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. No, suggest changes (esc)
|
||||
"
|
||||
`;
|
||||
@@ -70,7 +70,7 @@ exports[`ToolConfirmationMessage > with folder trust > 'for edit confirmations'
|
||||
Apply this change?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow for this session
|
||||
2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. Modify with external editor
|
||||
4. No, suggest changes (esc)
|
||||
"
|
||||
@@ -81,7 +81,7 @@ exports[`ToolConfirmationMessage > with folder trust > 'for exec confirmations'
|
||||
Allow execution of: 'echo'?
|
||||
|
||||
● 1. Allow once
|
||||
2. No, suggest changes (esc)
|
||||
2. No, suggest changes (esc)Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -90,7 +90,7 @@ exports[`ToolConfirmationMessage > with folder trust > 'for exec confirmations'
|
||||
Allow execution of: 'echo'?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow for this session
|
||||
2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. No, suggest changes (esc)
|
||||
"
|
||||
`;
|
||||
@@ -100,7 +100,7 @@ exports[`ToolConfirmationMessage > with folder trust > 'for info confirmations'
|
||||
Do you want to proceed?
|
||||
|
||||
● 1. Allow once
|
||||
2. No, suggest changes (esc)
|
||||
2. No, suggest changes (esc)Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -109,7 +109,7 @@ exports[`ToolConfirmationMessage > with folder trust > 'for info confirmations'
|
||||
Do you want to proceed?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow for this session
|
||||
2. Allow for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. No, suggest changes (esc)
|
||||
"
|
||||
`;
|
||||
@@ -120,7 +120,7 @@ Tool: test-tool
|
||||
Allow execution of MCP tool "test-tool" from server "test-server"?
|
||||
|
||||
● 1. Allow once
|
||||
2. No, suggest changes (esc)
|
||||
2. No, suggest changes (esc)Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -130,7 +130,7 @@ Tool: test-tool
|
||||
Allow execution of MCP tool "test-tool" from server "test-server"?
|
||||
|
||||
● 1. Allow once
|
||||
2. Allow tool for this session
|
||||
2. Allow tool for this session Enter to select · ↑/↓ to navigate · Esc to cancel
|
||||
3. Allow all server tools for this session
|
||||
4. No, suggest changes (esc)
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user