rtfpessoa / diff2html

Pretty diff to html javascript library (diff2html)
https://diff2html.xyz
MIT License
2.8k stars 273 forks source link

Make d2h-d-none override visibility: fix broken hiding of viewed files #445

Closed jacekkopecky closed 1 year ago

jacekkopecky commented 1 year ago

Fixes a regression: toggling Viewed no longer hides the patch for the file.

Steps to reproduce:

  1. *** show a diff (e.g. at https://jsbin.com/salayecelu/edit?html,output )
  2. *** click "Viewed"
  3. *** observe that the file is still shown

Expected Results:

The file should hide when "Viewed" is toggled on.

I believe the problem was introduced in b164b511d80edf25ca942b50dc4911b12257b7ee

Since .d2h-d-none is the first rule in the file, other rules with the same specificity override it, e.g. line 102 in .d2h-files-diff. This means hiding no longer works. This commit fixes that; alternatively, the .d2h-d-none rule should be moved to the end of the file if you don't like !important.

jacekkopecky commented 1 year ago

Hi, I see CI is failing but I don't think it's something I could fix - this PR only changed one line of CSS, after all. Any comments?

rtfpessoa commented 1 year ago

Fixed in #447

Thank you for the explanation. Makes more sense to me now.