-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[dashboard] Move inactive workspaces out of sight #10450
Conversation
@gtsiolis Can you take a look? |
@@ -145,8 +145,12 @@ export class WorkspaceModel implements Disposable, Partial<GitpodClient> { | |||
} | |||
|
|||
protected isActive(info: WorkspaceInfo): boolean { | |||
const lastSessionStart = WorkspaceInfo.lastActiveISODate(info); | |||
const twentyfourHoursAgo = new Date(Date.now() - 1000 * 60 * 60 * 24).toISOString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In timeutil.ts
there are helpers for this - hoursBefore(lastSessionStart, 24)
(info.workspace.pinned || (!!info.latestInstance && info.latestInstance.status?.phase !== "stopped")) && | ||
(info.workspace.pinned || | ||
(!!info.latestInstance && info.latestInstance.status?.phase !== "stopped") || | ||
twentyfourHoursAgo.localeCompare(lastSessionStart) < 0) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, we may be able to use isDateGreaterOrEqual(d1, d2)
for the comparison here. Unsure if this works with the locale however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise looks good to me, thanks for the change. Approving but adding hold for George to have a look at designs.
/hold
/werft run 👍 started the job as gitpod-build-sefftinge-make-it-easier-to-delete-4233.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this up and +1 for making this happen, @svenefftinge! 🍷
Left some comments below containing bits from the design thinking while reviewing UX changes here.
Overall, I love the idea of hiding the inactive workspaces. Since we already have a block element for separating the active from inactive workspaces, I'd suggest keeping this block element instead of introducing a line separator. I'd expect more changes to land in the workspaces list soon, see relevant discussion (internal).
Also made a prototype (internal) to visualize this better. Feedback is welcome.
/werft run 👍 started the job as gitpod-build-sefftinge-make-it-easier-to-delete-4233.5 |
59a5657
to
f3577e4
Compare
f3577e4
to
adf23cd
Compare
started the job as gitpod-build-sefftinge-make-it-easier-to-delete-4233.8 because the annotations in the pull request description changed |
adf23cd
to
1a22dc8
Compare
started the job as gitpod-build-sefftinge-make-it-easier-to-delete-4233.10 because the annotations in the pull request description changed |
1a22dc8
to
baf3eb9
Compare
started the job as gitpod-build-sefftinge-make-it-easier-to-delete-4233.12 because the annotations in the pull request description changed |
baf3eb9
to
d5940c9
Compare
(As a user) I'm fine with hiding (folding away) inactive workspaces - but there is still a distinction between pinned and not-pinned, isn't there? There used to be a separation on the workspaces page between pinned and unpinned. I found that useful. I'd like it back! (Another suggestion, inappropriate for this PR, but just to provide food for thought: Users are allowed to name their workspaces - but the name appears at the end of the repo name - and there isn't much space for it! See here where the names are "latest" and "tapscript-<something-to-long-to-show>": Maybe put the name first - or on a separate line if it gets too long? Names are useful - in some use cases (much) more useful than branch names to keep what's in different workspaces clear in your head - it would be nice to have longer ones. In fact, one reason I spend time deleting inactive workspaces is because the names are relatively useless to tell me which one's which, so I delete the known useless ones to remove some confusion. Simply folding them away doesn't really help this use case ...) |
The pinned workspaces are considered "active" and therefore always in the upper section. This is the same behavior as before. |
#10773 - ty for the suggestion! |
Description
Many users are manually deleting workspaces, keeping their workspaces list clean.
Users should feel less urge to manually clean up and cleaning up should be simpler.
This PR, makes the inactive workspaces section on the /workspaces list collapsable (collapsed by default) to give a cleaner impression. When expanded there is a button to delete them.
Related Issue(s)
Fixes #1053
Fixes #4233
How to test
Use the preview env and start a few workspaces, stop them. Check the workspaces list.
Release Notes
Documentation