[PR #9357] feat(opencode): add full-file diff toggle in TUI permission view #13087

Open
opened 2026-02-16 18:17:57 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9357

State: open
Merged: No


What does this PR do?

Adds a ctrl+o shortcut in TUI permission preview to toggle between default (4-line) and full-file diff when in fullscreen mode. The tool layer now generates diffFull alongside diff for edit/write/patch operations, and the UI switches the display source on demand. No changes to default behavior—toggle only appears after ctrl+f.
fixes: https://github.com/anomalyco/opencode/issues/9026 https://github.com/anomalyco/opencode/issues/7091

How did you verify your code works?

  • bun install and bun run typecheck pass
  • Manual test: ran bun dev, triggered an edit permission, pressed ctrl+f to enter fullscreen, then ctrl+o to toggle between diff and full-file diff. Verified shortcuts appear/disappear correctly and the hint text changes between "full file" and "collapse" as expected.

Effect Preview:

Use ctrl+f to preview the diff before expanding (unchanged):
image

After expanding with ctrl+f (showing 4 lines of context):
image

Use ctrl+o to further expand (display the remaining lines in the file as context lines):
image

Press ctrl+o again to return to the 4-line context

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9357 **State:** open **Merged:** No --- ### What does this PR do? Adds a ctrl+o shortcut in TUI permission preview to toggle between default (4-line) and full-file diff when in fullscreen mode. The tool layer now generates diffFull alongside diff for edit/write/patch operations, and the UI switches the display source on demand. No changes to default behavior—toggle only appears after ctrl+f. fixes: https://github.com/anomalyco/opencode/issues/9026 https://github.com/anomalyco/opencode/issues/7091 ### How did you verify your code works? - bun install and bun run typecheck pass - Manual test: ran bun dev, triggered an edit permission, pressed ctrl+f to enter fullscreen, then ctrl+o to toggle between diff and full-file diff. Verified shortcuts appear/disappear correctly and the hint text changes between "full file" and "collapse" as expected. ### Effect Preview: Use ctrl+f to preview the diff before expanding (unchanged): <img width="2746" height="748" alt="image" src="https://github.com/user-attachments/assets/43df6caa-e601-4731-953d-17b5cfd5e13b" /> After expanding with ctrl+f (showing 4 lines of context): <img width="2765" height="1614" alt="image" src="https://github.com/user-attachments/assets/b818e0c0-09a9-405c-8793-debf2182872d" /> Use ctrl+o to further expand (display the remaining lines in the file as context lines): <img width="2774" height="1629" alt="image" src="https://github.com/user-attachments/assets/40aedd8b-ede2-4ffc-95bc-0b7eede5fb6c" /> Press ctrl+o again to return to the 4-line context
yindo added the pull-request label 2026-02-16 18:17:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13087