Skip to content

Commit 923daf5

Browse files
authored
fix: show Tasks view container in Cursor when not authenticated (#839)
Cursor has a bug where view containers whose views are all hidden via `when` clauses never re-appear after the context changes. Add a placeholder login tree view so the coderTasks container always has at least one visible view. Fixes #838
1 parent 7d85c05 commit 923daf5

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
- Fixed SSH config writes failing on Windows when antivirus, cloud sync software,
1919
or another process briefly locks the file.
20+
- Fixed Tasks view container not showing in Cursor when not authenticated.
2021

2122
### Changed
2223

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@
211211
}
212212
],
213213
"coderTasks": [
214+
{
215+
"id": "coder.tasksLogin",
216+
"name": "Coder Tasks",
217+
"icon": "media/tasks-logo.svg",
218+
"when": "!coder.authenticated"
219+
},
214220
{
215221
"type": "webview",
216222
"id": "coder.tasksPanel",
@@ -225,6 +231,11 @@
225231
"view": "myWorkspaces",
226232
"contents": "Coder is a platform that provisions remote development environments. \n[Login](command:coder.login)",
227233
"when": "!coder.authenticated && coder.loaded"
234+
},
235+
{
236+
"view": "coder.tasksLogin",
237+
"contents": "Sign in to view and manage Coder tasks.\n[Login](command:coder.login)",
238+
"when": "!coder.authenticated && coder.loaded"
228239
}
229240
],
230241
"commands": [

src/extension.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,18 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
188188
// controlled by contexts, see `when` in the package.json.
189189
const commands = new Commands(serviceContainer, client, deploymentManager);
190190

191+
// Placeholder tree view for the coderTasks container when not authenticated.
192+
// Works around a Cursor bug where containers with all views hidden via `when`
193+
// clauses never re-appear after the context changes.
194+
ctx.subscriptions.push(
195+
vscode.window.createTreeView("coder.tasksLogin", {
196+
treeDataProvider: {
197+
getTreeItem: () => new vscode.TreeItem(""),
198+
getChildren: () => [],
199+
},
200+
}),
201+
);
202+
191203
// Register Tasks webview panel with dependencies
192204
const tasksPanelProvider = new TasksPanelProvider(
193205
ctx.extensionUri,

0 commit comments

Comments
 (0)