Skip to content

Commit 0ce9b81

Browse files
committed
Add status to workspaces sidebar
1 parent 809c2c3 commit 0ce9b81

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
### Added
6+
7+
- Workspace and agent statuses now show in the sidebar. These are updated every
8+
five seconds.
9+
510
## [v1.0.2](https://github.com/coder/vscode-coder/releases/tag/v1.0.2) (2024-06-12)
611

712
### Fixed

src/remote.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ export class Remote {
253253
writeEmitter.fire(log.output + "\r\n")
254254
})
255255
socket.on("error", (error) => {
256-
reject(new Error(`Failed to watch workspace build using ${socketUrlRaw}: ${errToStr(error, "no further details")}`))
256+
reject(
257+
new Error(
258+
`Failed to watch workspace build using ${socketUrlRaw}: ${errToStr(error, "no further details")}`,
259+
),
260+
)
257261
})
258262
socket.on("close", () => {
259263
resolve()

src/workspacesProvider.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ export class OpenableTreeItem extends vscode.TreeItem {
280280
constructor(
281281
label: string,
282282
tooltip: string,
283+
description: string,
283284
collapsibleState: vscode.TreeItemCollapsibleState,
284285

285286
public readonly workspaceOwner: string,
@@ -292,6 +293,7 @@ export class OpenableTreeItem extends vscode.TreeItem {
292293
super(label, collapsibleState)
293294
this.contextValue = contextValue
294295
this.tooltip = tooltip
296+
this.description = description
295297
}
296298

297299
iconPath = {
@@ -307,11 +309,10 @@ class AgentTreeItem extends OpenableTreeItem {
307309
workspaceName: string,
308310
watchMetadata = false,
309311
) {
310-
const label = agent.name
311-
const detail = `Status: ${agent.status}`
312312
super(
313-
label,
314-
detail,
313+
agent.name, // label
314+
`Status: ${agent.status}`, // tooltip
315+
agent.status, // description
315316
watchMetadata ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.None,
316317
workspaceOwner,
317318
workspaceName,
@@ -337,6 +338,7 @@ export class WorkspaceTreeItem extends OpenableTreeItem {
337338
super(
338339
label,
339340
detail,
341+
workspace.latest_build.status, // description
340342
showOwner ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.Expanded,
341343
workspace.owner_name,
342344
workspace.name,

0 commit comments

Comments
 (0)