Repository navigation
Increase diff contrast and improve gutter behavior - #3000
Conversation
Borders darkened as a consequence
Without this we're creating a gap between each diff line which means moving the mouse up or down near the right hand side gutter will cause the hover state to toggle back and forth. Resetting the line height while maintaining 20px tall lines means decreasing the padding to 2px (from 3.33333px)
|
Looks awesome @niik! Note that you have to use “Fixes” before each issue name to auto-close them ( |
| @@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| 'diff-line-gutter', | ||
| lineClass, | ||
| selectedClass, | ||
| hoverClass, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| // 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.
This comment was marked as spam.
Sorry, something went wrong.
| '+': 'diff-add', | ||
| '-': 'diff-delete', | ||
| '@': 'diff-hunk', | ||
| ' ': 'diff-context', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
😻 |
Increase contrast of red/green backgrounds
We're now using the same colors as GitHub.com
(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
Thin border for gutter in read-only mode
Editable

Read-only

One more state for hover depending on selected/unselected
This is showing before and after, illustrating the problem of clicking with no visual feedback
Fix for hunk highlight when hovering on context line
Fix flickering when hovering close to the gutter
Additionally this moves our
DiffLineGuttercomponent 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