mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
feat: Ctrl+O to expand paste placeholder (#18103)
This commit is contained in:
@@ -9,6 +9,7 @@ import { render } from '../../test-utils/render.js';
|
||||
import { Text } from 'ink';
|
||||
import { StatusDisplay } from './StatusDisplay.js';
|
||||
import { UIStateContext, type UIState } from '../contexts/UIStateContext.js';
|
||||
import { TransientMessageType } from '../../utils/events.js';
|
||||
import { ConfigContext } from '../contexts/ConfigContext.js';
|
||||
import { SettingsContext } from '../contexts/SettingsContext.js';
|
||||
import { createMockSettings } from '../../test-utils/settings.js';
|
||||
@@ -40,7 +41,7 @@ type UIStateOverrides = Partial<Omit<UIState, 'buffer'>> & {
|
||||
const createMockUIState = (overrides: UIStateOverrides = {}): UIState =>
|
||||
({
|
||||
ctrlCPressedOnce: false,
|
||||
warningMessage: null,
|
||||
transientMessage: null,
|
||||
ctrlDPressedOnce: false,
|
||||
showEscapePrompt: false,
|
||||
shortcutsHelpVisible: false,
|
||||
@@ -112,7 +113,10 @@ describe('StatusDisplay', () => {
|
||||
it('prioritizes Ctrl+C prompt over everything else (except system md)', () => {
|
||||
const uiState = createMockUIState({
|
||||
ctrlCPressedOnce: true,
|
||||
warningMessage: 'Warning',
|
||||
transientMessage: {
|
||||
text: 'Warning',
|
||||
type: TransientMessageType.Warning,
|
||||
},
|
||||
activeHooks: [{ name: 'hook', eventName: 'event' }],
|
||||
});
|
||||
const { lastFrame } = renderStatusDisplay(
|
||||
@@ -124,7 +128,24 @@ describe('StatusDisplay', () => {
|
||||
|
||||
it('renders warning message', () => {
|
||||
const uiState = createMockUIState({
|
||||
warningMessage: 'This is a warning',
|
||||
transientMessage: {
|
||||
text: 'This is a warning',
|
||||
type: TransientMessageType.Warning,
|
||||
},
|
||||
});
|
||||
const { lastFrame } = renderStatusDisplay(
|
||||
{ hideContextSummary: false },
|
||||
uiState,
|
||||
);
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders hint message', () => {
|
||||
const uiState = createMockUIState({
|
||||
transientMessage: {
|
||||
text: 'This is a hint',
|
||||
type: TransientMessageType.Hint,
|
||||
},
|
||||
});
|
||||
const { lastFrame } = renderStatusDisplay(
|
||||
{ hideContextSummary: false },
|
||||
@@ -135,7 +156,10 @@ describe('StatusDisplay', () => {
|
||||
|
||||
it('prioritizes warning over Ctrl+D', () => {
|
||||
const uiState = createMockUIState({
|
||||
warningMessage: 'Warning',
|
||||
transientMessage: {
|
||||
text: 'Warning',
|
||||
type: TransientMessageType.Warning,
|
||||
},
|
||||
ctrlDPressedOnce: true,
|
||||
});
|
||||
const { lastFrame } = renderStatusDisplay(
|
||||
|
||||
Reference in New Issue
Block a user