Skip to content

Change diff style and whitespace visibility in one click#1799

Merged
busches merged 9 commits into
refined-github:masterfrom
busches:update-diff-settings
Mar 15, 2019
Merged

Change diff style and whitespace visibility in one click#1799
busches merged 9 commits into
refined-github:masterfrom
busches:update-diff-settings

Conversation

@busches

@busches busches commented Feb 17, 2019

Copy link
Copy Markdown
Member

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 #1292

image

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

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread source/features/diff-view-without-whitespace-option.tsx Outdated
Comment thread source/features/rename-diff-settings-to-icon.tsx Outdated
@fregante

Copy link
Copy Markdown
Member

The readme still has this image 😬

@busches

busches commented Feb 18, 2019

Copy link
Copy Markdown
Member Author

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.

@sindresorhus

Copy link
Copy Markdown
Member

Or... 1-click

I like the one-click icons @bfred-it suggested.

Comment thread source/content.ts
@yakov116 yakov116 mentioned this pull request Feb 24, 2019
@fregante fregante changed the title Update Diff Settings Update diff view options Feb 24, 2019
@fregante fregante self-assigned this Mar 12, 2019
@fregante

fregante commented Mar 12, 2019

Copy link
Copy Markdown
Member

Tested on:

@fregante fregante removed their assignment Mar 12, 2019
@busches

busches commented Mar 12, 2019

Copy link
Copy Markdown
Member Author

Forgot about this, thanks for finishing it up, looks good to me.

</div>;
}

return <>{elements.map(element => <div className="diffbar-item">{element}</div>)}</>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This function is ugly, but I already rewrote it a few times. If you think of another way to write this, please write it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Considering the alternatives I can think of, this doesn't look so bad.

@busches busches merged commit 42c0803 into refined-github:master Mar 15, 2019
@busches busches deleted the update-diff-settings branch March 15, 2019 01:56
@fregante

Copy link
Copy Markdown
Member

🎉

@fregante fregante changed the title Update diff view options Change diff style and whitespace visibility in one click Mar 15, 2019
This was referenced Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Remove whitespace toggle

3 participants