From 7e2a47c2f7708bb8cbafc11b532fb32bf97a7fc3 Mon Sep 17 00:00:00 2001 From: wenshao Date: Fri, 10 Apr 2026 09:46:08 +0800 Subject: [PATCH] refactor: rename verboseMode to compactMode for better UX clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Compact Mode" label is more intuitive than "Verbose Mode" for users, as it directly describes the default compact view experience. This change inverts the boolean semantics (compactMode=false means show full output) and exposes the setting in the /settings dialog (showInDialog: true). - Rename ui.verboseMode → ui.compactMode with inverted default (false) - Rename VerboseModeContext → CompactModeContext (file and exports) - Rename TOGGLE_VERBOSE_MODE → TOGGLE_COMPACT_MODE in key bindings - Update all consumer components with inverted logic - Update i18n keys across 6 locales (verbose → compact) - Update VS Code settings schema - Add ui.compactMode documentation to settings.md - Fix Ctrl+O description in keyboard-shortcuts.md --- docs/users/configuration/settings.md | 1 + docs/users/reference/keyboard-shortcuts.md | 2 +- packages/cli/src/config/keyBindings.ts | 4 +-- packages/cli/src/config/settingsSchema.ts | 10 +++---- packages/cli/src/i18n/locales/de.js | 6 ++-- packages/cli/src/i18n/locales/en.js | 6 ++-- packages/cli/src/i18n/locales/ja.js | 6 ++-- packages/cli/src/i18n/locales/pt.js | 6 ++-- packages/cli/src/i18n/locales/ru.js | 6 ++-- packages/cli/src/i18n/locales/zh.js | 6 ++-- packages/cli/src/ui/AppContainer.tsx | 28 +++++++++---------- packages/cli/src/ui/components/Footer.tsx | 10 +++---- .../src/ui/components/HistoryItemDisplay.tsx | 8 +++--- .../cli/src/ui/components/MainContent.tsx | 4 +-- .../__snapshots__/Footer.test.tsx.snap | 4 +-- .../components/messages/ToolGroupMessage.tsx | 6 ++-- .../components/messages/ToolMessage.test.tsx | 14 +++++----- .../ui/components/messages/ToolMessage.tsx | 6 ++-- .../src/ui/contexts/CompactModeContext.tsx | 23 +++++++++++++++ .../src/ui/contexts/VerboseModeContext.tsx | 23 --------------- packages/cli/src/ui/keyMatchers.test.ts | 4 +-- .../schemas/settings.schema.json | 6 ++-- 22 files changed, 95 insertions(+), 94 deletions(-) create mode 100644 packages/cli/src/ui/contexts/CompactModeContext.tsx delete mode 100644 packages/cli/src/ui/contexts/VerboseModeContext.tsx diff --git a/docs/users/configuration/settings.md b/docs/users/configuration/settings.md index ccf44c849ae..eaabe7c936e 100644 --- a/docs/users/configuration/settings.md +++ b/docs/users/configuration/settings.md @@ -106,6 +106,7 @@ Settings are organized into categories. All settings should be placed within the | `ui.showMemoryUsage` | boolean | Display memory usage information in the UI. | `false` | | `ui.showLineNumbers` | boolean | Show line numbers in code blocks in the CLI output. | `true` | | `ui.showCitations` | boolean | Show citations for generated text in the chat. | `true` | +| `ui.compactMode` | boolean | Hide tool output and thinking for a cleaner view. Toggle with `Ctrl+O` during a session. When enabled, a `compact` indicator appears in the footer. The setting persists across sessions. | `false` | | `enableWelcomeBack` | boolean | Show welcome back dialog when returning to a project with conversation history. When enabled, Qwen Code will automatically detect if you're returning to a project with a previously generated project summary (`.qwen/PROJECT_SUMMARY.md`) and show a dialog allowing you to continue your previous conversation or start fresh. This feature integrates with the `/summary` command and quit confirmation dialog. | `true` | | `ui.accessibility.enableLoadingPhrases` | boolean | Enable loading phrases (disable for accessibility). | `true` | | `ui.accessibility.screenReader` | boolean | Enables screen reader mode, which adjusts the TUI for better compatibility with screen readers. | `false` | diff --git a/docs/users/reference/keyboard-shortcuts.md b/docs/users/reference/keyboard-shortcuts.md index fdfc41b879b..e6a259e88a6 100644 --- a/docs/users/reference/keyboard-shortcuts.md +++ b/docs/users/reference/keyboard-shortcuts.md @@ -10,7 +10,7 @@ This document lists the available keyboard shortcuts in Qwen Code. | `Ctrl+C` | Cancel the ongoing request and clear the input. Press twice to exit the application. | | `Ctrl+D` | Exit the application if the input is empty. Press twice to confirm. | | `Ctrl+L` | Clear the screen. | -| `Ctrl+O` | Toggle the display of the debug console. | +| `Ctrl+O` | Toggle compact mode (hide/show tool output and thinking). | | `Ctrl+S` | Allows long responses to print fully, disabling truncation. Use your terminal's scrollback to view the entire output. | | `Ctrl+T` | Toggle the display of tool descriptions. | | `Shift+Tab` (`Tab` on Windows) | Cycle approval modes (`plan` → `default` → `auto-edit` → `yolo`) | diff --git a/packages/cli/src/config/keyBindings.ts b/packages/cli/src/config/keyBindings.ts index b13da27fa31..196602ba1d0 100644 --- a/packages/cli/src/config/keyBindings.ts +++ b/packages/cli/src/config/keyBindings.ts @@ -51,7 +51,7 @@ export enum Command { EXIT = 'exit', SHOW_MORE_LINES = 'showMoreLines', RETRY_LAST = 'retryLast', - TOGGLE_VERBOSE_MODE = 'toggleVerboseMode', + TOGGLE_COMPACT_MODE = 'toggleCompactMode', // Shell commands REVERSE_SEARCH = 'reverseSearch', @@ -173,7 +173,7 @@ export const defaultKeyBindings: KeyBindingConfig = { [Command.EXIT]: [{ key: 'd', ctrl: true }], [Command.SHOW_MORE_LINES]: [{ key: 's', ctrl: true }], [Command.RETRY_LAST]: [{ key: 'y', ctrl: true }], - [Command.TOGGLE_VERBOSE_MODE]: [{ key: 'o', ctrl: true }], + [Command.TOGGLE_COMPACT_MODE]: [{ key: 'o', ctrl: true }], // Shell commands [Command.REVERSE_SEARCH]: [{ key: 'r', ctrl: true }], diff --git a/packages/cli/src/config/settingsSchema.ts b/packages/cli/src/config/settingsSchema.ts index 29215522acb..e67a1334fad 100644 --- a/packages/cli/src/config/settingsSchema.ts +++ b/packages/cli/src/config/settingsSchema.ts @@ -591,15 +591,15 @@ const SETTINGS_SCHEMA = { description: 'The last time the feedback dialog was shown.', showInDialog: false, }, - verboseMode: { + compactMode: { type: 'boolean', - label: 'Verbose Mode', + label: 'Compact Mode', category: 'UI', requiresRestart: false, - default: true, + default: false, description: - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).', - showInDialog: false, + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).', + showInDialog: true, }, }, }, diff --git a/packages/cli/src/i18n/locales/de.js b/packages/cli/src/i18n/locales/de.js index 11a64170532..34da53113d7 100644 --- a/packages/cli/src/i18n/locales/de.js +++ b/packages/cli/src/i18n/locales/de.js @@ -1970,9 +1970,9 @@ export default { 'Raw-Modus nicht verfügbar. Bitte in einem interaktiven Terminal ausführen.', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(↑ ↓ Pfeiltasten zum Navigieren, Enter zum Auswählen, Strg+C zum Beenden)\n', - verbose: 'ausführlich', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - 'Vollständige Tool-Ausgabe und Denkprozess im ausführlichen Modus anzeigen (mit Strg+O umschalten).', + compact: 'kompakt', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'Tool-Ausgabe und Denkprozess ausblenden für eine übersichtlichere Ansicht (mit Strg+O umschalten).', 'Press Ctrl+O to show full tool output': 'Strg+O für vollständige Tool-Ausgabe drücken', diff --git a/packages/cli/src/i18n/locales/en.js b/packages/cli/src/i18n/locales/en.js index a27249410af..e11711f504c 100644 --- a/packages/cli/src/i18n/locales/en.js +++ b/packages/cli/src/i18n/locales/en.js @@ -2010,9 +2010,9 @@ export default { 'Raw mode not available. Please run in an interactive terminal.', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n', - verbose: 'verbose', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).', + compact: 'compact', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).', 'Press Ctrl+O to show full tool output': 'Press Ctrl+O to show full tool output', diff --git a/packages/cli/src/i18n/locales/ja.js b/packages/cli/src/i18n/locales/ja.js index 57b1439707e..e18e847e880 100644 --- a/packages/cli/src/i18n/locales/ja.js +++ b/packages/cli/src/i18n/locales/ja.js @@ -1462,9 +1462,9 @@ export default { 'Rawモードが利用できません。インタラクティブターミナルで実行してください。', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(↑ ↓ 矢印キーで移動、Enter で選択、Ctrl+C で終了)\n', - verbose: '詳細', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - '詳細モードで完全なツール出力と思考を表示します(Ctrl+O で切り替え)。', + compact: 'コンパクト', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'コンパクトモードでツール出力と思考を非表示にします(Ctrl+O で切り替え)。', 'Press Ctrl+O to show full tool output': 'Ctrl+O で完全なツール出力を表示', 'Switch to plan mode or exit plan mode': diff --git a/packages/cli/src/i18n/locales/pt.js b/packages/cli/src/i18n/locales/pt.js index b51b73f9207..3c5d92c786f 100644 --- a/packages/cli/src/i18n/locales/pt.js +++ b/packages/cli/src/i18n/locales/pt.js @@ -1960,9 +1960,9 @@ export default { 'Modo raw não disponível. Execute em um terminal interativo.', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(Use ↑ ↓ para navegar, Enter para selecionar, Ctrl+C para sair)\n', - verbose: 'detalhado', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - 'Mostrar saída completa da ferramenta e raciocínio no modo detalhado (alternar com Ctrl+O).', + compact: 'compacto', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'Ocultar saída da ferramenta e raciocínio para uma visualização mais limpa (alternar com Ctrl+O).', 'Press Ctrl+O to show full tool output': 'Pressione Ctrl+O para exibir a saída completa da ferramenta', diff --git a/packages/cli/src/i18n/locales/ru.js b/packages/cli/src/i18n/locales/ru.js index 341277106d5..8c2141f252c 100644 --- a/packages/cli/src/i18n/locales/ru.js +++ b/packages/cli/src/i18n/locales/ru.js @@ -1967,9 +1967,9 @@ export default { 'Raw-режим недоступен. Пожалуйста, запустите в интерактивном терминале.', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(↑ ↓ стрелки для навигации, Enter для выбора, Ctrl+C для выхода)\n', - verbose: 'подробный', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - 'Показывать полный вывод инструментов и процесс рассуждений в подробном режиме (переключить с помощью Ctrl+O).', + compact: 'компактный', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'Скрывать вывод инструментов и процесс рассуждений для более чистого вида (переключить с помощью Ctrl+O).', 'Press Ctrl+O to show full tool output': 'Нажмите Ctrl+O для показа полного вывода инструментов', diff --git a/packages/cli/src/i18n/locales/zh.js b/packages/cli/src/i18n/locales/zh.js index 74f949a6dc5..05b061db128 100644 --- a/packages/cli/src/i18n/locales/zh.js +++ b/packages/cli/src/i18n/locales/zh.js @@ -1814,9 +1814,9 @@ export default { '原始模式不可用。请在交互式终端中运行。', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(使用 ↑ ↓ 箭头导航,Enter 选择,Ctrl+C 退出)\n', - verbose: '详细', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - '详细模式下显示完整工具输出和思考过程(Ctrl+O 切换)。', + compact: '紧凑', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + '紧凑模式下隐藏工具输出和思考过程,界面更简洁(Ctrl+O 切换)。', 'Press Ctrl+O to show full tool output': '按 Ctrl+O 查看详细工具调用结果', 'Switch to plan mode or exit plan mode': '切换到计划模式或退出计划模式', diff --git a/packages/cli/src/ui/AppContainer.tsx b/packages/cli/src/ui/AppContainer.tsx index 21314964c67..c564cc5ba93 100644 --- a/packages/cli/src/ui/AppContainer.tsx +++ b/packages/cli/src/ui/AppContainer.tsx @@ -71,7 +71,7 @@ import { useApprovalModeCommand } from './hooks/useApprovalModeCommand.js'; import { useResumeCommand } from './hooks/useResumeCommand.js'; import { useSlashCommandProcessor } from './hooks/slashCommandProcessor.js'; import { useVimMode } from './contexts/VimModeContext.js'; -import { VerboseModeProvider } from './contexts/VerboseModeContext.js'; +import { CompactModeProvider } from './contexts/CompactModeContext.js'; import { useTerminalSize } from './hooks/useTerminalSize.js'; import { calculatePromptWidths } from './components/InputPrompt.js'; import { useStdin, useStdout } from 'ink'; @@ -1262,8 +1262,8 @@ export const AppContainer = (props: AppContainerProps) => { const [showToolDescriptions, setShowToolDescriptions] = useState(false); - const [verboseMode, setVerboseMode] = useState( - settings.merged.ui?.verboseMode ?? true, + const [compactMode, setCompactMode] = useState( + settings.merged.ui?.compactMode ?? false, ); const [frozenSnapshot, setFrozenSnapshot] = useState< HistoryItemWithoutId[] | null @@ -1681,10 +1681,10 @@ export const AppContainer = (props: AppContainerProps) => { if (activePtyId || embeddedShellFocused) { setEmbeddedShellFocused((prev) => !prev); } - } else if (keyMatchers[Command.TOGGLE_VERBOSE_MODE](key)) { - const newValue = !verboseMode; - setVerboseMode(newValue); - void settings.setValue(SettingScope.User, 'ui.verboseMode', newValue); + } else if (keyMatchers[Command.TOGGLE_COMPACT_MODE](key)) { + const newValue = !compactMode; + setCompactMode(newValue); + void settings.setValue(SettingScope.User, 'ui.compactMode', newValue); refreshStatic(); // Only freeze during the actual responding phase. WaitingForConfirmation // must keep focus so the user can approve/cancel tool confirmation UI. @@ -1726,8 +1726,8 @@ export const AppContainer = (props: AppContainerProps) => { // debugKeystrokeLogging is read at call time, so no stale closure risk. settings, isAuthenticating, - verboseMode, - setVerboseMode, + compactMode, + setCompactMode, setFrozenSnapshot, pendingHistoryItems, refreshStatic, @@ -2154,9 +2154,9 @@ export const AppContainer = (props: AppContainerProps) => { ], ); - const verboseModeValue = useMemo( - () => ({ verboseMode, frozenSnapshot }), - [verboseMode, frozenSnapshot], + const compactModeValue = useMemo( + () => ({ compactMode, frozenSnapshot }), + [compactMode, frozenSnapshot], ); return ( @@ -2169,11 +2169,11 @@ export const AppContainer = (props: AppContainerProps) => { startupWarnings: props.startupWarnings || [], }} > - + - + diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx index 9934f3582e6..54956faf6d7 100644 --- a/packages/cli/src/ui/components/Footer.tsx +++ b/packages/cli/src/ui/components/Footer.tsx @@ -17,7 +17,7 @@ import { useStatusLine } from '../hooks/useStatusLine.js'; import { useUIState } from '../contexts/UIStateContext.js'; import { useConfig } from '../contexts/ConfigContext.js'; import { useVimMode } from '../contexts/VimModeContext.js'; -import { useVerboseMode } from '../contexts/VerboseModeContext.js'; +import { useCompactMode } from '../contexts/CompactModeContext.js'; import { ApprovalMode } from '@qwen-code/qwen-code-core'; import { t } from '../../i18n/index.js'; @@ -26,7 +26,7 @@ export const Footer: React.FC = () => { const config = useConfig(); const { vimEnabled, vimMode } = useVimMode(); const { text: statusLineText } = useStatusLine(); - const { verboseMode } = useVerboseMode(); + const { compactMode } = useCompactMode(); const { promptTokenCount, showAutoAcceptIndicator } = { promptTokenCount: uiState.sessionStats.lastPromptTokenCount, @@ -101,10 +101,10 @@ export const Footer: React.FC = () => { ), }); } - if (verboseMode) { + if (compactMode) { rightItems.push({ - key: 'verbose', - node: {t('verbose')}, + key: 'compact', + node: {t('compact')}, }); } diff --git a/packages/cli/src/ui/components/HistoryItemDisplay.tsx b/packages/cli/src/ui/components/HistoryItemDisplay.tsx index 02c4b04141d..dcfb47b9013 100644 --- a/packages/cli/src/ui/components/HistoryItemDisplay.tsx +++ b/packages/cli/src/ui/components/HistoryItemDisplay.tsx @@ -48,7 +48,7 @@ import { ContextUsage } from './views/ContextUsage.js'; import { ArenaAgentCard, ArenaSessionCard } from './arena/ArenaCards.js'; import { InsightProgressMessage } from './messages/InsightProgressMessage.js'; import { BtwMessage } from './messages/BtwMessage.js'; -import { useVerboseMode } from '../contexts/VerboseModeContext.js'; +import { useCompactMode } from '../contexts/CompactModeContext.js'; interface HistoryItemDisplayProps { item: HistoryItem; @@ -80,7 +80,7 @@ const HistoryItemDisplayComponent: React.FC = ({ ? 0 : 1; - const { verboseMode } = useVerboseMode(); + const { compactMode } = useCompactMode(); const itemForDisplay = useMemo(() => escapeAnsiCtrlCodes(item), [item]); const contentWidth = terminalWidth - 4; const boxWidth = mainAreaWidth || contentWidth; @@ -120,7 +120,7 @@ const HistoryItemDisplayComponent: React.FC = ({ contentWidth={contentWidth} /> )} - {verboseMode && itemForDisplay.type === 'gemini_thought' && ( + {!compactMode && itemForDisplay.type === 'gemini_thought' && ( = ({ contentWidth={contentWidth} /> )} - {verboseMode && itemForDisplay.type === 'gemini_thought_content' && ( + {!compactMode && itemForDisplay.type === 'gemini_thought_content' && ( { const { version } = useAppContext(); const uiState = useUIState(); - const { frozenSnapshot } = useVerboseMode(); + const { frozenSnapshot } = useCompactMode(); const { pendingHistoryItems, terminalWidth, diff --git a/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap index 633f0bba751..a198a131641 100644 --- a/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap @@ -2,7 +2,7 @@ exports[`