feat(tui): Dynamic Details - compact tool output with click-to-expand #7260
+158
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


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
tui.dynamic_details_max_lines(default: 15)tui.dynamic_details_show_arrows(default: true)Configuration
{ "tui": { "dynamic_details_max_lines": 15, "dynamic_details_show_arrows": true } }Applies To
Block-container tools (bash, write, edit, patch) when:
TodoWrite is excluded (always expanded) for visibility.
Implementation
Enhances the existing
BlockToolcomponent with collapse/expand logic rather than introducing new abstractions. Uses:virtualLineCountfor accurate "+N" displaymaxHeight+overflow: hiddenfor clipping when collapsedChanges
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx- Add dynamicDetails context, toggle command, and collapse logic in BlockToolpackages/opencode/src/config/config.ts- Add config options for max lines and arrow indicators