Refined-github: Expand diffs in either direction

Created on 30 Apr 2018  路  6Comments  路  Source: sindresorhus/refined-github

One thing that has always irked me about Github is that even though the diff expand button looks omnidirectional:

image

It actually only expands the bottom chunk upward.

image

There is literally no way to expand the top chunk downward if, for example, I wanted to see lines 27 and up. This is especially annoying when there are gaps of hundreds of lines in between the chunks.

I'd love a way to expand from either end, possibly by splitting the expand button into two separate buttons that each indicate which side they expand.

Please! 鈾ワ笌 enhancement help wanted

Most helpful comment

It was a pain, but I figured out how to modify the expand button data-url in this userscript. Hopefully, I added enough comments to make it easy to add to this extension.

BeforeAfter
before after

All 6 comments

It was a pain, but I figured out how to modify the expand button data-url in this userscript. Hopefully, I added enough comments to make it easy to add to this extension.

BeforeAfter
before after

Great job, Mottie! Given the complexity I'd leave it as a userscript instead of copying it to Refined GitHub.

@Mottie I'm thinking about merging some of your userscripts (like this one) into Refined GitHub via npm/github/require. What do you think about it? Are you open to the idea?

Sure, go for it!

That's been finally implemented by GitHub: https://twitter.com/github/status/1090684311492165632

This issue can be closed.

Neat! We probably need to update the code we use to make the whole line clickable

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vanniktech picture vanniktech  路  3Comments

hkdobrev picture hkdobrev  路  3Comments

shivapoudel picture shivapoudel  路  3Comments

sindresorhus picture sindresorhus  路  3Comments

durka picture durka  路  3Comments