Skip to content

feat(tui): Dynamic Details - compact tool output with click-to-expand - #7260

Closed
ryanwyler wants to merge 1 commit into
anomalyco:devfrom
gignit:feature/dynamic-details-v2
Closed

ryanwyler wants to merge 1 commit into
anomalyco:devfrom
gignit:feature/dynamic-details-v2

Conversation

@ryanwyler

@ryanwyler ryanwyler commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

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.

Fixes #7450
Relates to #1816

Also helps with:

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

github-actions Bot commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

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

No duplicate PRs found

@ryanwyler

Copy link
Copy Markdown
Contributor Author
image image

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

…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

Copy link
Copy Markdown
Contributor Author

Closing to re-open from the correct fork (gignit/opencode -> anomalyco/opencode). Will resubmit shortly.

@ryanwyler ryanwyler closed this Feb 22, 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.

[FEATURE]: Truncate output of long scripts/diffs by default

1 participant