Skip to content

Hide by-default context-only changes in our range-diff viewer#2380

Merged
Urgau merged 1 commit intorust-lang:masterfrom
Urgau:gh-range-diff-show-context-only-changes
Apr 19, 2026
Merged

Hide by-default context-only changes in our range-diff viewer#2380
Urgau merged 1 commit intorust-lang:masterfrom
Urgau:gh-range-diff-show-context-only-changes

Conversation

@Urgau
Copy link
Copy Markdown
Member

@Urgau Urgau commented Apr 17, 2026

This PR adds an off-by-default to control the default visibility of each file diff when it only contains context changes, that is when the different is not on the +/- lines.

This makes the diff more easy to read by hiding by default some mostly useless diff.

Off On
image image

http://localhost:8000/gh-range-diff/rust-lang/rust/12f35ad39ed3e39df4d953c46d4f6cc6c82adc96..e867ac9b8da8eeecbb143192fe0f08eff1c48260/4dbafc340b0f8e9ff9e95974d0ceef81ae2652c8..d3bdea115d929178e0a3189fb4fdf0e827529ed3

@Urgau Urgau requested a review from Kobzol April 17, 2026 21:19
Copy link
Copy Markdown
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

Maybe you could store the checkbox value into LocalStorage, to persist it across page reloads? I suspect that people who turn it off would like to do it for all or most diffs. But that's just a suggestion, feel free to merge as-is :)

View changes since this review

@Urgau
Copy link
Copy Markdown
Member Author

Urgau commented Apr 19, 2026

Maybe you could store the checkbox value into LocalStorage, to persist it across page reloads?

Since we don't touch the checkbox value from JS, the browser already keep the checkbox value across page reloads. Though it doesn't keep the state across different diffs, we'll see what people think.

@Urgau Urgau added this pull request to the merge queue Apr 19, 2026
Merged via the queue into rust-lang:master with commit 0f8f97e Apr 19, 2026
3 checks passed
@Urgau Urgau deleted the gh-range-diff-show-context-only-changes branch April 19, 2026 12:14
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