The dynamically extension icon does not appear in the sidebar due to the "when" condition

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The extension icon does not appear in the sidebar due to the “when” condition.
My extension config:

“viewsContainers”: {
“activitybar”: [
{
“id”: “someId”,

“when”: “enableMyExtension”
},
]
},
async register(disposables: vscode.Disposable): Promise {

await vscode.commands.executeCommand(“setContext”, “enableMyExtension”, true);
}

In vscode, this works as expected
As a workaround, you can switch to the Agents tab and then return to the Editor tab, then the icon is displayed.

Steps to Reproduce

Open Cursor IDE with installed an extension that dynamically adds another extension to the panel

Expected Behavior

In vscode, this works as expected
As a workaround, you can switch to the Agents tab and then return to the Editor tab, then the icon is displayed.

Operating System

MacOS

Version Information

Version: 2.2.36 (Universal)
VSCode Version: 1.105.1
Commit: 55c9bc11e99cedd1fb93fbb7996abf779c583150
Date: 2025-12-18T06:25:21.733Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the detailed report.

It looks like Cursor isn’t updating the activity bar right after setContext. The fact that switching to Agents and back fixes it confirms it’s a UI re-render or refresh issue.

To reproduce it more precisely, can you share the extension name or a minimal repro project? Or the full viewsContainers config from your package.json.

I’ll pass this to the team.

package.json

“viewsContainers”: {
“activitybar”: [
{
“id”: “some id”,
“title”: “some title”,
“icon”: “resources/icons/icon.svg”,
“when”: “enableExtension”
},
]
},

plugin

async register(disposables: vscode.Disposable): Promise {
...
disposables.push(…);
await vscode.commands.executeCommand(“setContext”, “enableExtension”, true);
}

now i can’t refresh UI, switch to Agents doesn’t help

it still working in vs code