Skip to content

Conversation

@brentlopez
Copy link

Summary

Adds Warp-like collapsible blocks to OpenCode's TUI, enabling users to collapse/expand verbose tool outputs.

Changes

  • BlockTool component: Added collapsed state with clickable arrow toggle (▶/▼)
  • Session context: Added collapsedBlocks state management via createStore
  • Event system: Added tui.block.toggle command
  • Plugin API: Added tui.block.collapsed hook for plugin integration

Motivation

Long tool outputs (like npm install or test results) can clutter the terminal. This feature allows users to:

  • Click the arrow to collapse/expand blocks
  • Plugins can control collapse behavior programmatically
  • Enables building Warp-like UX extensions

Testing

  • All existing typechecks pass
  • Manual testing with TUI confirms collapse/expand works
  • Plugin hook tested with opencode-fold plugin

Related

This enables the opencode-fold plugin which brings Warp-like blocks and intent detection to OpenCode.

- Add collapsed state management to session context
- BlockTool now supports collapse/expand with clickable arrow (▶/▼)
- Add tui.block.toggle command to event system
- Add tui.block.collapsed hook for plugin integration
- All BlockTool usages updated with blockID for state tracking

Enables Warp-like block UX where users can collapse verbose tool outputs.
Plugins can now control block collapse behavior via the new hook.
@brentlopez brentlopez closed this Jan 4, 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