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
105 stars 11 forks source link

Highlight changed files #1

Closed crepererum closed 1 year ago

crepererum commented 1 year ago

It would be helpful if the side bar could highlight files and directories that contain changes, so it's easier to find the needle in the haystack in large code bases.

Cool project idea BTW :sunglasses:

xfbs commented 1 year ago

Hey, thanks so much for the feedback! I'm working on implementing this right now. Basically going to make it so that it shows a quick summary of how many lines were added/removed. This is what it would look like:

Screenshot from 2023-03-08 11-27-45

This takes a little bit of rewriting (need to create all of the diff data ahead of time rather than lazily when viewing a file) but I think it should be doable.

xfbs commented 1 year ago

The latest commit implements this. Should already be deployed. Seems to work pretty good, only downside is that it now takes longer for the UI to load, because we have to generate the diff for all of the files in the crate (so that we can render the summary). I'm thinking of refactoring it a bit to where we initially only compute the diff for the current file, so that it can display something to the user, and meanwhile asynchronously compute the rest of the data and then backfill. So basically the summary data would appear a second or so later.