Commit Graph

69 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
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
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
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
Steven Robertson
b0ceb74462 feat: implement AfterTool tail tool calls (#18486) 2026-02-24 03:57:00 +00:00
N. Taylor Mullen
14415316c0 feat(core): add support for MCP progress updates (#19046) 2026-02-18 20:46:12 +00:00
Jarrod Whelan
4a48d7cf93 feat(cli): truncate shell output in UI history and improve active shell display (#17438) 2026-02-08 08:09:48 +00:00
Jacob Richman
a1f5d39029 Fix issue #17080 (#17100)
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
2026-01-23 00:02:14 +00:00
Jacob Richman
63c918fe7d fix(ui): resolve sticky header regression in tool messages (#16514) 2026-01-13 22:17:05 +00:00
Jacob Richman
ca6786a28b feat(ui): use Tab to switch focus between shell and input (#14332) 2026-01-12 23:30:12 +00:00
Jack Wotherspoon
d351f07758 feat: custom loading phrase when interactive shell requires input (#12535) 2025-11-21 17:19:34 +00:00
Gal Zahavi
2231497b1f feat: add click-to-focus support for interactive shell (#13341) 2025-11-19 23:49:39 +00:00
Jacob Richman
fb99b95372 Switch back to truncating headers. Unfortunately we have too many headers that are 10+ lines for no good reason so we need to add back this truncation until we fix them. (#13018) 2025-11-13 19:38:19 +00:00
Jacob Richman
ee7065f665 Sticky headers where the top rounded border is sticky. (#12971) 2025-11-13 01:01:16 +00:00
Jacob Richman
cbbf565121 Support ink scrolling final pr (#12567) 2025-11-11 15:50:11 +00:00
Tommaso Sciortino
35afab31e1 Don't display todo in history (#11516) 2025-10-20 17:36:55 +00:00
Tommaso Sciortino
cd76b0b22d Create Todo List Tab (#11430) 2025-10-18 04:10:57 +00:00
Tommaso Sciortino
9a4211b610 Improve rendering of ToDo lists. (#11315) 2025-10-16 23:06:43 +00:00
Srivats Jayaram
6ded45e5d2 feat: Add markdown toggle (alt+m) to switch between rendered and raw… (#10383)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
2025-10-16 18:23:36 +00:00
Jacob Richman
558be87311 Re-land bbiggs changes to reduce margin on narrow screens with fixes + full width setting (#10522) 2025-10-10 02:27:20 +00:00
Gal Zahavi
467a305f26 chore(shell): Enable interactive shell by default (#10661) 2025-10-08 20:28:19 +00:00
Gal Zahavi
6695c32aa2 fix(shell): improve shell output presentation and usability (#8837) 2025-09-30 20:44:58 +00:00
Jacob Richman
375b8522fc Fix bug where users are unable to re-enter disconnected terminals. (#8765) 2025-09-20 17:59:37 +00:00
Gal Zahavi
ec0acc486e fix(cli) : fix shell colors to match new coloring (#8747)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-09-18 20:35:55 +00:00
Gal Zahavi
a34e375193 refactor(shell): Send AnsiOutput when ShowColor is false (#8647) 2025-09-18 20:04:46 +00:00
Miguel Solorio
67f7dae4e3 Update default text styles (#8291) 2025-09-11 21:22:16 +00:00
Gal Zahavi
181898cb5d feat(shell): enable interactive commands with virtual terminal (#6694) 2025-09-11 20:27:27 +00:00
Miguel Solorio
b9b6fe1f73 feat(ui): Semantic tokens refactor (#8087) 2025-09-10 17:57:07 +00:00
christine betts
fe5bb6694e Screen reader updates (#7307) 2025-08-28 20:52:14 +00:00
Arya Gummadi
4c3ec1f0cc refactor: centralize tool status symbols in constants (#7054) 2025-08-27 14:54:32 +00:00
Pascal Birchler
0f031a7f89 Explict imports & exports with type modifier (#3774) 2025-08-25 22:04:53 +00:00
Arya Gummadi
71c090c696 feat: add golden snapshot test for ToolGroupMessage and improve success symbol (#7037) 2025-08-25 21:42:18 +00:00
Arya Gummadi
4170dbdac3 fix: misaligned right border on tool calls ui and spacing in multiple tool calls ui (#6941) 2025-08-25 18:26:06 +00:00
Jacob Richman
6c1373c332 Revert "Update semantic color tokens" (#6365) 2025-08-16 03:18:31 +00:00
Miguel Solorio
3c0af3654a Update semantic color tokens (#6253)
Co-authored-by: jacob314 <jacob314@gmail.com>
2025-08-15 22:39:54 +00:00
Noritaka Kobayashi
dbe217828d chore: fix typos in comment-out (#1540)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
2025-06-26 04:34:53 +00:00
Jacob Richman
8bd5645dd4 Truncate all strings before displaying in a tool messages to avoid stack overflows (#1395) 2025-06-24 22:31:55 +00:00
Sandy Tao
a411c415a8 Do not render mcp responses as markdown (#1388) 2025-06-24 14:10:41 -07: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
Olcan
d061419452 enforce minimum lines shown/hidden (#860) 2025-06-08 17:11:16 -07:00
Miguel Solorio
8a0a2523ca Allow themes to theme the UI (#769) 2025-06-05 14:35:47 -07:00
Olcan
a0ba65944f disable markdown rendering of shell tool output (#625) 2025-05-30 12:43:59 -07:00
Olcan
7c4a5464f6 truncate (hide) tool output at the top, add some spacing, also fix shell output interval change accidentally undone in a previous commit (#619) 2025-05-30 01:58:09 -07:00
Jacob Richman
05a49702d8 Refactor: Add GeminiRespondingSpinner to make use of streamingState idiomatic (#583) 2025-05-28 11:17:19 -07:00
Taylor Mullen
7408c78dbb Change tool call spinner to be different.
- This differentiates the tool calling spinner from one that matches the normal loading indiator to somethign a little more seamless.
2025-05-25 16:05:22 -07:00
Jacob Richman
b4c16d1f56 Code review comment fixes and some refactors. (#525)
No intentional different behavior aside for tweaks suggested from the code review of #506 Refactor: Extract console message logic to custom hook

This commit refactors the console message handling from App.tsx into a new custom hook useConsoleMessages.

This change improves the testability of the console message logic and declutters the main App component.

Created useConsoleMessages.ts to encapsulate console message state and update logic.
Updated App.tsx to utilize the new useConsoleMessages hook.
Added unit tests for useConsoleMessages.ts to ensure its functionality.
I deleted and started over on LoadingIndicator.test.tsx as I spent way too much time trying to fix it before just regenerating the tests as the code was easier to write tests for from scratch and the existing tests were not that good (I added them in the previous pull request).
2025-05-24 00:44:17 -07:00
Jacob Richman
91ee02898a feat: Modify loading indicator to support a paused state (#506) 2025-05-23 10:25:17 -07:00
Brandon Keiji
01971741e0 feat: add emphasis to tool confirmations (#502) 2025-05-23 05:28:31 +00:00