Commit Graph

33 Commits

Author SHA1 Message Date
Jarrod Whelan
166d3cf23b 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-29 15:15:56 -07:00
Gal Zahavi
36e6445dba feat(sandbox): dynamic macOS sandbox expansion and worktree support (#23301) 2026-03-24 04:48:13 +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
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
ruomeng
94e6bf8591 fix(cli): resolve duplicate footer on tool cancel via ESC (#21743) (#21781) 2026-03-18 20:27:38 +00:00
Gal Zahavi
b49fc8122d feat(security): add disableAlwaysAllow setting to disable auto-approvals (#21941) 2026-03-13 23:02:09 +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
Jacob Richman
c7e2dbe0cf Fix so shell calls are formatted (#21237) 2026-03-05 18:39:42 +00:00
Adib234
ef247e220d feat(plan): support opening and modifying plan in external editor (#20348) 2026-02-26 04:38:44 +00:00
Yuki Okita
05bc0399f3 feat(cli): allow expanding full details of MCP tool on approval (#19916) 2026-02-24 01:45:05 +00:00
Emily Hedlund
a01d7e9a05 security: implement deceptive URL detection and disclosure in tool confirmations (#19288) 2026-02-20 20:21:31 +00:00
Emily Hedlund
aed348a99c security: strip deceptive Unicode characters from terminal output (#19026)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-02-20 20:04:32 +00:00
Jacob Richman
04f65f3d55 Migrate core render util to use xterm.js as part of the rendering loop. (#19044) 2026-02-19 00:46:50 +00:00
Abhi
00f73b73bc refactor(cli): finalize event-driven transition and remove interaction bridge (#18569) 2026-02-13 02:14:35 +00:00
Gal Zahavi
aba8c5f662 fix(cli): allow restricted .env loading in untrusted sandboxed folders (#17806) 2026-02-04 01:08:10 +00:00
Abhi
68649c8dec fix(cli): restore 'Modify with editor' option in external terminals (#17621) 2026-01-27 02:24:25 +00:00
Abhi
c266b529ae refactor(cli): decouple UI from live tool execution via ToolActionsContext (#17183) 2026-01-21 21:16:30 +00:00
N. Taylor Mullen
1681ae1842 refactor(cli): unify shell confirmation dialogs (#16828) 2026-01-16 23:06:52 +00:00
Abhi
a3234fb534 prefactor: add rootCommands as array so it can be used for policy parsing (#16640) 2026-01-14 18:50:28 +00:00
Jacob Richman
419464a8c2 feat(ui): Put "Allow for all future sessions" behind a setting off by default. (#15322) 2025-12-19 17:25:23 +00:00
N. Taylor Mullen
e0f159085e feat: simplify tool confirmation labels for better UX (#15296) 2025-12-19 00:38:53 +00:00
Megha Bansal
e205a468d9 Improve test coverage for cli/src/ui/components (#13598) 2025-11-22 02:47:29 +00:00
shrutip90
2a0e69d833 fix(trust): Update config.isTrustedFolder (#7373) 2025-08-29 02:41:33 +00:00
shrutip90
4e49ee4c73 Make config non optional in ToolConfirmationMessage (#7083) 2025-08-26 17:02:22 +00:00
shrutip90
97ce197f38 Treat undefined same as true for isTrustedFolder (#7073) 2025-08-26 02:57:57 +00:00
shrutip90
ae1f67df04 feat: Disable YOLO and AUTO_EDIT modes for untrusted folders (#7041) 2025-08-26 00:30:04 +00:00
Pascal Birchler
0f031a7f89 Explict imports & exports with type modifier (#3774) 2025-08-25 22:04:53 +00:00
Jacob Richman
bd5e49c5ff fix(input) Resolve cases where escape was broken (#6304) 2025-08-15 17:54:00 +00:00
Brandon Keiji
f6c36f75e3 fix: prepublish changes to package names (#1420) 2025-06-25 12:41:11 +00:00
Jacob Richman
b0bc7c3d99 Fix flicker issues by ensuring all actively changing content fits in the viewport (#1217) 2025-06-19 13:17:23 -07:00
Allen Hutchison
31b28ade01 Improvements to web-fetch tool (#1030) 2025-06-13 17:44:14 -07:00