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
Navigation to diff view from description page #750
Navigation to diff view from description page #750
Conversation
rebornix
commented
Dec 11, 2018
•
edited
edited

| context.subscriptions.push(vscode.commands.registerCommand('pr.openDescription', async (pr: IPullRequestModel) => { | ||
| const pullRequest = ensurePR(prManager, pr); | ||
| context.subscriptions.push(vscode.commands.registerCommand('pr.openDescription', async (descriptionNode: DescriptionNode) => { | ||
| const pullRequest = ensurePR(prManager, descriptionNode.pullRequestModel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when opening the description from the command palette or the status bar, descriptionNode can be undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
| const diffPath: HTMLSpanElement = document.createElement('span'); | ||
| diffPath.className = outdated ? 'diffPath outdated' : 'diffPath'; | ||
| diffPath.textContent = comments[0].path; | ||
| diffPath.addEventListener('click', () => this.openDiff(comments[0])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the event listener only be added if the comment isn't outdated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| if ((prContainer as TreeNode | Revealable<TreeNode>).revealComment) { | ||
| (prContainer as TreeNode | Revealable<TreeNode>).revealComment(comment); | ||
| } | ||
| } catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log something to debug if reveal fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| @@ -591,11 +591,24 @@ class ReviewNode { | |||
| }); | |||
| } | |||
|
|
|||
| let outdated = comments[0].position !== comments[0].original_position; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in other places we check if position is null to determine if a comment is outdated. I think we should do that here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
@RMacfarlane comments addressed ;) |
…iffhunk-from-descriptionview
…iffhunk-from-descriptionview

