r-lib / diffviewer

HTML widget to visually compare files
http://diffviewer.r-lib.org
Other
58 stars 7 forks source link

Should allow viewing files without diffs #1

Open wch opened 4 years ago

wch commented 4 years ago

This is something I've wanted for a while: to be able to just view a directory of files, without diffs. That would be useful for when the initial snapshots are created.

hadley commented 4 years ago

I think that's out of scope for this package — it just provides an html widget for showing a diff of a single file.

warnes commented 4 years ago

@hadley The two tasks aren't independent, and it would be helpful to allow viewing diffs and unchanged files via the same web interface.

For instance, in using https:://github.com/Rstudio/shinytest, I want to look at an unchanged json or PNG, for instance to see what is present/looks like when there is no delta between them. A moment ago, I wanted to look at the plot preceding one with a delta. This currently requires using a separate UI.

hadley commented 4 years ago

@jbkunst could you please change the no-differences display to show the existing file, rather than just "no changes"?

jbkunst commented 4 years ago

@hadley @warnes

Now, If the files are the same the widget show the entire file. For example:

image

I guess we should do the same in the case of csv, right? Actually:

image

wch commented 4 years ago

The idea (at least for me) is that it would be useful to view the contents of a directory without even comparing it to another. The use case is when you run snapshot-based tests for the first time, and you want to check what the snapshots look like before deciding that you want to keep them. Currently I end up using an entirely different program to view files in this situation.

lionel- commented 3 years ago

This would be also helpful for reviewing new vdiffr snapshots. I guess it'd be difficult to single out the new snapshots (could be done using git inspection maybe?), but at least being able to see all the generated snapshots would be nice.