diffviewer icon indicating copy to clipboard operation
diffviewer copied to clipboard

Should allow viewing files without diffs

Open wch opened this issue 3 years ago • 6 comments

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.

wch avatar Aug 10 '20 19:08 wch

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

hadley avatar Aug 20 '20 17:08 hadley

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

warnes avatar Aug 26 '20 22:08 warnes

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

hadley avatar Aug 27 '20 21:08 hadley

@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

jbkunst avatar Aug 28 '20 06:08 jbkunst

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.

wch avatar Aug 28 '20 13:08 wch

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.

lionel- avatar Jun 08 '21 08:06 lionel-