Skip to content

fix(ink-ui): add tool call display and improve visual stability#163

Merged
laynepenney merged 1 commit intomainfrom
fix/ink-ui-tool-display
Jan 26, 2026
Merged

fix(ink-ui): add tool call display and improve visual stability#163
laynepenney merged 1 commit intomainfrom
fix/ink-ui-tool-display

Conversation

@laynepenney
Copy link
Copy Markdown
Collaborator

Summary

  • Add addToolCall() and addToolResult() methods to InkUiController to display tool calls in the Ink UI
  • Display tool results with line count, duration, and error status
  • Fix visual stability by always showing the activity panel with minimum height padding
  • Add comprehensive tests for Ink UI controller (11 tests)

Changes

File Description
src/ui/ink/controller.ts Add addToolCall() and addToolResult() methods
src/index.ts Call new controller methods in onToolCall/onToolResult callbacks
src/ui/ink/app.tsx Remove early return, add minimum height padding to activity panel
tests/ink-ui.test.ts New test file with 11 tests

Test plan

  • Build passes
  • All 2026 tests pass
  • Start codi --ui ink and ask it to read a file
  • Verify tool call name and input shown
  • Verify tool result shown after completion
  • Verify activity panel maintains stable position

🤖 Generated with Claude Code

@laynepenney laynepenney force-pushed the fix/ink-ui-tool-display branch from c71f0b8 to 79bbde5 Compare January 25, 2026 23:54
@laynepenney
Copy link
Copy Markdown
Collaborator Author

Self-Review

  • ✅ Build passes
  • ✅ All 2030 tests pass (15 new Ink UI tests)
  • ✅ Renamed status variable to icon in addToolResult() for clarity
  • ✅ Replaced while loop with immutable array construction for padding
  • ✅ Added 4 edge case tests (empty tool name, 0ms duration, empty result, empty input)
  • ✅ Verified tool call display format matches classic UI (📎 emoji)

Ready to merge.

- Add addToolCall() and addToolResult() methods to InkUiController
- Display tool calls with name and truncated input preview
- Display tool results with line count, duration, and error status
- Remove early return in activity panel to always show it
- Add minimum height padding (3 lines) to prevent layout jumping
- Use immutable array construction for activity panel padding
- Add comprehensive tests for Ink UI controller (55 tests)
  - Tool call/result edge cases (special chars, unicode, boundaries)
  - Status update handling
  - Confirmation queue (multiple, abort, patterns)
  - Message streaming (interleaved, unicode)
  - Worker/reader events
  - Session selection
  - Exit and lifecycle

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@laynepenney
Copy link
Copy Markdown
Collaborator Author

Updated with Comprehensive Edge Case Tests

Added 40 more edge case tests (now 55 total):

Tool Call Messages (23 tests)

  • Special characters in input
  • Nested objects
  • Unicode/emoji in results
  • Whitespace-only results
  • Very large durations
  • Many newlines
  • Null values in input
  • Multiple rapid tool calls
  • Boundary truncation cases

Status Updates (5 tests)

  • Null values in status
  • Empty activity detail
  • Status preservation

Confirmation Queue (6 tests)

  • Non-existent confirmation resolution
  • Worker confirmation source
  • Abort result
  • Complex approval patterns
  • Many queued confirmations

Message Streaming (6 tests)

  • Unicode chunks
  • Newlines in chunks
  • Interleaved messages
  • startAssistantMessage id uniqueness

Worker/Reader Events (6 tests)

  • State updates
  • Results
  • Logs

Session Selection (4 tests)

  • Request/resolve flow
  • Cancellation
  • Custom prompt
  • Wrong id handling

Exit/Lifecycle (2 tests)

Message Types (5 tests)

Total: 2070 tests passing

@laynepenney laynepenney force-pushed the fix/ink-ui-tool-display branch from 79bbde5 to a53b3cd Compare January 26, 2026 00:03
@laynepenney laynepenney merged commit fa26695 into main Jan 26, 2026
3 checks passed
@laynepenney laynepenney deleted the fix/ink-ui-tool-display branch January 26, 2026 00:31
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