Skip to content

fix: make sure Coder plugin indicates when a workspace is being deleted #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 29, 2024

Conversation

Parkreiner
Copy link
Member

No issue to link – something I noticed in the past few days.

Changes made

  • Added a little more granularity to the UI code for WorkspacesListItem
    • Instead of only differentiating between online and offline, there's now online/offline/deleting
    • Before, if you deleted a workspace in Coder, it would show up as online in Backstage

@Parkreiner Parkreiner requested a review from code-asher March 23, 2024 14:02
@Parkreiner Parkreiner self-assigned this Mar 23, 2024
@Parkreiner Parkreiner changed the title fix: make sure Coder plugin displays when a workspace is being deleted fix: make sure Coder plugin indicates when a workspace is being deleted Mar 23, 2024
@Parkreiner Parkreiner requested a review from Kira-Pilot March 25, 2024 14:05
@@ -226,6 +230,37 @@ export const WorkspacesListItem = ({
);
};

const deletingStatuses: readonly WorkspaceStatus[] = ['deleting', 'deleted'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should deleted be moved to offline? Worried folks might assume a workspace is stuck in a transient state.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, that's a good call. I think I over-complicated things, and we can keep the status a binary offline/online
Will fix really quick

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized how unlikely we are to show deleted workspaces in a filtered list view.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think it still makes sense to make the change – at the very least, the deleting workspaces would show up for "owner:me", which is the first filter people are going to see

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Parkreiner I like deleting! We can definitely keep this addition! I more meant that if a workspace is deleted, it is also offline.

In general, these boundary states (deleting, starting, etc) are useful and down the road I'd love to expose more of them as you've done here.

Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

type AvailabilityStatus = 'online' | 'offline' | 'deleting';

function getAvailabilityStatus(workspace: Workspace): AvailabilityStatus {
const currentStatus = workspace.latest_build.status;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find myself again really wishing we had pattern matching!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah...Yeah.

@Parkreiner Parkreiner merged commit 81502c2 into main Mar 29, 2024
@Parkreiner Parkreiner deleted the mes/deleting-ws branch March 29, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants