Change diff style and whitespace visibility in one click#1799
Conversation
This changes the 'Diff settings' text to the settings icon and removes the whitespace options if `diff-view-without-whitespace-options` is enabled. Example URL: https://github.com/sindresorhus/refined-github/pull/1146/files Closes refined-github#1292
There was a problem hiding this comment.
These two features should probably be one under a name like faster-pr-diff-options
Also perhaps we can make "unified/split" a 2-clicks operation as well, like:
delegate('.js-diff-style-toggle input', 'change', event => event.delegateTarget.form.submit());and thus we can drop the Always header and Apply and reload button.
Or... 1-click
![]() |
Do the icons make kind of sense?
https://octicons.github.com/icon/book/
https://octicons.github.com/icon/diff/
The whole form can be extracted and adjusted with the icons, probably.
|
Did all the feedback, thanks! Except for the delegate or separate buttons, I can see both working, what do others like? Same for the readme update, I'll save that till we decide on the dropdown or buttons. |
I like the one-click icons @bfred-it suggested. |
|
Tested on:
|
|
Forgot about this, thanks for finishing it up, looks good to me. |
| </div>; | ||
| } | ||
|
|
||
| return <>{elements.map(element => <div className="diffbar-item">{element}</div>)}</>; |
There was a problem hiding this comment.
This function is ugly, but I already rewrote it a few times. If you think of another way to write this, please write it.
There was a problem hiding this comment.
Considering the alternatives I can think of, this doesn't look so bad.
|
🎉 |
https://user-images.githubusercontent.com/1402241/54178764-d1c96080-44d1-11e9-889c-734ffd2a602d.png Co-authored-by: Federico Brigante <github@bfred.it>



This changes the 'Diff settings' text to the settings icon and removes
the whitespace options if
diff-view-without-whitespace-optionsisenabled.
Example URL:
https://github.com/sindresorhus/refined-github/pull/1146/files
Closes #1292