Skip to content

Commit 8298133

Browse files
Adib234Yuna Seol
authored andcommitted
feat(plan): update cycling order of approval modes (#17622)
1 parent 7b74fe6 commit 8298133

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

packages/cli/src/ui/constants/tips.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const INFORMATIVE_TIPS = [
9090
'Toggle the todo list display with Ctrl+T…',
9191
'See full, untruncated responses with Ctrl+O…',
9292
'Toggle auto-approval (YOLO mode) for all tools with Ctrl+Y…',
93-
'Cycle through approval modes (Default, Plan, Auto-Edit) with Shift+Tab…',
93+
'Cycle through approval modes (Default, Auto-Edit, Plan) with Shift+Tab…',
9494
'Toggle Markdown rendering (raw markdown mode) with Alt+M…',
9595
'Toggle shell mode by typing ! in an empty prompt…',
9696
'Insert a newline with a backslash (\\) followed by Enter…',

packages/cli/src/ui/hooks/useApprovalModeIndicator.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,23 +237,23 @@ describe('useApprovalModeIndicator', () => {
237237
}),
238238
);
239239

240-
// DEFAULT -> PLAN
240+
// DEFAULT -> AUTO_EDIT
241241
act(() => {
242242
capturedUseKeypressHandler({ name: 'tab', shift: true } as Key);
243243
});
244244
expect(mockConfigInstance.setApprovalMode).toHaveBeenCalledWith(
245-
ApprovalMode.PLAN,
245+
ApprovalMode.AUTO_EDIT,
246246
);
247247

248-
// PLAN -> AUTO_EDIT
248+
// AUTO_EDIT -> PLAN
249249
act(() => {
250250
capturedUseKeypressHandler({ name: 'tab', shift: true } as Key);
251251
});
252252
expect(mockConfigInstance.setApprovalMode).toHaveBeenCalledWith(
253-
ApprovalMode.AUTO_EDIT,
253+
ApprovalMode.PLAN,
254254
);
255255

256-
// AUTO_EDIT -> DEFAULT
256+
// PLAN -> DEFAULT
257257
act(() => {
258258
capturedUseKeypressHandler({ name: 'tab', shift: true } as Key);
259259
});

packages/cli/src/ui/hooks/useApprovalModeIndicator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ export function useApprovalModeIndicator({
5959
const currentMode = config.getApprovalMode();
6060
switch (currentMode) {
6161
case ApprovalMode.DEFAULT:
62+
nextApprovalMode = ApprovalMode.AUTO_EDIT;
63+
break;
64+
case ApprovalMode.AUTO_EDIT:
6265
nextApprovalMode = config.isPlanEnabled()
6366
? ApprovalMode.PLAN
64-
: ApprovalMode.AUTO_EDIT;
67+
: ApprovalMode.DEFAULT;
6568
break;
6669
case ApprovalMode.PLAN:
67-
nextApprovalMode = ApprovalMode.AUTO_EDIT;
68-
break;
69-
case ApprovalMode.AUTO_EDIT:
7070
nextApprovalMode = ApprovalMode.DEFAULT;
7171
break;
7272
case ApprovalMode.YOLO:

0 commit comments

Comments
 (0)