Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update diff2html to version 3 #1273

Merged
merged 10 commits into from
Feb 22, 2020
Merged

Conversation

campersau
Copy link
Collaborator

@campersau campersau commented Feb 6, 2020

just to keep up with the API changes.

See rtfpessoa/diff2html#297 (comment)

@Hirse
Copy link
Contributor

Hirse commented Feb 6, 2020

Are there no changes required to the CSS?

background: transparent;
}

/*** adjustments for ungit ***/
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Everything above this line is copied from https://github.com/rtfpessoa/diff2html/blob/4e28c5c3275f6f703a6923d23d001bfb676331a6/src/ui/css/diff2html.css
Everything below this line is customized for ungit.
Maybe we should split these into separate files.

*
* Diff to HTML (diff2html.css)
* Author: rtfpessoa
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add the version number of diff2html here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure, this part is copied 1:1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Opted to include the css file from npm package so this file now only contains the adjustments.

@campersau
Copy link
Collaborator Author

NEW | OLD

image

image

@Hirse
Copy link
Contributor

Hirse commented Feb 7, 2020

Thanks for the comparison images.
Where does the difference in height come from?
Also, in the bottom case (red) the line number color changes.

@campersau campersau force-pushed the update_diff2html branch 2 times, most recently from 39ee3a9 to 292be99 Compare February 8, 2020 13:42
@campersau
Copy link
Collaborator Author

The height difference came from the different font (monospace) and font-size (13px) which I have changed back to the previous values here 14a6e9b

Some other things which changed:

  • The lines which contain changes are no longer indented a little bit more than the lines without changes
  • The line numbers are now always aligned to the right
  • The line numbers are now the same color in line by line vs side by side diffs
  • Also fixed the checkbox alignment for patches

Updated screenshots from the new version:
image

image

image

image

image

image

Comment on lines 60 to 61
-moz-user-select: none;
-ms-user-select: none;
Copy link
Contributor

@Hirse Hirse Feb 9, 2020

Choose a reason for hiding this comment

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

These don't seem to be necessary any more:
https://developer.mozilla.org/en-US/docs/Web/CSS/user-select#Browser_compatibility

Also, is this not done by diff2html already?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only in the diff2html UI which we are not using. Also it seems a bit buggy. I have opened rtfpessoa/diff2html#303 for that.

@campersau campersau merged commit ae83c8c into FredrikNoren:master Feb 22, 2020
@campersau campersau deleted the update_diff2html branch February 22, 2020 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants