Skip to content

feat: enhance split (side-by-side) diff viewer rendering#40

Merged
bakayu merged 4 commits intomasterfrom
feat-improve-git-diff-ui
Feb 16, 2026
Merged

feat: enhance split (side-by-side) diff viewer rendering#40
bakayu merged 4 commits intomasterfrom
feat-improve-git-diff-ui

Conversation

@shatrughantwt
Copy link
Contributor

@shatrughantwt shatrughantwt commented Feb 16, 2026

Description

Fixes #36

This PR enhances the TUI diff viewer by improving the split (side-by-side) view rendering.

Changes

  • Improved stability of split diff rendering
  • Fixed ANSI handling issues
  • Cleaned up parsing logic

The viewer now works reliably with colored diff output.


TODO:

  • reduce the splitViewThreshold, 120 is too wide, 80 should be good enough.

Signed-off-by: shatrughan mishra <shatrughanm485@gmail.com>
@shatrughantwt shatrughantwt changed the title fix: remove ansi code and fix split viewer feat: enhance split (side-by-side) diff viewer rendering Feb 16, 2026
@shatrughantwt shatrughantwt requested a review from bakayu February 16, 2026 12:18
}

// Threshold for split-view: 120 chars available
const splitViewThreshold = 120
Copy link
Member

@bakayu bakayu Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Ok, this looks much better, there are a few things you can do to greatly improve the UX:

  • reduce the splitViewThreshold, 120 is too wide, 80 should be good enough.

Then, in a follow-up PR, add these features:

  • add a vertical line to separate the diffs, use the same color as the border colors from the panels, if you struggle with this one I can help you with it.
  • add line numbers
  • add a keybind to manually switch from split view to unified view (which also stays the fallback if the screen is narrow, judged by splitViewThreshold

Copy link
Contributor Author

@shatrughantwt shatrughantwt Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm should i only reduce the splitviewthreshold to 80 in this pr and Implement the separator line numbers and keybind improvements in a follow-up PR after this one is merged?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, reduce the splitViewThreshold to 80 in this PR and work on the rest in a follow-up PR

@bakayu
Copy link
Member

bakayu commented Feb 16, 2026

@shatrughantwt if you want to continue working here, you can close #38

@bakayu
Copy link
Member

bakayu commented Feb 16, 2026

On second though: it should be fine to only do this in this PR - reduce the splitViewThreshold, 120 is too wide, 80 should be good enough.
And do the rest in a follow-up PR

shatrughantwt and others added 3 commits February 16, 2026 18:43
Signed-off-by: shatrughan mishra <shatrughanm485@gmail.com>
Signed-off-by: shatrughan mishra <shatrughanm485@gmail.com>
Signed-off-by: Ayush <mail@ayuch.dev>
@bakayu bakayu merged commit c2b20c1 into master Feb 16, 2026
2 checks passed
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.

Improve visual diff viewer for clearer and more intuitive change representation

2 participants