[PR #6390] feat(tui): add dynamic details for collapsible tool outputs #11876

Closed
opened 2026-02-16 18:16:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6390

State: closed
Merged: No


Summary

Adds dynamic collapsing of long tool outputs in the TUI to save screen space. When enabled, tool outputs exceeding a configurable line threshold are automatically collapsed. Click anywhere on the tool block to expand/collapse.

Features

  • Tool outputs exceeding threshold are automatically collapsed
  • Click anywhere on tool block to expand/collapse
  • Configurable threshold via tui.dynamic_details_max_lines (default: 15)
  • Toggle via Ctrl+P -> "Enable/Disable dynamic details"
  • Persisted in KV store as dynamic_details (default: enabled)

Configuration

{
  "tui": {
    "dynamic_details_max_lines": 15
  }
}

Applies To

Block-container tools (bash, write, edit, patch) when:

  • Output exceeds configured line threshold
  • Tool has completed (not pending/error states)

Changes

  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx - Add dynamicDetails state, toggle command, and collapse logic in ToolPart
  • packages/opencode/src/config/config.ts - Add tui.dynamic_details_max_lines config option
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6390 **State:** closed **Merged:** No --- ## Summary Adds dynamic collapsing of long tool outputs in the TUI to save screen space. When enabled, tool outputs exceeding a configurable line threshold are automatically collapsed. Click anywhere on the tool block to expand/collapse. ## Features - Tool outputs exceeding threshold are automatically collapsed - Click anywhere on tool block to expand/collapse - Configurable threshold via `tui.dynamic_details_max_lines` (default: 15) - Toggle via Ctrl+P -> "Enable/Disable dynamic details" - Persisted in KV store as `dynamic_details` (default: enabled) ## Configuration ```json { "tui": { "dynamic_details_max_lines": 15 } } ``` ## Applies To Block-container tools (bash, write, edit, patch) when: - Output exceeds configured line threshold - Tool has completed (not pending/error states) ## Changes - `packages/opencode/src/cli/cmd/tui/routes/session/index.tsx` - Add dynamicDetails state, toggle command, and collapse logic in ToolPart - `packages/opencode/src/config/config.ts` - Add `tui.dynamic_details_max_lines` config option
yindo added the pull-request label 2026-02-16 18:16:48 -05:00
yindo closed this issue 2026-02-16 18:16:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11876