opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: Dynamic Details - compact tool output with click-to-expand enhancing navigation and workflow

Open ryanwyler opened this issue 3 weeks ago • 1 comments

Summary

Keeps vital tool output compact but fully accessible with a mouse click to quickly view the entire output. Click anywhere on the tool block to expand/collapse making navigating more efficient and easier to follow instead of pages of tool outputs speeding by.

Features

  • Tool outputs are compact showing first 15 lines
  • Click anywhere to easily expand/collapse
  • Configurable threshold via tui.dynamic_details_max_lines (default: 15)
  • Configurable arrow indicators via tui.dynamic_details_show_arrows (default: true)
  • Toggle via Ctrl+P -> "Enable/Disable dynamic details"
  • Persisted in KV store as dynamic_details (default: disabled)

Configuration

{
  "tui": {
    "dynamic_details_max_lines": 15,
    "dynamic_details_show_arrows": true
  }
}

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 and tui.dynamic_details_show_arrows config options

Rebase Notes

Rebased onto latest dev and updated for API compatibility:

  • Updated PermissionRequest.callID to PermissionRequest.tool?.callID (permission API change)
  • Added showAssistantMetadata signal (new upstream feature)
  • Updated DialogExportOptions.show call to include new parameters

ryanwyler avatar Dec 29 '25 20:12 ryanwyler