mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Merge pull request #1245 from QwenLM/feat/remove-corgi-mode
Remove obsolete “corgi mode”
This commit is contained in:
@@ -58,7 +58,6 @@ vi.mock('../ui/commands/authCommand.js', () => ({ authCommand: {} }));
|
|||||||
vi.mock('../ui/commands/bugCommand.js', () => ({ bugCommand: {} }));
|
vi.mock('../ui/commands/bugCommand.js', () => ({ bugCommand: {} }));
|
||||||
vi.mock('../ui/commands/clearCommand.js', () => ({ clearCommand: {} }));
|
vi.mock('../ui/commands/clearCommand.js', () => ({ clearCommand: {} }));
|
||||||
vi.mock('../ui/commands/compressCommand.js', () => ({ compressCommand: {} }));
|
vi.mock('../ui/commands/compressCommand.js', () => ({ compressCommand: {} }));
|
||||||
vi.mock('../ui/commands/corgiCommand.js', () => ({ corgiCommand: {} }));
|
|
||||||
vi.mock('../ui/commands/docsCommand.js', () => ({ docsCommand: {} }));
|
vi.mock('../ui/commands/docsCommand.js', () => ({ docsCommand: {} }));
|
||||||
vi.mock('../ui/commands/editorCommand.js', () => ({ editorCommand: {} }));
|
vi.mock('../ui/commands/editorCommand.js', () => ({ editorCommand: {} }));
|
||||||
vi.mock('../ui/commands/extensionsCommand.js', () => ({
|
vi.mock('../ui/commands/extensionsCommand.js', () => ({
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import { bugCommand } from '../ui/commands/bugCommand.js';
|
|||||||
import { clearCommand } from '../ui/commands/clearCommand.js';
|
import { clearCommand } from '../ui/commands/clearCommand.js';
|
||||||
import { compressCommand } from '../ui/commands/compressCommand.js';
|
import { compressCommand } from '../ui/commands/compressCommand.js';
|
||||||
import { copyCommand } from '../ui/commands/copyCommand.js';
|
import { copyCommand } from '../ui/commands/copyCommand.js';
|
||||||
import { corgiCommand } from '../ui/commands/corgiCommand.js';
|
|
||||||
import { docsCommand } from '../ui/commands/docsCommand.js';
|
import { docsCommand } from '../ui/commands/docsCommand.js';
|
||||||
import { directoryCommand } from '../ui/commands/directoryCommand.js';
|
import { directoryCommand } from '../ui/commands/directoryCommand.js';
|
||||||
import { editorCommand } from '../ui/commands/editorCommand.js';
|
import { editorCommand } from '../ui/commands/editorCommand.js';
|
||||||
@@ -63,7 +62,6 @@ export class BuiltinCommandLoader implements ICommandLoader {
|
|||||||
clearCommand,
|
clearCommand,
|
||||||
compressCommand,
|
compressCommand,
|
||||||
copyCommand,
|
copyCommand,
|
||||||
corgiCommand,
|
|
||||||
docsCommand,
|
docsCommand,
|
||||||
directoryCommand,
|
directoryCommand,
|
||||||
editorCommand,
|
editorCommand,
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ export const createMockCommandContext = (
|
|||||||
pendingItem: null,
|
pendingItem: null,
|
||||||
setPendingItem: vi.fn(),
|
setPendingItem: vi.fn(),
|
||||||
loadHistory: vi.fn(),
|
loadHistory: vi.fn(),
|
||||||
toggleCorgiMode: vi.fn(),
|
|
||||||
toggleVimEnabled: vi.fn(),
|
toggleVimEnabled: vi.fn(),
|
||||||
extensionsUpdateState: new Map(),
|
extensionsUpdateState: new Map(),
|
||||||
setExtensionsUpdateState: vi.fn(),
|
setExtensionsUpdateState: vi.fn(),
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||||||
const { settings, config, initializationResult } = props;
|
const { settings, config, initializationResult } = props;
|
||||||
const historyManager = useHistory();
|
const historyManager = useHistory();
|
||||||
useMemoryMonitor(historyManager);
|
useMemoryMonitor(historyManager);
|
||||||
const [corgiMode, setCorgiMode] = useState(false);
|
|
||||||
const [debugMessage, setDebugMessage] = useState<string>('');
|
const [debugMessage, setDebugMessage] = useState<string>('');
|
||||||
const [quittingMessages, setQuittingMessages] = useState<
|
const [quittingMessages, setQuittingMessages] = useState<
|
||||||
HistoryItem[] | null
|
HistoryItem[] | null
|
||||||
@@ -485,7 +484,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||||||
}, 100);
|
}, 100);
|
||||||
},
|
},
|
||||||
setDebugMessage,
|
setDebugMessage,
|
||||||
toggleCorgiMode: () => setCorgiMode((prev) => !prev),
|
|
||||||
dispatchExtensionStateUpdate,
|
dispatchExtensionStateUpdate,
|
||||||
addConfirmUpdateExtensionRequest,
|
addConfirmUpdateExtensionRequest,
|
||||||
openSubagentCreateDialog,
|
openSubagentCreateDialog,
|
||||||
@@ -498,7 +496,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||||||
openSettingsDialog,
|
openSettingsDialog,
|
||||||
openModelDialog,
|
openModelDialog,
|
||||||
setDebugMessage,
|
setDebugMessage,
|
||||||
setCorgiMode,
|
|
||||||
dispatchExtensionStateUpdate,
|
dispatchExtensionStateUpdate,
|
||||||
openPermissionsDialog,
|
openPermissionsDialog,
|
||||||
openApprovalModeDialog,
|
openApprovalModeDialog,
|
||||||
@@ -1218,7 +1215,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||||||
qwenAuthState,
|
qwenAuthState,
|
||||||
editorError,
|
editorError,
|
||||||
isEditorDialogOpen,
|
isEditorDialogOpen,
|
||||||
corgiMode,
|
|
||||||
debugMessage,
|
debugMessage,
|
||||||
quittingMessages,
|
quittingMessages,
|
||||||
isSettingsDialogOpen,
|
isSettingsDialogOpen,
|
||||||
@@ -1309,7 +1305,6 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||||||
qwenAuthState,
|
qwenAuthState,
|
||||||
editorError,
|
editorError,
|
||||||
isEditorDialogOpen,
|
isEditorDialogOpen,
|
||||||
corgiMode,
|
|
||||||
debugMessage,
|
debugMessage,
|
||||||
quittingMessages,
|
quittingMessages,
|
||||||
isSettingsDialogOpen,
|
isSettingsDialogOpen,
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
/**
|
|
||||||
* @license
|
|
||||||
* Copyright 2025 Google LLC
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
||||||
import { corgiCommand } from './corgiCommand.js';
|
|
||||||
import { type CommandContext } from './types.js';
|
|
||||||
import { createMockCommandContext } from '../../test-utils/mockCommandContext.js';
|
|
||||||
|
|
||||||
describe('corgiCommand', () => {
|
|
||||||
let mockContext: CommandContext;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
mockContext = createMockCommandContext();
|
|
||||||
vi.spyOn(mockContext.ui, 'toggleCorgiMode');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should call the toggleCorgiMode function on the UI context', async () => {
|
|
||||||
if (!corgiCommand.action) {
|
|
||||||
throw new Error('The corgi command must have an action.');
|
|
||||||
}
|
|
||||||
|
|
||||||
await corgiCommand.action(mockContext, '');
|
|
||||||
|
|
||||||
expect(mockContext.ui.toggleCorgiMode).toHaveBeenCalledTimes(1);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have the correct name and description', () => {
|
|
||||||
expect(corgiCommand.name).toBe('corgi');
|
|
||||||
expect(corgiCommand.description).toBe('Toggles corgi mode.');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* @license
|
|
||||||
* Copyright 2025 Google LLC
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { CommandKind, type SlashCommand } from './types.js';
|
|
||||||
|
|
||||||
export const corgiCommand: SlashCommand = {
|
|
||||||
name: 'corgi',
|
|
||||||
description: 'Toggles corgi mode.',
|
|
||||||
hidden: true,
|
|
||||||
kind: CommandKind.BUILT_IN,
|
|
||||||
action: (context, _args) => {
|
|
||||||
context.ui.toggleCorgiMode();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -64,8 +64,6 @@ export interface CommandContext {
|
|||||||
* @param history The array of history items to load.
|
* @param history The array of history items to load.
|
||||||
*/
|
*/
|
||||||
loadHistory: UseHistoryManagerReturn['loadHistory'];
|
loadHistory: UseHistoryManagerReturn['loadHistory'];
|
||||||
/** Toggles a special display mode. */
|
|
||||||
toggleCorgiMode: () => void;
|
|
||||||
toggleVimEnabled: () => Promise<boolean>;
|
toggleVimEnabled: () => Promise<boolean>;
|
||||||
setGeminiMdFileCount: (count: number) => void;
|
setGeminiMdFileCount: (count: number) => void;
|
||||||
reloadCommands: () => void;
|
reloadCommands: () => void;
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ const createMockUIState = (overrides: Partial<UIState> = {}): UIState =>
|
|||||||
},
|
},
|
||||||
branchName: 'main',
|
branchName: 'main',
|
||||||
debugMessage: '',
|
debugMessage: '',
|
||||||
corgiMode: false,
|
|
||||||
errorCount: 0,
|
errorCount: 0,
|
||||||
nightly: false,
|
nightly: false,
|
||||||
isTrustedFolder: true,
|
isTrustedFolder: true,
|
||||||
@@ -183,6 +182,7 @@ describe('Composer', () => {
|
|||||||
|
|
||||||
const { lastFrame } = renderComposer(uiState, settings);
|
const { lastFrame } = renderComposer(uiState, settings);
|
||||||
|
|
||||||
|
// Smoke check that the Footer renders when enabled.
|
||||||
expect(lastFrame()).toContain('Footer');
|
expect(lastFrame()).toContain('Footer');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -200,7 +200,6 @@ describe('Composer', () => {
|
|||||||
it('passes correct props to Footer including vim mode when enabled', async () => {
|
it('passes correct props to Footer including vim mode when enabled', async () => {
|
||||||
const uiState = createMockUIState({
|
const uiState = createMockUIState({
|
||||||
branchName: 'feature-branch',
|
branchName: 'feature-branch',
|
||||||
corgiMode: true,
|
|
||||||
errorCount: 2,
|
errorCount: 2,
|
||||||
sessionStats: {
|
sessionStats: {
|
||||||
sessionId: 'test-session',
|
sessionId: 'test-session',
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ export const Footer: React.FC = () => {
|
|||||||
debugMode,
|
debugMode,
|
||||||
branchName,
|
branchName,
|
||||||
debugMessage,
|
debugMessage,
|
||||||
corgiMode,
|
|
||||||
errorCount,
|
errorCount,
|
||||||
showErrorDetails,
|
showErrorDetails,
|
||||||
promptTokenCount,
|
promptTokenCount,
|
||||||
@@ -45,7 +44,6 @@ export const Footer: React.FC = () => {
|
|||||||
debugMode: config.getDebugMode(),
|
debugMode: config.getDebugMode(),
|
||||||
branchName: uiState.branchName,
|
branchName: uiState.branchName,
|
||||||
debugMessage: uiState.debugMessage,
|
debugMessage: uiState.debugMessage,
|
||||||
corgiMode: uiState.corgiMode,
|
|
||||||
errorCount: uiState.errorCount,
|
errorCount: uiState.errorCount,
|
||||||
showErrorDetails: uiState.showErrorDetails,
|
showErrorDetails: uiState.showErrorDetails,
|
||||||
promptTokenCount: uiState.sessionStats.lastPromptTokenCount,
|
promptTokenCount: uiState.sessionStats.lastPromptTokenCount,
|
||||||
@@ -153,16 +151,6 @@ export const Footer: React.FC = () => {
|
|||||||
{showMemoryUsage && <MemoryUsageDisplay />}
|
{showMemoryUsage && <MemoryUsageDisplay />}
|
||||||
</Box>
|
</Box>
|
||||||
<Box alignItems="center" paddingLeft={2}>
|
<Box alignItems="center" paddingLeft={2}>
|
||||||
{corgiMode && (
|
|
||||||
<Text>
|
|
||||||
<Text color={theme.ui.symbol}>| </Text>
|
|
||||||
<Text color={theme.status.error}>▼</Text>
|
|
||||||
<Text color={theme.text.primary}>(´</Text>
|
|
||||||
<Text color={theme.status.error}>ᴥ</Text>
|
|
||||||
<Text color={theme.text.primary}>`)</Text>
|
|
||||||
<Text color={theme.status.error}>▼ </Text>
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
{!showErrorDetails && errorCount > 0 && (
|
{!showErrorDetails && errorCount > 0 && (
|
||||||
<Box>
|
<Box>
|
||||||
<Text color={theme.ui.symbol}>| </Text>
|
<Text color={theme.ui.symbol}>| </Text>
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ export interface UIState {
|
|||||||
qwenAuthState: QwenAuthState;
|
qwenAuthState: QwenAuthState;
|
||||||
editorError: string | null;
|
editorError: string | null;
|
||||||
isEditorDialogOpen: boolean;
|
isEditorDialogOpen: boolean;
|
||||||
corgiMode: boolean;
|
|
||||||
debugMessage: string;
|
debugMessage: string;
|
||||||
quittingMessages: HistoryItem[] | null;
|
quittingMessages: HistoryItem[] | null;
|
||||||
isSettingsDialogOpen: boolean;
|
isSettingsDialogOpen: boolean;
|
||||||
|
|||||||
@@ -153,7 +153,6 @@ describe('useSlashCommandProcessor', () => {
|
|||||||
openModelDialog: mockOpenModelDialog,
|
openModelDialog: mockOpenModelDialog,
|
||||||
quit: mockSetQuittingMessages,
|
quit: mockSetQuittingMessages,
|
||||||
setDebugMessage: vi.fn(),
|
setDebugMessage: vi.fn(),
|
||||||
toggleCorgiMode: vi.fn(),
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -909,7 +908,6 @@ describe('useSlashCommandProcessor', () => {
|
|||||||
vi.fn(), // openThemeDialog
|
vi.fn(), // openThemeDialog
|
||||||
mockOpenAuthDialog,
|
mockOpenAuthDialog,
|
||||||
vi.fn(), // openEditorDialog
|
vi.fn(), // openEditorDialog
|
||||||
vi.fn(), // toggleCorgiMode
|
|
||||||
mockSetQuittingMessages,
|
mockSetQuittingMessages,
|
||||||
vi.fn(), // openSettingsDialog
|
vi.fn(), // openSettingsDialog
|
||||||
vi.fn(), // openModelSelectionDialog
|
vi.fn(), // openModelSelectionDialog
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ interface SlashCommandProcessorActions {
|
|||||||
openApprovalModeDialog: () => void;
|
openApprovalModeDialog: () => void;
|
||||||
quit: (messages: HistoryItem[]) => void;
|
quit: (messages: HistoryItem[]) => void;
|
||||||
setDebugMessage: (message: string) => void;
|
setDebugMessage: (message: string) => void;
|
||||||
toggleCorgiMode: () => void;
|
|
||||||
dispatchExtensionStateUpdate: (action: ExtensionUpdateAction) => void;
|
dispatchExtensionStateUpdate: (action: ExtensionUpdateAction) => void;
|
||||||
addConfirmUpdateExtensionRequest: (request: ConfirmationRequest) => void;
|
addConfirmUpdateExtensionRequest: (request: ConfirmationRequest) => void;
|
||||||
openSubagentCreateDialog: () => void;
|
openSubagentCreateDialog: () => void;
|
||||||
@@ -206,7 +205,6 @@ export const useSlashCommandProcessor = (
|
|||||||
setDebugMessage: actions.setDebugMessage,
|
setDebugMessage: actions.setDebugMessage,
|
||||||
pendingItem,
|
pendingItem,
|
||||||
setPendingItem,
|
setPendingItem,
|
||||||
toggleCorgiMode: actions.toggleCorgiMode,
|
|
||||||
toggleVimEnabled,
|
toggleVimEnabled,
|
||||||
setGeminiMdFileCount,
|
setGeminiMdFileCount,
|
||||||
reloadCommands,
|
reloadCommands,
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ export function createNonInteractiveUI(): CommandContext['ui'] {
|
|||||||
loadHistory: (_newHistory) => {},
|
loadHistory: (_newHistory) => {},
|
||||||
pendingItem: null,
|
pendingItem: null,
|
||||||
setPendingItem: (_item) => {},
|
setPendingItem: (_item) => {},
|
||||||
toggleCorgiMode: () => {},
|
|
||||||
toggleVimEnabled: async () => false,
|
toggleVimEnabled: async () => false,
|
||||||
setGeminiMdFileCount: (_count) => {},
|
setGeminiMdFileCount: (_count) => {},
|
||||||
reloadCommands: () => {},
|
reloadCommands: () => {},
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
"src/ui/commands/clearCommand.test.ts",
|
"src/ui/commands/clearCommand.test.ts",
|
||||||
"src/ui/commands/compressCommand.test.ts",
|
"src/ui/commands/compressCommand.test.ts",
|
||||||
"src/ui/commands/copyCommand.test.ts",
|
"src/ui/commands/copyCommand.test.ts",
|
||||||
"src/ui/commands/corgiCommand.test.ts",
|
|
||||||
"src/ui/commands/docsCommand.test.ts",
|
"src/ui/commands/docsCommand.test.ts",
|
||||||
"src/ui/commands/editorCommand.test.ts",
|
"src/ui/commands/editorCommand.test.ts",
|
||||||
"src/ui/commands/extensionsCommand.test.ts",
|
"src/ui/commands/extensionsCommand.test.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user