Commit 70396d1
feat: optimize compact mode UX — shortcuts, settings sync, and safety (#3100)
* feat: optimize compact mode UX — shortcuts, settings sync, and safety improvements
- Add Ctrl+O to keyboard shortcuts list (?) and /help command
- Sync compact mode toggle from Settings dialog with CompactModeContext
- Protect tool approval prompts from being hidden in compact mode
(MainContent forces live rendering during WaitingForConfirmation)
- Remove snapshot freezing on toggle — treat as persistent preference,
not temporary peek (differs from Claude Code's session-scoped model)
- Add compact mode tip to startup Tips rotation for non-intrusive discovery
- Remove compact mode indicator from footer to reduce UI clutter
- Add competitive analysis design doc (EN + ZH) comparing with Claude Code
- Update user docs (settings.md) and i18n translations (en/zh/ru/pt)
Relates to #3047, #2767, #2770
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: remove frozenSnapshot dead code and Chinese design doc
- Remove frozenSnapshot state, useEffect, and all related logic from
AppContainer, MainContent, CompactModeContext, and test files
- Simplify MainContent to always render live pendingHistoryItems
- Delete compact-mode-design-zh.md (redundant Chinese translation)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address PR review feedback for compact mode optimization
- Add refreshStatic() call after setCompactMode in SettingsDialog
so already-rendered Static history updates immediately
- Fix outdated column split comment in KeyboardShortcuts (5+4+4)
- Update design doc: remove all frozenSnapshot references, renumber
optimization recommendations, fix file reference descriptions
- Add missing i18n keys for de.js and ja.js locales
- Add test for SettingsDialog compact mode sync with CompactModeContext
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: prevent subagent confirmation from being hidden in compact mode
hasConfirmingTool only checks ToolCallStatus.Confirming, but subagent
approvals arrive via resultDisplay.pendingConfirmation while the tool
status remains Executing. Add hasSubagentPendingConfirmation to the
showCompact guard so tool groups with pending subagent confirmations
are always force-expanded.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: force show subagent confirmation result in compact mode
The previous fix (47ee03c) correctly force-expanded the tool group
wrapper when a subagent had pending confirmation, but each inner
ToolMessage still hid its resultDisplay due to compactMode check,
which hid the AgentExecutionDisplay containing the inline confirmation
UI.
Add isAgentWithPendingConfirmation to forceShowResult conditions so
the inner AgentExecutionDisplay is rendered even in compact mode.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(compact-mode): merge consecutive tool groups across hidden items
In compact mode, sequential tool calls across multiple LLM turns each
produced a separate bordered box, defeating the "compact" intent. The
model typically emits a `gemini_thought` between consecutive tool calls,
which is hidden in compact mode — so visually the boxes look adjacent,
but in `history` they are separated by hidden items.
This commit adds render-time merging of consecutive tool_group history
items, where "consecutive" allows hidden-in-compact items
(`gemini_thought`, `gemini_thought_content`) between them.
Key pieces:
- New `mergeCompactToolGroups` utility that merges adjacent mergeable
tool_groups, skipping hidden items between them. Force-expand
conditions (Confirming/Error tools, subagent pending confirmation,
user-initiated, focused embedded shell) preserve group boundaries so
authorization prompts, errors, and shell focus stay visible.
- `MainContent.tsx` applies the merger only when `compactMode === true`
(verbose mode is unchanged) and calls `refreshStatic()` when a merge
consolidates items, because Ink's `<Static>` is append-only and
cannot replace already-committed terminal content.
- `CompactToolGroupDisplay.tsx` shows a `× N` count when a merged
group contains more than one tool, matching the existing single-turn
multi-tool display style.
- 19 unit tests covering empty/single/multiple groups, hidden-item
skipping (the 8-tool real-world scenario), force-expand boundaries,
mixed tool types, and complex sequences.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: 秦奇 <gary.gq@alibaba-inc.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 08d3d6e commit 70396d1
File tree
22 files changed
+1091
-70
lines changed- docs
- design/compact-mode
- users/configuration
- packages/cli/src
- i18n/locales
- services/tips
- ui
- components
- messages
- contexts
- utils
22 files changed
+1091
-70
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1787 | 1787 | | |
1788 | 1788 | | |
1789 | 1789 | | |
| 1790 | + | |
| 1791 | + | |
1790 | 1792 | | |
1791 | 1793 | | |
1792 | 1794 | | |
| |||
1993 | 1995 | | |
1994 | 1996 | | |
1995 | 1997 | | |
| 1998 | + | |
| 1999 | + | |
1996 | 2000 | | |
1997 | 2001 | | |
1998 | 2002 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
1563 | 1564 | | |
1564 | 1565 | | |
1565 | 1566 | | |
| 1567 | + | |
| 1568 | + | |
1566 | 1569 | | |
1567 | 1570 | | |
1568 | 1571 | | |
| |||
2033 | 2036 | | |
2034 | 2037 | | |
2035 | 2038 | | |
| 2039 | + | |
2036 | 2040 | | |
2037 | 2041 | | |
2038 | 2042 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1182 | 1182 | | |
1183 | 1183 | | |
1184 | 1184 | | |
| 1185 | + | |
| 1186 | + | |
1185 | 1187 | | |
1186 | 1188 | | |
1187 | 1189 | | |
| |||
1484 | 1486 | | |
1485 | 1487 | | |
1486 | 1488 | | |
| 1489 | + | |
| 1490 | + | |
1487 | 1491 | | |
1488 | 1492 | | |
1489 | 1493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
1520 | 1521 | | |
1521 | 1522 | | |
1522 | 1523 | | |
| 1524 | + | |
| 1525 | + | |
1523 | 1526 | | |
1524 | 1527 | | |
1525 | 1528 | | |
| |||
1983 | 1986 | | |
1984 | 1987 | | |
1985 | 1988 | | |
| 1989 | + | |
1986 | 1990 | | |
1987 | 1991 | | |
1988 | 1992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
1714 | 1715 | | |
1715 | 1716 | | |
1716 | 1717 | | |
| 1718 | + | |
| 1719 | + | |
1717 | 1720 | | |
1718 | 1721 | | |
1719 | 1722 | | |
| |||
1990 | 1993 | | |
1991 | 1994 | | |
1992 | 1995 | | |
| 1996 | + | |
1993 | 1997 | | |
1994 | 1998 | | |
1995 | 1999 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
1480 | 1481 | | |
1481 | 1482 | | |
1482 | 1483 | | |
| 1484 | + | |
| 1485 | + | |
1483 | 1486 | | |
1484 | 1487 | | |
1485 | 1488 | | |
| |||
1839 | 1842 | | |
1840 | 1843 | | |
1841 | 1844 | | |
| 1845 | + | |
1842 | 1846 | | |
1843 | 1847 | | |
1844 | 1848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
178 | 187 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1313 | 1313 | | |
1314 | 1314 | | |
1315 | 1315 | | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | 1316 | | |
1321 | 1317 | | |
1322 | 1318 | | |
| |||
1331 | 1327 | | |
1332 | 1328 | | |
1333 | 1329 | | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
1346 | 1330 | | |
1347 | 1331 | | |
1348 | 1332 | | |
| |||
1734 | 1718 | | |
1735 | 1719 | | |
1736 | 1720 | | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | 1721 | | |
1745 | 1722 | | |
1746 | 1723 | | |
| |||
1776 | 1753 | | |
1777 | 1754 | | |
1778 | 1755 | | |
1779 | | - | |
1780 | | - | |
1781 | 1756 | | |
1782 | 1757 | | |
1783 | 1758 | | |
| |||
2207 | 2182 | | |
2208 | 2183 | | |
2209 | 2184 | | |
2210 | | - | |
2211 | | - | |
| 2185 | + | |
| 2186 | + | |
2212 | 2187 | | |
2213 | 2188 | | |
2214 | 2189 | | |
| |||
0 commit comments