Feature Request: TUI option for minimal/collapsed diff display #6604

Open
opened 2026-02-16 18:04:43 -05:00 by yindo · 2 comments
Owner

Originally created by @sukakcoding on GitHub (Jan 17, 2026).

Originally assigned to: @thdxr on GitHub.

Problem

When editing large files (300-500+ lines), the diff output in the TUI becomes very long and requires extensive scrolling. This makes it hard to follow the conversation flow.

Current Behavior

✅ Edited file src/components/App.tsx
┌─────────────────────────────────────────────────┐
│ - old line 1                                    │
│ + new line 1                                    │
│ - old line 2                                    │
│ + new line 2                                    │
│ ... (500 more lines of diff) ...                │
└─────────────────────────────────────────────────┘

Expected Behavior

Minimal mode - clean, compact:

✅ Edited file src/components/App.tsx (+245, -123 lines)

Minimal + expandable - click to see full diff:

✅ Edited file src/components/App.tsx (+245, -123 lines) [expand]

Use Case

  • Large refactors with many line changes
  • Generated code (500+ lines)
  • Config file updates
  • Keeping conversation flow readable

Suggested Implementation

New TUI config option in opencode.json:

{
  "tui": {
    "diff_display": "minimal"
  }
}
Mode Behavior
full Show complete diff (current default)
minimal Show only filename + line counts, with option to expand

When minimal:

  • Default view: collapsed (filename + stats only)
  • User can expand to see full diff if needed

Important Note

UI vs Context Separation:

The minimal feature should ideally:

  • UI: Show minimal/collapsed for clean scrolling experience
  • AI Context: Keep full diff in conversation history so AI maintains understanding

This prevents AI from "forgetting" what was edited while keeping the TUI clean for users.

User sees:  ✅ Edited file App.tsx (+50, -30 lines) [expand]
AI sees:    Full diff content in context for continuity
Originally created by @sukakcoding on GitHub (Jan 17, 2026). Originally assigned to: @thdxr on GitHub. ### Problem When editing large files (300-500+ lines), the diff output in the TUI becomes very long and requires extensive scrolling. This makes it hard to follow the conversation flow. ### Current Behavior ``` ✅ Edited file src/components/App.tsx ┌─────────────────────────────────────────────────┐ │ - old line 1 │ │ + new line 1 │ │ - old line 2 │ │ + new line 2 │ │ ... (500 more lines of diff) ... │ └─────────────────────────────────────────────────┘ ``` ### Expected Behavior **Minimal mode** - clean, compact: ``` ✅ Edited file src/components/App.tsx (+245, -123 lines) ``` **Minimal + expandable** - click to see full diff: ``` ✅ Edited file src/components/App.tsx (+245, -123 lines) [expand] ``` ### Use Case - Large refactors with many line changes - Generated code (500+ lines) - Config file updates - Keeping conversation flow readable ### Suggested Implementation New TUI config option in `opencode.json`: ```json { "tui": { "diff_display": "minimal" } } ``` | Mode | Behavior | |------|----------| | `full` | Show complete diff (current default) | | `minimal` | Show only filename + line counts, with option to expand | When `minimal`: - Default view: collapsed (filename + stats only) - User can expand to see full diff if needed ### Important Note **UI vs Context Separation:** The minimal feature should ideally: - **UI**: Show minimal/collapsed for clean scrolling experience - **AI Context**: Keep full diff in conversation history so AI maintains understanding This prevents AI from "forgetting" what was edited while keeping the TUI clean for users. ``` User sees: ✅ Edited file App.tsx (+50, -30 lines) [expand] AI sees: Full diff content in context for continuity ```
yindo added the opentui label 2026-02-16 18:04:43 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 17, 2026):

This issue might be a duplicate or related to existing issues. Please check:

  • #8450: Diff/Write/Edit view visibility is truncated now and require too much scrolling - directly addresses the same pain point of excessive scrolling when viewing diffs
  • #9026: TUI: Add full-file diff toggle in permission fullscreen view - similar request for diff display control (though specific to permissions)
  • #9017, #9018, #9019: Compact Mode Phase 1-3 - broader feature addressing readability of large content through multi-level display hierarchy (FULL, COLLAPSED, SHORTHAND, HIDDEN) which may provide a more comprehensive solution

Feel free to ignore if your use case is specifically different from these.

@github-actions[bot] commented on GitHub (Jan 17, 2026): This issue might be a duplicate or related to existing issues. Please check: - #8450: Diff/Write/Edit view visibility is truncated now and require too much scrolling - directly addresses the same pain point of excessive scrolling when viewing diffs - #9026: TUI: Add full-file diff toggle in permission fullscreen view - similar request for diff display control (though specific to permissions) - #9017, #9018, #9019: Compact Mode Phase 1-3 - broader feature addressing readability of large content through multi-level display hierarchy (FULL, COLLAPSED, SHORTHAND, HIDDEN) which may provide a more comprehensive solution Feel free to ignore if your use case is specifically different from these.
Author
Owner

@LIHUA919 commented on GitHub (Jan 17, 2026):

Hi! I'd like to work on this feature. Before I start implementation, I have a couple of questions:

  1. Compact Mode overlap: I noticed there's a planned Compact Mode feature (#9017-9019) that includes a 4-level display hierarchy (FULL, COLLAPSED,
    SHORTHAND, HIDDEN). Would this diff display feature conflict with or be superseded by Compact Mode? Or should they be implemented independently?

  2. Design review requirement: Per CONTRIBUTING guidelines, core UI features may require design review. Does this feature need design approval before
    implementation?

My proposed approach

If this is good to implement, my plan would be:

  • Add a new tui.diff_display config option ("full" | "minimal")
  • When "minimal": Edit/Write tools show collapsed by default (filename + line stats)
  • User can click to expand and see full diff
  • Full diff remains in message metadata for AI context (no changes to AI understanding)

Please let me know if this aligns with the team's vision, or if I should wait for Compact Mode instead.

@LIHUA919 commented on GitHub (Jan 17, 2026): Hi! I'd like to work on this feature. Before I start implementation, I have a couple of questions: 1. **Compact Mode overlap**: I noticed there's a planned Compact Mode feature (#9017-9019) that includes a 4-level display hierarchy (FULL, COLLAPSED, SHORTHAND, HIDDEN). Would this diff display feature conflict with or be superseded by Compact Mode? Or should they be implemented independently? 2. **Design review requirement**: Per CONTRIBUTING guidelines, core UI features may require design review. Does this feature need design approval before implementation? ## My proposed approach If this is good to implement, my plan would be: - Add a new `tui.diff_display` config option (\"full\" | \"minimal\") - When \"minimal\": Edit/Write tools show collapsed by default (filename + line stats) - User can click to expand and see full diff - Full diff remains in message metadata for AI context (no changes to AI understanding) Please let me know if this aligns with the team's vision, or if I should wait for Compact Mode instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6604