Skip to content

Offer the switch to the unified diff only when it is enabled - #2877

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:unified-diff-switch-behind-preference
Aug 14, 2026
Merged

Offer the switch to the unified diff only when it is enabled#2877
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:unified-diff-switch-behind-preference

Conversation

@vogella

@vogella vogella commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The compare editor showed the button that switches an open comparison over to the unified diff for every comparison the unified diff can display, no matter whether the experimental preference that enables the unified diff was set. The button slipped into master with #2874 earlier than intended, and @tobiasmelcher asked in #2854 to gate it on that preference.

The button now follows the preference and stays hidden while it is off, so users who did not opt into the experiment do not see it. The check reads the same preference store that decides which editor an input opens in, which means the button appears exactly when reopening the same comparison would bring up the unified diff. canShowAsUnifiedDiff stays free of the preference so that switching keeps working for an editor that was opened while the preference was on and had it turned off afterwards.

The existing test class covers both states of the preference for a qualifying comparison, plus a comparison the unified diff cannot display while the preference is on.

The compare editor showed the button that switches over to the unified
diff for every comparison the unified diff can display, no matter whether
the preference that enables the unified diff was set. The unified diff is
still experimental, so the button now follows that preference and stays
hidden while it is off.

The check sits in canOfferUnifiedDiffSwitch next to canShowAsUnifiedDiff,
which keeps answering from the structure of the comparison alone so that
switching still works once the button was offered. A test covers both
states of the preference for the same qualifying comparison.

@tobiasmelcher tobiasmelcher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot. I tested it manually on my machine and the feature works as described.

@vogella

vogella commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @tobiasmelcher for the review.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   1h 0m 22s ⏱️ - 1m 31s
 4 760 tests +1   4 738 ✅ +2   22 💤 ±0  0 ❌  - 1 
12 171 runs  +3  12 018 ✅ +4  153 💤 ±0  0 ❌  - 1 

Results for commit cb3da13. ± Comparison against base commit 7d8eb62.

@vogella
vogella merged commit be20307 into eclipse-platform:master Aug 14, 2026
18 checks passed
@vogella
vogella deleted the unified-diff-switch-behind-preference branch August 14, 2026 15:36
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.

2 participants