Skip to content
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] improved workspaces #3457

Merged
merged 1 commit into from
Mar 17, 2021
Merged

[dashboard] improved workspaces #3457

merged 1 commit into from
Mar 17, 2021

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Mar 15, 2021

Ready for a review.

@jankeromnes
Copy link
Contributor

There is a secret link for this in the Reviewers section:

Screenshot 2021-03-16 at 08 28 23

@@ -5,6 +5,7 @@
"private": true,
"dependencies": {
"@gitpod/gitpod-protocol": "0.1.5",
"moment": "^2.29.1",
Copy link
Member

Choose a reason for hiding this comment

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

Moment.js is a legacy project, now in maintenance mode. In most cases, you should choose a different library.

nit: it would be great to find an alternative to format relative time. this is quite a balloon in the resulting bundle.

Copy link
Member

Choose a reason for hiding this comment

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

if it's used just to format relative time, maybe it's good to use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat, and there is a polyfill available, too.

@@ -1,3 +1,3 @@
export default function Separator() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this component really necessary?

</div>
<div className="flex flex-col w-3/12">
<div className="text-gray-900">{ws.id}</div>
<div className="text-sm overflow-ellipsis truncate text-gray-400">{getProject(ws)}</div>
<Link to={"/start/#"+ws.id}><div className="font-medium text-gray-800 truncate hover:underline">{ws.id}</div></Link>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe re-use startUrl?

Suggested change
<Link to={"/start/#"+ws.id}><div className="font-medium text-gray-800 truncate hover:underline">{ws.id}</div></Link>
<Link to={startUrl}><div className="font-medium text-gray-800 truncate hover:underline">{ws.id}</div></Link>

<div className="text-sm text-gray-400">{pendingChanges.toString() || 'No Changes'}</div>
<div className="font-medium text-gray-500 truncate">{currentBranch}</div>
<div className={changesClassName + " truncate cursor-pointer"} onClick={() => setChangesModalVisible(true)}>{changesLabel}</div>
<Modal visible={changesModalVisible} onClose={() => setChangesModalVisible(false)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename changesModalVisible to isPendingChangesModalVisible?

</div>
<Modal visible={modalVisible} onClose={() => setModalVisible(false)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename modalVisible to isDeleteWorkspaceModalVisible?

Comment on lines 49 to 55
<DropDown entries={[{
title: 'Status: Active',
onClick: onActive
}, {
title: 'Status: Recent',
onClick: onRecent
}]} />
Copy link
Contributor

@jankeromnes jankeromnes Mar 16, 2021

Choose a reason for hiding this comment

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

As a user, I have no idea what these mean, and they're not even mutually exclusive.

I still vote for:

  • Top Workspaces (by default, only running or pinned)
  • All Workspaces (if you didn't find what you wanted)

Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

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

Awesome! 🔥 Many thanks for implementing a context menu and improving the workspace list.

Seems to work generally well. 🚀 However, trying to start or download a workspace didn't work for me (empty page).

@svenefftinge
Copy link
Member Author

Todos:

  • implement search
  • update pinned and shareable
  • show ordering
  • implement pagination (more button on bottom)
  • remove status: prefix from filter
  • rendering of moment.js (seems to be off sometimes)

<div className="bg-transparent h-1/3" />
<div className="bg-white rounded-md px-6 py-4 max-w-lg mx-auto">
<div className="bg-white border rounded-lg px-6 py-4 max-w-lg mx-auto">
Copy link
Contributor

@jankeromnes jankeromnes Mar 16, 2021

Choose a reason for hiding this comment

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

@gtsiolis said that Modal padding is 24px (p-6), and also that border-radius is rounded-xl:

Suggested change
<div className="bg-white border rounded-lg px-6 py-4 max-w-lg mx-auto">
<div className="bg-white border rounded-xl p-6 max-w-lg mx-auto">

@gtsiolis
Copy link
Contributor

gtsiolis commented Mar 16, 2021

/werft run

👍 started the job as gitpod-build-minor-updates.2

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Looks great! Added a first round of comments below! 🥊

</div>
</div>
<div className="lg:px-28 px-10 pt-4 flex flex-col space-y-2">
<div className="py-2 flex justify-between space-x-2 text-sm text-gray-400 border-t border-b border-gray-200">
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Minor spacing issue:

Suggested change
<div className="py-2 flex justify-between space-x-2 text-sm text-gray-400 border-t border-b border-gray-200">
<div className="py-3 flex justify-between space-x-2 text-sm text-gray-400 border-t border-b border-gray-200">

{props.children}
</div>
{expanded?
<div className={`z-50 w-40 bg-white absolute py-2 right-0 flex flex-col border border-gray-300 rounded-lg space-y-2`}>
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Border color.

Suggested change
<div className={`z-50 w-40 bg-white absolute py-2 right-0 flex flex-col border border-gray-300 rounded-lg space-y-2`}>
<div className={`z-50 w-40 bg-white absolute py-2 right-0 flex flex-col border border-gray-200 rounded-lg space-y-2`}>

d="m280,278a153,153 0 1,0-2,2l170,170m-91-117 110,110-26,26-110-110" />
</svg>
</div>
<input className="border-0 text-sm text-gray-400" type="text" placeholder="Search Workspace" onChange={(v) => { console.log(v) }} />
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Could we set the placeholder color to gray-400 and user input with gray-600? 🎨

</div></>;
<Header title="Workspaces" subtitle="Manage past workspaces" />

<div className="lg:px-28 px-10 pt-4 flex">
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Minor padding issue.

Suggested change
<div className="lg:px-28 px-10 pt-4 flex">
<div className="lg:px-28 px-10 pt-8 flex">

}]} />
</div>
</div>
<div className="lg:px-28 px-10 pt-4 flex flex-col space-y-2">
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Minor padding issue:

Suggested change
<div className="lg:px-28 px-10 pt-4 flex flex-col space-y-2">
<div className="lg:px-28 px-10 flex flex-col space-y-2">

<div className={`z-50 w-40 bg-white absolute py-2 right-0 flex flex-col border border-gray-300 rounded-lg space-y-2`}>
{enhancedEntries.map(e => {
const entry = <p key={e.title} className={`px-4 py-2 text-gray-600 hover:bg-gray-200 hover:text-gray-800 ${e.customFontStyle || font} ${e.separator? ' border-b border-gray-300':''}`} >
{e.title}{e.active ? <span className="pl-1 font-semibold">&#x2713;</span> : null}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Could we align the checkmark to the right end of the dropdown option?

{e.title}{e.active ? <span className="pl-1 font-semibold">&#x2713;</span> : null}
</p>
return <a href={e.href} onClick={e.onClick}>
{entry}
Copy link
Contributor

Choose a reason for hiding this comment

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

quesrtion: Also, could we change the text and dropdown arrow icon color to gray-600 on hover?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you clarify, I think it is already gray-600 without hover.

Copy link
Contributor

@gtsiolis gtsiolis Mar 17, 2021

Choose a reason for hiding this comment

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

I remember seeing the status filter dropdown label and arrow using the same color on hover. Ideally both the label and the icon arrow would use gray-400 and switch to gray-600 on hover. Feel free to ignore this if this is not the case anymore. 🏓

break;
}
case 'interrupted': {
stateClassName += ' bg-red-200 text-red-600'
stateClassName += ' bg-red-400 text-red-600'
Copy link
Contributor

Choose a reason for hiding this comment

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

question: What do you think of adding the kumquat color (#FFB45B) for the starting phase?

}
];
const project = getProject(ws);
return <div className="whitespace-nowrap flex space-x-2 py-6 w-full justify-between hover:bg-gray-100 rounded-lg">
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Left and right padding here is 24px (px-6). Then we can remove the inner left padding below in https://github.com/gitpod-io/gitpod/pull/3457/files#diff-02ffe6851cca7925757e521dfba549b1e72892581cc6a6596cb4f5c0656cb300R91.

Copy link
Contributor

Choose a reason for hiding this comment

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

thought: Let's also add cursor-pointer and change radius to rounded-xl (12px). @jankeromnes added the link on the row in the running workspaces modal and feels good! WDYT?

];
const project = getProject(ws);
return <div className="whitespace-nowrap flex space-x-2 py-6 w-full justify-between hover:bg-gray-100 rounded-lg">
<div className="w-10 self-center pl-4" >
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Minor padding issue:

Suggested change
<div className="w-10 self-center pl-4" >
<div className="pr-3 self-center" >

@svenefftinge svenefftinge force-pushed the minor-updates branch 2 times, most recently from 8e9ea76 to 59a0719 Compare March 17, 2021 07:29
@svenefftinge
Copy link
Member Author

svenefftinge commented Mar 17, 2021

/werft run

👍 started the job as gitpod-build-minor-updates.5

@svenefftinge svenefftinge merged commit e834989 into dashboard-v2 Mar 17, 2021
@svenefftinge svenefftinge deleted the minor-updates branch March 17, 2021 09:59
svenefftinge added a commit that referenced this pull request Mar 22, 2021
[dashboard] improved workspaces
svenefftinge added a commit that referenced this pull request Mar 22, 2021
[dashboard] improved workspaces
pavan-tri pushed a commit to trilogy-group/gitpod that referenced this pull request Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants