-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[dashboard] misc dashboard improvements #3496
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
Conversation
@@ -89,7 +89,7 @@ export class Workspaces extends React.Component<WorkspacesProps, WorkspacesState | |||
<div className="w-3/12">Name</div> | |||
<div className="w-4/12">Context</div> | |||
<div className="w-2/12">Pending Changes</div> | |||
<div className="w-2/12">Last Active</div> | |||
<div className="w-2/12">Last Start</div> |
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.
@gtsiolis I changed this to Last Start
because that is what the time really shows. Last Active
was confusing because for running workspaces it seems they should be active just now.
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.
I was tempted to suggest to revert this but let's leave this as is for now. Seems more accurate indeed!
/werft run 👍 started the job as gitpod-build-se-misc-dashboard.2 |
if (!props.visible) { | ||
return null; | ||
} | ||
setTimeout(() => window.addEventListener('click', props.onClose, { once: true }), 0); | ||
setTimeout(() => { |
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.
I'd suggest to use useEffect
hook instead in order to guarantee that the event listeners are received by the visible modals only.
This is what I did in parallel.
const handler = (e: MouseEvent) => {
// ...
}
useEffect(() => {
if (!props.visible) {
window.removeEventListener("click", handler)
return;
}
window.addEventListener("click", handler)
// do something on unmount
return () => { };
}, [props.visible]);
This hook's invocation depends on props.visible
change, which gives us control of the event handlers.
OTOH, given the setTimeout
solution, a <Modal visible={false}></Modal>
would already register the event handler.
onClick: () => { | ||
e.onClick && e.onClick(); | ||
onClick: (event: MouseEvent) => { | ||
e.onClick && e.onClick(event); |
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.
👍🏻
return ( | ||
<div className="fixed top-0 left-0 bg-black bg-opacity-70 z-50 w-screen h-screen" > | ||
<div className="fixed top-0 left-0 bg-black bg-opacity-70 z-50 w-screen h-screen" onClick={close}> |
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.
I believe, onClick={close}
here will trigger close
even if you click-select anything within the modal.
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.
It does not, because I stop.propagation below
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.
I see
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.
Alright, this is shaping up! 🌟
Here're some more outstanding issues, feel free to resolve here or a new PR. Thanks @svenefftinge!
- When searching and focus is on the search text field, on ESC clear the search input.
- Change placeholder text Search Workspace to Search Workspaces.
- Clicking Open in the more actions dropdown for stopped workspaces does not work.
- When manually stopping a workspace redirect to dashboard.
- Persist top menu state on Workspaces and Settings
- Could we apply a subtle hover transition effect on everything? See also relevant discussion.
- When clicking on Workspaces the top menu always move to Active workspaces.
- What do you think of adding
animate-pulse
on kumquar workspaces status indicator for starting and stopping workspaces? - Let's also change the font weight for more actions dropdown items to
font-medium
- Let's change the width of the dropdown of the more actions to
w-48
. This will also use the same width as the side menu. Also, let's change the dropdown spacing fromspace-y-2
tospace-y-1
andpy-2
topy-1
. - What do you think of removing the responsive layout of the table? Is this easily turned off? If not, feel free to ignore for now.
- Can we also remove the responsive layout of the top menu and profile menu?
- The more actions dropdown is missing a top margin of 8px from the more action button.
- Workspace more actions button should be visible only on hover. See similar approach in [dashboard] Re-implement running workspace selector for new dashboard #3464 (comment).
- The filter prefix is nice but everything up there on the top right is a filter. I still think Status prefix is better. Feel free to leave this as is for now.
setTimeout(() => { | ||
const keyHandler = (k: globalThis.KeyboardEvent) => { | ||
if (!k.bubbles) { | ||
if (k.key === 'Escape') { |
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.
issue: Modals do not close on ESC. 💭
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.
fixed, the predicate for the capturing phase was wrong
@@ -89,7 +89,7 @@ export class Workspaces extends React.Component<WorkspacesProps, WorkspacesState | |||
<div className="w-3/12">Name</div> | |||
<div className="w-4/12">Context</div> | |||
<div className="w-2/12">Pending Changes</div> | |||
<div className="w-2/12">Last Active</div> | |||
<div className="w-2/12">Last Start</div> |
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.
I was tempted to suggest to revert this but let's leave this as is for now. Seems more accurate indeed!
@@ -89,7 +89,7 @@ export class Workspaces extends React.Component<WorkspacesProps, WorkspacesState | |||
<div className="w-3/12">Name</div> | |||
<div className="w-4/12">Context</div> | |||
<div className="w-2/12">Pending Changes</div> | |||
<div className="w-2/12">Last Active</div> | |||
<div className="w-2/12">Last Start</div> |
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.
question: If creation timestamp is still important, could we add a tooltip when hovering on the last start timestamp with the creation timestamp (e.g. Created 2 days ago)?
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.
Not sure it is important
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.
OK, let's drop it for now.
{props.closeable !== false && ( | ||
<div className="absolute right-9 top-8 cursor-pointer" onClick={props.onClose}> | ||
<div className="absolute right-9 top-8 cursor-pointer" onClick={close}> |
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.
{props.closeable !== false && ( | ||
<div className="absolute right-9 top-8 cursor-pointer" onClick={props.onClose}> | ||
<div className="absolute right-9 top-8 cursor-pointer" onClick={close}> |
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.
thought: Regarding the icons, we could use them as SVGs or import the npm package for the icons library but it's not stable yet, see Usage. See icon assets in relevant discussion.
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.
Agree, we should decide on how to deal with it.
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.
Added follow-up in #3508.
<p>Do you really want to delete this workspace?</p> | ||
<h3>Delete Workspace</h3> | ||
<div className="border-t border-gray-200 mt-2 -mx-6 px-6 py-2"> | ||
<p>Do you really want to delete the following workspace?</p> |
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.
suggestion: Maybe make this less aggressive. 😇
<p>Do you really want to delete the following workspace?</p> | |
<p class="mt-1 mb-2 text-base">Are you sure you want to delete this workspace?</p> |
<h3>Delete Workspace</h3> | ||
<div className="border-t border-gray-200 mt-2 -mx-6 px-6 py-2"> | ||
<p>Do you really want to delete the following workspace?</p> | ||
<div className="w-full p-3"> |
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.
nitpick: Minor modal pixel lift. ⭐
<div className="w-full p-3"> | |
<div className="w-full p-4 mb-2 bg-gray-100 rounded-xl group bg-gray-100"> |
</div> | ||
<div className="flex"> | ||
<div className="flex-1"></div> | ||
<div className="flex justify-end mt-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.
nitpick: Minor modal pixel lift.
<div className="flex justify-end mt-4"> | |
<div className="flex justify-end mt-5"> |
<div className="py-4"> | ||
<p>Do you really want to delete this workspace?</p> | ||
<h3>Delete Workspace</h3> | ||
<div className="border-t border-gray-200 mt-2 -mx-6 px-6 py-2"> |
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.
<button className="cursor-pointer px-3 py-2 text-white text-sm rounded-md border-2 border-red-800 bg-red-600 hover:bg-red-800" | ||
onClick={()=>getGitpodService().server.deleteWorkspace(ws.id)}> | ||
onClick={() => model.deleteWorkspace(ws.id)}> | ||
Delete |
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.
nitpick: Let's make this more actionable and descriptive.
Delete | |
Delete Workspace |
the modal dialog should - close on ESC - close on click outside modal but not within - handle enter
88d3764
to
47aa569
Compare
filed #3507 |
Uh oh!
There was an error while loading. Please reload this page.