Skip to content

scm: remember worktree visibility across restarts#307887

Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:fix/scm-remember-worktree-selection
Open

scm: remember worktree visibility across restarts#307887
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:fix/scm-remember-worktree-selection

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

@yogeshwaran-c yogeshwaran-c commented Apr 5, 2026

Summary

  • When a repository is discovered after the initial loading phase (5s debounce) has ended (e.g. git worktrees detected by git.detectWorktrees), the SCM view service was ignoring the persisted visibility state and making the repository visible by default
  • This forced users to re-hide any worktrees they had previously deselected on every restart
  • This change keeps consulting the persisted state for repositories added after loading finished: if the repository was explicitly hidden in the previous session, it stays hidden when it is re-discovered

Fixes #271554

Test plan

  • Open a workspace with a git repository and worktrees with git.detectWorktrees: true
  • Hide one or more worktrees via checkbox in the Source Control view
  • Restart VS Code
  • Verify the hidden worktrees remain hidden after restart
  • Verify the visible worktrees remain visible

@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering bot commented Apr 5, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • src/vs/workbench/contrib/scm/browser/scmViewService.ts

When a repository is discovered after the initial loading phase has
ended (e.g. git worktrees detected by git.detectWorktrees), the SCM
view service was ignoring the persisted visibility state and making
the repository visible by default. This forced users to re-hide any
worktrees they had previously deselected on every restart.

This change keeps consulting the persisted state for repositories
added after loading finished: if the repository was explicitly
hidden in the previous session, it stays hidden when it is
re-discovered.

Fixes microsoft#271554
@yogeshwaran-c yogeshwaran-c force-pushed the fix/scm-remember-worktree-selection branch from 810a3bc to 3954cc7 Compare April 6, 2026 16:21
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.

Remember the selection of selected worktrees under the Source Control: Changes panel

2 participants