mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 23:21:27 -07:00
feat(plan): update UI Theme for Plan Mode (#17243)
This commit is contained in:
@@ -1274,6 +1274,21 @@ describe('InputPrompt', () => {
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('should render correctly in plan mode', async () => {
|
||||
props.approvalMode = ApprovalMode.PLAN;
|
||||
const { stdout, unmount } = renderWithProviders(<InputPrompt {...props} />);
|
||||
|
||||
await waitFor(() => {
|
||||
const frame = stdout.lastFrame();
|
||||
// In plan mode it uses '>' but with success color.
|
||||
// We check that it contains '>' and not '*' or '!'.
|
||||
expect(frame).toContain('>');
|
||||
expect(frame).not.toContain('*');
|
||||
expect(frame).not.toContain('!');
|
||||
});
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('should NOT clear the buffer on Ctrl+C if it is empty', async () => {
|
||||
props.buffer.text = '';
|
||||
const { stdin, unmount } = renderWithProviders(<InputPrompt {...props} />, {
|
||||
|
||||
@@ -1043,6 +1043,8 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
!shellModeActive && approvalMode === ApprovalMode.AUTO_EDIT;
|
||||
const showYoloStyling =
|
||||
!shellModeActive && approvalMode === ApprovalMode.YOLO;
|
||||
const showPlanStyling =
|
||||
!shellModeActive && approvalMode === ApprovalMode.PLAN;
|
||||
|
||||
let statusColor: string | undefined;
|
||||
let statusText = '';
|
||||
@@ -1052,6 +1054,9 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
} else if (showYoloStyling) {
|
||||
statusColor = theme.status.error;
|
||||
statusText = 'YOLO mode';
|
||||
} else if (showPlanStyling) {
|
||||
statusColor = theme.status.success;
|
||||
statusText = 'Plan mode';
|
||||
} else if (showAutoAcceptStyling) {
|
||||
statusColor = theme.status.warning;
|
||||
statusText = 'Accepting edits';
|
||||
|
||||
Reference in New Issue
Block a user