Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse existing tabs when opening files from changes tree #1585

Merged
merged 4 commits into from Apr 10, 2018

Conversation

@grokys
Copy link
Contributor

@grokys grokys commented Apr 5, 2018

This fixes the following issue in #1570:

Each time I click a comment the entire diff view reloads #1549 (review)

To test

  • Open a PR or PR review in the GitHub pane
  • Open a file by double clicking or using the context menu
  • Optionally make the tab non-temporary (i.e. move it from the right to the left)
  • Open the same document
  • The same tab should be used rather than a new tab being opened

Implementation

This requires that when we extract a file to a temp file, that the same file at the same commit is always extracted to the same location. To do this, we use a hash of the file's relative path in the repository and the encoding as the temp directory name, and place the commit sha in the temp file's filename.

Depends on #1582
Part of #1491

grokys added 2 commits Apr 5, 2018
This requires that when we extract a file to a temp file, that the same file at the same commit is always extracted to the same location. To do this, we use a hash of the file's relative path in the repository and the encoding as the temp directory name, and place the commit sha in the temp file's filename.
Move `GetSha256Hash` into `StringExtensions` as it's needed in >1 place.
@grokys grokys mentioned this pull request Apr 5, 2018
8 of 18 tasks complete
Also fix unit test for `no body/>0 file comments` case - it wasn't correct before as it was assigning a body.
@grokys grokys mentioned this pull request Apr 5, 2018
17 of 17 tasks complete
Copy link
Collaborator

@jcansdale jcansdale left a comment

This is working well. 😄

Looks like a couple of stray commits snuck in (e.g. Allow request changes with only file comments.).

@jcansdale jcansdale changed the base branch from feature/pr-reviews-master to feature/pr-reviews Apr 10, 2018
@jcansdale jcansdale changed the base branch from feature/pr-reviews to feature/pr-reviews-master Apr 10, 2018
Copy link
Collaborator

@jcansdale jcansdale left a comment

Looks good, works well. 😄

@jcansdale jcansdale merged commit aa6dbc1 into feature/pr-reviews-master Apr 10, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@jcansdale jcansdale deleted the fixes/reuse-existing-diff-tab branch Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.