Make the unsaved count badge in Open Editors open the first unsaved editor - #329609
Open
Benjamin Christopher Simmonds (benibenj) with Copilot wants to merge 3 commits into
Open
Make the unsaved count badge in Open Editors open the first unsaved editor#329609Benjamin Christopher Simmonds (benibenj) with Copilot wants to merge 3 commits into
Benjamin Christopher Simmonds (benibenj) with Copilot wants to merge 3 commits into
Conversation
Copilot started work on behalf of
Benjamin Christopher Simmonds (benibenj)
August 7, 2026 15:28
View session
…ditor Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>
Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing tab for unsaved editors in VS Code
Make the unsaved count badge in Open Editors open the first unsaved editor
Aug 7, 2026
Benjamin Christopher Simmonds (benibenj)
approved these changes
Aug 7, 2026
Benjamin Christopher Simmonds (benibenj)
marked this pull request as ready for review
August 7, 2026 16:11
Benjamin Christopher Simmonds (benibenj)
enabled auto-merge (squash)
August 7, 2026 16:11
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.
Description
When an editor with unsaved changes is not reachable from the tab bar, there is no quick way to get back to it. The Open Editors header already shows a "N unsaved" badge, but it was purely decorative.
This makes the badge an activatable shortcut to the first unsaved editor in index order (the first dirty editor of the first group that has one).
openEditorsView.tsfindFirstDirtyEditor(groups)— a pure function so the lookup can be unit tested.tabIndex = 0/role="button"with a managed hover ("Open Unsaved Editor") viaIHoverService, and handlers forCLICK,Tapand Enter/Space.updateDirtyIndicatorsets an aria label ("{0} unsaved, open unsaved editor") so screen readers keep the count and learn the action.GroupsOrder.GRID_APPEARANCE, matching whatgetElements()already uses to build the list.openeditors.css:focus-visibleoutline using--vscode-focusBorder.openEditorsView.test.tsfindFirstDirtyEditor.Notes for reviewers
All activation handlers call
EventHelper.stop(e, true)—Panetoggles the pane's expanded state on header click and on Enter/Space, so without this the pane collapses when the badge is activated:Tapis handled separately (mirroringBaseActionViewItem) becauseGesturesuppresses the synthesizedclickon touch devices, so aCLICK-only handler would never fire and the tap would collapse the pane instead.One known gap left as-is: the badge counts dirty working copies, so a dirty working copy with no open editor (e.g. a single-file refactor with
files.refactoring.autoSave: false) makes the click a no-op. That count/list mismatch pre-dates this change; gating the affordance dynamically would need extra listeners and risks the badge going silently non-interactive. Happy to revisit if reviewers disagree.