[Routine - VT] fix(extension): refresh treeView description after workspace folder changes - #115
Merged
Conversation
…hanges reinitializeScopes() prunes activeScopeIds for scopes whose workspace folder was removed, but the panel description text (set once at activation) was never recomputed, so it could keep showing a stale scope name/count after a folder add/remove.
winterdrive
marked this pull request as ready for review
August 16, 2026 15:32
winterdrive
added a commit
that referenced
this pull request
Aug 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.
1. Pre-flight Check
Checked open PRs and active
routine/*branches before selecting a target (see full list below). This PR touches onlysrc/extension.ts, which is not touched by any currently open PR:src/core/ProjectExplorer.ts,src/test/unit/projectExplorerMaxResults.test.tssrc/sendTo.tssrc/core/FileEntryMatcher.ts,src/test/unit/fileEntryMatcher.test.tssrc/core/GroupManager.ts,src/test/unit/groupManagerNonArrayConfig.test.tsmcp-server/package*.json,package*.json(dependency bump only)src/mcp/SkillGenerator.tssrc/dragAndDrop.ts,src/test/unit/dragIsDescendantCycleGuard.test.tssrc/core/AutoGrouper.ts,src/test/unit/autoGrouperBookmarks.test.tsi18n/*.json,src/provider.tssrc/commands.ts,src/i18n.ts,src/test/unit/copyGroupName.test.tsmcp-server/src/server.tsNo open PR or active routine branch touches
src/extension.ts, so this change does not overlap with any in-flight work.2. Changes
onDidChangeWorkspaceFoldersinsrc/extension.tscallsprovider.reinitializeScopes(), which prunesactiveScopeIdsentries for any scope whose workspace folder was just removed. However theTreeView.descriptionstring (set once atactivate()time fromprovider.computeScopeDescription()) was never recomputed after that prune, so the panel header could keep showing a stale scope label/count (e.g. still say "2 scopes" after one of the active scopes' folders was removed from the workspace).Fix: recompute and re-assign
treeView.descriptionright afterreinitializeScopes(), mirroring the same pattern already used insrc/commands.tsfor the scope-selection commands.This PR does not modify any VS Code command registrations, contributed configuration keys (
package.json), dependencies, or the tab-group serialization/storage format. It is a 3-line, single-file change.3. Safety Verification
Commands run locally, all passed:
npx tsc -p ./— no type errorsnpm run test(tsc -p ./ && jest --runInBand) — 31 test suites / 203 tests passedNo
lintorformat:checkscript exists inpackage.json, so those steps were skipped.4. CI / Release Gate Note
This is a daily routine Draft PR. Package version bump and
CHANGELOG.mdupdates are intentionally deferred to the weekend release/integration PR. If CI fails solely due to the repository's version-bump gate, that is expected release-readiness behavior for a routine PR, not a code validation failure.