Skip to content

feat: rich tool visualization with ExecCell component - #268

Merged
laynepenney merged 3 commits into
mainfrom
feat/tool-visualization
Feb 5, 2026
Merged

feat: rich tool visualization with ExecCell component#268
laynepenney merged 3 commits into
mainfrom
feat/tool-visualization

Conversation

@laynepenney

Copy link
Copy Markdown
Member

No description provided.

Implement comprehensive tool execution visualization for codi-rs TUI:

## New Components

- **ExecCell**: Rich visual display for tool calls
  - Color-coded status (yellow=running, green=success, red=error)
  - Animated spinner during execution (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏)
  - Live output streaming (last 5 lines displayed)
  - Duration tracking with ms/s precision
  - Expandable view for full input/output JSON
  - Input parameter preview with truncation

- **ExecCellManager**: Track multiple concurrent tool executions
  - Add/remove/get cells by ID
  - Running count and cell filtering
  - Spinner animation tick for all running cells
  - Automatic cleanup of old completed cells

## Integration

- Updated agent callbacks to include tool_id for tracking
- Modified App to create and manage exec cells on tool events
- Integrated exec cells into TUI layout between messages and input
- Added spinner animation tick to event loop

## Testing

- 6 insta snapshot tests for visual regression
- 44 unit tests covering all ExecCell functionality:
  - ToolStatus states and transitions
  - Cell lifecycle (pending → running → success/error)
  - Output buffering and streaming
  - Duration formatting
  - Manager operations
  - Edge cases (empty results, multiline, complex JSON)

## Files Added
- src/tui/components/exec_cell.rs (417 lines)
- src/tui/components/mod.rs
- tests/tui_exec_cell.rs (159 lines)
- tests/exec_cell_unit.rs (365 lines)
- tests/snapshots/*.snap (9 snapshot files)

## Files Modified
- Cargo.toml (added insta dev dependency)
- src/agent/types.rs (updated callback signatures)
- src/agent/mod.rs (pass tool_id in callbacks)
- src/orchestrate/child_agent.rs (fix callback signatures)
- src/tui/mod.rs (export components module)
- src/tui/app.rs (add exec_cells field and event handlers)
- src/tui/ui.rs (render exec cells in layout)

All 500+ tests pass ✓
@laynepenney
laynepenney merged commit 1d1ed7a into main Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant