Clear webview view badge when set to undefined - #15567
Open
hadley wants to merge 1 commit into
Open
Conversation
WebviewViewPane.updateBadge registered the view activity when a badge was set but never disposed it when the badge became undefined, so the numeric badge stayed on the view container after the extension cleared it. TreeView's badge setter already handles this with an else branch that clears the activity; add the same here.
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
WebviewViewPane.updateBadgeregisters the view activity (the numeric badge on the view container) when a badge is assigned, but never disposes it when the badge is set back toundefined. The badge therefore stays visible on the activity bar after the extension has cleared it.The tree view badge setter in
src/vs/workbench/browser/parts/views/treeView.tshandles this correctly with anelse { this._activity.clear(); }branch; the webview view pane is simply missing the equivalent.Discovered while implementing a needs-input badge in Posit Assistant (posit-dev/assistant#2094): extension-side logging confirmed
webviewView.badge = undefinedwas assigned, yet the badge remained visible.Notes
webviewViewPane.ts; which I upstreamed at Fix webview view badge not clearing when set to undefined microsoft/vscode#331019webviewView.badge = { value: 1, tooltip: '...' }, then setwebviewView.badge = undefined— before this change the badge persists; after, it clears.