Skip to content
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

Allow for conditional side-by-side or inline diffEditor #123111

Closed
Tracked by #189320
NiloCK opened this issue May 6, 2021 · 1 comment · Fixed by #189304
Closed
Tracked by #189320

Allow for conditional side-by-side or inline diffEditor #123111

NiloCK opened this issue May 6, 2021 · 1 comment · Fixed by #189304
Assignees
Labels
diff-editor Diff editor issues feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@NiloCK
Copy link

NiloCK commented May 6, 2021

I like side-by-side diffs. I'm also pretty happy with inline diffs. What I don't like is finding myself looking at side-by-side diffs in a narrow editor window:

image

My suggestion aligns with responsive web design - the diffEditor should be configurable to run side-by-side above a certain breakpoint, and inline below.

proposed configuration flag:

diffEditor.renderInlineBreakpoint: number

The renderInlineBreakpoint value could be pixels (probably the easiest implementation path) or a character count (probably a finer-grained tool).

This flag would have no effect if diffEditor.renderSideBySide is set to false.

(Famous last words) This seems like a pretty straightforward patch to write. I could have a look at it myself if I receive some feedback to the effect that there are no anticipated blockers with respect to merging something like this into main.

@alexdima alexdima added diff-editor Diff editor issues feature-request Request for new features or functionality labels Jun 7, 2021
@alexdima alexdima added this to the Backlog milestone Jun 7, 2021
@hediet hediet modified the milestones: Backlog, August 2023 Jul 27, 2023
@hediet hediet assigned hediet and unassigned alexdima Jul 27, 2023
@hediet
Copy link
Member

hediet commented Jul 27, 2023

This is actually a great idea!

I think we can enable this by default (900px seems like a good breakpoint width) to make the inline view feature more discoverable.
Also, we can add a menu entry "Use Inline View When Space Is Limited" that only shows when the inline view is shown because the space is limited:

Code_-_OSS_LZHVr7X3l0

Verification steps:

  • Open the diff editor in side-by-side view
  • Reduce the width
  • Notice that the diff editor switches to inline view
  • Notice that the ... menu has options to control this behavior

Expect the implementation in insiders end of next week.

hediet added a commit that referenced this issue Jul 31, 2023
Uses inline-view in diff editor when width is small. Fixes #123111.
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Jul 31, 2023
@beto811 beto811 mentioned this issue Jul 31, 2023
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Aug 3, 2023
@hediet hediet added the verification-needed Verification of issue is requested label Aug 29, 2023
@rzhao271 rzhao271 added the verified Verification succeeded label Aug 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
diff-editor Diff editor issues feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants