Skip to content

Commit 204f0e3

Browse files
authored
fix: change dummy workspace logic to include starting and stopping (#107)
fixes #104 Includes starting, stopping, pending and unknown (rare!) workspaces as "dummy" grayed workspaces. TBD what we want to do with failed or canceled workspaces.
1 parent be72f80 commit 204f0e3

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

App/ViewModels/TrayWindowViewModel.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
207207
// For every stopped workspace that doesn't have any agents, add a
208208
// dummy agent row.
209209
foreach (var workspace in rpcModel.Workspaces.Where(w =>
210-
w.Status == Workspace.Types.Status.Stopped && !workspacesWithAgents.Contains(w.Id)))
210+
ShouldShowDummy(w) && !workspacesWithAgents.Contains(w.Id)))
211211
{
212212
if (!Uuid.TryFrom(workspace.Id.Span, out var uuid))
213213
continue;
@@ -372,4 +372,21 @@ public void Exit()
372372
{
373373
_ = ((App)Application.Current).ExitApplication();
374374
}
375+
376+
private static bool ShouldShowDummy(Workspace workspace)
377+
{
378+
switch (workspace.Status)
379+
{
380+
case Workspace.Types.Status.Unknown:
381+
case Workspace.Types.Status.Pending:
382+
case Workspace.Types.Status.Starting:
383+
case Workspace.Types.Status.Stopping:
384+
case Workspace.Types.Status.Stopped:
385+
return true;
386+
// TODO: should we include and show a different color than Gray for workspaces that are
387+
// failed, canceled or deleting?
388+
default:
389+
return false;
390+
}
391+
}
375392
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy