xfbs / diff.rs

Web application to render a diff between Rust crate versions. Implemented in Yew, runs fully in the browser as WebAssembly.
https://diff.rs
MIT License
86 stars 6 forks source link

Hide context by default #7

Closed Alphare closed 1 year ago

Alphare commented 1 year ago

Most diffing tools hide unchanged parts and only show some context, allowing you to optionally show more (or all) context. I think this would speed up workflow quite a bit, and possibly reduce the amount of data sent over the wire, if that's a metric you care about.

IMO a simple -5 +5 lines context is already a good starting point, more intricate things like showing the closest "indentation header" are a bonus, and they are more complex to implement.

xfbs commented 1 year ago

Hey, I definitely agree with you on this. This is something that multiple people have requested on Reddit as well. I think it should be possible to adapt the DiffView component to allow for folding batches of unchanged file, and to do so by default. The diffing crate this uses (similar) even has a feature built-in to collapse unchanged regions.

At the same time, I also like being able to see the entire file. Maybe this should be something that is behind a toggle switch. If you are adventorous and want to play with it, I'm happy to merge stuff. Otherwise I'll play with it but it might take me some time to get something workable.

xfbs commented 1 year ago

I think I can close this, since the context is now hidden by default.