Skip to content

Clear webview view badge when set to undefined - #15567

Open
hadley wants to merge 1 commit into
posit-dev:mainfrom
hadley:fix/webview-view-badge-clear
Open

Clear webview view badge when set to undefined#15567
hadley wants to merge 1 commit into
posit-dev:mainfrom
hadley:fix/webview-view-badge-clear

Conversation

@hadley

@hadley hadley commented Aug 15, 2026

Copy link
Copy Markdown

WebviewViewPane.updateBadge registers 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 to undefined. 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.ts handles this correctly with an else { 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 = undefined was assigned, yet the badge remained visible.

Notes

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.
@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@hadley

hadley commented Aug 15, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@hadley hadley changed the title Fix webview view badge not clearing when set to undefined Clear webview view badge when set to undefined Aug 15, 2026
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.

1 participant