Skip to content

Conversation

@liangxiao777
Copy link

@liangxiao777 liangxiao777 commented Jan 19, 2026

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: #9026 #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

@github-actions
Copy link
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.

@github-actions
Copy link
Contributor

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

Based on my search results, I found one potentially related PR that might be worth reviewing for context:

Related PR:

This PR appears to be related to diff display modes in the TUI, which is similar in scope to the current PR's focus on toggling between different diff views (4-line context vs. full-file). The two features might complement each other or could potentially be consolidated.

However, this doesn't appear to be addressing the exact same feature (full-file diff toggle with ctrl+o in permission view), so it's not a direct duplicate.

Conclusion: No duplicate PRs found that address the same feature of adding a full-file diff toggle in the TUI permission view.

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]: TUI: Add full-file diff toggle in permission fullscreen view

1 participant