Fix Files node parent in pull request changes tree#8846
Open
Eiji-Kudo wants to merge 5 commits into
Open
Conversation
Eiji-Kudo
marked this pull request as ready for review
July 15, 2026 05:46
Author
|
@codex review |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a VS Code tree handle resolution issue in the Changes in Pull Request view by aligning FilesCategoryNode’s parent pointer with its rendered container (RepositoryChangesNode), preventing the tree from becoming empty during auto-reveal when node handles aren’t cached.
Changes:
- Parent
FilesCategoryNodetoRepositoryChangesNodeto enableTreeDataProvider.getParent()to reconstruct the rendered chain. - Add a regression test validating the
Filesnode parent relationship used bygetParent()/TreeView.reveal().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/view/treeNodes/repositoryChangesNode.ts | Fixes the Files category node parent pointer to match the rendered tree hierarchy. |
| src/test/view/treeNodes/repositoryChangesNode.test.ts | Adds a regression test to validate the parent chain for the Files node. |
Comments suppressed due to low confidence (1)
src/view/treeNodes/repositoryChangesNode.ts:116
CommitsNodeis still constructed withthis.parent(the root tree provider), soCommitsNode.getParent()returnsundefinedeven though it is rendered underRepositoryChangesNode. This leaves the same VS Code handle-resolution/reveal failure mode in place for the visible Commits category node.
this._filesCategoryNode = new FilesCategoryNode(this, this._reviewModel, this.pullRequestModel);
this._commitsCategoryNode = new CommitsNode(
this.parent,
this._pullRequestManager,
this.pullRequestModel,
Author
|
@microsoft-github-policy-service agree |
alexr00
enabled auto-merge (squash)
July 16, 2026 09:49
alexr00
approved these changes
Jul 16, 2026
chrmarti
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Changes in Pull Request view can become empty when file auto-reveal asks VS Code to resolve the visible
Filescategory. The category was reporting the root tree provider as its parent instead of theRepositoryChangesNodethat directly contains it, so VS Code could not reconstruct the rendered parent chain when the node handle was not cached.FilesandCommitscategory nodes to their renderedRepositoryChangesNodecontainer.TreeDataProvider.getParent()andTreeView.reveal().Testing
npm run lintnpm run compilenpm run compile:testManual verification
Follow-up issues
None.
Fixes #8845