Fix PR tree reveal errors for flat file layout#8522
Merged
alexr00 merged 2 commits intomicrosoft:mainfrom Feb 17, 2026
Merged
Conversation
- Re-parent file nodes to FilesCategoryNode when rendering flat layout so tree handles stay consistent. - Honor fileAutoReveal on tree visibility changes and guard reveal until Files node is initialized. - Avoid reveal calls when a file node is already attached to the tree root parent.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes reveal failures in the Pull Request tree view that occurred when using flat file layout, which could break the PR diff UI with "Cannot resolve tree item" errors.
Changes:
- Re-parents file nodes to FilesCategoryNode in flat layout to align parent pointers with rendered hierarchy
- Gates visibility-triggered auto-reveal behind the fileAutoReveal setting
- Prevents reveal attempts before FilesCategoryNode is initialized
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/view/treeNodes/filesCategoryNode.ts | Re-parents file nodes to FilesCategoryNode in flat layout to fix parent pointer mismatch |
| src/view/treeNodes/repositoryChangesNode.ts | Extracts isFileAutoRevealEnabled helper, gates visibility-triggered reveal, and adds initialization check |
alexr00
approved these changes
Feb 16, 2026
alexr00
reviewed
Feb 16, 2026
Member
alexr00
left a comment
There was a problem hiding this comment.
@gvilums, thank you for the PR! As a small token of our appreciation you can claim some VS Code swag here by signing in with GitHub: https://app.brilliantmade.com/r/VS%20Code/micro3ggh85p3
Member
|
@gvilums could you accept the CLA as in #8522 (comment) ? I want to get this fix out to folks 😁 |
Contributor
Author
|
@microsoft-github-policy-service agree |
Member
|
/AzurePipelines run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
lszomoru
approved these changes
Feb 17, 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
Fixes
PullRequestTreereveal failures that can break the PR diff UI with errors like:Root causes
FilesCategoryNode, but theirparentstayed pointed at hiddenDirectoryTreeNodeinstances.fileAutoRevealwas enforced for active-editor changes, but not for tree visibility changes.FilesCategoryNodechildren were materialized.Changes
FilesCategoryNodewhen rendering flat layout (FilesCategoryNode#getChildren).githubPullRequests.fileAutoRevealinRepositoryChangesNode.Validation
Cannot resolve tree item for element 0/0:rdma.rs