Skip to content

Conversation

@ryanwyler
Copy link
Contributor

@ryanwyler ryanwyler commented Jan 7, 2026

Summary

Keeps tool output compact and accessible with click-to-expand functionality. Tool blocks with more than 15 lines collapse by default, showing a preview with a "+N" indicator. Click anywhere on the tool block to expand/collapse, making it easier to navigate long sessions without pages of output scrolling by.

Compliments commit: b3a2f9fb4

Features

  • Tool outputs collapse when exceeding configured line threshold
  • Click anywhere on tool block to expand/collapse
  • Shows "+N" indicator for hidden lines
  • 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 preference in KV store (default: enabled)

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/running states)

TodoWrite is excluded (always expanded) for visibility.

Implementation

Enhances the existing BlockTool component with collapse/expand logic rather than introducing new abstractions. Uses:

  • Data-based line counting for collapse decisions (stable, based on tool output)
  • Visual line counting via virtualLineCount for accurate "+N" display
  • maxHeight + overflow: hidden for clipping when collapsed

Changes

  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx - Add dynamicDetails context, toggle command, and collapse logic in BlockTool
  • packages/opencode/src/config/config.ts - Add config options for max lines and arrow indicators

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@ryanwyler
Copy link
Contributor Author

image image

…pand

Keeps tool output compact and accessible with click-to-expand functionality.
Tool blocks with more than 15 lines collapse by default, showing a preview
with a "+N" indicator. Click anywhere on the tool block to expand/collapse.

Features:
- Tool outputs collapse when exceeding configured line threshold
- Click anywhere on tool block to expand/collapse
- Shows "+N" indicator for hidden lines
- Configurable via tui.dynamic_details_max_lines (default: 15)
- Configurable via tui.dynamic_details_show_arrows (default: true)
- Toggle via Ctrl+P -> "Enable/Disable dynamic details"
- Persisted preference in KV store (default: enabled)

Applies to block-container tools (bash, write, edit, patch) when output
exceeds configured threshold and tool has completed. TodoWrite excluded
for visibility.

Implementation enhances existing BlockTool component with collapse/expand
logic using maxHeight + overflow:hidden for clipping when collapsed.
@ryanwyler ryanwyler force-pushed the feature/dynamic-details-v2 branch from e13f88d to f4d7538 Compare January 8, 2026 05:08
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