Skip to content

Increase diff contrast and improve gutter behavior - #3000

Merged
donokuda merged 13 commits into
masterfrom
diff-contrasts
Oct 11, 2017
Merged

donokuda merged 13 commits into
masterfrom
diff-contrasts

Conversation

@niik

@niik niik commented Oct 10, 2017 •

Copy link
Copy Markdown
Member

Increase contrast of red/green backgrounds

We're now using the same colors as GitHub.com

screen shot 2017-10-10 at 18 25 16

(Before on the left, after on the right)

Darker backgrounds in gutter

We now use an even darker shade in the gutter to highlight the gutter area

screen shot 2017-10-10 at 18 26 35

Thin border for gutter in read-only mode

Editable
screen shot 2017-10-10 at 18 27 50

Read-only
screen shot 2017-10-10 at 18 27 32

One more state for hover depending on selected/unselected

colors

This is showing before and after, illustrating the problem of clicking with no visual feedback

Fix for hunk highlight when hovering on context line

moargutter

Fix flickering when hovering close to the gutter

flicker

Additionally this moves our DiffLineGutter component from directly manipulating the DOM and instead manipulating state and re-rendering.

cc @donokuda for a look but I welcome a code review here as well.

Fixes #2586
Fixes #2181

@niik niik added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 10, 2017
@j-f1

j-f1 commented Oct 10, 2017 •

Copy link
Copy Markdown
Contributor

Looks awesome @niik! Note that you have to use “Fixes” before each issue name to auto-close them (Fixes #2586, fixes #2181).

@@ -100,34 +127,26 @@ export class DiffLineGutter extends React.Component<IDiffGutterProps, {}> {
* Indicate whether the current gutter element is selected
*/
public isIncluded(): boolean {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

'diff-line-gutter',
lineClass,
selectedClass,
hoverClass,

This comment was marked as spam.

This comment was marked as spam.


// is unmounted, so we can use this as a chance to cleanup.
// We unsubscribe without checking for isIncludeableLine since
// that might have changed underneath us

This comment was marked as spam.

'+': 'diff-add',
'-': 'diff-delete',
'@': 'diff-hunk',
' ': 'diff-context',

This comment was marked as spam.

This comment was marked as spam.

@joshaber joshaber self-assigned this Oct 10, 2017

@joshaber joshaber 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.

This looks great to me ✨ I'll leave it for @donokuda to merge when he's happy with it.

@donokuda donokuda 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.

😍

@donokuda
donokuda merged commit 592fe5e into master Oct 11, 2017
@donokuda
donokuda deleted the diff-contrasts branch October 11, 2017 16:32
@vojtech-dobes

Copy link
Copy Markdown

😻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants