Skip to content

Commit 176d868

Browse files
committed
Add tooltips to describe the status
1 parent 5f31f55 commit 176d868

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed

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

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,33 @@ import com.intellij.ui.JBColor
1111
* WorkspaceAndAgentStatus represents the combined status of a single agent and
1212
* its workspace (or just the workspace if there are no agents).
1313
*/
14-
enum class WorkspaceAndAgentStatus(val label: String) {
14+
enum class WorkspaceAndAgentStatus(val label: String, val description: String) {
1515
// Workspace states.
16-
QUEUED("◍ Queued"), STARTING("⦿ Starting"), FAILED("ⓧ Failed"),
17-
DELETING("⦸ Deleting"), DELETED("⦸ Deleted"),
18-
STOPPING("◍ Stopping"), STOPPED("◍ Stopped"),
19-
CANCELING("◍ Canceling action"), CANCELED("◍ Canceled action"),
20-
RUNNING("⦿ Running"),
16+
QUEUED("◍ Queued", "The workspace is queueing to start."),
17+
STARTING("⦿ Starting", "The workspace is starting."),
18+
FAILED("ⓧ Failed", "The workspace has failed to start."),
19+
DELETING("⦸ Deleting", "The workspace is being deleted."),
20+
DELETED("⦸ Deleted", "The workspace has been deleted."),
21+
STOPPING("◍ Stopping", "The workspace is stopping."),
22+
STOPPED("◍ Stopped", "The workspace has stopped."),
23+
CANCELING("◍ Canceling action", "The workspace is being canceled."),
24+
CANCELED("◍ Canceled action", "The workspace has been canceled."),
25+
RUNNING("⦿ Running", "The workspace is running, waiting for agents."),
2126

2227
// Agent states.
23-
OFF("⦸ Off"), CONNECTING("⦿ Connecting"), DISCONNECTED("⦸ Disconnected"), TIMEOUT("ⓧ Timeout"),
24-
AGENT_STARTING("⦿ Starting"), AGENT_STARTING_READY("⦿ Starting"),
25-
CREATED("⦿ Created"), START_ERROR("◍ Started with error"), START_TIMEOUT("◍ Started with timeout"),
26-
SHUTTING_DOWN("◍ Shutting down"), SHUTDOWN_ERROR("⦸ Shutdown with error"), SHUTDOWN_TIMEOUT("⦸ Shutdown with timeout"),
27-
READY("⦿ Ready");
28+
CONNECTING("⦿ Connecting", "The agent is connecting."),
29+
DISCONNECTED("⦸ Disconnected", "The agent has disconnected."),
30+
TIMEOUT("ⓧ Timeout", "The agent has timed out."),
31+
AGENT_STARTING("⦿ Starting", "The agent is running the startup script."),
32+
AGENT_STARTING_READY("⦿ Starting", "The agent is running the startup script but is ready to accept connections."),
33+
CREATED("⦿ Created", "The agent has been created."),
34+
START_ERROR("◍ Started with error", "The agent is ready but the startup script errored."),
35+
START_TIMEOUT("◍ Started with timeout", "The agent is ready but the startup script timed out"),
36+
SHUTTING_DOWN("◍ Shutting down", "The agent is shutting down."),
37+
SHUTDOWN_ERROR("⦸ Shutdown with error", "The agent shut down but the shutdown script errored."),
38+
SHUTDOWN_TIMEOUT("⦸ Shutdown with timeout", "The agent shut down but the shutdown script timed out."),
39+
OFF("⦸ Off", "The agent has shut down."),
40+
READY("⦿ Ready", "The agent is ready to accept connections.");
2841

2942
fun statusColor(): JBColor = when (this) {
3043
READY, AGENT_STARTING_READY -> JBColor.GREEN

src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,11 +906,19 @@ class CoderWorkspacesStepView(val setNextButtonEnabled: (Boolean) -> Unit) : Cod
906906

907907
override fun getRenderer(item: WorkspaceAgentModel?): TableCellRenderer {
908908
return object : DefaultTableCellRenderer() {
909-
override fun getTableCellRendererComponent(table: JTable, value: Any, isSelected: Boolean, hasFocus: Boolean, row: Int, column: Int): Component {
909+
override fun getTableCellRendererComponent(
910+
table: JTable,
911+
value: Any,
912+
isSelected: Boolean,
913+
hasFocus: Boolean,
914+
row: Int,
915+
column: Int,
916+
): Component {
910917
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column)
911918
if (value is String) {
912919
text = value
913920
foreground = WorkspaceAndAgentStatus.from(value).statusColor()
921+
toolTipText = WorkspaceAndAgentStatus.from(value).description
914922
}
915923
font = this@CoderWorkspacesStepView.tableOfWorkspaces.tableHeader.font
916924
border = JBUI.Borders.empty(0, 8)

0 commit comments

Comments
 (0)