Skip to content

feat: redesign diff view with horizontal layout and new tab options #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThomasK33
Copy link
Member

Improved Diff View Layout and Configuration

This PR refactors the diff view functionality to provide more flexible layout options and better tab management:

  • Added a new layout option to replace the previous vertical_split boolean, supporting both "vertical" and "horizontal" layouts
  • Replaced open_in_current_tab with open_in_new_tab for more intuitive configuration
  • Removed redundant options auto_close_on_accept and show_diff_stats that were no longer used
  • Added proper type annotations for configuration options
  • Implemented improved window management when opening diffs in new tabs
  • Added terminal window preservation when opening diffs in new tabs
  • Improved window option handling to maintain consistent appearance across different layouts
  • Enhanced cleanup logic to properly handle both tab-based and window-based diff views
  • Updated tests to reflect the new configuration options

These changes make the diff view more customizable while simplifying the configuration interface. Users can now choose between vertical or horizontal layouts and easily open diffs in new tabs while maintaining access to the terminal.

@ThomasK33 ThomasK33 marked this pull request as ready for review August 7, 2025 10:29
@ThomasK33 ThomasK33 linked an issue Aug 7, 2025 that may be closed by this pull request
@ThomasK33 ThomasK33 changed the base branch from thomask33/feat_add_Claude_Haiku_model_and_update_type_annotations to graphite-base/111 August 7, 2025 10:35
@ThomasK33 ThomasK33 force-pushed the thomask33/feat_redesign_diff_view_with_horizontal_layout_and_new_tab_options branch from 82aff2b to 9734f3f Compare August 7, 2025 10:36
@graphite-app graphite-app bot changed the base branch from graphite-base/111 to main August 7, 2025 10:36
@ThomasK33 ThomasK33 force-pushed the thomask33/feat_redesign_diff_view_with_horizontal_layout_and_new_tab_options branch 4 times, most recently from 4ae7572 to 0f7c9ba Compare August 8, 2025 07:12
@ThomasK33 ThomasK33 force-pushed the thomask33/feat_redesign_diff_view_with_horizontal_layout_and_new_tab_options branch from 0f7c9ba to 7ab50da Compare August 8, 2025 14:18
@alex35mil
Copy link

@ThomasK33 thanks for the fix! The only issue I noticed so far is that after the accept/reject, the new tab remains opened (just not active), so I end up with bunch of tabs opened - one per each diff.

@alex35mil
Copy link

alex35mil commented Aug 8, 2025

Actually, if I reject (with a keymap, not via CC cli menu) - the new tab is closed, but Claude Code split is gone as well.

@alex35mil
Copy link

Also, after accepting, the inner terminal width becomes wider and goes off-screen until I close all diff tabs and refocus the claude code window.

Change-Id: Ia8df210bad3a05b7eddd92fafbbb4f8aa90e2704
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 force-pushed the thomask33/feat_redesign_diff_view_with_horizontal_layout_and_new_tab_options branch from 7ab50da to f8c7db8 Compare August 8, 2025 19:34
@ThomasK33
Copy link
Member Author

@ThomasK33 thanks for the fix! The only issue I noticed so far is that after the accept/reject, the new tab remains opened (just not active), so I end up with bunch of tabs opened - one per each diff.

Got it, thanks @alex35mil. I've removed the tab and diff closing parts and am waiting for Claude Code to send a tab close tool call. When accepting or denying a diff now, it seems to close the tab and diff correctly.

@alex35mil
Copy link

@ThomasK33 Tested the update. Everything seems to be fixed except I need to refocus the Claude window to fix its width after accept/reject with keymap - it still goes off screen after these actions.

Also, another idea for the diff in a new tab - having an option to hide the Claude window in the new tab with diff, thus there's more screen estate for reviewing the diff. I find myself not looking at the Claude output during the review, so it's a waste of screen space.

@alex35mil
Copy link

Oh, and I just noticed a bunch of unnamed buffers created after the accept/reject dance in the new tab.

@S1M0N38
Copy link

S1M0N38 commented Aug 9, 2025

Is it possible to have an option to disable the Neovim diff view entirely (so to just use the diff provided directly in claudecode)? Maybe something like

diff_opts = {
  enabled = true
  -- other diff opts ...
}

The new field diff_opts.enabled in opts could be a boolean with true as the default for backward compatibility.

I've decided to comment here because I've noticed this PR is about a diff view redesign, and I think this is something related to that. If you prefer, I can open a separate issue.

@ThomasK33
Copy link
Member Author

Is it possible to have an option to disable the Neovim diff view entirely (so to just use the diff provided directly in claudecode)? Maybe something like

diff_opts = {

  enabled = true

  -- other diff opts ...

}

The new field diff_opts.enabled in opts could be a boolean with true as the default for backward compatibility.

I've decided to comment here because I've noticed this PR is about a diff view redesign, and I think this is something related to that. If you prefer, I can open a separate issue.

Nope, won't be adding that. You can configure that in Claude Code itself. See: #45 (comment)

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.

[BUG] config.diff_opts.open_in_current_tab doesn't work
3 participants