Skip to content

refactor(sidebar): remove nested environment virtual child (#895) - #903

Merged
jeonghun-jj-lee merged 1 commit into
mainfrom
fix/895-remove-nested-env-child
Sep 8, 2026
Merged

refactor(sidebar): remove nested environment virtual child (#895)#903
jeonghun-jj-lee merged 1 commit into
mainfrom
fix/895-remove-nested-env-child

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

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:

2980 extension tests pass.

…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
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c0ef2979-fe65-499b-9755-854ce9720b13


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jeonghun-jj-lee
jeonghun-jj-lee merged commit bf40aba into main Sep 8, 2026
10 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant