github / VisualStudio

GitHub Extension for Visual Studio
https://visualstudio.github.com
MIT License
2.37k stars 1.21k forks source link

It's nearly impossible to tell where a file has moved from and to #1961

Open jcansdale opened 6 years ago

jcansdale commented 6 years ago

Version

What happened

Steps to Reproduce

  1. Open a PR with moved file in PR details view (e.g. https://github.com/github/VisualStudio/pull/1955)
  2. Double click on a moved file

Expected behavior: [What you expect to happen]

Tooltip of diff tab shows source and destination of moved file.

Actual behavior: [What actually happens]

Tooltip shows destination path as both source and destination. File appears as an added file in diff (all green on RHS).

Screenshot or GIF:

image

image

If I try to comment, I get position is invalid: image

Here is the same file on dotcom for comparison: image

Proposed Solution

  1. Fix tooltip and diff on diff view
  2. Show similar source and destination tooltop on tree view

Having just the destination on the tree view node isn't useful without a source to compare it with. I'd suggest simply showing [moved] on the node to avoid horizontal scrolling issues for minimal gain. Having the a source and destination as the tooltip would be very useful.

image

jcansdale commented 6 years ago

@meaghanlewis could you see if you can repro this? It's a bit of a nasty one. 😭

meaghanlewis commented 5 years ago

@jcansdale I can reproduce this and see exactly what you mean about not being able to tell a file was moved and not being able to comment on the moved file.

I don't see any other editors handle this situation. I think it makes sense yo try to do what dotcom does here like you suggest and:

  1. fix the tooltip to show the source and destination
  2. fix the diff on diff view to show "File renamed without changes" to prevent commenting