Skip to content

Add a default_diff_view setting - #48669

Closed
JosephTLyons wants to merge 6 commits into
mainfrom
Add-a-default-diff-view-setting
Closed

Add a default_diff_view setting#48669
JosephTLyons wants to merge 6 commits into
mainfrom
Add-a-default-diff-view-setting

Conversation

@JosephTLyons

@JosephTLyons JosephTLyons commented Feb 7, 2026

Copy link
Copy Markdown
Collaborator
  • Tests
  • Code Reviewed
  • Manual QA

For the person reviewing:

  • Opinions on the setting / option names?

I didn't add the setting to settings editor in this PR, figured I'd do that in a follow up.
I kept the default as stacked, but we might want to consider the results here.

Release Notes:

  • N/A

Introduces a new `default_diff_view` setting under the `git` settings
section with two options: `stacked` (default) and `side_by_side`.

When opening the project diff, the editor now reads this setting and
initializes directly in the correct mode during construction, before the
first render, so there is no visual flash.

- Define `DefaultDiffView` enum in settings_content
- Add `default_diff_view` to `GitSettings` in both settings content
  and project settings
- Add `SplittableEditor::do_split()` as a public method that accepts
  an optional project to avoid re-borrowing the workspace during entity
  construction
- Check the setting in `ProjectDiff::new_impl` and split immediately
  if `side_by_side` is configured
- Add tests for both default (stacked) and side-by-side modes
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Feb 7, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Feb 7, 2026
@yeskunall

Copy link
Copy Markdown
Member

While you’re at it @JosephTLyons do you think you can update the docs as well? If not, you can ping me and I’ll do it.

@JosephTLyons

JosephTLyons commented Feb 7, 2026

Copy link
Copy Markdown
Collaborator Author

While you’re at it @JosephTLyons do you think you can update the docs as well? If not, you can ping me and I’ll do it.

Yep, I'll do that. I'll wait until it hits review in case anyone prefers different naming.

Maybe docs should also be included in the new PR template checklist we have.

@yeskunall

Copy link
Copy Markdown
Member

Maybe docs should also be included in the new PR template checklist we have.

A solid yes on that.

@JosephTLyons

Copy link
Copy Markdown
Collaborator Author

Dupe of: #48440

@JosephTLyons
JosephTLyons deleted the Add-a-default-diff-view-setting branch June 12, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants