Skip to content

Conversation

@ryanwyler
Copy link
Contributor

@ryanwyler ryanwyler commented Dec 29, 2025

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
Copy link
Contributor Author

dynamic-details-collapsed dynamic-details-expanded

@ryanwyler ryanwyler force-pushed the feature/dynamic-details branch 5 times, most recently from c07e14b to 966af84 Compare January 5, 2026 05:50
@ryanwyler ryanwyler force-pushed the feature/dynamic-details branch from 966af84 to c08fd53 Compare January 5, 2026 16:08
@ryanwyler
Copy link
Contributor Author

Closing in favor of a cleaner implementation that enhances the existing BlockTool component rather than introducing the ToolRegistry pattern. The new PR maintains the same functionality (click-to-expand/collapse tool outputs) with a much smaller, focused diff that's compatible with current upstream.

The new implementation:

  • ~200 lines vs ~1500 lines
  • Enhances existing BlockTool instead of replacing tool rendering
  • No unrelated changes bundled in
  • Works cleanly with current upstream/dev

New PR incoming.

@ryanwyler ryanwyler closed this Jan 7, 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