Skip to content

Commit 74dcd39

Browse files
committed
fix: show a red warning icon for failed workspaces
Failed workspaces used a gray offline icons. Instead, we now render a red warning icon (exclamation mark).
1 parent 203db88 commit 74dcd39

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Changed
66

7-
- improved workspace status reporting (icon and colors) when it is stopping, deleting, stopped or when we are
7+
- improved workspace status reporting (icon and colors) when it is failed, stopping, deleting, stopped or when we are
88
establishing the SSH connection.
99

1010
## 0.2.2 - 2025-05-21

src/main/kotlin/com/coder/toolbox/models/WorkspaceAndAgentStatus.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,21 @@ enum class WorkspaceAndAgentStatus(val label: String, val description: String) {
7272
}
7373

7474
private fun getStateColor(context: CoderToolboxContext): StateColor {
75-
return if (ready()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Active)
75+
return if (this == FAILED) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.FailedToStart)
76+
else if (this == DELETING) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Deleting)
77+
else if (this == DELETED) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Deleted)
78+
else if (ready()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Active)
7679
else if (unhealthy()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Unhealthy)
7780
else if (canStart() || this == STOPPING) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Hibernating)
7881
else if (pending()) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Activating)
79-
else if (this == DELETING) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Deleting)
80-
else if (this == DELETED) context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Deleted)
8182
else context.envStateColorPalette.getColor(StandardRemoteEnvironmentState.Unreachable)
8283
}
8384

8485
private fun getStateIcon(): EnvironmentStateIcons {
85-
return if (ready() || unhealthy()) EnvironmentStateIcons.Active
86-
else if (canStart()) EnvironmentStateIcons.Offline
86+
return if (this == FAILED) EnvironmentStateIcons.Error
8787
else if (pending() || this == DELETING || this == DELETED || this == STOPPING) CircularSpinner
88+
else if (ready() || unhealthy()) EnvironmentStateIcons.Active
89+
else if (canStart()) EnvironmentStateIcons.Offline
8890
else EnvironmentStateIcons.NoIcon
8991
}
9092

0 commit comments

Comments
 (0)