zgrossbart / jdd

A semantic JSON compare tool
http://www.jsondiff.com
Apache License 2.0
1.03k stars 180 forks source link

Enhancement: Make new diff button sticky #21

Open Hillshum opened 5 years ago

Hillshum commented 5 years ago

Currently, the button to start a new diff is only available at the top of the page, requiring scrolling upwards to access it. If I'm halfway down a giant diff, scrolling upwards is rather annoying. There's plenty of room in the sidebar for the button. Can it be put there?

I realize this is a pretty simple change, and I might just do it myself after I get home from work today.

zgrossbart commented 5 years ago

Thank you very much for the enhancement. There's a bit of a space issue here. I wouldn't want to put the new button the top of the side bar since you want the focus to be on the next and previous buttons. However, I wouldn't want to put it at the bottom because it would jump around when you look at different differences.

Any ideas where we should put the button?

Hillshum commented 5 years ago

Pin it to the very bottom of the sidebar? That way it won't jump around if the list of differences varies in length, and it doesn't interfere with the nav buttons at the top of the sidebar.

zgrossbart commented 5 years ago

What would happen if you had enough diffs and a short enough screen to have an overlap?

Hillshum commented 5 years ago

Scroll? You could have diffs overflowing even without an additional button, though the button does make it more likely to happen, regardless of where the button is positioned.

zgrossbart commented 5 years ago

We can scroll, but then we can't make it have a fixed position and it might still be off the screen.

Hillshum commented 5 years ago

The button could be fixed to the bottom with the diffs scrolling in a box just above.

Hillshum commented 5 years ago

Or just put the diff viewer on a different path from the input fields so that the back button works.

zgrossbart commented 5 years ago

I'll see if I can find some time to play with it later today. Feel free to do a PR if you have a better idea.