feat(plan): update UI Theme for Plan Mode (#17243)

This commit is contained in:
Adib234
2026-01-22 17:22:21 -05:00
committed by GitHub
parent 57601adc90
commit 5f1c6447a9
2 changed files with 20 additions and 0 deletions

View File

@@ -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} />, {

View File

@@ -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';