Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 284 additions & 0 deletions docs/design/compact-mode/compact-mode-design.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/users/configuration/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +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` |
| `ui.compactMode` | boolean | Hide tool output and thinking for a cleaner view. Toggle with `Ctrl+O` during a session or via the Settings dialog. Tool approval prompts are never hidden, even in compact mode. 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` |
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/i18n/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,8 @@ export default {
'Sie können den Berechtigungsmodus schnell mit Tab oder /approval-mode wechseln.',
'Try /insight to generate personalized insights from your chat history.':
'Probieren Sie /insight, um personalisierte Erkenntnisse aus Ihrem Chatverlauf zu erstellen.',
'Press Ctrl+O to toggle compact mode — hide tool output and thinking for a cleaner view.':
'Strg+O drücken, um den Kompaktmodus umzuschalten — Tool-Ausgabe und Denkprozess ausblenden.',

// ============================================================================
// Custom API Key Configuration
Expand Down Expand Up @@ -1972,6 +1974,8 @@ export default {
'(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n':
'(↑ ↓ Pfeiltasten zum Navigieren, Enter zum Auswählen, Strg+C zum Beenden)\n',
compact: 'kompakt',
'compact mode: on (Ctrl+O off)': 'Kompaktmodus: ein (Strg+O aus)',
'to toggle compact mode': 'Kompaktmodus umschalten',
'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':
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/i18n/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default {
'to search history': 'to search history',
'to paste images': 'to paste images',
'for external editor': 'for external editor',
'to toggle compact mode': 'to toggle compact mode',
'Jump through words in the input': 'Jump through words in the input',
Comment on lines 59 to 63

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New i18n keys were added here for compact-mode discoverability, but other built-in locales (notably de.js and ja.js) do not define them, so those UIs will fall back to the English keys. Please add corresponding entries to all supported built-in locale files to keep translations consistent.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e45c997. Added to toggle compact mode, compact mode: on (Ctrl+O off), and the Tips string to both de.js and ja.js locales.

'Close dialogs, cancel requests, or quit application':
'Close dialogs, cancel requests, or quit application',
Expand Down Expand Up @@ -1556,6 +1557,8 @@ export default {
'You can switch permission mode quickly with Tab or /approval-mode.',
'Try /insight to generate personalized insights from your chat history.':
'Try /insight to generate personalized insights from your chat history.',
'Press Ctrl+O to toggle compact mode — hide tool output and thinking for a cleaner view.':
'Press Ctrl+O to toggle compact mode — hide tool output and thinking for a cleaner view.',

// ============================================================================
// Exit Screen / Stats
Expand Down Expand Up @@ -2013,6 +2016,7 @@ export default {
'(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n':
'(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n',
compact: 'compact',
'compact mode: on (Ctrl+O off)': 'compact mode: on (Ctrl+O off)',
'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':
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/i18n/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,8 @@ export default {
'Tab または /approval-mode で権限モードをすばやく切り替えられます。',
'Try /insight to generate personalized insights from your chat history.':
'/insight でチャット履歴からパーソナライズされたインサイトを生成できます。',
'Press Ctrl+O to toggle compact mode — hide tool output and thinking for a cleaner view.':
'Ctrl+O でコンパクトモードを切り替え — ツール出力と思考を非表示にしてすっきり表示。',
'Tips for getting started:': '始めるためのヒント:',
'1. Ask questions, edit files, or run commands.':
'1. 質問したり、ファイルを編集したり、コマンドを実行したりできます',
Expand Down Expand Up @@ -1464,6 +1466,8 @@ export default {
'(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n':
'(↑ ↓ 矢印キーで移動、Enter で選択、Ctrl+C で終了)\n',
compact: 'コンパクト',
'compact mode: on (Ctrl+O off)': 'コンパクトモード: オン (Ctrl+O でオフ)',
'to toggle compact mode': 'コンパクトモードの切り替え',
'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 で完全なツール出力を表示',
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/i18n/locales/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default {
'to search history': 'para pesquisar no histórico',
'to paste images': 'para colar imagens',
'for external editor': 'para editor externo',
'to toggle compact mode': 'alternar modo compacto',
'Jump through words in the input': 'Pular palavras na entrada',
'Close dialogs, cancel requests, or quit application':
'Fechar diálogos, cancelar solicitações ou sair do aplicativo',
Expand Down Expand Up @@ -1512,6 +1513,8 @@ export default {
'Você pode alternar o modo de permissão rapidamente com Shift+Tab ou /approval-mode.',
'Try /insight to generate personalized insights from your chat history.':
'Experimente /insight para gerar insights personalizados do seu histórico de conversas.',
'Press Ctrl+O to toggle compact mode — hide tool output and thinking for a cleaner view.':
'Pressione Ctrl+O para alternar o modo compacto — ocultar saída de ferramentas e raciocínio.',

// ============================================================================
// Exit Screen / Stats
Expand Down Expand Up @@ -1962,6 +1965,7 @@ export default {
'(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n':
'(Use ↑ ↓ para navegar, Enter para selecionar, Ctrl+C para sair)\n',
compact: 'compacto',
'compact mode: on (Ctrl+O off)': 'modo compacto: ligado (Ctrl+O desligar)',
'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':
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/i18n/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default {
'to search history': 'поиск в истории',
'to paste images': 'вставить изображения',
'for external editor': 'внешний редактор',
'to toggle compact mode': 'переключить компактный режим',

// ============================================================================
// Поля системной информации
Expand Down Expand Up @@ -1706,6 +1707,8 @@ export default {
'Вы можете быстро переключать режим разрешений с помощью Tab или /approval-mode.',
'Try /insight to generate personalized insights from your chat history.':
'Попробуйте /insight, чтобы получить персонализированные выводы из истории чатов.',
'Press Ctrl+O to toggle compact mode — hide tool output and thinking for a cleaner view.':
'Нажмите Ctrl+O для переключения компактного режима — скрыть вывод инструментов и рассуждения.',

// ============================================================================
// Custom API Key Configuration
Expand Down Expand Up @@ -1969,6 +1972,7 @@ export default {
'(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n':
'(↑ ↓ стрелки для навигации, Enter для выбора, Ctrl+C для выхода)\n',
compact: 'компактный',
'compact mode: on (Ctrl+O off)': 'компактный режим: вкл (Ctrl+O выкл)',
'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).':
'Скрывать вывод инструментов и процесс рассуждений для более чистого вида (переключить с помощью Ctrl+O).',
'Press Ctrl+O to show full tool output':
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/i18n/locales/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default {
'to search history': '搜索历史',
'to paste images': '粘贴图片',
'for external editor': '外部编辑器',
'to toggle compact mode': '切换紧凑模式',
'Jump through words in the input': '在输入中按单词跳转',
'Close dialogs, cancel requests, or quit application':
'关闭对话框、取消请求或退出应用程序',
Expand Down Expand Up @@ -1473,6 +1474,8 @@ export default {
'按 Tab 或输入 /approval-mode 可快速切换权限模式。',
'Try /insight to generate personalized insights from your chat history.':
'试试 /insight,从聊天记录中生成个性化洞察。',
'Press Ctrl+O to toggle compact mode — hide tool output and thinking for a cleaner view.':
'按 Ctrl+O 切换紧凑模式 ── 隐藏工具输出和思考过程,界面更简洁。',

// ============================================================================
// Exit Screen / Stats
Expand Down Expand Up @@ -1819,6 +1822,7 @@ export default {
'(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n':
'(使用 ↑ ↓ 箭头导航,Enter 选择,Ctrl+C 退出)\n',
compact: '紧凑',
'compact mode: on (Ctrl+O off)': '紧凑模式:开(Ctrl+O 关闭)',
'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 查看详细工具调用结果',
Expand Down
29 changes: 2 additions & 27 deletions packages/cli/src/ui/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1265,10 +1265,6 @@ export const AppContainer = (props: AppContainerProps) => {
const [compactMode, setCompactMode] = useState<boolean>(
settings.merged.ui?.compactMode ?? false,
);
const [frozenSnapshot, setFrozenSnapshot] = useState<
HistoryItemWithoutId[] | null
>(null);

const [ctrlCPressedOnce, setCtrlCPressedOnce] = useState(false);
const ctrlCTimerRef = useRef<NodeJS.Timeout | null>(null);
const [ctrlDPressedOnce, setCtrlDPressedOnce] = useState(false);
Expand All @@ -1283,18 +1279,6 @@ export const AppContainer = (props: AppContainerProps) => {
const [showEscapePrompt, setShowEscapePrompt] = useState(false);
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = useState(false);

useEffect(() => {
// Clear frozen snapshot when streaming ends OR when entering confirmation
// state. During WaitingForConfirmation, the user needs to see the latest
// pending items (including the confirmation message) rather than a stale snapshot.
if (
streamingState === StreamingState.Idle ||
streamingState === StreamingState.WaitingForConfirmation
) {
setFrozenSnapshot(null);
}
}, [streamingState]);

const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } =
useFolderTrust(settings, setIsTrustedFolder);
const {
Expand Down Expand Up @@ -1686,13 +1670,6 @@ export const AppContainer = (props: AppContainerProps) => {
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.
if (streamingState === StreamingState.Responding) {
setFrozenSnapshot([...pendingHistoryItems]);
} else {
setFrozenSnapshot(null);
}
}
},
[
Expand Down Expand Up @@ -1728,8 +1705,6 @@ export const AppContainer = (props: AppContainerProps) => {
isAuthenticating,
compactMode,
setCompactMode,
setFrozenSnapshot,
pendingHistoryItems,
refreshStatic,
],
);
Expand Down Expand Up @@ -2155,8 +2130,8 @@ export const AppContainer = (props: AppContainerProps) => {
);

const compactModeValue = useMemo(
() => ({ compactMode, frozenSnapshot }),
[compactMode, frozenSnapshot],
() => ({ compactMode, setCompactMode }),
[compactMode, setCompactMode],
);

return (
Expand Down
8 changes: 0 additions & 8 deletions packages/cli/src/ui/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ 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 { useCompactMode } from '../contexts/CompactModeContext.js';
import { ApprovalMode } from '@qwen-code/qwen-code-core';
import { t } from '../../i18n/index.js';

Expand All @@ -26,7 +25,6 @@ export const Footer: React.FC = () => {
const config = useConfig();
const { vimEnabled, vimMode } = useVimMode();
const { text: statusLineText } = useStatusLine();
const { compactMode } = useCompactMode();

const { promptTokenCount, showAutoAcceptIndicator } = {
promptTokenCount: uiState.sessionStats.lastPromptTokenCount,
Expand Down Expand Up @@ -101,12 +99,6 @@ export const Footer: React.FC = () => {
),
});
}
if (compactMode) {
rightItems.push({
key: 'compact',
node: <Text color={theme.text.accent}>{t('compact')}</Text>,
});
}

// Layout matches upstream: left column has status line (top) + hints/mode
// (bottom), right section has indicators. Status line and hints coexist.
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/ui/components/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ export const Help: React.FC<Help> = ({ commands, width }) => (
</Text>{' '}
- {t('Clear the screen')}
</Text>
<Text color={theme.text.primary}>
<Text bold color={theme.text.accent}>
Ctrl+O
</Text>{' '}
- {t('to toggle compact mode')}
</Text>
<Text color={theme.text.primary}>
<Text bold color={theme.text.accent}>
{process.platform === 'darwin' ? 'Ctrl+X / Meta+Enter' : 'Ctrl+X'}
Expand Down
9 changes: 5 additions & 4 deletions packages/cli/src/ui/components/KeyboardShortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const getShortcuts = (): Shortcut[] => [
{ key: 'ctrl+y', description: t('to retry last request') },
{ key: getPasteKey(), description: t('to paste images') },
{ key: getExternalEditorKey(), description: t('for external editor') },
{ key: 'ctrl+o', description: t('to toggle compact mode') },
];

const ShortcutItem: React.FC<{ shortcut: Shortcut }> = ({ shortcut }) => (
Expand All @@ -55,11 +56,11 @@ const COLUMN_GAP = 4;
const MARGIN_LEFT = 2;
const MARGIN_RIGHT = 2;

// Column distribution for different layouts (4+4+4 for 3 cols, 6+6 for 2 cols)
// Column distribution for different layouts (5+4+4 for 3 cols, 7+6 for 2 cols)
const COLUMN_SPLITS: Record<number, number[]> = {
3: [4, 4, 4],
2: [6, 6],
1: [12],
3: [5, 4, 4],
2: [7, 6],
1: [13],
};

export const KeyboardShortcuts: React.FC = () => {
Expand Down
Loading
Loading