Sessions: Replace badge with inline title count in Changes view#303482
Merged
mrleemurray merged 6 commits intomainfrom Mar 20, 2026
Merged
Sessions: Replace badge with inline title count in Changes view#303482mrleemurray merged 6 commits intomainfrom
mrleemurray merged 6 commits intomainfrom
Conversation
Replace the NumberBadge on the Changes view tab with an inline title that shows the file count directly, e.g. '7 Changes' instead of a badge overlay. - Export dynamic changesContainerTitle with a getter-based value - Add refreshContainerInfo() to IViewContainerModel interface and ViewContainerModel implementation - Remove IActivityService/NumberBadge dependency from ChangesViewPane
The inline title count was reading from activeSessionChangesObs (raw session changes only) instead of topLevelStats which accounts for deduplication and version mode filtering. Move the title update into onVisible() where topLevelStats is available, and reset the title when the view is hidden.
- Add blank line separator after changesContainerTitle block - Add constructor-level fallback autorun to keep title in sync when the view is hidden and the active session changes - Reset title to 'Changes' on dispose to avoid stale counts
Remove the updateContainerTitle(0) call from the hide handler so the count persists when the user switches to another tab. The fallback autorun in the constructor still handles session switches while the view is hidden.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Sessions “Changes” view container to show the file count inline in the tab title (instead of a badge), and introduces a small API to force re-reading container metadata when the title changes dynamically.
Changes:
- Add
refreshContainerInfo()toIViewContainerModel/ViewContainerModelso callers can trigger a re-read of container title/icon/keybinding. - Implement a dynamic
ILocalizedStringtitle for the Changes view container and update it from computed top-level stats while the view is visible. - Update the Changes view container registration to use the dynamic title object.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/services/views/common/viewContainerModel.ts | Adds refreshContainerInfo() to re-run container metadata computation and emit change events. |
| src/vs/workbench/common/views.ts | Extends IViewContainerModel with the new refreshContainerInfo() API and documentation. |
| src/vs/sessions/contrib/changes/browser/changesView.ts | Replaces the activity badge approach with dynamic container title updates driven by topLevelStats. |
| src/vs/sessions/contrib/changes/browser/changesView.contribution.ts | Registers the Changes container using the new dynamic changesContainerTitle. |
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
@sandy081Matched files:
@benibenjMatched files:
|
Yoyokrazy
approved these changes
Mar 20, 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.
Update the Changes view to display an inline title count instead of a badge, ensuring accurate file counts by utilizing top-level statistics. Maintain the count when switching tabs and address review feedback for improved clarity and functionality.