refactor(sidebar): remove nested environment virtual child (#895) - #903
Merged
Conversation
…ct trees (#895) Now that environments have their own top-level accordion section, the virtual environment-root child appended to project file trees (#885) is redundant. The environment pill on project roots provides the visual link. Removed: - rootEnvironments map from SidebarTreeService - Virtual child append in getChildren() - entryKind and environmentSlug fields from TreeEntry (bridge + webview) - 3 old #885 tests replaced with 2 tests asserting no virtual child
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
jeonghun-jj-lee
added a commit
that referenced
this pull request
Sep 8, 2026
…er gap (#903) (#905) Two bugs combined to make resolved (non-workspace) environment nodes expand with nothing beneath them: 1. Cache poisoning: readDirectoryEntries swallows errors and returns []. The webview cached [] (truthy), so all !childrenCache[path] guards evaluated false, permanently suppressing re-requests. Fix: never cache empty arrays — delete the key instead, leaving undefined (falsy) so future renders re-request children. 2. Watcher gap: setupWatcher uses createFileSystemWatcher('**/*') which is workspace-scoped, and the handler checks getWorkspaceFolder(uri) which drops non-workspace URIs. Resolved environments (source: 'resolved', auto-surfaced from the registry) are not workspace folders, so filesystem changes inside them never invalidated the poisoned cache. Fix: create per-path FileSystemWatcher using RelativePattern for resolved environment paths. Watchers are refreshed on roots changes, deduped, debounced (300ms), and disposed cleanly. Also adds console.warn to readDirectoryEntries catch block for future diagnosis visibility.
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.
Removes the virtual environment-root entry that appeared as the last child when expanding a project root (#885). Now that environments have their own top-level accordion section (#895), this nested view is redundant — the environment pill on the project root provides the visual link.
Removed:
rootEnvironmentsmap fromSidebarTreeServicegetChildren()entryKindandenvironmentSlugfields fromTreeEntry(bridge + webview)2980 extension tests pass.