Commit Graph

261 Commits

Author SHA1 Message Date
Jarrod Whelan
974fd7a528 refactor(cli): address code review feedback
- Abstracted hardcoded padding, margin, and width calculations in `DenseToolMessage` into explicit constants to improve readability.
- Made `terminalWidth` a required property on `DenseToolMessageProps` to ensure consistent layout calculations, simplifying internal ternary checks.
- Updated `DenseToolMessage` tests to provide the now-required `terminalWidth` prop.
- Removed expensive `node:crypto` usage in `DiffRenderer` key generation, opting for a simpler optional key.
- Simplified terminal refresh logic in `AppContainer` by removing `setTimeout` from the "show more lines" handler, as it was redundant.
- Streamlined `staticHeight` calculation loop in `ToolGroupMessage` to use layout constants.
- Removed redundant `height={0}` properties on Box borders in `ToolGroupMessage`.
- Simplified `effectiveMaxHeight` assignment in `ToolResultDisplay` by using the pre-calculated `availableHeight` directly.
- Restore tool message padding by moving `paddingTop={1}` from `ToolMessage` and `ShellToolMessage` content boxes back to `paddingBottom={1}` in `StickyHeader`.
- Restore `ToolConfirmationQueue` layout.
- Removed excluded file information from ReadManyFiles tool's compact output
2026-03-30 15:44:15 -07:00
Jarrod Whelan
666576c766 feat(ui): implement compact tool output and structured tool results
This commit introduces the compactToolOutput feature to optimize terminal vertical space usage for common, high-volume tools.

1. Compact Tool Output UI:
- Added DenseToolMessage component for rendering compact, single-line tool summaries.
- Updated ToolGroupMessage to detect contiguous compact tools and render them with stitched borders for a streamlined look.
- Added Ctrl+O shortcut in AppContainer to toggle full expansion of tool results from the last turn.
- Implemented useGeminiStream border logic to correctly render borders around dense sections.

2. Core Tool Structured Results:
- grep: Updated to return GrepResult with matches, file paths, and line numbers instead of a raw formatted string.
- ls (list_directory): Updated to return ListDirectoryResult with an array of files.
- read_many_files: Updated to return ReadManyFilesResult with read files, skipped files, and reasons.
- Modified ToolResultDisplay and isStructuredToolResult type guards to support these new structured interfaces.

3. User Settings & Documentation:
- Added compactToolOutput to the UI settings schema (default: true).
- Updated configuration docs and schema to reflect the new setting.
- Adjusted compact subview line limits (COMPACT_TOOL_SUBVIEW_MAX_LINES).

test(cli): refine settings and tool action mocks to resolve test rig regressions

This update addresses incomplete settings store contracts and default state mismatches that caused snapshot runtime errors and verification failures in compact tool output tests.

1. Settings Mock Completeness:
- Updated `createMockSettings` in `mockConfig.ts` to include required functional methods (`subscribe`, `getSnapshot`, `setValue`) to satisfy React's `useSyncExternalStore` contract. This resolves "store.getSnapshot is not a function" errors in snapshot tests.

2. Tool Actions Provider Configuration:
- Modified `renderWithProviders` to accept a `toolActions` options object, allowing individual tests to inject specific tool expansion states.
- Changed the default mock for `isExpanded` from `true` to `false` to align with the application's default behavior (collapsed outputs) in alternate buffer mode.

3. Test Refactoring:
- Refactored `ToolGroupMessage.compact.test.tsx` to use the standardized `createMockSettings` utility rather than a manual generic object, ensuring proper context evaluation during rendering.

refactor(cli): address nuanced snapshot rendering scenarios through layout and padding refinements

- Refined height calculation logic in ToolGroupMessage to ensure consistent spacing between compact and standard tools.
- Adjusted padding and margins in StickyHeader, ToolConfirmationQueue, ShellToolMessage, and ToolMessage for visual alignment.
- Updated TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT to account for internal layout changes.
- Improved ToolResultDisplay height handling in alternate buffer mode.
- Updated test snapshots to reflect layout and spacing corrections.

refactor(cli): cleanup and simplify UI components

- Reduced UI refresh delay in AppContainer.tsx for a more responsive user experience.
- Reorder imports and hook definitions within AppContainer.tsx to reduce diff 'noise'.

refactor(cli): enhance compact output robustness and visual regression testing

Addressing automated review feedback to improve code maintainability and layout stability.

1. Robust File Extension Parsing:
- Introduced getFileExtension utility in packages/cli/src/ui/utils/fileUtils.ts using node:path for reliable extension extraction.
- Updated DenseToolMessage and DiffRenderer to use the new utility, replacing fragile string splitting.

2. Visual Regression Coverage:
- Added SVG snapshot tests to DenseToolMessage.test.tsx to verify semantic color rendering and layout integrity in compact mode.

fix(cli): resolve dense tool output code quality issues

- Replaced manual string truncation with Ink's `wrap="truncate-end"` to adhere to UI guidelines.
- Added `isReadManyFilesResult` type guard to `packages/core/src/tools/tools.ts` to improve typing for structured tool results.
- Fixed an incomplete test case in `DenseToolMessage.test.tsx` to properly simulate expansion via context instead of missing mouse events.
2026-03-30 15:44:15 -07:00
Christian Gunderman
b7c86b5497 UX for topic narration tool (#24079) 2026-03-28 21:33:38 +00:00
Adam Weidman
3eebb75b7a feat(core): agnostic background task UI with CompletionBehavior (#22740)
Co-authored-by: mkorwel <matt.korwel@gmail.com>
2026-03-28 21:27:51 +00:00
Jacob Richman
97c99f263a Fix test flakes by globally mocking ink-spinner (#24044) 2026-03-27 21:19:46 +00:00
Jacob Richman
a86935b6de fix(cli): allow ask question dialog to take full window height (#23693) 2026-03-25 23:26:34 +00:00
Adam Weidman
91d756f391 fix(core): improve remote agent streaming UI and UX (#23633) 2026-03-24 15:34:04 +00:00
Gal Zahavi
36e6445dba feat(sandbox): dynamic macOS sandbox expansion and worktree support (#23301) 2026-03-24 04:48:13 +00:00
Abhi
a1f9af3fa7 fix(core): accurately reflect subagent tool failure in UI (#23187) 2026-03-24 01:56:00 +00:00
Jarrod Whelan
89ca78837e refactor(cli,core): foundational layout, identity management, and type safety (#23286) 2026-03-24 01:49:51 +00:00
Dev Randalpura
139ef0d5bd fix(ui): make tool confirmations take up entire terminal height (#22366)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-23 19:42:30 +00:00
Christian Gunderman
d1dc4902fd fix(hooks): support 'ask' decision for BeforeTool hooks (#21146) 2026-03-21 03:52:39 +00:00
Tommaso Sciortino
6c78eb7a39 test(cli): refactor tests for async render utilities (#23252) 2026-03-20 20:08:29 +00:00
Tommaso Sciortino
23264ced9a refactor(cli): integrate real config loading into async test utils (#23040) 2026-03-19 17:05:33 +00:00
Dev Randalpura
34f271504a fix(ui): fix flickering on small terminal heights (#21416)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
2026-03-18 21:28:21 +00:00
ruomeng
94e6bf8591 fix(cli): resolve duplicate footer on tool cancel via ESC (#21743) (#21781) 2026-03-18 20:27:38 +00:00
Tommaso Sciortino
a5a461c234 test(cli): simplify createMockSettings calls (#22952) 2026-03-18 18:12:44 +00:00
Tommaso Sciortino
d7dfcf7f99 refactor(cli): simplify keypress and mouse providers and update tests (#22853) 2026-03-18 16:38:56 +00:00
Abhi
be7c7bb83d fix(cli): resolve subagent grouping and UI state persistence (#22252) 2026-03-18 03:11:20 +00:00
N. Taylor Mullen
e2658ccda8 refactor(cli): remove extra newlines in ShellToolMessage.tsx (#22868)
Co-authored-by: Spencer <spencertang@google.com>
2026-03-17 23:48:16 +00:00
Sri Pasumarthi
e3df87cf1a fix: Adjust ToolGroupMessage filtering to hide Confirming and show Canceled tool calls. (#22230) 2026-03-16 15:50:11 +00:00
Gal Zahavi
b49fc8122d feat(security): add disableAlwaysAllow setting to disable auto-approvals (#21941) 2026-03-13 23:02:09 +00:00
anj-s
dd8d4c98b3 feat(tracker): return TodoList display for tracker tools (#22060) 2026-03-13 18:18:33 +00:00
Sri Pasumarthi
41d4f59f5e feat: Display pending and confirming tool calls (#22106)
Co-authored-by: Spencer <spencertang@google.com>
2026-03-12 05:57:37 +00:00
nityam
be16caece2 merge duplicate imports packages/cli/src subtask2 (#22051) 2026-03-11 20:14:12 +00:00
Aashir Javed
b00d7c88ad fix(ui): prevent empty tool-group border stubs after filtering (#21852)
Co-authored-by: jacob314 <jacob314@gmail.com>
2026-03-10 19:09:07 +00:00
Spencer
a220874281 feat(policy): support auto-add to policy by default and scoped persistence (#20361) 2026-03-10 17:01:41 +00:00
Tommaso Sciortino
215f8f3f15 refactor(ui): unify keybinding infrastructure and support string initialization (#21776) 2026-03-09 23:26:33 +00:00
Muhammad Usman
f88488d1f9 fix(core): resolve Windows line ending and path separation bugs across CLI (#21068) 2026-03-09 22:40:22 +00:00
Tommaso Sciortino
ab64b15d51 refactor: migrate to useKeyMatchers hook (#21753) 2026-03-09 20:48:09 +00:00
joshualitt
a17691f0fc feat(core): improve subagent result display (#20378) 2026-03-09 19:20:15 +00:00
Keith Guerin
237864eb63 feat(cli): Invert quota language to 'percent used' (#20100)
Co-authored-by: jacob314 <jacob314@gmail.com>
2026-03-07 23:17:10 +00:00
Jacob Richman
e89cf5d86e fix(cli): correct shell height reporting (#21492) 2026-03-07 19:31:09 +00:00
Jarrod Whelan
54b0344fc5 fix(ui): unify Ctrl+O expansion hint experience across buffer modes (#21474) 2026-03-07 19:04:22 +00:00
Keith Guerin
e5d58c2b5a feat(cli): overhaul thinking UI (#18725) 2026-03-07 04:20:27 +00:00
Tommaso Sciortino
6d607a5953 feat(ui): dynamically generate all keybinding hints (#21346) 2026-03-06 18:34:26 +00:00
Mark McLaughlin
6aa6630137 fix(theme): improve theme color contrast for macOS Terminal.app (#21175) 2026-03-05 23:33:49 +00:00
Jacob Richman
c7e2dbe0cf Fix so shell calls are formatted (#21237) 2026-03-05 18:39:42 +00:00
Dev Randalpura
f20e45175e fix(ui): add partial output to cancelled shell UI (#21178)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-05 17:30:20 +00:00
Dev Randalpura
205d69eb07 fix(ui): removed double padding on rendered content (#21029) 2026-03-05 01:00:34 +00:00
Keith Guerin
d25088956d feat(ui): standardize semantic focus colors and enhance history visibility (#20745)
Co-authored-by: jacob314 <jacob314@gmail.com>
2026-03-04 00:10:09 +00:00
Keith Guerin
1e2afbb514 feat(cli): invert context window display to show usage (#20071)
Co-authored-by: jacob314 <jacob314@gmail.com>
2026-03-03 09:22:29 +00:00
Christian Gunderman
7ca3a33f8b Subagent activity UX. (#17570) 2026-03-02 21:04:31 +00:00
Dmitry Lyalin
7f8ce8657c Add low/full CLI error verbosity mode for cleaner UI (#20399) 2026-02-27 19:15:10 +00:00
Jerop Kipruto
66b8922d66 feat(ui): add 'ctrl+o' hint to truncated content message (#20529) 2026-02-27 15:02:46 +00:00
Jarrod Whelan
049d48ef60 test(cli): fix flaky ToolResultDisplay overflow test (#20518) 2026-02-27 00:30:43 +00:00
Adib234
ef247e220d feat(plan): support opening and modifying plan in external editor (#20348) 2026-02-26 04:38:44 +00:00
Jacob Richman
f9f916e1dc test: support tests that include color information (#20220) 2026-02-25 23:31:35 +00:00
Jasmeet Bhatia
c0b76af442 feat(mcp): add progress bar, throttling, and input validation for MCP tool progress (#19772) 2026-02-24 17:13:51 +00:00
Keith Guerin
d143a83d5b refactor(ui): Update and simplify use of gray colors in themes (#20141) 2026-02-24 09:21:10 +00:00